spandsp-0.0.6/0000775000175000017500000000000012357123347010177 500000000000000spandsp-0.0.6/INSTALL0000664000175000017500000002446311072610446011153 00000000000000Building and installing spandsp =============================== A number of distributions include spandsp, but they usually use older versions of the library, which lack a lot of the features of the current version. Before installing spandsp, make sure there are no older versions already on your machine. Make sure libtiff is installed on your machine. Versions 3.5.7, 3.6.0, 3.7.1 and 3.8.2 seem to work OK. There have been several bugs related to FAX document handling in some versions of libtiff. Also, some people have had trouble using spandsp because they had more than one version of libtiff on their machine. Take care with this. If you are using an RPM based system, such as RedHat or Fedora, you will need the libtiff and libtiff-devel RPMs installed to be able to build spandsp. You can use the usual: ./configure make make install process to build the spandsp library. Note that if you use configure in this way, the software will be installed in /usr/local. In this case make sure your /etc/ld.so.conf file has an entry for /usr/local/lib. If you wish the software to be installed in /usr, you should build it with the commands. ./configure --prefix=/usr make make install Building the programming documentation ====================================== If you wish to build the programming documentation for spandsp, configure spandsp with: ./configure --enable-doc You need doxygen installed on your machine. Building the test suite ======================= Most sections of the spandsp library have an accompanying test program in the test directory. If you wish to build these test programs, configure spandsp with: ./configure --enable-tests To build these tests you will need libaudiofile installed on your machine. To build the modem tests, with the GUI monitoring feature you will need Fltk 1.1.4 or later, an audio meter module and a cartesian plotting module. Fltk may be obtained from http://www.fltk.org. The audio meter module may be obtained from http://www.soft-switch.org/downloads/Fl_Audio_Meter.tgz . The cartesian plotting module may be obtained from http://134.226.68.29/fltk. However, there is no suitable makefile supplied with that. You can find a version at http://www.soft-switch.org/downloads/Fl_Cartesian.tgz which will build as a Linux library. The actual code in both these versions is identical. You need to have Fltk 1.1.4 or later installed before building the plotting library. Applications ============ Applications support for spandsp is built into packages such as Callweaver, FreeSwitch and iaxmodem. Code to add spandsp based FAX support to Asterisk may be found at http://sourceforge.net/projects/agx-ast-addons. Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' is used to create `configure' by a program called `autoconf'. You only need `configure.ac' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. spandsp-0.0.6/AUTHORS0000664000175000017500000000004510346577443011174 00000000000000Steve Underwood spandsp-0.0.6/spandsp-sim/0000775000175000017500000000000012357123347012435 500000000000000spandsp-0.0.6/spandsp-sim/libspandsp_sim.2008.vcproj0000664000175000017500000001601112343640734017177 00000000000000 spandsp-0.0.6/spandsp-sim/Makefile.in0000664000175000017500000006547012343626375014442 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = make_line_models$(EXEEXT) subdir = spandsp-sim DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/config/depcomp $(nobase_include_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_check_real_file.m4 \ $(top_srcdir)/m4/ax_fixed_point_machine.m4 \ $(top_srcdir)/m4/ax_misaligned_access_fails.m4 \ $(top_srcdir)/m4/ax_c99_features.m4 \ $(top_srcdir)/m4/ax_check_export_capability.m4 \ $(top_srcdir)/m4/ax_check_arm_neon.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) libspandsp_sim_la_LIBADD = am_libspandsp_sim_la_OBJECTS = g1050.lo line_model.lo rfc2198_sim.lo \ test_utils.lo nodist_libspandsp_sim_la_OBJECTS = line_models.lo libspandsp_sim_la_OBJECTS = $(am_libspandsp_sim_la_OBJECTS) \ $(nodist_libspandsp_sim_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libspandsp_sim_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_CFLAGS) $(CFLAGS) $(libspandsp_sim_la_LDFLAGS) $(LDFLAGS) \ -o $@ PROGRAMS = $(noinst_PROGRAMS) am_make_line_models_OBJECTS = make_line_models.$(OBJEXT) make_line_models_OBJECTS = $(am_make_line_models_OBJECTS) make_line_models_DEPENDENCIES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libspandsp_sim_la_SOURCES) \ $(nodist_libspandsp_sim_la_SOURCES) \ $(make_line_models_SOURCES) DIST_SOURCES = $(libspandsp_sim_la_SOURCES) \ $(make_line_models_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(nobase_include_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ COMP_VENDOR_CFLAGS = @COMP_VENDOR_CFLAGS@ COMP_VENDOR_LDFLAGS = @COMP_VENDOR_LDFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_FAX2TIFF = @HAVE_FAX2TIFF@ HAVE_PBMTOG3 = @HAVE_PBMTOG3@ HAVE_SOX = @HAVE_SOX@ INSERT_INTTYPES_HEADER = @INSERT_INTTYPES_HEADER@ INSERT_MATH_HEADER = @INSERT_MATH_HEADER@ INSERT_STDBOOL_HEADER = @INSERT_STDBOOL_HEADER@ INSERT_STDINT_HEADER = @INSERT_STDINT_HEADER@ INSERT_TGMATH_HEADER = @INSERT_TGMATH_HEADER@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ -L$(top_builddir)/src -lspandsp $(SIMLIBS) LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIMLIBS = @SIMLIBS@ SPANDSP_LT_AGE = @SPANDSP_LT_AGE@ SPANDSP_LT_CURRENT = @SPANDSP_LT_CURRENT@ SPANDSP_LT_REVISION = @SPANDSP_LT_REVISION@ SPANDSP_MISALIGNED_ACCESS_FAILS = @SPANDSP_MISALIGNED_ACCESS_FAILS@ SPANDSP_SUPPORT_T85 = @SPANDSP_SUPPORT_T85@ SPANDSP_SUPPORT_V34 = @SPANDSP_SUPPORT_V34@ SPANDSP_USE_EXPORT_CAPABILITY = @SPANDSP_USE_EXPORT_CAPABILITY@ SPANDSP_USE_FIXED_POINT = @SPANDSP_USE_FIXED_POINT@ STRIP = @STRIP@ TESTLIBS = @TESTLIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = $(COMP_VENDOR_CFLAGS) AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS) MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = libspandsp_sim.dsp \ libspandsp_sim.2005.vcproj \ libspandsp_sim.2008.vcproj \ msvc/make_line_models.2008.vcproj \ msvc/msvcproj.head \ msvc/msvcproj.foot \ msvc/vc8proj.head \ msvc/vc8proj.foot \ msvc/vc9proj.head \ msvc/vc9proj.foot AM_CPPFLAGS = -I$(top_builddir) -I$(top_builddir)/src -DDATADIR="\"$(pkgdatadir)\"" lib_LTLIBRARIES = libspandsp-sim.la libspandsp_sim_la_SOURCES = g1050.c \ line_model.c \ rfc2198_sim.c \ test_utils.c nodist_libspandsp_sim_la_SOURCES = line_models.c libspandsp_sim_la_LDFLAGS = -version-info @SPANDSP_LT_CURRENT@:@SPANDSP_LT_REVISION@:@SPANDSP_LT_AGE@ $(COMP_VENDOR_LDFLAGS) nobase_include_HEADERS = spandsp/g1050.h \ spandsp/line_model.h \ spandsp/line_models.h \ spandsp/rfc2198_sim.h \ spandsp/test_utils.h \ spandsp-sim.h make_line_models_SOURCES = make_line_models.c make_line_models_LDADD = -L$(top_builddir)/src -lspandsp DSP = libspandsp_sim.dsp VCPROJ8 = libspandsp_sim.2005.vcproj VCPROJ9 = libspandsp_sim.2008.vcproj WIN32SOURCES = $(libspandsp_sim_la_SOURCES) WIN32HEADERS = $(nobase_include_HEADERS) DSPOUT = | awk '{printf("%s\r\n", $$0)}' >> $(DSP) VCPROJOUT8 = | awk '{printf("%s\r\n", $$0)}' >> $(VCPROJ8) VCPROJOUT9 = | awk '{printf("%s\r\n", $$0)}' >> $(VCPROJ9) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu spandsp-sim/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu spandsp-sim/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libspandsp-sim.la: $(libspandsp_sim_la_OBJECTS) $(libspandsp_sim_la_DEPENDENCIES) $(EXTRA_libspandsp_sim_la_DEPENDENCIES) $(AM_V_CCLD)$(libspandsp_sim_la_LINK) -rpath $(libdir) $(libspandsp_sim_la_OBJECTS) $(libspandsp_sim_la_LIBADD) $(LIBS) clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list make_line_models$(EXEEXT): $(make_line_models_OBJECTS) $(make_line_models_DEPENDENCIES) $(EXTRA_make_line_models_DEPENDENCIES) @rm -f make_line_models$(EXEEXT) $(AM_V_CCLD)$(LINK) $(make_line_models_OBJECTS) $(make_line_models_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g1050.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/line_model.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/line_models.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/make_line_models.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfc2198_sim.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_utils.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nobase_includeHEADERS: $(nobase_include_HEADERS) @$(NORMAL_INSTALL) @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \ echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \ $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \ done uninstall-nobase_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-nobase_includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES uninstall-nobase_includeHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS \ cscopelist-am ctags ctags-am distclean distclean-compile \ distclean-generic distclean-libtool distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-libLTLIBRARIES \ install-man install-nobase_includeHEADERS install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES \ uninstall-nobase_includeHEADERS # We need to run make_line_models, so it generates the line_models.h file # used by several of the test programs. line_models.lo: make_line_models$(EXEEXT) line_models.c line_models.$(OBJEXT): make_line_models$(EXEEXT) line_models.c line_models.c: make_line_models$(EXEEXT) ./make_line_models$(EXEEXT) $(DSP): msvc/msvcproj.head msvc/msvcproj.foot Makefile.am echo "creating $(DSP)" @(cp $(srcdir)/msvc/msvcproj.head $(DSP); \ echo "# Begin Group \"Source Files\"" $(DSPOUT); \ for file in $(WIN32SOURCES); do \ echo "# Begin Source File" $(DSPOUT); \ echo "" $(DSPOUT); \ echo "SOURCE=.\\"$$file $(DSPOUT); \ echo "# End Source File" $(DSPOUT); \ done; \ echo "# End Group" $(DSPOUT); \ echo "# Begin Group \"Header Files\"" $(DSPOUT); \ for file in $(WIN32HEADERS); do \ echo "# Begin Source File" $(DSPOUT); \ echo "" $(DSPOUT); \ echo "SOURCE=.\\"$$file $(DSPOUT); \ echo "# End Source File" $(DSPOUT); \ done; \ echo "# End Group" $(DSPOUT); \ cat $(srcdir)/msvc/msvcproj.foot $(DSPOUT) ) $(VCPROJ8): msvc/vc8proj.head msvc/vc8proj.foot Makefile.am echo "creating $(VCPROJ8)" @(cp $(srcdir)/msvc/vc8proj.head $(VCPROJ8); \ for file in $(WIN32SOURCES); do \ echo "" $(VCPROJOUT8); \ done; \ echo "" $(VCPROJOUT8); \ for file in $(WIN32HEADERS); do \ echo "" $(VCPROJOUT8); \ done; \ cat $(srcdir)/msvc/vc8proj.foot $(VCPROJOUT8) ) $(VCPROJ9): msvc/vc9proj.head msvc/vc9proj.foot Makefile.am echo "creating $(VCPROJ9)" @(cp $(srcdir)/msvc/vc9proj.head $(VCPROJ9); \ for file in $(WIN32SOURCES); do \ echo "" $(VCPROJOUT9); \ done; \ echo "" $(VCPROJOUT9); \ for file in $(WIN32HEADERS); do \ echo "" $(VCPROJOUT9); \ done; \ cat $(srcdir)/msvc/vc9proj.foot $(VCPROJOUT9) ) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: spandsp-0.0.6/spandsp-sim/g1050.c0000664000175000017500000017300512100775505013256 00000000000000/* * SpanDSP - a series of DSP components for telephony * * g1050.c - IP network modeling, as per G.1050/TIA-921. * * Written by Steve Underwood * * Copyright (C) 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #define GEN_CONST #include #endif #include "floating_fudge.h" #include "spandsp.h" #include "spandsp/g1050.h" #define PACKET_LOSS_TIME -1 #define FALSE 0 #define TRUE (!FALSE) g1050_constants_t g1050_constants[1] = { { { { /* Side A LAN */ { 0.004, /*! Probability of loss rate change low->high */ 0.1 /*! Probability of loss rate change high->low */ }, { { 0.0, /*! Probability of an impulse */ 0.0, }, { 0.5, 0.0 } }, 1.0, /*! Impulse height, based on MTU and bit rate */ 0.0, /*! Impulse decay coefficient */ 0.001, /*! Probability of packet loss due to occupancy. */ 0.15 /*! Probability of packet loss due to a multiple access collision. */ }, { /* Side A access link */ { 0.0002, /*! Probability of loss rate change low->high */ 0.2 /*! Probability of loss rate change high->low */ }, { { 0.001, /*! Probability of an impulse */ 0.0, }, { 0.3, 0.4 } }, 40.0, /*! Impulse height, based on MTU and bit rate */ 0.75, /*! Impulse decay coefficient */ 0.0005, /*! Probability of packet loss due to occupancy. */ 0.0 /*! Probability of packet loss due to a multiple access collision. */ }, { /* Side B access link */ { 0.0002, /*! Probability of loss rate change low->high */ 0.2 /*! Probability of loss rate change high->low */ }, { { 0.001, /*! Probability of an impulse */ 0.0, }, { 0.3, 0.4 } }, 40.0, /*! Impulse height, based on MTU and bit rate */ 0.75, /*! Impulse decay coefficient */ 0.0005, /*! Probability of packet loss due to occupancy. */ 0.0 /*! Probability of packet loss due to a multiple access collision. */ }, { /* Side B LAN */ { 0.004, /*! Probability of loss rate change low->high */ 0.1 /*! Probability of loss rate change high->low */ }, { { 0.0, /*! Probability of an impulse */ 0.0, }, { 0.5, 0.0 } }, 1.0, /*! Impulse height, based on MTU and bit rate */ 0.0, /*! Impulse decay coefficient */ 0.001, /*! Probability of packet loss due to occupancy. */ 0.15 /*! Probability of packet loss due to a multiple access collision. */ } } } }; g1050_channel_speeds_t g1050_speed_patterns[168] = { { 4000000, 0, 128000, 768000, 0, 4000000, 0, 128000, 768000, 0, 0.360}, { 4000000, 0, 128000, 768000, 0, 20000000, 0, 128000, 768000, 0, 0.720}, { 4000000, 0, 128000, 768000, 0, 100000000, 0, 128000, 768000, 0, 0.360}, { 20000000, 0, 128000, 768000, 0, 20000000, 0, 128000, 768000, 0, 0.360}, { 20000000, 0, 128000, 768000, 0, 100000000, 0, 128000, 768000, 0, 0.360}, {100000000, 0, 128000, 768000, 0, 100000000, 0, 128000, 768000, 0, 0.090}, { 4000000, 0, 128000, 1536000, 0, 4000000, 0, 384000, 768000, 0, 0.720}, { 4000000, 0, 128000, 1536000, 0, 20000000, 0, 384000, 768000, 0, 1.470}, { 4000000, 0, 128000, 1536000, 0, 100000000, 0, 384000, 768000, 0, 0.840}, { 20000000, 0, 128000, 1536000, 0, 20000000, 0, 384000, 768000, 0, 0.750}, { 20000000, 0, 128000, 1536000, 0, 100000000, 0, 384000, 768000, 0, 0.855}, {100000000, 0, 128000, 1536000, 0, 100000000, 0, 384000, 768000, 0, 0.240}, { 4000000, 0, 128000, 3000000, 0, 4000000, 0, 384000, 768000, 0, 0.120}, { 4000000, 0, 128000, 3000000, 0, 20000000, 0, 384000, 768000, 0, 0.420}, { 4000000, 0, 128000, 3000000, 0, 100000000, 0, 384000, 768000, 0, 0.840}, { 20000000, 0, 128000, 3000000, 0, 20000000, 0, 384000, 768000, 0, 0.300}, { 20000000, 0, 128000, 3000000, 0, 100000000, 0, 384000, 768000, 0, 0.930}, {100000000, 0, 128000, 3000000, 0, 100000000, 0, 384000, 768000, 0, 0.390}, { 4000000, 0, 384000, 768000, 0, 4000000, 0, 128000, 1536000, 0, 0.720}, { 4000000, 0, 384000, 768000, 0, 20000000, 0, 128000, 1536000, 0, 1.470}, { 4000000, 0, 384000, 768000, 0, 100000000, 0, 128000, 1536000, 0, 0.840}, { 20000000, 0, 384000, 768000, 0, 20000000, 0, 128000, 1536000, 0, 0.750}, { 20000000, 0, 384000, 768000, 0, 100000000, 0, 128000, 1536000, 0, 0.855}, {100000000, 0, 384000, 768000, 0, 100000000, 0, 128000, 1536000, 0, 0.240}, { 4000000, 0, 384000, 1536000, 0, 4000000, 0, 384000, 1536000, 0, 1.440}, { 4000000, 0, 384000, 1536000, 0, 20000000, 0, 384000, 1536000, 0, 3.000}, { 4000000, 0, 384000, 1536000, 0, 100000000, 0, 384000, 1536000, 0, 1.920}, { 20000000, 0, 384000, 1536000, 0, 20000000, 0, 384000, 1536000, 0, 1.563}, { 20000000, 0, 384000, 1536000, 0, 100000000, 0, 384000, 1536000, 0, 2.000}, {100000000, 0, 384000, 1536000, 0, 100000000, 0, 384000, 1536000, 0, 0.640}, { 4000000, 0, 384000, 3000000, 0, 4000000, 0, 384000, 1536000, 0, 0.240}, { 4000000, 0, 384000, 3000000, 0, 20000000, 0, 384000, 1536000, 0, 0.850}, { 4000000, 0, 384000, 3000000, 0, 100000000, 0, 384000, 1536000, 0, 1.720}, { 20000000, 0, 384000, 3000000, 0, 20000000, 0, 384000, 1536000, 0, 0.625}, { 20000000, 0, 384000, 3000000, 0, 100000000, 0, 384000, 1536000, 0, 2.025}, {100000000, 0, 384000, 3000000, 0, 100000000, 0, 384000, 1536000, 0, 1.040}, { 4000000, 0, 384000, 768000, 0, 4000000, 0, 128000, 3000000, 0, 0.120}, { 4000000, 0, 384000, 768000, 0, 20000000, 0, 128000, 3000000, 0, 0.420}, { 4000000, 0, 384000, 768000, 0, 100000000, 0, 128000, 3000000, 0, 0.840}, { 20000000, 0, 384000, 768000, 0, 20000000, 0, 128000, 3000000, 0, 0.300}, { 20000000, 0, 384000, 768000, 0, 100000000, 0, 128000, 3000000, 0, 0.930}, {100000000, 0, 384000, 768000, 0, 100000000, 0, 128000, 3000000, 0, 0.390}, { 4000000, 0, 384000, 1536000, 0, 4000000, 0, 384000, 3000000, 0, 0.240}, { 4000000, 0, 384000, 1536000, 0, 20000000, 0, 384000, 3000000, 0, 0.850}, { 4000000, 0, 384000, 1536000, 0, 100000000, 0, 384000, 3000000, 0, 1.720}, { 20000000, 0, 384000, 1536000, 0, 20000000, 0, 384000, 3000000, 0, 0.625}, { 20000000, 0, 384000, 1536000, 0, 100000000, 0, 384000, 3000000, 0, 2.025}, {100000000, 0, 384000, 1536000, 0, 100000000, 0, 384000, 3000000, 0, 1.040}, { 4000000, 0, 384000, 3000000, 0, 4000000, 0, 384000, 3000000, 0, 0.040}, { 4000000, 0, 384000, 3000000, 0, 20000000, 0, 384000, 3000000, 0, 0.200}, { 4000000, 0, 384000, 3000000, 0, 100000000, 0, 384000, 3000000, 0, 0.520}, { 20000000, 0, 384000, 3000000, 0, 20000000, 0, 384000, 3000000, 0, 0.250}, { 20000000, 0, 384000, 3000000, 0, 100000000, 0, 384000, 3000000, 0, 1.300}, {100000000, 0, 384000, 3000000, 0, 100000000, 0, 384000, 3000000, 0, 1.690}, { 4000000, 0, 128000, 1536000, 0, 20000000, 0, 768000, 1536000, 0, 0.090}, { 4000000, 0, 128000, 1536000, 0, 100000000, 0, 768000, 1536000, 0, 0.360}, { 20000000, 0, 128000, 1536000, 0, 20000000, 0, 768000, 1536000, 0, 0.090}, { 20000000, 0, 128000, 1536000, 0, 100000000, 0, 768000, 1536000, 0, 0.405}, {100000000, 0, 128000, 1536000, 0, 100000000, 0, 768000, 1536000, 0, 0.180}, { 4000000, 0, 128000, 7000000, 0, 20000000, 0, 768000, 768000, 0, 0.270}, { 4000000, 0, 128000, 7000000, 0, 100000000, 0, 768000, 768000, 0, 1.080}, { 20000000, 0, 128000, 7000000, 0, 20000000, 0, 768000, 768000, 0, 0.270}, { 20000000, 0, 128000, 7000000, 0, 100000000, 0, 768000, 768000, 0, 1.215}, {100000000, 0, 128000, 7000000, 0, 100000000, 0, 768000, 768000, 0, 0.540}, { 4000000, 0, 128000, 13000000, 0, 20000000, 0, 768000, 13000000, 0, 0.030}, { 4000000, 0, 128000, 13000000, 0, 100000000, 0, 768000, 13000000, 0, 0.120}, { 20000000, 0, 128000, 13000000, 0, 20000000, 0, 768000, 13000000, 0, 0.030}, { 20000000, 0, 128000, 13000000, 0, 100000000, 0, 768000, 13000000, 0, 0.135}, {100000000, 0, 128000, 13000000, 0, 100000000, 0, 768000, 13000000, 0, 0.060}, { 4000000, 0, 384000, 1536000, 0, 20000000, 0, 1536000, 1536000, 0, 0.180}, { 4000000, 0, 384000, 1536000, 0, 100000000, 0, 1536000, 1536000, 0, 0.720}, { 20000000, 0, 384000, 1536000, 0, 20000000, 0, 1536000, 1536000, 0, 0.188}, { 20000000, 0, 384000, 1536000, 0, 100000000, 0, 1536000, 1536000, 0, 0.870}, {100000000, 0, 384000, 1536000, 0, 100000000, 0, 1536000, 1536000, 0, 0.480}, { 4000000, 0, 384000, 7000000, 0, 20000000, 0, 768000, 1536000, 0, 0.540}, { 4000000, 0, 384000, 7000000, 0, 100000000, 0, 768000, 1536000, 0, 2.160}, { 20000000, 0, 384000, 7000000, 0, 20000000, 0, 768000, 1536000, 0, 0.563}, { 20000000, 0, 384000, 7000000, 0, 100000000, 0, 768000, 1536000, 0, 2.610}, {100000000, 0, 384000, 7000000, 0, 100000000, 0, 768000, 1536000, 0, 1.440}, { 4000000, 0, 384000, 13000000, 0, 20000000, 0, 1536000, 13000000, 0, 0.060}, { 4000000, 0, 384000, 13000000, 0, 100000000, 0, 1536000, 13000000, 0, 0.240}, { 20000000, 0, 384000, 13000000, 0, 20000000, 0, 1536000, 13000000, 0, 0.063}, { 20000000, 0, 384000, 13000000, 0, 100000000, 0, 1536000, 13000000, 0, 0.290}, {100000000, 0, 384000, 13000000, 0, 100000000, 0, 1536000, 13000000, 0, 0.160}, { 4000000, 0, 384000, 1536000, 0, 20000000, 0, 1536000, 3000000, 0, 0.030}, { 4000000, 0, 384000, 1536000, 0, 100000000, 0, 1536000, 3000000, 0, 0.120}, { 20000000, 0, 384000, 1536000, 0, 20000000, 0, 1536000, 3000000, 0, 0.075}, { 20000000, 0, 384000, 1536000, 0, 100000000, 0, 1536000, 3000000, 0, 0.495}, {100000000, 0, 384000, 1536000, 0, 100000000, 0, 1536000, 3000000, 0, 0.780}, { 4000000, 0, 384000, 7000000, 0, 20000000, 0, 768000, 3000000, 0, 0.090}, { 4000000, 0, 384000, 7000000, 0, 100000000, 0, 768000, 3000000, 0, 0.360}, { 20000000, 0, 384000, 7000000, 0, 20000000, 0, 768000, 3000000, 0, 0.225}, { 20000000, 0, 384000, 7000000, 0, 100000000, 0, 768000, 3000000, 0, 1.485}, {100000000, 0, 384000, 7000000, 0, 100000000, 0, 768000, 3000000, 0, 2.340}, { 4000000, 0, 384000, 13000000, 0, 20000000, 0, 3000000, 13000000, 0, 0.010}, { 4000000, 0, 384000, 13000000, 0, 100000000, 0, 3000000, 13000000, 0, 0.040}, { 20000000, 0, 384000, 13000000, 0, 20000000, 0, 3000000, 13000000, 0, 0.025}, { 20000000, 0, 384000, 13000000, 0, 100000000, 0, 3000000, 13000000, 0, 0.165}, {100000000, 0, 384000, 13000000, 0, 100000000, 0, 3000000, 13000000, 0, 0.260}, { 4000000, 0, 768000, 1536000, 0, 20000000, 0, 128000, 1536000, 0, 0.090}, { 20000000, 0, 768000, 1536000, 0, 20000000, 0, 128000, 1536000, 0, 0.090}, { 20000000, 0, 768000, 1536000, 0, 100000000, 0, 128000, 1536000, 0, 0.405}, { 4000000, 0, 768000, 1536000, 0, 100000000, 0, 128000, 1536000, 0, 0.360}, {100000000, 0, 768000, 1536000, 0, 100000000, 0, 128000, 1536000, 0, 0.180}, { 4000000, 0, 1536000, 1536000, 0, 20000000, 0, 384000, 1536000, 0, 0.180}, { 20000000, 0, 1536000, 1536000, 0, 20000000, 0, 384000, 1536000, 0, 0.188}, { 20000000, 0, 1536000, 1536000, 0, 100000000, 0, 384000, 1536000, 0, 0.870}, { 4000000, 0, 1536000, 1536000, 0, 100000000, 0, 384000, 1536000, 0, 0.720}, {100000000, 0, 1536000, 1536000, 0, 100000000, 0, 384000, 1536000, 0, 0.480}, { 4000000, 0, 1536000, 3000000, 0, 20000000, 0, 384000, 1536000, 0, 0.030}, { 20000000, 0, 1536000, 3000000, 0, 20000000, 0, 384000, 1536000, 0, 0.075}, { 20000000, 0, 1536000, 3000000, 0, 100000000, 0, 384000, 1536000, 0, 0.495}, { 4000000, 0, 1536000, 3000000, 0, 100000000, 0, 384000, 1536000, 0, 0.120}, {100000000, 0, 1536000, 3000000, 0, 100000000, 0, 384000, 1536000, 0, 0.780}, { 4000000, 0, 768000, 768000, 0, 20000000, 0, 128000, 7000000, 0, 0.270}, { 20000000, 0, 768000, 768000, 0, 20000000, 0, 128000, 7000000, 0, 0.270}, { 20000000, 0, 768000, 768000, 0, 100000000, 0, 128000, 7000000, 0, 1.215}, { 4000000, 0, 768000, 768000, 0, 100000000, 0, 128000, 7000000, 0, 1.080}, {100000000, 0, 768000, 768000, 0, 100000000, 0, 128000, 7000000, 0, 0.540}, { 4000000, 0, 768000, 1536000, 0, 20000000, 0, 384000, 7000000, 0, 0.540}, { 20000000, 0, 768000, 1536000, 0, 20000000, 0, 384000, 7000000, 0, 0.563}, { 20000000, 0, 768000, 1536000, 0, 100000000, 0, 384000, 7000000, 0, 2.610}, { 4000000, 0, 768000, 1536000, 0, 100000000, 0, 384000, 7000000, 0, 2.160}, {100000000, 0, 768000, 1536000, 0, 100000000, 0, 384000, 7000000, 0, 1.440}, { 4000000, 0, 768000, 3000000, 0, 20000000, 0, 384000, 7000000, 0, 0.090}, { 20000000, 0, 768000, 3000000, 0, 20000000, 0, 384000, 7000000, 0, 0.225}, { 20000000, 0, 768000, 3000000, 0, 100000000, 0, 384000, 7000000, 0, 1.485}, { 4000000, 0, 768000, 3000000, 0, 100000000, 0, 384000, 7000000, 0, 0.360}, {100000000, 0, 768000, 3000000, 0, 100000000, 0, 384000, 7000000, 0, 2.340}, { 4000000, 0, 768000, 13000000, 0, 20000000, 0, 128000, 13000000, 0, 0.030}, { 20000000, 0, 768000, 13000000, 0, 20000000, 0, 128000, 13000000, 0, 0.030}, { 20000000, 0, 768000, 13000000, 0, 100000000, 0, 128000, 13000000, 0, 0.135}, { 4000000, 0, 768000, 13000000, 0, 100000000, 0, 128000, 13000000, 0, 0.120}, {100000000, 0, 768000, 13000000, 0, 100000000, 0, 128000, 13000000, 0, 0.060}, { 4000000, 0, 1536000, 13000000, 0, 20000000, 0, 384000, 13000000, 0, 0.060}, { 20000000, 0, 1536000, 13000000, 0, 20000000, 0, 384000, 13000000, 0, 0.063}, { 20000000, 0, 1536000, 13000000, 0, 100000000, 0, 384000, 13000000, 0, 0.290}, { 4000000, 0, 1536000, 13000000, 0, 100000000, 0, 384000, 13000000, 0, 0.240}, {100000000, 0, 1536000, 13000000, 0, 100000000, 0, 384000, 13000000, 0, 0.160}, { 4000000, 0, 3000000, 13000000, 0, 20000000, 0, 384000, 13000000, 0, 0.010}, { 20000000, 0, 3000000, 13000000, 0, 20000000, 0, 384000, 13000000, 0, 0.025}, { 20000000, 0, 3000000, 13000000, 0, 100000000, 0, 384000, 13000000, 0, 0.165}, { 4000000, 0, 3000000, 13000000, 0, 100000000, 0, 384000, 13000000, 0, 0.040}, {100000000, 0, 3000000, 13000000, 0, 100000000, 0, 384000, 13000000, 0, 0.260}, { 20000000, 0, 1536000, 1536000, 0, 20000000, 0, 1536000, 1536000, 0, 0.023}, { 20000000, 0, 1536000, 1536000, 0, 100000000, 0, 1536000, 1536000, 0, 0.180}, {100000000, 0, 1536000, 1536000, 0, 100000000, 0, 1536000, 1536000, 0, 0.360}, { 20000000, 0, 1536000, 7000000, 0, 20000000, 0, 768000, 1536000, 0, 0.068}, { 20000000, 0, 1536000, 7000000, 0, 100000000, 0, 768000, 1536000, 0, 0.540}, {100000000, 0, 1536000, 7000000, 0, 100000000, 0, 768000, 1536000, 0, 1.080}, { 20000000, 0, 1536000, 13000000, 0, 20000000, 0, 1536000, 13000000, 0, 0.015}, { 20000000, 0, 1536000, 13000000, 0, 100000000, 0, 1536000, 13000000, 0, 0.120}, {100000000, 0, 1536000, 13000000, 0, 100000000, 0, 1536000, 13000000, 0, 0.240}, { 20000000, 0, 768000, 1536000, 0, 20000000, 0, 1536000, 7000000, 0, 0.068}, { 20000000, 0, 768000, 1536000, 0, 100000000, 0, 1536000, 7000000, 0, 0.540}, {100000000, 0, 768000, 1536000, 0, 100000000, 0, 1536000, 7000000, 0, 1.080}, { 20000000, 0, 768000, 7000000, 0, 20000000, 0, 768000, 7000000, 0, 0.203}, { 20000000, 0, 768000, 7000000, 0, 100000000, 0, 768000, 7000000, 0, 1.620}, {100000000, 0, 768000, 7000000, 0, 100000000, 0, 768000, 7000000, 0, 3.240}, { 20000000, 0, 768000, 13000000, 0, 20000000, 0, 7000000, 13000000, 0, 0.023}, { 20000000, 0, 768000, 13000000, 0, 100000000, 0, 7000000, 13000000, 0, 0.180}, {100000000, 0, 768000, 13000000, 0, 100000000, 0, 7000000, 13000000, 0, 0.360}, { 20000000, 0, 7000000, 13000000, 0, 20000000, 0, 768000, 13000000, 0, 0.023}, { 20000000, 0, 7000000, 13000000, 0, 100000000, 0, 768000, 13000000, 0, 0.180}, {100000000, 0, 7000000, 13000000, 0, 100000000, 0, 768000, 13000000, 0, 0.360}, { 20000000, 0, 13000000, 13000000, 0, 20000000, 0, 13000000, 13000000, 0, 0.003}, { 20000000, 0, 13000000, 13000000, 0, 100000000, 0, 13000000, 13000000, 0, 0.020}, {100000000, 0, 13000000, 13000000, 0, 100000000, 0, 13000000, 13000000, 0, 0.040} }; g1050_model_t g1050_standard_models[9] = { { /* Severity 0 - no impairment */ { 0, /*! Percentage likelihood of occurance in scenario A */ 0, /*! Percentage likelihood of occurance in scenario B */ 0, /*! Percentage likelihood of occurance in scenario C */ }, { 0.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0 /*! Peak jitter */ }, { 0.0, /*! Percentage occupancy */ 512, /*! MTU */ 0.0 /*! Peak jitter */ }, { 0.0, /*! Basic delay of the regional backbone, in seconds */ 0.0, /*! Basic delay of the intercontinental backbone, in seconds */ 0.0, /*! Percentage packet loss of the backbone */ 0.0, /*! Maximum jitter of the backbone, in seconds */ 0.0, /*! Interval between the backbone route flapping between two paths, in seconds */ 0.0, /*! The difference in backbone delay between the two routes we flap between, in seconds */ 0.0, /*! The interval between link failures, in seconds */ 0.0, /*! The duration of link failures, in seconds */ 0.0, /*! Probability of packet loss in the backbone, in percent */ 0.0 /*! Probability of a packet going out of sequence in the backbone. */ }, { 0.0, /*! Percentage occupancy */ 512, /*! MTU */ 0.0 /*! Peak jitter */ }, { 0.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0 /*! Peak jitter */ } }, { /* Severity A */ { 50, /*! Percentage likelihood of occurance in scenario A */ 5, /*! Percentage likelihood of occurance in scenario B */ 5, /*! Percentage likelihood of occurance in scenario C */ }, { 1.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0015 /*! Peak jitter */ }, { 0.0, /*! Percentage occupancy */ 512, /*! MTU */ 0.0 /*! Peak jitter */ }, { 0.004, /*! Basic delay of the regional backbone, in seconds */ 0.016, /*! Basic delay of the intercontinental backbone, in seconds */ 0.0, /*! Percentage packet loss of the backbone */ 0.005, /*! Maximum jitter of the backbone, in seconds */ 0.0, /*! Interval between the backbone route flapping between two paths, in seconds */ 0.0, /*! The difference in backbone delay between the two routes we flap between, in seconds */ 0.0, /*! The interval between link failures, in seconds */ 0.0, /*! The duration of link failures, in seconds */ 0.0, /*! Probability of packet loss in the backbone, in percent */ 0.0 /*! Probability of a packet going out of sequence in the backbone. */ }, { 0.0, /*! Percentage occupancy */ 512, /*! MTU */ 0.0 /*! Peak jitter */ }, { 1.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0015 /*! Peak jitter */ } }, { /* Severity B */ { 30, /*! Percentage likelihood of occurance in scenario A */ 25, /*! Percentage likelihood of occurance in scenario B */ 5, /*! Percentage likelihood of occurance in scenario C */ }, { 2.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0015 /*! Peak jitter */ }, { 1.0, /*! Percentage occupancy */ 512, /*! MTU */ 0.0 /*! Peak jitter */ }, { 0.008, /*! Basic delay of the regional backbone, in seconds */ 0.032, /*! Basic delay of the intercontinental backbone, in seconds */ 0.01, /*! Percentage packet loss of the backbone */ 0.01, /*! Maximum jitter of the backbone, in seconds */ 3600.0, /*! Interval between the backbone route flapping between two paths, in seconds */ 0.002, /*! The difference in backbone delay between the two routes we flap between, in seconds */ 3600.0, /*! The interval between link failures, in seconds */ 0.064, /*! The duration of link failures, in seconds */ 0.0, /*! Probability of packet loss in the backbone, in percent */ 0.0 /*! Probability of a packet going out of sequence in the backbone. */ }, { 1.0, /*! Percentage occupancy */ 512, /*! MTU */ 0.0 /*! Peak jitter */ }, { 2.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0015 /*! Peak jitter */ } }, { /* Severity C */ { 15, /*! Percentage likelihood of occurance in scenario A */ 30, /*! Percentage likelihood of occurance in scenario B */ 10, /*! Percentage likelihood of occurance in scenario C */ }, { 3.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0015 /*! Peak jitter */ }, { 2.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0 /*! Peak jitter */ }, { 0.016, /*! Basic delay of the regional backbone, in seconds */ 0.064, /*! Basic delay of the intercontinental backbone, in seconds */ 0.02, /*! Percentage packet loss of the backbone */ 0.016, /*! Maximum jitter of the backbone, in seconds */ 1800.0, /*! Interval between the backbone route flapping between two paths, in seconds */ 0.004, /*! The difference in backbone delay between the two routes we flap between, in seconds */ 1800.0, /*! The interval between link failures, in seconds */ 0.128, /*! The duration of link failures, in seconds */ 0.0, /*! Probability of packet loss in the backbone, in percent */ 0.0 /*! Probability of a packet going out of sequence in the backbone. */ }, { 2.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0 /*! Peak jitter */ }, { 3.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0015 /*! Peak jitter */ } }, { /* Severity D */ { 5, /*! Percentage likelihood of occurance in scenario A */ 25, /*! Percentage likelihood of occurance in scenario B */ 15, /*! Percentage likelihood of occurance in scenario C */ }, { 5.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0015 /*! Peak jitter */ }, { 4.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0 /*! Peak jitter */ }, { 0.032, /*! Basic delay of the regional backbone, in seconds */ 0.128, /*! Basic delay of the intercontinental backbone, in seconds */ 0.04, /*! Percentage packet loss of the backbone */ 0.04, /*! Maximum jitter of the backbone, in seconds */ 900.0, /*! Interval between the backbone route flapping between two paths, in seconds */ 0.008, /*! The difference in backbone delay between the two routes we flap between, in seconds */ 900.0, /*! The interval between link failures, in seconds */ 0.256, /*! The duration of link failures, in seconds */ 0.0, /*! Probability of packet loss in the backbone, in percent */ 0.0 /*! Probability of a packet going out of sequence in the backbone. */ }, { 4.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0 /*! Peak jitter */ }, { 5.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0015 /*! Peak jitter */ } }, { /* Severity E */ { 0, /*! Percentage likelihood of occurance in scenario A */ 10, /*! Percentage likelihood of occurance in scenario B */ 20, /*! Percentage likelihood of occurance in scenario C */ }, { 8.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0015 /*! Peak jitter */ }, { 8.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0 /*! Peak jitter */ }, { 0.064, /*! Basic delay of the regional backbone, in seconds */ 0.196, /*! Basic delay of the intercontinental backbone, in seconds */ 0.1, /*! Percentage packet loss of the backbone */ 0.07, /*! Maximum jitter of the backbone, in seconds */ 480.0, /*! Interval between the backbone route flapping between two paths, in seconds */ 0.016, /*! The difference in backbone delay between the two routes we flap between, in seconds */ 480.0, /*! The interval between link failures, in seconds */ 0.4, /*! The duration of link failures, in seconds */ 0.0, /*! Probability of packet loss in the backbone, in percent */ 0.0 /*! Probability of a packet going out of sequence in the backbone. */ }, { 8.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0 /*! Peak jitter */ }, { 8.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0015 /*! Peak jitter */ } }, { /* Severity F */ { 0, /*! Percentage likelihood of occurance in scenario A */ 0, /*! Percentage likelihood of occurance in scenario B */ 25, /*! Percentage likelihood of occurance in scenario C */ }, { 12.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0015 /*! Peak jitter */ }, { 15.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0 /*! Peak jitter */ }, { 0.128, /*! Basic delay of the regional backbone, in seconds */ 0.256, /*! Basic delay of the intercontinental backbone, in seconds */ 0.2, /*! Percentage packet loss of the backbone */ 0.1, /*! Maximum jitter of the backbone, in seconds */ 240.0, /*! Interval between the backbone route flapping between two paths, in seconds */ 0.032, /*! The difference in backbone delay between the two routes we flap between, in seconds */ 240.0, /*! The interval between link failures, in seconds */ 0.8, /*! The duration of link failures, in seconds */ 0.0, /*! Probability of packet loss in the backbone, in percent */ 0.0 /*! Probability of a packet going out of sequence in the backbone. */ }, { 15.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0 /*! Peak jitter */ }, { 12.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0015 /*! Peak jitter */ } }, { /* Severity G */ { 0, /*! Percentage likelihood of occurance in scenario A */ 0, /*! Percentage likelihood of occurance in scenario B */ 15, /*! Percentage likelihood of occurance in scenario C */ }, { 16.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0015 /*! Peak jitter */ }, { 30.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0 /*! Peak jitter */ }, { 0.256, /*! Basic delay of the regional backbone, in seconds */ 0.512, /*! Basic delay of the intercontinental backbone, in seconds */ 0.5, /*! Percentage packet loss of the backbone */ 0.15, /*! Maximum jitter of the backbone, in seconds */ 120.0, /*! Interval between the backbone route flapping between two paths, in seconds */ 0.064, /*! The difference in backbone delay between the two routes we flap between, in seconds */ 120.0, /*! The interval between link failures, in seconds */ 1.6, /*! The duration of link failures, in seconds */ 0.0, /*! Probability of packet loss in the backbone, in percent */ 0.0 /*! Probability of a packet going out of sequence in the backbone. */ }, { 30.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0 /*! Peak jitter */ }, { 16.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0015 /*! Peak jitter */ } }, { /* Severity H */ { 0, /*! Percentage likelihood of occurance in scenario A */ 0, /*! Percentage likelihood of occurance in scenario B */ 5, /*! Percentage likelihood of occurance in scenario C */ }, { 20.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0015 /*! Peak jitter */ }, { 50.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0 /*! Peak jitter */ }, { 0.512, /*! Basic delay of the regional backbone, in seconds */ 0.768, /*! Basic delay of the intercontinental backbone, in seconds */ 1.0, /*! Percentage packet loss of the backbone */ 0.5, /*! Maximum jitter of the backbone, in seconds */ 60.0, /*! Interval between the backbone route flapping between two paths, in seconds */ 0.128, /*! The difference in backbone delay between the two routes we flap between, in seconds */ 60.0, /*! The interval between link failures, in seconds */ 3.0, /*! The duration of link failures, in seconds */ 1.0, /*! Probability of packet loss in the backbone, in percent */ 1.0 /*! Probability of a packet going out of sequence in the backbone. */ }, { 50.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0 /*! Peak jitter */ }, { 20.0, /*! Percentage occupancy */ 1508, /*! MTU */ 0.0015 /*! Peak jitter */ } } }; #if defined(HAVE_DRAND48) static __inline__ void q1050_rand_init(void) { srand48(time(NULL)); } /*- End of function --------------------------------------------------------*/ static __inline__ double q1050_rand(void) { return drand48(); } /*- End of function --------------------------------------------------------*/ #else static __inline__ void q1050_rand_init(void) { srand(time(NULL)); } /*- End of function --------------------------------------------------------*/ static __inline__ double q1050_rand(void) { return (double) rand()/(double) RAND_MAX; } /*- End of function --------------------------------------------------------*/ #endif static __inline__ double scale_probability(double prob, double scale) { /* Re-calculate probability based on a different time interval */ return 1.0 - pow(1.0 - prob, scale); } /*- End of function --------------------------------------------------------*/ static void g1050_segment_init(g1050_segment_state_t *s, int link_type, g1050_segment_constants_t *constants, g1050_segment_model_t *parms, int bit_rate, int multiple_access, int qos_enabled, int packet_size, int packet_rate) { double x; double packet_interval; memset(s, 0, sizeof(*s)); packet_interval = 1000.0/packet_rate; /* Some calculatons are common to both LAN and access links, and those that are not. */ s->link_type = link_type; s->prob_loss_rate_change[0] = scale_probability(constants->prob_loss_rate_change[0]*parms->percentage_occupancy, 1.0/packet_interval); s->serial_delay = packet_size*8.0/bit_rate; if (link_type == G1050_LAN_LINK) { s->prob_loss_rate_change[1] = scale_probability(constants->prob_loss_rate_change[1], 1.0/packet_interval); s->prob_impulse[0] = constants->prob_impulse[0][0]; s->prob_impulse[1] = constants->prob_impulse[1][0]; s->impulse_coeff = constants->impulse_coeff; s->impulse_height = parms->mtu*(8.0/bit_rate)*(1.0 + parms->percentage_occupancy/constants->impulse_height); } else if (link_type == G1050_ACCESS_LINK) { s->prob_loss_rate_change[1] = scale_probability(constants->prob_loss_rate_change[1]/(1.0 + parms->percentage_occupancy), 1.0/packet_interval); s->prob_impulse[0] = scale_probability(constants->prob_impulse[0][0] + (parms->percentage_occupancy/2000.0), 1.0/packet_interval); s->prob_impulse[1] = scale_probability(constants->prob_impulse[1][0] + (constants->prob_impulse[1][1]*parms->percentage_occupancy/100.0), 1.0/packet_interval); s->impulse_coeff = 1.0 - scale_probability(1.0 - constants->impulse_coeff, 1.0/packet_interval); x = (1.0 - constants->impulse_coeff)/(1.0 - s->impulse_coeff); s->impulse_height = x*parms->mtu*(8.0/bit_rate)*(1.0 + parms->percentage_occupancy/constants->impulse_height); } /* The following are calculated the same way for LAN and access links */ s->prob_packet_loss = constants->prob_packet_loss*parms->percentage_occupancy; s->qos_enabled = qos_enabled; s->multiple_access = multiple_access; s->prob_packet_collision_loss = constants->prob_packet_collision_loss; s->max_jitter = parms->max_jitter; /* The following is common state information to all links. */ s->high_loss = FALSE; s->congestion_delay = 0.0; s->last_arrival_time = 0.0; /* Count of packets lost in this segment. */ s->lost_packets = 0; s->lost_packets_2 = 0; } /*- End of function --------------------------------------------------------*/ static void g1050_core_init(g1050_core_state_t *s, g1050_core_model_t *parms, int packet_rate) { memset(s, 0, sizeof(*s)); /* Set up route flapping. */ /* This is the length of the period of both the delayed duration and the non-delayed. */ s->route_flap_interval = parms->route_flap_interval*G1050_TICKS_PER_SEC; /* How much additional delay is added or subtracted during route flaps. */ s->route_flap_delta = parms->route_flap_delay; /* Current tick count. This is initialized so that we are part way into the first CLEAN interval before the first change occurs. This is a random portion of the period. When we reach the first flap, the flapping in both directions becomes periodic. */ s->route_flap_counter = s->route_flap_interval - 99 - floor(s->route_flap_interval*q1050_rand()); s->link_failure_interval_ticks = parms->link_failure_interval*G1050_TICKS_PER_SEC; /* Link failures occur when the count reaches this number of ticks. */ /* Duration of a failure. */ s->link_failure_duration_ticks = floor((G1050_TICKS_PER_SEC*parms->link_failure_duration)); /* How far into the first CLEAN interval we are. This is like the route flap initialzation. */ s->link_failure_counter = s->link_failure_interval_ticks - 99 - floor(s->link_failure_interval_ticks*q1050_rand()); s->link_recovery_counter = s->link_failure_duration_ticks; s->base_delay = parms->base_regional_delay; s->max_jitter = parms->max_jitter; s->prob_packet_loss = parms->prob_packet_loss/100.0; s->prob_oos = parms->prob_oos/100.0; s->last_arrival_time = 0.0; s->delay_delta = 0; /* Count of packets lost in this segment. */ s->lost_packets = 0; s->lost_packets_2 = 0; } /*- End of function --------------------------------------------------------*/ static void g1050_segment_model(g1050_segment_state_t *s, double delays[], int len) { int i; int lose; int was_high_loss; double impulse; double slice_delay; /* Compute delay and loss value for each time slice. */ for (i = 0; i < len; i++) { lose = FALSE; /* Initialize delay to the serial delay plus some jitter. */ slice_delay = s->serial_delay + s->max_jitter*q1050_rand(); /* If no QoS, do congestion delay and packet loss analysis. */ if (!s->qos_enabled) { /* To match the logic in G.1050 we need to record the current loss state, before checking if we should change. */ was_high_loss = s->high_loss; /* Toggle between the low-loss and high-loss states, based on the transition probability. */ if (q1050_rand() < s->prob_loss_rate_change[was_high_loss]) s->high_loss = !s->high_loss; impulse = 0.0; if (q1050_rand() < s->prob_impulse[was_high_loss]) { impulse = s->impulse_height; if (!was_high_loss || s->link_type == G1050_LAN_LINK) impulse *= q1050_rand(); } if (was_high_loss && q1050_rand() < s->prob_packet_loss) lose = TRUE; /* Single pole LPF for the congestion delay impulses. */ s->congestion_delay = s->congestion_delay*s->impulse_coeff + impulse*(1.0 - s->impulse_coeff); slice_delay += s->congestion_delay; } /* If duplex mismatch on LAN, packet loss based on loss probability. */ if (s->multiple_access && (q1050_rand() < s->prob_packet_collision_loss)) lose = TRUE; /* Put computed delay into time slice array. */ if (lose) { delays[i] = PACKET_LOSS_TIME; s->lost_packets++; } else { delays[i] = slice_delay; } } } /*- End of function --------------------------------------------------------*/ static void g1050_core_model(g1050_core_state_t *s, double delays[], int len) { int32_t i; int lose; double jitter_delay; for (i = 0; i < len; i++) { lose = FALSE; jitter_delay = s->base_delay + s->max_jitter*q1050_rand(); /* Route flapping */ if (--s->route_flap_counter <= 0) { /* Route changed */ s->delay_delta = s->route_flap_delta - s->delay_delta; s->route_flap_counter = s->route_flap_interval; } if (q1050_rand() < s->prob_packet_loss) lose = TRUE; /* Link failures */ if (--s->link_failure_counter <= 0) { /* We are in a link failure */ lose = TRUE; if (--s->link_recovery_counter <= 0) { /* Leave failure state. */ s->link_failure_counter = s->link_failure_interval_ticks; s->link_recovery_counter = s->link_failure_duration_ticks; lose = FALSE; } } if (lose) { delays[i] = PACKET_LOSS_TIME; s->lost_packets++; } else { delays[i] = jitter_delay + s->delay_delta; } } } /*- End of function --------------------------------------------------------*/ static int g1050_segment_delay(g1050_segment_state_t *s, double base_time, double arrival_times[], double delays[], int num_packets) { int i; int32_t departure_time; int lost_packets; /* Add appropriate delays to the packets for the segments before the core. */ lost_packets = 0; for (i = 0; i < num_packets; i++) { /* Apply half a millisecond of rounding, as we working in millisecond steps. */ departure_time = (arrival_times[i] + 0.0005 - base_time)*G1050_TICKS_PER_SEC; if (arrival_times[i] == PACKET_LOSS_TIME) { /* Lost already */ } else if (delays[departure_time] == PACKET_LOSS_TIME) { arrival_times[i] = PACKET_LOSS_TIME; lost_packets++; } else { arrival_times[i] += delays[departure_time]; if (arrival_times[i] < s->last_arrival_time) arrival_times[i] = s->last_arrival_time; else s->last_arrival_time = arrival_times[i]; } } return lost_packets; } /*- End of function --------------------------------------------------------*/ static int g1050_segment_delay_preserve_order(g1050_segment_state_t *s, double base_time, double arrival_times_a[], double arrival_times_b[], double delays[], int num_packets) { int i; int j; int departure_time; double last_arrival_time; double last_arrival_time_temp; int lost_packets; /* Add appropriate delays to the packets for the segments after the core. */ last_arrival_time = 0.0; last_arrival_time_temp = 0.0; lost_packets = 0; for (i = 0; i < num_packets; i++) { /* We need to preserve the order that came out of the core, so we use an alternate array for the results. */ /* Apply half a millisecond of rounding, as we working in millisecond steps. */ departure_time = (arrival_times_a[i] + 0.0005 - base_time)*G1050_TICKS_PER_SEC; if (arrival_times_a[i] == PACKET_LOSS_TIME) { /* Lost already */ arrival_times_b[i] = PACKET_LOSS_TIME; } else if (delays[departure_time] == PACKET_LOSS_TIME) { arrival_times_b[i] = PACKET_LOSS_TIME; lost_packets++; } else { arrival_times_b[i] = arrival_times_a[i] + delays[departure_time]; if (arrival_times_a[i] < last_arrival_time) { /* If a legitimate out of sequence packet is detected, search back a fixed amount of time to preserve order. */ for (j = i - 1; j >= 0; j--) { if ((arrival_times_a[j] != PACKET_LOSS_TIME) && (arrival_times_b[j] != PACKET_LOSS_TIME)) { if ((arrival_times_a[i] - arrival_times_a[j]) > SEARCHBACK_PERIOD) break; if ((arrival_times_a[j] > arrival_times_a[i]) && (arrival_times_b[j] < arrival_times_b[i])) { arrival_times_b[j] = arrival_times_b[i]; } } } } else { last_arrival_time = arrival_times_a[i]; if (arrival_times_b[i] < last_arrival_time_temp) arrival_times_b[i] = last_arrival_time_temp; else last_arrival_time_temp = arrival_times_b[i]; } } } return lost_packets; } /*- End of function --------------------------------------------------------*/ static int g1050_core_delay(g1050_core_state_t *s, double base_time, double arrival_times[], double delays[], int num_packets) { int i; int departure_time; int lost_packets; /* This element does NOT preserve packet order. */ lost_packets = 0; for (i = 0; i < num_packets; i++) { /* Apply half a millisecond of rounding, as we working in millisecond steps. */ departure_time = (arrival_times[i] + 0.0005 - base_time)*G1050_TICKS_PER_SEC; if (arrival_times[i] == PACKET_LOSS_TIME) { /* Lost already */ } else if (delays[departure_time] == PACKET_LOSS_TIME) { arrival_times[i] = PACKET_LOSS_TIME; lost_packets++; } else { /* Not lost. Compute arrival time. */ arrival_times[i] += delays[departure_time]; if (arrival_times[i] < s->last_arrival_time) { /* This packet is EARLIER than the last one. It is out of order! */ /* Do we allow it to stay out of order? */ if (q1050_rand() >= s->prob_oos) arrival_times[i] = s->last_arrival_time; } else { /* Packet is in the correct order, relative to the last one. */ s->last_arrival_time = arrival_times[i]; } } } return lost_packets; } /*- End of function --------------------------------------------------------*/ static void g1050_simulate_chunk(g1050_state_t *s) { int i; s->base_time += 1.0; memcpy(&s->segment[0].delays[0], &s->segment[0].delays[G1050_TICKS_PER_SEC], 2*G1050_TICKS_PER_SEC*sizeof(s->segment[0].delays[0])); g1050_segment_model(&s->segment[0], &s->segment[0].delays[2*G1050_TICKS_PER_SEC], G1050_TICKS_PER_SEC); memcpy(&s->segment[1].delays[0], &s->segment[1].delays[G1050_TICKS_PER_SEC], 2*G1050_TICKS_PER_SEC*sizeof(s->segment[1].delays[0])); g1050_segment_model(&s->segment[1], &s->segment[1].delays[2*G1050_TICKS_PER_SEC], G1050_TICKS_PER_SEC); memcpy(&s->core.delays[0], &s->core.delays[G1050_TICKS_PER_SEC], 2*G1050_TICKS_PER_SEC*sizeof(s->core.delays[0])); g1050_core_model(&s->core, &s->core.delays[2*G1050_TICKS_PER_SEC], G1050_TICKS_PER_SEC); memcpy(&s->segment[2].delays[0], &s->segment[2].delays[G1050_TICKS_PER_SEC], 2*G1050_TICKS_PER_SEC*sizeof(s->segment[2].delays[0])); g1050_segment_model(&s->segment[2], &s->segment[2].delays[2*G1050_TICKS_PER_SEC], G1050_TICKS_PER_SEC); memcpy(&s->segment[3].delays[0], &s->segment[3].delays[G1050_TICKS_PER_SEC], 2*G1050_TICKS_PER_SEC*sizeof(s->segment[3].delays[0])); g1050_segment_model(&s->segment[3], &s->segment[3].delays[2*G1050_TICKS_PER_SEC], G1050_TICKS_PER_SEC); memcpy(&s->arrival_times_1[0], &s->arrival_times_1[s->packet_rate], 2*s->packet_rate*sizeof(s->arrival_times_1[0])); memcpy(&s->arrival_times_2[0], &s->arrival_times_2[s->packet_rate], 2*s->packet_rate*sizeof(s->arrival_times_2[0])); for (i = 0; i < s->packet_rate; i++) { s->arrival_times_1[2*s->packet_rate + i] = s->base_time + 2.0 + (double) i/(double) s->packet_rate; s->arrival_times_2[2*s->packet_rate + i] = 0.0; } s->segment[0].lost_packets_2 += g1050_segment_delay(&s->segment[0], s->base_time, s->arrival_times_1, s->segment[0].delays, s->packet_rate); s->segment[1].lost_packets_2 += g1050_segment_delay(&s->segment[1], s->base_time, s->arrival_times_1, s->segment[1].delays, s->packet_rate); s->core.lost_packets_2 += g1050_core_delay(&s->core, s->base_time, s->arrival_times_1, s->core.delays, s->packet_rate); s->segment[2].lost_packets_2 += g1050_segment_delay_preserve_order(&s->segment[2], s->base_time, s->arrival_times_1, s->arrival_times_2, s->segment[2].delays, s->packet_rate); s->segment[3].lost_packets_2 += g1050_segment_delay_preserve_order(&s->segment[3], s->base_time, s->arrival_times_2, s->arrival_times_1, s->segment[3].delays, s->packet_rate); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(g1050_state_t *) g1050_init(int model, int speed_pattern, int packet_size, int packet_rate) { g1050_state_t *s; g1050_constants_t *constants; g1050_channel_speeds_t *sp; g1050_model_t *mo; int i; /* If the random generator has not been seeded it might give endless zeroes - it depends on the platform. */ for (i = 0; i < 10; i++) { if (q1050_rand() != 0.0) break; } if (i >= 10) q1050_rand_init(); if ((s = (g1050_state_t *) malloc(sizeof(*s))) == NULL) return NULL; memset(s, 0, sizeof(*s)); constants = &g1050_constants[0]; sp = &g1050_speed_patterns[speed_pattern - 1]; mo = &g1050_standard_models[model]; memset(s, 0, sizeof(*s)); s->packet_rate = packet_rate; s->packet_size = packet_size; g1050_segment_init(&s->segment[0], G1050_LAN_LINK, &constants->segment[0], &mo->sidea_lan, sp->sidea_lan_bit_rate, sp->sidea_lan_multiple_access, FALSE, packet_size, packet_rate); g1050_segment_init(&s->segment[1], G1050_ACCESS_LINK, &constants->segment[1], &mo->sidea_access_link, sp->sidea_access_link_bit_rate_ab, FALSE, sp->sidea_access_link_qos_enabled, packet_size, packet_rate); g1050_core_init(&s->core, &mo->core, packet_rate); g1050_segment_init(&s->segment[2], G1050_ACCESS_LINK, &constants->segment[2], &mo->sideb_access_link, sp->sideb_access_link_bit_rate_ba, FALSE, sp->sideb_access_link_qos_enabled, packet_size, packet_rate); g1050_segment_init(&s->segment[3], G1050_LAN_LINK, &constants->segment[3], &mo->sideb_lan, sp->sideb_lan_bit_rate, sp->sideb_lan_multiple_access, FALSE, packet_size, packet_rate); s->base_time = 0.0; /* Start with enough of the future modelled to allow for the worst jitter. After this we will always keep at least 2 seconds of the future modelled. */ g1050_segment_model(&s->segment[0], s->segment[0].delays, 3*G1050_TICKS_PER_SEC); g1050_segment_model(&s->segment[1], s->segment[1].delays, 3*G1050_TICKS_PER_SEC); g1050_core_model(&s->core, s->core.delays, 3*G1050_TICKS_PER_SEC); g1050_segment_model(&s->segment[2], s->segment[2].delays, 3*G1050_TICKS_PER_SEC); g1050_segment_model(&s->segment[3], s->segment[3].delays, 3*G1050_TICKS_PER_SEC); /* Initialise the arrival times to the departure times */ for (i = 0; i < 3*s->packet_rate; i++) { s->arrival_times_1[i] = s->base_time + (double) i/(double)s->packet_rate; s->arrival_times_2[i] = 0.0; } s->segment[0].lost_packets_2 += g1050_segment_delay(&s->segment[0], s->base_time, s->arrival_times_1, s->segment[0].delays, s->packet_rate); s->segment[1].lost_packets_2 += g1050_segment_delay(&s->segment[1], s->base_time, s->arrival_times_1, s->segment[1].delays, s->packet_rate); s->core.lost_packets_2 += g1050_core_delay(&s->core, s->base_time, s->arrival_times_1, s->core.delays, s->packet_rate); s->segment[2].lost_packets_2 += g1050_segment_delay_preserve_order(&s->segment[2], s->base_time, s->arrival_times_1, s->arrival_times_2, s->segment[2].delays, s->packet_rate); s->segment[3].lost_packets_2 += g1050_segment_delay_preserve_order(&s->segment[3], s->base_time, s->arrival_times_2, s->arrival_times_1, s->segment[3].delays, s->packet_rate); s->first = NULL; s->last = NULL; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) g1050_dump_parms(int model, int speed_pattern) { g1050_channel_speeds_t *sp; g1050_model_t *mo; sp = &g1050_speed_patterns[speed_pattern - 1]; mo = &g1050_standard_models[model]; printf("Model %d%c\n", speed_pattern, 'A' + model - 1); printf("LOO %.6f%% %.6f%% %.6f%%\n", mo->loo[0]*sp->loo/100.0, mo->loo[1]*sp->loo/100.0, mo->loo[2]*sp->loo/100.0); printf("Side A LAN %dbps, %.3f%% occupancy, MTU %d, %s MA\n", sp->sidea_lan_bit_rate, mo->sidea_lan.percentage_occupancy, mo->sidea_lan.mtu, (sp->sidea_lan_multiple_access) ? "" : "no"); printf("Side A access %dbps, %.3f%% occupancy, MTU %d, %s QoS\n", sp->sidea_access_link_bit_rate_ab, mo->sidea_access_link.percentage_occupancy, mo->sidea_access_link.mtu, (sp->sidea_access_link_qos_enabled) ? "" : "no"); printf("Core delay %.4fs (%.4fs), peak jitter %.4fs, prob loss %.4f%%, prob OOS %.4f%%\n", mo->core.base_regional_delay, mo->core.base_intercontinental_delay, mo->core.max_jitter, mo->core.prob_packet_loss, mo->core.prob_oos); printf(" Route flap interval %.4fs, delay change %.4fs\n", mo->core.route_flap_interval, mo->core.route_flap_delay); printf(" Link failure interval %.4fs, duration %.4fs\n", mo->core.link_failure_interval, mo->core.link_failure_duration); printf("Side B access %dbps, %.3f%% occupancy, MTU %d, %s QoS\n", sp->sideb_access_link_bit_rate_ba, mo->sideb_access_link.percentage_occupancy, mo->sideb_access_link.mtu, (sp->sideb_access_link_qos_enabled) ? "" : "no"); printf("Side B LAN %dbps, %.3f%% occupancy, MTU %d, %s MA\n", sp->sideb_lan_bit_rate, mo->sideb_lan.percentage_occupancy, mo->sideb_lan.mtu, (sp->sideb_lan_multiple_access) ? "" : "no"); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g1050_put(g1050_state_t *s, const uint8_t buf[], int len, int seq_no, double departure_time) { g1050_queue_element_t *element; g1050_queue_element_t *e; double arrival_time; while (departure_time >= s->base_time + 1.0) g1050_simulate_chunk(s); arrival_time = s->arrival_times_1[(int) ((departure_time - s->base_time)*(double) s->packet_rate + 0.5)]; if (arrival_time < 0) { /* This packet is lost */ return 0; } if ((element = (g1050_queue_element_t *) malloc(sizeof(*element) + len)) == NULL) return -1; element->next = NULL; element->prev = NULL; element->seq_no = seq_no; element->departure_time = departure_time; element->arrival_time = arrival_time; element->len = len; memcpy(element->pkt, buf, len); /* Add it to the queue, in order */ if (s->last == NULL) { /* The queue is empty */ s->first = s->last = element; } else { for (e = s->last; e; e = e->prev) { if (e->arrival_time <= arrival_time) break; } if (e) { element->next = e->next; element->prev = e; e->next = element; } else { element->next = s->first; s->first = element; } if (element->next) element->next->prev = element; else s->last = element; } //printf(">> Seq %d, departs %f, arrives %f\n", seq_no, departure_time, arrival_time); return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g1050_get(g1050_state_t *s, uint8_t buf[], int max_len, double current_time, int *seq_no, double *departure_time, double *arrival_time) { int len; g1050_queue_element_t *element; element = s->first; if (element == NULL) { if (seq_no) *seq_no = -1; if (departure_time) *departure_time = -1; if (arrival_time) *arrival_time = -1; return -1; } if (element->arrival_time > current_time) { if (seq_no) *seq_no = element->seq_no; if (departure_time) *departure_time = element->departure_time; if (arrival_time) *arrival_time = element->arrival_time; return -1; } /* Return the first packet in the queue */ len = element->len; memcpy(buf, element->pkt, len); if (seq_no) *seq_no = element->seq_no; if (departure_time) *departure_time = element->departure_time; if (arrival_time) *arrival_time = element->arrival_time; //printf("<< Seq %d, arrives %f (%f)\n", element->seq_no, element->arrival_time, current_time); /* Remove it from the queue */ if (s->first == s->last) s->last = NULL; s->first = element->next; if (element->next) element->next->prev = NULL; free(element); return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) g1050_queue_dump(g1050_state_t *s) { g1050_queue_element_t *e; printf("Queue scanned forewards\n"); for (e = s->first; e; e = e->next) printf("Seq %5d, arrival %10.4f, len %3d\n", e->seq_no, e->arrival_time, e->len); printf("Queue scanned backwards\n"); for (e = s->last; e; e = e->prev) printf("Seq %5d, arrival %10.4f, len %3d\n", e->seq_no, e->arrival_time, e->len); } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/spandsp-sim/rfc2198_sim.c0000664000175000017500000001264412100775505014471 00000000000000/* * SpanDSP - a series of DSP components for telephony * * rfc2198_sim.c - Simulate the behaviour of RFC2198 (or UDPTL) redundancy. * * Written by Steve Underwood * * Copyright (C) 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #define GEN_CONST #include #endif #include "floating_fudge.h" #include "spandsp.h" #include "spandsp/g1050.h" #include "spandsp/rfc2198_sim.h" #define PACKET_LOSS_TIME -1 #define FALSE 0 #define TRUE (!FALSE) SPAN_DECLARE(rfc2198_sim_state_t *) rfc2198_sim_init(int model, int speed_pattern, int packet_size, int packet_rate, int redundancy_depth) { rfc2198_sim_state_t *s; if ((s = (rfc2198_sim_state_t *) malloc(sizeof(*s))) == NULL) return NULL; memset(s, 0, sizeof(*s)); s->g1050 = g1050_init(model, speed_pattern, packet_size, packet_rate); s->redundancy_depth = redundancy_depth; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) rfc2198_sim_put(rfc2198_sim_state_t *s, const uint8_t buf[], int len, int seq_no, double departure_time) { uint8_t buf2[8192]; uint8_t *p; uint16_t *q; int slot; int i; /* Save the packet in the history buffer */ memcpy(s->tx_pkt[s->next_pkt], buf, len); s->tx_pkt_len[s->next_pkt] = len; s->tx_pkt_seq_no[s->next_pkt] = seq_no; /* Construct the redundant packet */ p = buf2; slot = s->next_pkt; q = (uint16_t *) p; *q = s->redundancy_depth; p += sizeof(uint16_t); for (i = 0; i < s->redundancy_depth; i++) { q = (uint16_t *) p; *q = s->tx_pkt_len[slot]; p += sizeof(uint16_t); memcpy(p, s->tx_pkt[slot], s->tx_pkt_len[slot]); p += s->tx_pkt_len[slot]; slot = (slot - 1) & 0x1F; } s->next_pkt = (s->next_pkt + 1) & 0x1F; return g1050_put(s->g1050, buf2, p - buf2, seq_no, departure_time); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) rfc2198_sim_get(rfc2198_sim_state_t *s, uint8_t buf[], int max_len, double current_time, int *seq_no, double *departure_time, double *arrival_time) { int len; int lenx; int seq_nox; int i; #if defined(_MSC_VER) uint8_t *bufx = (uint8_t *) _alloca(s->redundancy_depth*1024); #else uint8_t bufx[s->redundancy_depth*1024]; #endif uint8_t *p; uint16_t *q; int redundancy_depth; if (s->rx_queued_pkts) { /* We have some stuff from the last g1050_get() still to deliver */ s->rx_queued_pkts--; memcpy(buf, s->rx_pkt[s->rx_queued_pkts], s->rx_pkt_len[s->rx_queued_pkts]); *seq_no = s->rx_pkt_seq_no[s->rx_queued_pkts]; return s->rx_pkt_len[s->rx_queued_pkts]; } len = g1050_get(s->g1050, bufx, s->redundancy_depth*1024, current_time, &seq_nox, departure_time, arrival_time); if (len > 0) { p = bufx; q = (uint16_t *) p; redundancy_depth = *q; p += sizeof(uint16_t); i = 0; if (seq_nox > s->next_seq_no) { /* Some stuff is missing. Try to fill it in. */ s->rx_queued_pkts = seq_nox - s->next_seq_no; if (s->rx_queued_pkts >= redundancy_depth) s->rx_queued_pkts = redundancy_depth - 1; for (i = 0; i < s->rx_queued_pkts; i++) { q = (uint16_t *) p; s->rx_pkt_len[i] = *q; p += sizeof(uint16_t); memcpy(s->rx_pkt[i], p, s->rx_pkt_len[i]); s->rx_pkt_seq_no[i] = seq_nox - i; p += s->rx_pkt_len[i]; } } *seq_no = seq_nox - i; q = (uint16_t *) p; lenx = *q; p += sizeof(uint16_t); memcpy(buf, p, lenx); s->next_seq_no = seq_nox + 1; } else { lenx = len; } return lenx; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/spandsp-sim/libspandsp_sim.2005.vcproj0000664000175000017500000000656012343640734017204 00000000000000 spandsp-0.0.6/spandsp-sim/make_line_models.c0000664000175000017500000013577312100775505016023 00000000000000/* * SpanDSP - a series of DSP components for telephony * * make_line_models.c * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page make_line_models_page Telephony line model construction \section make_line_models_page_sec_1 What does it do? ???. \section make_line_models_page_sec_2 How does it work? ???. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include "floating_fudge.h" #if defined(HAVE_FFTW3_H) #include #else #include #endif #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "spandsp.h" #if !defined(M_PI) # define M_PI 3.14159265358979323846 /* pi */ #endif #define LINE_MODEL_FILE_NAME "line_models.c" #define SAMPLE_RATE 8000 #define LINE_FILTER_SIZE 129 #define FFT_SIZE 1024 /* Tabulated medium range telephone line response (from p 537, Digital Communication, John G. Proakis */ /* amp 1.0 -> 2.15, freq = 3000 Hz -> 3.2, by 0.2 increments delay = 4 ms -> 2.2 */ struct { int frequency; float amp; float delay; } proakis[] = { { 0, 0.00, 4.80}, { 200, 0.90, 3.50}, { 400, 1.40, 2.20}, { 600, 1.80, 0.90}, { 800, 2.00, 0.50}, {1000, 2.10, 0.25}, {1200, 2.30, 0.10}, {1400, 2.30, 0.05}, {1600, 2.20, 0.00}, {1800, 2.10, 0.00}, {2000, 2.00, 0.00}, {2200, 1.85, 0.05}, {2400, 1.75, 0.10}, {2600, 1.55, 0.20}, {2800, 1.30, 0.40}, {3000, 1.10, 0.50}, {3200, 0.80, 0.90}, {3400, 0.55, 1.20}, {3600, 0.25, 2.20}, {3800, 0.05, 3.20}, {4000, 0.05, 4.20}, {4200, 0.05, 5.20} }; #define CPE_TO_CO_ATTENUATION 0 /* In dB */ #define CPE_TO_CO_DELAY 1 /* In us */ #define CPE_TO_CO_IMPEDANCE 2 /* In ohms */ #define CPE_TO_CO_PHASE 3 /* In degrees */ #define CO_TO_CPE_IMPEDANCE 4 /* In ohms */ #define CO_TO_CPE_PHASE 5 /* In degrees */ #define CO_TO_CPE_ATTENUATION 6 /* In dB */ #define CO_TO_CPE_DELAY 7 /* In us */ /* Terms used, for V.56bis: AD = attenuation distortion EDD = envelope delay distortion */ /* V.56bis EIA LL-1, non-loaded loop */ struct { int freq; float ad[8]; } eia_ll1[] = { { 200, {0.0, 0.4, 767, -1.4, 767, -1.4, 0.0, 0.4}}, { 300, {0.0, 0.7, 766, -2.0, 766, -2.0, 0.0, 0.7}}, { 400, {0.0, 0.5, 763, -2.8, 763, -2.8, 0.0, 0.5}}, { 500, {0.0, 0.6, 765, -3.4, 765, -3.4, 0.0, 0.6}}, { 600, {0.0, 0.2, 764, -4.1, 764, -4.1, 0.0, 0.2}}, { 700, {0.0, 0.4, 764, -4.7, 764, -4.7, 0.0, 0.4}}, { 800, {0.0, 0.4, 762, -5.4, 762, -5.4, 0.0, 0.4}}, { 900, {0.0, 0.2, 762, -6.0, 762, -6.0, 0.0, 0.2}}, {1000, {1.2, 0.5, 761, -6.7, 761, -6.7, 1.2, 0.5}}, {1100, {0.0, 0.6, 759, -7.4, 759, -7.4, 0.0, 0.6}}, {1200, {0.0, 0.4, 757, -8.1, 757, -8.1, 0.0, 0.4}}, {1300, {0.0, 0.1, 757, -8.6, 757, -8.6, 0.0, 0.1}}, {1400, {0.0, 0.3, 755, -9.3, 755, -9.3, 0.0, 0.3}}, {1500, {0.0, 0.4, 753, -10.0, 753, -10.0, 0.0, 0.4}}, {1600, {0.0, 0.3, 751, -10.7, 751, -10.7, 0.0, 0.3}}, {1700, {0.0, 0.1, 748, -11.3, 748, -11.3, 0.0, 0.1}}, {1800, {0.0, 11.0, 748, -11.9, 748, -11.9, 0.0, 11.0}}, {1900, {0.1, 0.1, 745, -12.5, 745, -12.5, 0.1, 0.1}}, {2000, {0.1, 0.3, 743, -13.9, 743, -13.9, 0.1, 0.3}}, {2100, {0.1, 0.3, 740, -13.9, 740, -13.9, 0.1, 0.3}}, {2200, {0.1, 0.3, 737, -14.5, 737, -14.5, 0.1, 0.3}}, {2300, {0.1, 0.3, 734, -15.2, 734, -15.2, 0.1, 0.3}}, {2400, {0.1, 0.2, 731, -15.8, 731, -15.8, 0.1, 0.2}}, {2500, {0.1, 0.0, 728, -16.4, 728, -16.4, 0.1, 0.0}}, {2600, {0.1, 0.0, 729, -16.8, 729, -16.8, 0.1, 0.0}}, {2700, {0.2, 0.1, 726, -17.4, 726, -17.4, 0.2, 0.1}}, {2800, {0.2, 0.2, 722, -18.0, 722, -18.0, 0.2, 0.2}}, {2900, {0.2, 0.3, 719, -18.6, 719, -18.6, 0.2, 0.3}}, {3000, {0.2, 0.4, 715, -19.3, 715, -19.3, 0.2, 0.4}}, {3100, {0.2, 0.4, 712, -19.9, 712, -19.9, 0.2, 0.4}}, {3200, {0.2, 0.5, 708, -20.5, 708, -20.5, 0.2, 0.5}}, {3300, {0.2, 0.5, 704, -21.1, 704, -21.1, 0.2, 0.5}}, {3400, {0.2, 0.5, 700, -21.7, 700, -21.7, 0.2, 0.5}}, {3500, {0.2, 0.5, 696, -22.3, 696, -22.3, 0.2, 0.5}}, {3600, {0.2, 0.4, 692, -22.9, 692, -22.9, 0.2, 0.4}}, {3700, {0.2, 0.3, 688, -23.5, 688, -23.5, 0.2, 0.3}}, {3800, {0.2, 0.2, 684, -24.1, 684, -24.1, 0.2, 0.2}}, {3900, {0.2, 0.1, 680, -24.7, 680, -24.7, 0.2, 0.1}}, {4000, {0.2, -0.1, 676, -25.2, 676, -25.2, 0.2, -0.1}} }; /* V.56bis EIA LL-2, non-loaded loop */ struct { int freq; float ad[8]; } eia_ll2[] = { { 200, {-0.2, 6.6, 1086, -4.9, 1085, -5.6, -0.2, 6.6}}, { 300, {-0.2, 7.7, 1079, -7.3, 1077, -8.3, -0.2, 7.7}}, { 400, {-0.2, 6.7, 1062, -9.9, 1058, -11.2, -0.2, 6.7}}, { 500, {-0.2, 7.1, 1059, -12.0, 1053, -13.6, -0.2, 7.1}}, { 600, {-0.1, 5.2, 1041, -14.4, 1034, -16.3, -0.1, 5.2}}, { 700, {-0.1, 5.8, 1030, -16.5, 1020, -18.6, -0.1, 5.8}}, { 800, {-0.1, 5.4, 1010, -18.7, 998, -21.0, -0.1, 5.4}}, { 900, { 0.0, 4.5, 997, -20.5, 982, -23.1, 0.0, 4.5}}, {1000, { 3.2, 5.1, 976, -22.5, 959, -25.3, 3.2, 5.1}}, {1100, { 0.1, 5.0, 954, -24.5, 934, -27.4, 0.1, 5.0}}, {1200, { 0.1, 4.0, 931, -26.2, 909, -29.4, 0.1, 4.0}}, {1300, { 0.2, 2.7, 918, -27.6, 894, -30.9, 0.2, 2.7}}, {1400, { 0.2, 2.8, 897, -29.2, 871, -32.6, 0.2, 2.8}}, {1500, { 0.3, 2.6, 874, -30.7, 847, -34.3, 0.3, 2.6}}, {1600, { 0.3, 2.0, 852, -32.1, 823, -35.8, 0.3, 2.0}}, {1700, { 0.4, 0.9, 831, -33.4, 800, -37.2, 0.4, 0.9}}, {1800, { 0.5, 40.8, 816, -34.4, 783, -38.4, 0.5, 40.8}}, {1900, { 0.6, 0.0, 796, -35.6, 762, -39.6, 0.6, 0.0}}, {2000, { 0.6, -0.2, 776, -36.6, 741, -40.7, 0.6, -0.2}}, {2100, { 0.7, -0.6, 756, -37.6, 720, -41.8, 0.7, -0.6}}, {2200, { 0.8, -1.1, 737, -38.6, 700, -42.9, 0.8, -1.1}}, {2300, { 0.9, -1.8, 719, -39.4, 681, -43.8, 0.9, -1.8}}, {2400, { 1.0, -2.6, 701, -40.2, 663, -44.7, 1.0, -2.6}}, {2500, { 1.0, -3.7, 684, -41.0, 646, -45.5, 1.0, -3.7}}, {2600, { 1.1, -4.1, 678, -41.3, 639, -45.9, 1.1, -4.1}}, {2700, { 1.2, -4.3, 663, -42.0, 623, -46.6, 1.2, -4.3}}, {2800, { 1.3, -4.5, 647, -42.6, 607, -47.3, 1.3, -4.5}}, {2900, { 1.4, -4.8, 632, -43.1, 591, -47.9, 1.4, -4.8}}, {3000, { 1.5, -5.2, 617, -43.6, 576, -48.4, 1.5, -5.2}}, {3100, { 1.6, -5.6, 603, -44.1, 562, -49.0, 1.6, -5.6}}, {3200, { 1.7, -6.0, 589, -44.5, 548, -49.5, 1.7, -6.0}}, {3300, { 1.8, -6.5, 576, -44.9, 535, -49.9, 1.8, -6.5}}, {3400, { 1.9, -7.1, 563, -45.3, 522, -50.3, 1.9, -7.1}}, {3500, { 2.0, -7.7, 551, -45.6, 509, -50.7, 2.0, -7.7}}, {3600, { 2.1, -8.4, 539, -45.9, 498, -51.0, 2.1, -8.4}}, {3700, { 2.2, -9.1, 528, -46.2, 486, -51.3, 2.2, -9.1}}, {3800, { 2.3, -9.9, 518, -46.4, 476, -51.6, 2.3, -9.9}}, {3900, { 2.4, -10.6, 507, -46.6, 466, -51.9, 2.4, -10.6}}, {4000, { 2.5, -11.5, 498, -46.8, 456, -52.1, 2.5, -11.5}} }; /* V.56bis EIA LL-3, non-loaded loop */ struct { int freq; float ad[8]; } eia_ll3[] = { { 200, {-0.3, 10.5, 1176, -5.9, 1173, -7.4, -0.3, 10.5}}, { 300, {-0.3, 11.5, 1165, -8.8, 1159, -11.0, -0.3, 11.5}}, { 400, {-0.3, 10.6, 1140, -11.8, 1130, -14.7, -0.3, 10.6}}, { 500, {-0.3, 11.0, 1133, -14.3, 1117, -17.8, -0.3, 11.0}}, { 600, {-0.2, 8.5, 1108, -17.1, 1086, -21.2, -0.2, 8.5}}, { 700, {-0.2, 8.5, 1090, -19.4, 1062, -24.0, -0.2, 8.5}}, { 800, {-0.1, 8.4, 1062, -21.9, 1029, -27.0, -0.1, 8.4}}, { 900, { 0.0, 7.1, 1042, -23.9, 1003, -29.4, 0.0, 7.1}}, {1000, { 3.8, 7.7, 1013, -23.0, 969, -31.9, 3.8, 7.7}}, {1100, { 0.1, 7.4, 982, -28.1, 934, -34.3, 0.1, 7.4}}, {1200, { 0.1, 6.0, 953, -29.9, 900, -36.5, 0.1, 6.0}}, {1300, { 0.2, 4.2, 935, -31.3, 878, -38.1, 0.2, 4.2}}, {1400, { 0.3, 4.2, 907, -32.8, 847, -40.0, 0.3, 4.2}}, {1500, { 0.4, 3.7, 880, -34.3, 817, -41.7, 0.4, 3.7}}, {1600, { 0.5, 2.7, 853, -35.6, 787, -43.2, 0.5, 2.7}}, {1700, { 0.6, 1.2, 827, -36.8, 760, -44.6, 0.6, 1.2}}, {1800, { 0.7, 48.7, 809, -37.8, 739, -45.8, 0.7, 48.7}}, {1900, { 0.8, -0.2, 785, -38.8, 715, -47.0, 0.8, -0.2}}, {2000, { 0.9, -0.7, 763, -39.7, 691, -48.0, 0.9, -0.7}}, {2100, { 1.0, -1.3, 741, -40.5, 668, -49.1, 1.0, -1.3}}, {2200, { 1.1, -2.1, 719, -41.3, 647, -50.0, 1.1, -2.1}}, {2300, { 1.2, -2.1, 699, -42.0, 625, -50.8, 1.2, -2.1}}, {2400, { 1.2, -4.3, 680, -42.6, 606, -51.6, 1.2, -4.3}}, {2500, { 1.3, -5.6, 663, -43.2, 588, -52.3, 1.3, -5.6}}, {2600, { 1.6, -6.2, 656, -43.4, 581, -52.7, 1.6, -6.2}}, {2700, { 1.7, -6.6, 640, -43.9, 564, -53.3, 1.7, -6.6}}, {2800, { 1.8, -7.0, 624, -44.3, 548, -53.9, 1.8, -7.0}}, {2900, { 1.9, -7.5, 609, -44.7, 533, -54.4, 1.9, -7.5}}, {3000, { 2.0, -8.0, 594, -45.0, 518, -54.8, 2.0, -8.0}}, {3100, { 2.2, -8.6, 580, -45.3, 504, -55.3, 2.2, -8.6}}, {3200, { 2.3, -9.2, 566, -45.6, 490, -55.7, 2.3, -9.2}}, {3300, { 2.4, -9.9, 553, -45.8, 477, -56.0, 2.4, -9.9}}, {3400, { 2.6, -10.7, 540, -46.0, 465, -56.3, 2.6, -10.7}}, {3500, { 2.7, -11.4, 529, -46.2, 454, -56.6, 2.7, -11.4}}, {3600, { 2.8, -12.3, 517, -46.3, 443, -56.9, 2.8, -12.3}}, {3700, { 3.0, -13.1, 507, -46.4, 432, -57.1, 3.0, -13.1}}, {3800, { 3.1, -14.0, 497, -46.5, 422, -57.3, 3.1, -14.0}}, {3900, { 3.2, -14.9, 487, -46.6, 413, -57.5, 3.2, -14.9}}, {4000, { 3.3, -15.9, 478, -46.6, 404, -57.7, 3.3, -15.9}} }; /* V.56bis EIA LL-4, non-loaded loop */ struct { int freq; float ad[8]; } eia_ll4[] = { { 200, {-0.8, 31.0, 1564, -10.7, 1564, -10.7, -0.8, 31.0}}, { 300, {-0.8, 32.6, 1520, -15.6, 1520, -15.6, -0.8, 32.6}}, { 400, {-0.8, 29.8, 1447, -20.5, 1447, -20.5, -0.8, 29.8}}, { 500, {-0.6, 29.7, 1402, -24.3, 1402, -24.3, -0.6, 29.7}}, { 600, {-0.5, 24.9, 1328, -28.1, 1328, -28.1, -0.5, 24.9}}, { 700, {-0.4, 24.8, 1270, -31.2, 1270, -31.2, -0.4, 24.8}}, { 800, {-0.3, 22.7, 1200, -34.0, 1200, -34.0, -0.3, 22.7}}, { 900, {-0.1, 19.8, 1148, -36.2, 1148, -36.2, -0.1, 19.8}}, {1000, { 6.1, 19.3, 1086, -38.3, 1086, -38.3, 6.1, 19.3}}, {1100, { 0.1, 17.5, 1027, -40.1, 1027, -40.1, 0.1, 17.5}}, {1200, { 0.3, 14.3, 974, -41.6, 974, -41.6, 0.3, 14.3}}, {1300, { 0.5, 10.9, 941, -42.6, 941, -42.6, 0.5, 10.9}}, {1400, { 0.7, 9.6, 897, -43.7, 897, -43.7, 0.7, 9.6}}, {1500, { 0.9, 7.7, 856, -44.6, 856, -44.6, 0.9, 7.7}}, {1600, { 1.1, 5.3, 818, -45.3, 818, -45.3, 1.1, 5.3}}, {1700, { 1.3, 2.4, 784, -45.9, 784, -45.9, 1.3, 2.4}}, {1800, { 1.4, 69.1, 761, -46.3, 761, -46.3, 1.4, 69.1}}, {1900, { 1.7, -1.3, 732, -46.6, 732, -46.6, 1.7, -1.3}}, {2000, { 1.9, -2.7, 706, -46.9, 706, -46.9, 1.9, -2.7}}, {2100, { 2.1, -4.3, 682, -47.1, 682, -47.1, 2.1, -4.3}}, {2200, { 2.3, -6.0, 659, -47.3, 659, -47.3, 2.3, -6.0}}, {2300, { 2.5, -7.9, 638, -47.4, 638, -47.4, 2.5, -7.9}}, {2400, { 2.7, -9.9, 619, -47.4, 619, -47.4, 2.7, -9.9}}, {2500, { 2.9, -12.0, 602, -47.5, 602, -47.5, 2.9, -12.0}}, {2600, { 3.1, -13.0, 596, -47.4, 596, -47.4, 3.1, -13.0}}, {2700, { 3.3, -13.9, 580, -47.4, 580, -47.4, 3.3, -13.9}}, {2800, { 3.5, -14.8, 566, -47.3, 566, -47.3, 3.5, -14.8}}, {2900, { 3.7, -15.7, 552, -47.2, 552, -47.2, 3.7, -15.7}}, {3000, { 3.9, -16.7, 539, -47.1, 539, -47.1, 3.9, -16.7}}, {3100, { 4.1, -17.7, 526, -47.0, 526, -47.0, 4.1, -17.7}}, {3200, { 4.3, -18.7, 515, -46.8, 515, -46.8, 4.3, -18.7}}, {3300, { 4.5, -19.8, 504, -46.7, 504, -46.7, 4.5, -19.8}}, {3400, { 4.7, -20.8, 493, -46.5, 493, -46.5, 4.7, -20.8}}, {3500, { 4.9, -21.8, 484, -46.4, 484, -46.4, 4.9, -21.8}}, {3600, { 5.1, -22.9, 475, -46.2, 475, -46.2, 5.1, -22.9}}, {3700, { 5.3, -23.9, 466, -46.0, 466, -46.0, 5.3, -23.9}}, {3800, { 5.5, -25.0, 458, -45.9, 458, -45.9, 5.5, -25.0}}, {3900, { 5.6, -26.1, 451, -45.7, 451, -45.7, 5.6, -26.1}}, {4000, { 5.8, -27.2, 444, -45.5, 444, -45.5, 5.8, -27.2}} }; /* V.56bis EIA LL-5, non-loaded loop */ struct { int freq; float ad[8]; } eia_ll5[] = { { 200, {-1.4, 55.8, 1607, -12.7, 1574, -17.4, -1.4, 55.8}}, { 300, {-1.3, 57.2, 1541, -18.3, 1478, -24.8, -1.3, 57.2}}, { 400, {-1.2, 52.2, 1443, -23.6, 1350, -31.5, -1.2, 52.2}}, { 500, {-1.0, 51.0, 1379, -27.5, 1261, -36.4, -1.0, 51.0}}, { 600, {-0.9, 43.2, 1287, -31.2, 1150, -40.7, -0.9, 43.2}}, { 700, {-0.7, 41.8, 1216, -34.0, 1066, -44.0, -0.7, 41.8}}, { 800, {-0.5, 37.4, 1137, -36.5, 979, -46.9, -0.5, 37.4}}, { 900, {-0.2, 32.4, 1080, -38.3, 915, -48.9, -0.2, 32.4}}, {1000, { 7.0, 30.5, 1015, -39.8, 848, -50.7, 7.0, 30.5}}, {1100, { 0.3, 26.8, 956, -41.1, 788, -52.2, 0.3, 26.8}}, {1200, { 0.5, 21.5, 904, -42.1, 736, -53.3, 0.5, 21.5}}, {1300, { 0.8, 16.6, 873, -42.7, 703, -54.1, 0.8, 16.6}}, {1400, { 1.0, 14.1, 832, -43.2, 663, -54.8, 1.0, 14.1}}, {1500, { 1.3, 10.9, 795, -43.7, 627, -55.3, 1.3, 10.9}}, {1600, { 1.6, 7.3, 762, -44.0, 595, -55.7, 1.6, 7.3}}, {1700, { 1.9, 3.2, 733, -44.2, 567, -56.0, 1.9, 3.2}}, {1800, { 2.2, 81.5, 713, -44.3, 547, -56.2, 2.2, 81.5}}, {1900, { 2.4, -1.9, 689, -44.4, 524, -56.4, 2.4, -1.9}}, {2000, { 2.7, -3.9, 667, -44.4, 503, -56.5, 2.7, -3.9}}, {2100, { 3.0, -6.1, 646, -44.4, 485, -56.5, 3.0, -6.1}}, {2200, { 3.3, -8.3, 628, -44.4, 466, -56.5, 3.3, -8.3}}, {2300, { 3.6, -10.7, 610, -44.3, 450, -56.5, 3.6, -10.7}}, {2400, { 3.8, -13.1, 595, -44.2, 436, -56.4, 3.8, -13.1}}, {2500, { 4.1, -15.5, 581, -44.1, 422, -56.3, 4.1, -15.5}}, {2600, { 4.3, -16.7, 577, -44.0, 417, -56.2, 4.3, -16.7}}, {2700, { 4.6, -17.7, 565, -43.9, 406, -56.1, 4.6, -17.7}}, {2800, { 4.8, -18.8, 553, -43.8, 395, -56.0, 4.8, -18.8}}, {2900, { 5.1, -19.9, 542, -43.7, 395, -55.9, 5.1, -19.9}}, {3000, { 5.4, -21.0, 531, -43.6, 375, -55.7, 5.4, -21.0}}, {3100, { 5.6, -22.1, 521, -43.5, 366, -55.6, 5.6, -22.1}}, {3200, { 5.9, -23.2, 511, -43.4, 357, -55.4, 5.9, -23.2}}, {3300, { 6.1, -24.3, 502, -43.3, 349, -55.3, 6.1, -24.3}}, {3400, { 6.4, -25.4, 494, -43.2, 341, -55.1, 6.4, -25.4}}, {3500, { 6.6, -26.5, 486, -43.1, 334, -55.0, 6.6, -26.5}}, {3600, { 6.9, -27.6, 478, -43.0, 327, -54.8, 6.9, -27.6}}, {3700, { 7.1, -28.7, 471, -42.9, 321, -54.7, 7.1, -28.7}}, {3800, { 7.3, -29.9, 464, -42.8, 315, -54.6, 7.3, -29.9}}, {3900, { 7.5, -31.0, 458, -42.7, 310, -54.4, 7.5, -31.0}}, {4000, { 7.8, -32.1, 452, -42.7, 304, -54.3, 7.8, -32.1}} }; /* V.56bis EIA LL-6, non-loaded loop */ struct { int freq; float ad[8]; } eia_ll6[] = { { 200, {-0.2, -39.3, 1756, -12.0, 1748, -19.8, -0.2, -39.3}}, { 300, {-0.2, -31.7, 1642, -15.9, 1689, -26.9, -0.2, -31.7}}, { 400, {-0.2, -37.5, 1506, -18.4, 1427, -33.4, -0.2, -37.5}}, { 500, {-0.1, -34.7, 1442, -19.5, 1301, -37.7, -0.1, -34.7}}, { 600, {-0.1, -46.0, 1363, -20.1, 1153, -40.7, -0.1, -46.0}}, { 700, { 0.0, -40.8, 1320, -20.7, 1045, -42.2, 0.0, -40.8}}, { 800, { 0.0, -40.1, 1269, -21.5, 943, -42.3, 0.0, -40.1}}, { 900, { 0.0, -40.6, 1227, -22.5, 878, -41.3, 0.0, -40.6}}, {1000, { 6.6, -28.0, 1161, -23.4, 825, -39.3, 6.6, -28.0}}, {1100, { 0.0, -16.5, 1082, -23.5, 797, -36.8, 0.0, -16.5}}, {1200, {-0.1, 0.3, 1000, -22.2, 798, -34.4, -0.1, 0.3}}, {1300, { 0.0, -2.3, 943, -19.3, 826, -33.2, 0.0, -2.3}}, {1400, { 0.0, 13.5, 896, -14.0, 870, -33.8, 0.0, 13.5}}, {1500, { 0.1, 22.6, 890, -7.2, 916, -36.8, 0.1, 22.6}}, {1600, { 0.3, 30.3, 940, -0.3, 938, -42.0, 0.3, 30.3}}, {1700, { 0.5, 12.5, 1052, 4.6, 929, -48.0, 0.5, 12.5}}, {1800, { 0.8, 458.6, 1212, 6.9, 880, -52.8, 0.8, 458.6}}, {1900, { 1.1, -5.1, 1410, 3.5, 814, -56.5, 1.1, -5.1}}, {2000, { 1.4, -5.0, 1579, -3.6, 747, -58.5, 1.4, -5.0}}, {2100, { 1.5, 6.1, 1618, -13.2, 688, -58.8, 1.5, 6.1}}, {2200, { 1.5, 33.5, 1491, -21.5, 646, -57.7, 1.5, 33.5}}, {2300, { 1.4, 80.5, 1275, -24.9, 625, -55.6, 1.4, 80.5}}, {2400, { 1.3, 142.3, 1078, -20.8, 633, -53.8, 1.3, 142.3}}, {2500, { 1.4, 196.5, 985, -9.3, 664, -54.5, 1.4, 196.5}}, {2600, { 1.6, 214.5, 1045, 2.4, 692, -57.6, 1.6, 214.5}}, {2700, { 2.4, 196.8, 1326, 13.7, 684, -63.5, 2.4, 196.8}}, {2800, { 3.4, 150.4, 1887, 14.7, 637, -68.3, 3.4, 150.4}}, {2900, { 4.3, 125.3, 2608, 1.3, 501, -70.7, 4.3, 125.3}}, {3000, { 4.9, 174.6, 2730, -21.8, 533, -70.6, 4.9, 174.6}}, {3100, { 4.9, 380.0, 2094, -33.7, 506, -68.5, 4.9, 380.0}}, {3200, { 5.2, 759.3, 1642, -21.3, 522, -67.0, 5.2, 759.3}}, {3300, { 8.0, 680.1, 2348, 0.5, 531, -72.9, 8.0, 680.1}}, {3400, {13.1, 237.8, 4510, -20.9, 482, -77.3, 13.1, 237.8}}, {3500, {18.2, -18.8, 4116, -59.6, 439, -78.0, 18.2, -18.8}}, {3600, {22.7, -145.4, 3041, -74.4, 487, -77.7, 22.7, -145.4}}, {3700, {26.8, -214.5, 2427, -80.1, 383, -77.1, 26.8, -214.5}}, {3800, {30.4, -257.0, 2054, -82.7, 364, -76.4, 30.4, -257.0}}, {3900, {33.7, -285.6, 1803, -84.2, 348, -75.0, 33.7, -285.6}}, {4000, {36.8, -306.2, 1621, -85.1, 334, -75.7, 36.8, -306.2}} }; /* V.56bis EIA LL-7, non-loaded loop */ struct { int freq; float ad[8]; } eia_ll7[] = { { 200, { 0.4, -81.3, 1848, -10.5, 1737, -15.6, 0.4, -81.3}}, { 300, { 0.3, -68.9, 1785, -16.2, 1585, -21.6, 0.3, -68.9}}, { 400, { 0.2, -68.1, 1646, -22.0, 1388, -25.8, 0.2, -68.1}}, { 500, { 0.1, -57.0, 1528, -26.2, 1247, -27.7, 0.1, -57.0}}, { 600, { 0.0, -59.8, 1349, -28.9, 1087, -27.3, 0.0, -59.8}}, { 700, { 0.0, -45.0, 1205, -29.1, 975, -24.8, 0.0, -45.0}}, { 800, {-0.1, -36.9, 1064, -26.8, 885, -19.7, -0.1, -36.9}}, { 900, {-0.1, -37.1, 989, -22.6, 846, -13.5, -0.1, -37.1}}, {1000, { 5.9, -29.2, 944, -16.6, 847, -6.1, 5.9, -29.2}}, {1100, { 0.1, -30.8, 951, -10.5, 900, 0.3, 0.1, -30.8}}, {1200, { 0.2, -40.7, 1008, -5.9, 999, 4.9, 0.2, -40.7}}, {1300, { 0.4, -53.3, 1897, -4.0, 1122, 4.6, 0.4, -53.3}}, {1400, { 0.5, -52.7, 1197, -4.8, 1253, 1.9, 0.5, -52.7}}, {1500, { 0.6, -48.3, 1269, -8.4, 1339, -3.8, 0.6, -48.3}}, {1600, { 0.6, -38.0, 1274, -13.2, 1337, -10.4, 0.6, -38.0}}, {1700, { 0.5, -21.6, 1208, -16.9, 1250, -15.2, 0.5, -21.6}}, {1800, { 0.4, 539.7, 1119, -17.8, 1143, -16.6, 0.4, 539.7}}, {1900, { 0.3, 35.4, 1027, -14.7, 1036, -13.7, 0.3, 35.4}}, {2000, { 0.3, 64.1, 989, -7.9, 998, -6.9, 0.3, 64.1}}, {2100, { 0.4, 76.1, 1045, 0.1, 1040, 1.0, 0.4, 76.1}}, {2200, { 0.6, 69.8, 1210, 5.3, 1197, 6.9, 0.6, 69.8}}, {2300, { 1.0, 55.9, 1460, 4.6, 1430, 5.4, 1.0, 55.9}}, {2400, { 1.2, 51.3, 1692, -2.8, 1640, -1.7, 1.2, 51.3}}, {2500, { 1.3, 72.6, 1730, -13.4, 1666, -11.5, 1.3, 72.6}}, {2600, { 1.3, 117.1, 1613, -49.6, 1556, -16.9, 1.3, 117.1}}, {2700, { 1.1, 222.5, 1371, -19.5, 1334, -16.1, 1.1, 222.5}}, {2800, { 1.1, 332.3, 1258, -8.9, 1243, -5.1, 1.1, 332.3}}, {2900, { 1.7, 356.1, 1474, 4.8, 1480, 8.4, 1.7, 356.1}}, {3000, { 2.8, 299.9, 2128, 6.6, 2143, 9.8, 2.8, 299.9}}, {3100, { 3.9, 309.4, 2813, -10.5, 2882, -7.1, 3.9, 309.4}}, {3200, { 4.4, 576.4, 2490, -27.7, 2487, -22.2, 4.4, 576.4}}, {3300, { 5.6, 1030.6, 2237, -17.4, 2385, -9.0, 5.6, 1030.6}}, {3400, {10.7, 570.2, 3882, -19.2, 4855, -14.9, 10.7, 570.2}}, {3500, {17.3, 83.5, 4116, -57.4, 4649, -63.5, 17.3, 83.5}}, {3600, {23.2, -130.6, 3057, -74.0, 3175, -78.6, 23.2, -130.6}}, {3700, {28.3, -153.9, 2432, -80.0, 2471, -83.1, 28.3, -153.9}}, {3800, {32.8, -292.4, 2055, -82.8, 2072, -85.1, 32.8, -292.4}}, {3900, {36.9, -249.9, 1803, -84.2, 1811, -86.1, 36.9, -249.9}}, {4000, {40.7, -356.2, 1621, -85.1, 1625, -86.7, 40.7, -356.2}} }; /* V.56bis ETSI LL-1, non-loaded loop */ struct { int freq; float ad[8]; } etsi_ll1[] = { { 200, {-0.78, 14.0, 1248.5, -9.7, 1248.5, -9.7, -0.78, 14.0}}, { 300, {-0.74, 10.0, 1220.9, -14.3, 1220.9, -14.3, -0.74, 10.0}}, { 400, {-0.68, 8.0, 1185.2, -18.6, 1185.2, -18.6, -0.68, 8.0}}, { 500, {-0.60, 7.0, 1143.9, -22.6, 1143.9, -22.6, -0.60, 7.0}}, { 600, {-0.51, 6.0, 1099.0, -26.2, 1099.0, -26.2, -0.51, 6.0}}, { 700, {-0.40, 5.6, 1052.5, -29.5, 1052.5, -29.5, -0.40, 5.6}}, { 800, {-0.28, 5.3, 1005.9, -32.4, 1005.9, -32.4, -0.28, 5.3}}, { 900, {-0.14, 5.0, 960.3, -35.0, 960.3, -35.0, -0.14, 5.0}}, {1000, { 4.7, 4.6, 916.4, -37.3, 916.4, -37.3, 4.7, 4.6}}, {1100, { 0.16, 4.3, 874.6, -39.3, 874.6, -39.3, 0.16, 4.3}}, {1200, { 0.33, 3.6, 835.3, -41.1, 835.3, -41.1, 0.33, 3.6}}, {1300, { 0.49, 2.6, 798.5, -42.6, 798.5, -42.6, 0.49, 2.6}}, {1400, { 0.67, 2.0, 764.2, -43.9, 764.2, -43.9, 0.67, 2.0}}, {1500, { 0.85, 1.0, 732.3, -45.1, 732.3, -45.1, 0.85, 1.0}}, {1600, { 1.04, 0.6, 702.7, -46.1, 702.7, -46.1, 1.04, 0.6}}, {1700, { 1.23, 0.3, 675.3, -47.0, 675.3, -47.0, 1.23, 0.3}}, {1800, { 1.43, 40.0, 649.8, -47.7, 649.8, -47.7, 1.43, 40.0}}, {1900, { 1.63, -1.0, 626.2, -48.4, 626.2, -48.4, 1.63, -1.0}}, {2000, { 1.83, -2.0, 604.3, -48.9, 604.3, -48.9, 1.83, -2.0}}, {2100, { 2.03, -3.3, 584.0, -49.4, 584.0, -49.4, 2.03, -3.3}}, {2200, { 2.23, -3.6, 565.1, -49.8, 565.1, -49.8, 2.23, -3.6}}, {2300, { 2.44, -4.3, 547.5, -50.1, 547.5, -50.1, 2.44, -4.3}}, {2400, { 2.64, -5.0, 531.1, -50.4, 531.1, -50.4, 2.64, -5.0}}, {2500, { 2.84, -6.1, 515.9, -50.6, 515.9, -50.6, 2.84, -6.1}}, {2600, { 3.05, -6.6, 501.6, -50.8, 501.6, -50.8, 3.05, -6.6}}, {2700, { 3.25, -7.3, 488.2, -51.0, 488.2, -51.0, 3.25, -7.3}}, {2800, { 3.45, -7.6, 475.7, -51.1, 475.7, -51.1, 3.45, -7.6}}, {2900, { 3.65, -8.3, 464.0, -51.1, 464.0, -51.1, 3.65, -8.3}}, {3000, { 3.85, -8.6, 453.0, -51.2, 453.0, -51.2, 3.85, -8.6}}, {3100, { 4.04, -9.3, 442.6, -51.2, 442.6, -51.2, 4.04, -9.3}}, {3200, { 4.24, -10.3, 432.9, -51.2, 432.9, -51.2, 4.24, -10.3}}, {3300, { 4.43, -10.6, 423.7, -51.2, 423.7, -51.2, 4.43, -10.6}}, {3400, { 4.62, -11.3, 415.1, -51.2, 415.1, -51.2, 4.62, -11.3}}, {3500, { 4.81, -11.6, 406.9, -51.1, 406.9, -51.1, 4.81, -11.6}}, {3600, { 5.00, -12.3, 399.1, -51.1, 399.1, -51.1, 5.00, -12.3}}, {3700, { 5.19, -13.0, 391.8, -51.0, 391.8, -51.0, 5.19, -13.0}}, {3800, { 5.37, -13.4, 384.9, -51.0, 384.9, -51.0, 5.37, -13.4}}, {3900, { 5.56, -13.8, 378.3, -50.9, 378.3, -50.9, 5.56, -13.8}}, {4000, { 5.74, -14.4, 372.0, -50.8, 372.0, -50.8, 5.74, -14.4}} }; /* V.56bis ETSI LL-2, non-loaded loop */ struct { int freq; float ad[8]; } etsi_ll2[] = { { 200, {-0.10, 15.0, 850.3, -3.4, 850.3, -3.4, -0.10, 15.0}}, { 300, {-0.09, 8.0, 848.1, -5.1, 848.1, -5.1, -0.09, 8.0}}, { 400, {-0.09, 7.0, 845.1, -6.7, 845.1, -6.7, -0.09, 7.0}}, { 500, {-0.08, 5.0, 841.3, -8.4, 841.3, -8.4, -0.08, 5.0}}, { 600, {-0.07, 4.6, 836.7, -10.0, 836.7, -10.0, -0.07, 4.6}}, { 700, {-0.06, 4.3, 831.3, -11.6, 831.3, -11.6, -0.06, 4.3}}, { 800, {-0.04, 3.8, 825.3, -13.2, 825.3, -13.2, -0.04, 3.8}}, { 900, {-0.02, 3.4, 818.6, -14.8, 818.6, -14.8, -0.02, 3.4}}, {1000, { 1.80, 3.0, 811.4, -16.3, 811.4, -16.3, 1.8, 3.0}}, {1100, { 0.02, 2.6, 803.6, -17.8, 803.6, -17.8, 0.02, 2.6}}, {1200, { 0.04, 2.3, 795.3, -19.3, 795.3, -19.3, 0.04, 2.3}}, {1300, { 0.06, 1.3, 786.6, -20.7, 786.6, -20.7, 0.06, 1.3}}, {1400, { 0.09, 0.9, 777.5, -22.1, 777.5, -22.1, 0.09, 0.9}}, {1500, { 0.12, 0.6, 768.1, -23.5, 768.1, -23.5, 0.12, 0.6}}, {1600, { 0.15, 0.3, 758.4, -24.8, 758.4, -24.8, 0.15, 0.3}}, {1700, { 0.18, 0.0, 748.4, -26.1, 748.4, -26.1, 0.18, 0.0}}, {1800, { 0.21, 15, 738.4, -27.3, 738.4, -27.3, 0.21, 15.0}}, {1900, { 0.24, -1.0, 728.1, -28.5, 728.1, -28.5, 0.24, -1.0}}, {2000, { 0.28, -2.3, 717.8, -29.7, 717.8, -29.7, 0.28, -2.3}}, {2100, { 0.32, -2.6, 707.4, -30.8, 707.4, -30.8, 0.32, -2.6}}, {2200, { 0.36, -3.0, 697.0, -31.9, 697.0, -31.9, 0.36, -3.0}}, {2300, { 0.40, -3.3, 686.6, -33.0, 686.6, -33.0, 0.40, -3.3}}, {2400, { 0.44, -3.6, 676.2, -34.0, 676.2, -34.0, 0.44, -3.6}}, {2500, { 0.48, -4.5, 665.9, -35.0, 665.9, -35.0, 0.48, -4.5}}, {2600, { 0.53, -5.4, 655.6, -35.9, 655.6, -35.9, 0.53, -5.4}}, {2700, { 0.57, -6.3, 645.5, -36.8, 645.5, -36.8, 0.57, -6.3}}, {2800, { 0.62, -6.6, 635.5, -37.7, 635.5, -37.7, 0.62, -6.6}}, {2900, { 0.67, -6.9, 625.6, -38.6, 625.6, -38.6, 0.67, -6.9}}, {3000, { 0.72, -7.5, 615.8, -39.4, 615.8, -39.4, 0.72, -7.5}}, {3100, { 0.77, -8.3, 606.2, -40.2, 606.2, -40.2, 0.77, -8.3}}, {3200, { 0.82, -8.6, 596.7, -40.9, 596.7, -40.9, 0.82, -8.6}}, {3300, { 0.87, -9.3, 587.4, -41.6, 587.4, -41.6, 0.87, -9.3}}, {3400, { 0.92, -9.6, 578.3, -42.3, 578.3, -42.3, 0.92, -9.6}}, {3500, { 0.98, -10.3, 569.3, -43.0, 569.3, -43.0, 0.98, -10.3}}, {3600, { 1.03, -10.6, 560.6, -43.7, 560.6, -43.7, 1.03, -10.6}}, {3700, { 1.09, -11.3, 552.0, -44.3, 552.0, -44.3, 1.09, -11.3}}, {3800, { 1.14, -11.6, 543.5, -44.9, 543.5, -44.9, 1.14, -11.6}}, {3900, { 1.20, -12.3, 535.3, -45.4, 535.3, -45.4, 1.20, -12.3}}, {4000, { 1.26, -13.3, 527.2, -46.0, 527.2, -46.0, 1.26, -13.3}} }; /* V.56bis AD-1 AD-5 AD-6 AD-7 AD-8 AD-9 */ struct { int freq; float ad[6]; } ad[] = { { 0, {90.0, 90.0, 90.0, 90.0, 90.0, 90.0}}, { 200, { 6.0, 3.2, 3.0, 2.9, 11.6, 23.3}}, { 300, { 1.3, 1.4, 1.2, 1.1, 6.9, 13.9}}, { 400, { 0.0, 0.4, 0.3, 0.3, 4.0, 7.9}}, { 500, { 0.0, -0.1, 0.0, 0.1, 2.0, 4.1}}, { 600, { 0.0, -0.1, 0.0, 0.1, 1.2, 2.4}}, { 700, { 0.0, 0.1, 0.0, 0.0, 0.8, 1.7}}, { 800, { 0.0, 0.0, 0.0, -0.1, 0.5, 1.1}}, { 900, { 0.0, 0.0, 0.0, -0.1, 0.2, 0.4}}, {1000, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}}, {1100, { 0.0, 0.0, 0.1, 0.0, -0.1, -0.2}}, {1200, { 0.0, 0.0, 0.1, 0.1, -0.1, -0.2}}, {1300, { 0.0, 0.1, 0.2, 0.3, -0.1, -0.2}}, {1400, { 0.0, 0.2, 0.3, 0.4, -0.1, -0.3}}, {1500, { 0.0, 0.2, 0.3, 0.4, -0.2, -0.4}}, {1600, { 0.0, 0.3, 0.5, 0.5, -0.1, -0.3}}, {1700, { 0.0, 0.3, 0.5, 0.6, -0.1, -0.1}}, {1800, { 0.0, 0.3, 0.5, 0.6, 0.0, 0.0}}, {1900, { 0.0, 0.4, 0.7, 0.7, 0.1, 0.2}}, {2000, { 0.0, 0.5, 0.8, 0.9, 0.2, 0.5}}, {2100, { 0.1, 0.6, 1.0, 1.0, 0.5, 0.9}}, {2200, { 0.2, 0.7, 1.1, 1.1, 0.6, 1.1}}, {2300, { 0.3, 0.9, 1.2, 1.4, 0.8, 1.5}}, {2400, { 0.4, 1.1, 1.5, 1.6, 0.9, 1.8}}, {2500, { 0.5, 1.3, 1.8, 2.0, 1.1, 2.3}}, {2600, { 0.6, 1.6, 2.4, 2.7, 1.4, 2.8}}, {2700, { 0.7, 2.0, 3.0, 3.5, 1.7, 3.4}}, {2800, { 0.7, 2.3, 3.5, 4.3, 2.0, 4.0}}, {2900, { 0.9, 2.8, 4.2, 5.0, 2.4, 4.9}}, {3000, { 1.1, 3.2, 4.9, 5.8, 3.0, 5.9}}, {3100, { 1.2, 3.5, 5.6, 6.7, 3.4, 6.8}}, {3200, { 1.3, 4.1, 6.7, 8.0, 3.9, 7.7}}, {3300, { 1.6, 4.8, 8.0, 9.6, 4.6, 9.2}}, {3400, { 1.8, 5.3, 9.1, 11.0, 5.4, 10.7}}, {3500, { 2.4, 5.7, 10.3, 12.2, 6.3, 12.6}}, {3600, { 3.0, 6.6, 12.1, 13.9, 7.8, 15.5}}, {3700, { 5.7, 8.9, 15.8, 17.3, 10.3, 20.5}}, {3800, {13.5, 15.7, 24.4, 25.7, 16.2, 32.4}}, {3900, {31.2, 31.1, 42.2, 43.3, 29.9, 59.9}}, {4000, {31.2, 31.1, 42.2, 43.3, 29.9, 59.9}} }; /* V.56bis EDD-1 EDD-2 EDD-3 */ struct { int freq; float edd[3]; } edd[] = { { 0, {3.98, 3.76, 8.00}}, { 200, {3.98, 3.76, 8.00}}, { 300, {2.70, 3.76, 8.00}}, { 400, {1.69, 2.20, 6.90}}, { 500, {1.15, 1.36, 5.50}}, { 600, {0.80, 0.91, 4.40}}, { 700, {0.60, 0.64, 3.40}}, { 800, {0.50, 0.46, 2.80}}, { 900, {0.40, 0.34, 2.00}}, {1000, {0.30, 0.24, 1.50}}, {1100, {0.20, 0.16, 1.00}}, {1200, {0.20, 0.11, 0.70}}, {1300, {0.10, 0.07, 0.40}}, {1400, {0.05, 0.05, 0.30}}, {1500, {0.00, 0.03, 0.20}}, {1600, {0.00, 0.01, 0.10}}, {1700, {0.00, 0.00, 0.10}}, {1800, {0.00, 0.00, 0.00}}, {1900, {0.00, 0.02, 0.10}}, {2000, {0.00, 0.04, 0.10}}, {2100, {0.02, 0.08, 0.10}}, {2200, {0.02, 0.12, 0.20}}, {2300, {0.02, 0.16, 0.20}}, {2400, {0.02, 0.20, 0.30}}, {2500, {0.10, 0.27, 0.40}}, {2600, {0.12, 0.36, 0.50}}, {2700, {0.15, 0.47, 0.80}}, {2800, {0.20, 0.60, 1.10}}, {2900, {0.27, 0.77, 1.50}}, {3000, {0.40, 1.01, 2.00}}, {3100, {0.56, 1.32, 2.60}}, {3200, {0.83, 1.78, 3.20}}, {3300, {1.07, 1.78, 4.00}}, {3400, {1.39, 1.78, 4.00}}, {3500, {1.39, 1.78, 4.00}}, {3600, {1.39, 1.78, 4.00}}, {3700, {1.39, 1.78, 4.00}}, {3800, {1.39, 1.78, 4.00}}, {3900, {1.39, 1.78, 4.00}}, {4000, {1.39, 1.78, 4.00}} }; /* V.56bis PCM AD-1, AD-2, AD-3 */ struct { int freq; float ad[3]; } pcm_ad[] = { { 50, {41.4, 77.8, 114.2}}, { 100, {15.5, 27.7, 39.9}}, { 150, { 3.7, 6.1, 8.6}}, { 200, { 0.5, 0.8, 1.0}}, { 250, {-0.2, -0.2, -0.3}}, { 300, {-0.2, -0.3, -0.4}}, { 400, { 0.0, -0.2, -0.3}}, { 500, {-0.2, -0.4, -0.5}}, { 600, {-0.2, -0.3, -0.5}}, { 700, {-0.2, -0.3, -0.5}}, { 800, {-0.2, -0.4, -0.5}}, { 900, {-0.2, -0.3, -0.4}}, {1000, {-0.1, -0.2, -0.3}}, {1100, {-0.2, -0.3, -0.3}}, {1200, {-0.2, -0.3, -0.4}}, {1300, {-0.2, -0.3, -0.5}}, {1400, {-0.1, -0.3, -0.4}}, {1500, {-0.1, -0.3, -0.4}}, {1600, {-0.1, -0.2, -0.3}}, {1700, {-0.1, -0.3, -0.4}}, {1800, {-0.2, -0.3, -0.4}}, {1900, {-0.2, -0.3, -0.3}}, {2000, {-0.1, -0.2, -0.3}}, {2100, {-0.1, -0.2, -0.3}}, {2200, {-0.1, -0.3, -0.4}}, {2300, {-0.1, -0.1, -0.2}}, {2400, {-0.1, -0.1, -0.2}}, {2500, { 0.0, -0.1, -0.1}}, {2600, { 0.0, -0.1, -0.1}}, {2700, { 0.0, 0.0, 0.1}}, {2800, { 0.0, 0.0, 0.1}}, {2900, { 0.1, 0.2, 0.2}}, {3000, { 0.0, 0.0, 0.1}}, {3100, { 0.0, 0.0, 0.0}}, {3200, { 0.0, 0.0, 0.1}}, {3300, { 0.3, 0.7, 1.0}}, {3400, { 1.2, 2.4, 3.6}}, {3500, { 3.2, 6.3, 9.5}}, {3550, { 5.0, 9.6, 14.3}}, {3600, { 7.0, 13.5, 19.9}}, {3650, {10.0, 18.7, 27.5}}, {3700, {13.4, 24.6, 35.8}}, {3750, {18.1, 32.1, 46.2}}, {3800, {24.3, 41.2, 58.2}}, {3850, {32.5, 52.6, 72.7}}, {3900, {43.4, 66.6, 89.8}}, {4000, {43.4, 66.6, 89.8}} }; /* V.56bis PCM EDD-1, EDD-2, EDD-3 */ struct { int freq; float edd[3]; } pcm_edd[] = { { 150, { 2.76, 5.5, 8.3}}, { 200, { 1.70, 3.4, 5.1}}, { 250, { 0.92, 1.8, 2.8}}, { 300, { 0.55, 1.1, 1.7}}, { 400, { 0.25, 0.5, 0.7}}, { 500, { 0.12, 0.2, 0.4}}, { 600, { 0.06, 0.1, 0.2}}, { 700, { 0.03, 0.1, 0.1}}, { 800, { 0.01, 0.0, 0.0}}, { 900, { 0.00, 0.0, 0.0}}, {1000, {-0.01, 0.0, 0.0}}, {1100, {-0.01, 0.0, 0.0}}, {1200, {-0.02, 0.0, -0.1}}, {1300, {-0.02, 0.0, -0.1}}, {1400, {-0.01, 0.0, 0.0}}, {1500, {-0.01, 0.0, 0.0}}, {1600, { 0.00, 0.0, 0.0}}, {1700, { 0.00, 0.0, 0.0}}, {1800, { 0.01, 0.0, 0.0}}, {1900, { 0.02, 0.0, 0.0}}, {2000, { 0.02, 0.0, 0.1}}, {2100, { 0.04, 0.1, 0.1}}, {2200, { 0.05, 0.1, 0.2}}, {2300, { 0.06, 0.1, 0.2}}, {2400, { 0.07, 0.1, 0.2}}, {2500, { 0.10, 0.2, 0.3}}, {2600, { 0.11, 0.2, 0.3}}, {2700, { 0.14, 0.3, 0.4}}, {2800, { 0.18, 0.4, 0.5}}, {2900, { 0.22, 0.4, 0.6}}, {3000, { 0.27, 0.5, 0.8}}, {3100, { 0.34, 0.7, 1.0}}, {3200, { 0.45, 0.9, 1.4}}, {3250, { 0.52, 1.0, 1.6}}, {3300, { 0.60, 1.2, 1.8}}, {3350, { 0.66, 1.3, 2.0}}, {3400, { 0.74, 1.5, 2.2}}, {3450, { 0.79, 1.6, 2.4}}, {3500, { 0.83, 1.7, 2.5}}, {3550, { 0.84, 1.7, 2.5}}, {3600, { 0.81, 1.6, 2.4}}, {3700, { 0.81, 1.6, 2.4}}, {3800, { 0.81, 1.6, 2.4}}, {3900, { 0.81, 1.6, 2.4}}, {4000, { 0.81, 1.6, 2.4}} }; FILE *outfile; float impulse_responses[100][LINE_FILTER_SIZE]; int filter_sets = 0; static void generate_ad_edd(void) { float f; float offset; float amp; float phase; //float delay; float pw; #if defined(HAVE_FFTW3_H) double in[FFT_SIZE][2]; double out[FFT_SIZE][2]; #else fftw_complex in[FFT_SIZE]; fftw_complex out[FFT_SIZE]; #endif fftw_plan p; int i; int j; int k; int l; #if defined(HAVE_FFTW3_H) p = fftw_plan_dft_1d(FFT_SIZE, in, out, FFTW_BACKWARD, FFTW_ESTIMATE); #else p = fftw_create_plan(FFT_SIZE, FFTW_BACKWARD, FFTW_ESTIMATE); #endif for (j = 0; j < 6; j++) { for (k = 0; k < 3; k++) { for (i = 0; i < FFT_SIZE; i++) { #if defined(HAVE_FFTW3_H) in[i][0] = in[i][1] = 0.0f; #else in[i].re = in[i].im = 0.0f; #endif } for (i = 1; i < FFT_SIZE/2; i++) { f = (float) i*SAMPLE_RATE/FFT_SIZE; amp = 0.0f; for (l = 0; l < (int) (sizeof(ad)/sizeof(ad[0])); l++) { if (f < ad[l].freq) break; } if (l < (int) (sizeof(ad)/sizeof(ad[0]))) { offset = (f - ad[l - 1].freq)/(ad[l].freq - ad[l - 1].freq); amp = (1.0 - offset)*ad[l - 1].ad[j] + offset*ad[l].ad[j]; amp = pow(10.0, -amp/20.0); } //delay = 0.0f; for (l = 0; l < (int) (sizeof(edd)/sizeof(edd[0])); l++) { if (f < edd[l].freq) break; } if (l < (int) (sizeof(edd)/sizeof(edd[0]))) { offset = (f - edd[l - 1].freq)/(edd[l].freq - edd[l - 1].freq); //delay = (1.0f - offset)*edd[l - 1].edd[k] + offset*edd[l].edd[k]; } //phase = 2.0f*M_PI*f*delay*0.001f; phase = 0.0f; #if defined(HAVE_FFTW3_H) in[i][0] = amp*cosf(phase); in[i][1] = amp*sinf(phase); in[FFT_SIZE - i][0] = in[i][0]; in[FFT_SIZE - i][1] = -in[i][1]; #else in[i].re = amp*cosf(phase); in[i].im = amp*sinf(phase); in[FFT_SIZE - i].re = in[i].re; in[FFT_SIZE - i].im = -in[i].im; #endif } #if 0 for (i = 0; i < FFT_SIZE; i++) fprintf(outfile, "%5d %15.5f,%15.5f\n", i, in[i].re, in[i].im); #endif #if defined(HAVE_FFTW3_H) fftw_execute(p); #else fftw_one(p, in, out); #endif fprintf(outfile, "/* V.56bis AD-%d, EDD%d */\n", (j == 0) ? 1 : j + 4, k + 1); fprintf(outfile, "const float ad_%d_edd_%d_model[] =\n", (j == 0) ? 1 : j + 4, k + 1); fprintf(outfile, "{\n"); /* Normalise the filter's gain */ pw = 0.0f; l = FFT_SIZE - (LINE_FILTER_SIZE - 1)/2; for (i = 0; i < LINE_FILTER_SIZE; i++) { #if defined(HAVE_FFTW3_H) pw += out[l][0]*out[l][0]; #else pw += out[l].re*out[l].re; #endif if (++l == FFT_SIZE) l = 0; } pw = sqrt(pw); l = FFT_SIZE - (LINE_FILTER_SIZE - 1)/2; for (i = 0; i < LINE_FILTER_SIZE; i++) { #if defined(HAVE_FFTW3_H) impulse_responses[filter_sets][i] = out[l][0]/pw; #else impulse_responses[filter_sets][i] = out[l].re/pw; #endif fprintf(outfile, "%15.5f,\n", impulse_responses[filter_sets][i]); if (++l == FFT_SIZE) l = 0; } fprintf(outfile, "};\n\n"); filter_sets++; } } } static void generate_proakis(void) { float f; float f1; float offset; float amp; float phase; //float delay; float pw; int index; int i; int l; #if defined(HAVE_FFTW3_H) double in[FFT_SIZE][2]; double out[FFT_SIZE][2]; #else fftw_complex in[FFT_SIZE]; fftw_complex out[FFT_SIZE]; #endif fftw_plan p; #if defined(HAVE_FFTW3_H) p = fftw_plan_dft_1d(FFT_SIZE, in, out, FFTW_BACKWARD, FFTW_ESTIMATE); #else p = fftw_create_plan(FFT_SIZE, FFTW_BACKWARD, FFTW_ESTIMATE); #endif for (i = 0; i < FFT_SIZE; i++) { #if defined(HAVE_FFTW3_H) in[i][0] = in[i][1] = 0.0f; #else in[i].re = in[i].im = 0.0f; #endif } for (i = 1; i < FFT_SIZE/2; i++) { f = (float) i*SAMPLE_RATE/FFT_SIZE; f1 = f/200.0f; offset = f1 - floor(f1); index = (int) floor(f1); /* Linear interpolation */ amp = ((1.0f - offset)*proakis[index].amp + offset*proakis[index + 1].amp)/2.3f; //delay = (1.0f - offset)*proakis[index].delay + offset*proakis[index + 1].delay; //phase = 2.0f*M_PI*f*delay*0.001f; phase = 0.0f; #if defined(HAVE_FFTW3_H) in[i][0] = amp*cosf(phase); in[i][1] = amp*sinf(phase); in[FFT_SIZE - i][0] = in[i][0]; in[FFT_SIZE - i][1] = -in[i][1]; #else in[i].re = amp*cosf(phase); in[i].im = amp*sinf(phase); in[FFT_SIZE - i].re = in[i].re; in[FFT_SIZE - i].im = -in[i].im; #endif } #if defined(HAVE_FFTW3_H) fftw_execute(p); #else fftw_one(p, in, out); #endif fprintf(outfile, "/* Medium range telephone line response\n"); fprintf(outfile, " (from p 537, Digital Communication, John G. Proakis */\n"); fprintf(outfile, "const float proakis_line_model[] =\n"); fprintf(outfile, "{\n"); /* Normalise the filter's gain */ pw = 0.0f; l = FFT_SIZE - (LINE_FILTER_SIZE - 1)/2; for (i = 0; i < LINE_FILTER_SIZE; i++) { #if defined(HAVE_FFTW3_H) pw += out[l][0]*out[l][0]; #else pw += out[l].re*out[l].re; #endif if (++l == FFT_SIZE) l = 0; } pw = sqrt(pw); l = FFT_SIZE - (LINE_FILTER_SIZE - 1)/2; for (i = 0; i < LINE_FILTER_SIZE; i++) { #if defined(HAVE_FFTW3_H) impulse_responses[filter_sets][i] = out[l][0]/pw; #else impulse_responses[filter_sets][i] = out[l].re/pw; #endif fprintf(outfile, "%15.5f,\n", impulse_responses[filter_sets][i]); if (++l == FFT_SIZE) l = 0; } fprintf(outfile, "};\n\n"); filter_sets++; } int main(int argc, char *argv[]) { int i; int j; if ((outfile = fopen(LINE_MODEL_FILE_NAME, "w")) == NULL) { fprintf(stderr, "Failed to open %s\n", "line_model.txt"); exit(2); } generate_proakis(); generate_ad_edd(); fclose(outfile); if (argc > 1) { for (i = 0; i < LINE_FILTER_SIZE; i++) { printf("%d, ", i); for (j = 0; j < filter_sets; j++) { printf("%15.5f, ", impulse_responses[j][i]); } printf("\n"); } } return 0; } spandsp-0.0.6/spandsp-sim/libspandsp_sim.dsp0000664000175000017500000001103312343640734016071 00000000000000# Microsoft Developer Studio Project File - Name="spandsp" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=spandsp - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "spandsp.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "spandsp.mak" CFG="spandsp - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "spandsp - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "spandsp - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "spandsp - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D HAVE_TGMATH_H /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /Zi /O2 /I "." /I "..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D HAVE_TGMATH_H /D "_WINDLL" /FR /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib ws2_32.lib winmm.lib /nologo /dll /map /debug /machine:I386 /out:"Release/libspandsp.dll" !ELSEIF "$(CFG)" == "spandsp - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D HAVE_TGMATH_H /YX /FD /GZ /c # ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "." /I "..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D HAVE_TGMATH_H /FR /FD /GZ /c # SUBTRACT CPP /WX /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib ws2_32.lib winmm.lib /nologo /dll /incremental:no /map /debug /machine:I386 /out:"Debug/libspandsp.dll" /pdbtype:sept # SUBTRACT LINK32 /nodefaultlib !ENDIF # Begin Target # Name "spandsp - Win32 Release" # Name "spandsp - Win32 Debug" # Begin Group "Source Files" # Begin Source File SOURCE=.\g1050.c # End Source File # Begin Source File SOURCE=.\line_model.c # End Source File # Begin Source File SOURCE=.\rfc2198_sim.c # End Source File # Begin Source File SOURCE=.\test_utils.c # End Source File # End Group # Begin Group "Header Files" # Begin Source File SOURCE=.\spandsp/g1050.h # End Source File # Begin Source File SOURCE=.\spandsp/line_model.h # End Source File # Begin Source File SOURCE=.\spandsp/line_models.h # End Source File # Begin Source File SOURCE=.\spandsp/rfc2198_sim.h # End Source File # Begin Source File SOURCE=.\spandsp/test_utils.h # End Source File # Begin Source File SOURCE=.\spandsp-sim.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project spandsp-0.0.6/spandsp-sim/spandsp-sim.h0000664000175000017500000000240712100775521014760 00000000000000/* * SpanDSP - a series of DSP components for telephony * * spandsp-sim.h - The head guy amongst the simulator headers * * Written by Steve Underwood * * Copyright (C) 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_SIM_H_) #define _SPANDSP_SIM_H_ #include #include #include #include #include #include #include #include #include #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/spandsp-sim/Makefile.am0000664000175000017500000001062212343625042014404 00000000000000## ## SpanDSP - a series of DSP components for telephony ## ## Makefile.am - Process this file with automake to produce Makefile.in ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License version 2, as ## published by the Free Software Foundation. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. AM_CFLAGS = $(COMP_VENDOR_CFLAGS) AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS) LIBS += -L$(top_builddir)/src -lspandsp $(SIMLIBS) MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = libspandsp_sim.dsp \ libspandsp_sim.2005.vcproj \ libspandsp_sim.2008.vcproj \ msvc/make_line_models.2008.vcproj \ msvc/msvcproj.head \ msvc/msvcproj.foot \ msvc/vc8proj.head \ msvc/vc8proj.foot \ msvc/vc9proj.head \ msvc/vc9proj.foot AM_CPPFLAGS = -I$(top_builddir) -I$(top_builddir)/src -DDATADIR="\"$(pkgdatadir)\"" noinst_PROGRAMS = make_line_models lib_LTLIBRARIES = libspandsp-sim.la libspandsp_sim_la_SOURCES = g1050.c \ line_model.c \ rfc2198_sim.c \ test_utils.c nodist_libspandsp_sim_la_SOURCES = line_models.c libspandsp_sim_la_LDFLAGS = -version-info @SPANDSP_LT_CURRENT@:@SPANDSP_LT_REVISION@:@SPANDSP_LT_AGE@ $(COMP_VENDOR_LDFLAGS) nobase_include_HEADERS = spandsp/g1050.h \ spandsp/line_model.h \ spandsp/line_models.h \ spandsp/rfc2198_sim.h \ spandsp/test_utils.h \ spandsp-sim.h make_line_models_SOURCES = make_line_models.c make_line_models_LDADD = -L$(top_builddir)/src -lspandsp # We need to run make_line_models, so it generates the line_models.h file # used by several of the test programs. line_models.lo: make_line_models$(EXEEXT) line_models.c line_models.$(OBJEXT): make_line_models$(EXEEXT) line_models.c line_models.c: make_line_models$(EXEEXT) ./make_line_models$(EXEEXT) DSP = libspandsp_sim.dsp VCPROJ8 = libspandsp_sim.2005.vcproj VCPROJ9 = libspandsp_sim.2008.vcproj WIN32SOURCES = $(libspandsp_sim_la_SOURCES) WIN32HEADERS = $(nobase_include_HEADERS) DSPOUT = | awk '{printf("%s\r\n", $$0)}' >> $(DSP) VCPROJOUT8 = | awk '{printf("%s\r\n", $$0)}' >> $(VCPROJ8) VCPROJOUT9 = | awk '{printf("%s\r\n", $$0)}' >> $(VCPROJ9) $(DSP): msvc/msvcproj.head msvc/msvcproj.foot Makefile.am echo "creating $(DSP)" @(cp $(srcdir)/msvc/msvcproj.head $(DSP); \ echo "# Begin Group \"Source Files\"" $(DSPOUT); \ for file in $(WIN32SOURCES); do \ echo "# Begin Source File" $(DSPOUT); \ echo "" $(DSPOUT); \ echo "SOURCE=.\\"$$file $(DSPOUT); \ echo "# End Source File" $(DSPOUT); \ done; \ echo "# End Group" $(DSPOUT); \ echo "# Begin Group \"Header Files\"" $(DSPOUT); \ for file in $(WIN32HEADERS); do \ echo "# Begin Source File" $(DSPOUT); \ echo "" $(DSPOUT); \ echo "SOURCE=.\\"$$file $(DSPOUT); \ echo "# End Source File" $(DSPOUT); \ done; \ echo "# End Group" $(DSPOUT); \ cat $(srcdir)/msvc/msvcproj.foot $(DSPOUT) ) $(VCPROJ8): msvc/vc8proj.head msvc/vc8proj.foot Makefile.am echo "creating $(VCPROJ8)" @(cp $(srcdir)/msvc/vc8proj.head $(VCPROJ8); \ for file in $(WIN32SOURCES); do \ echo "" $(VCPROJOUT8); \ done; \ echo "" $(VCPROJOUT8); \ for file in $(WIN32HEADERS); do \ echo "" $(VCPROJOUT8); \ done; \ cat $(srcdir)/msvc/vc8proj.foot $(VCPROJOUT8) ) $(VCPROJ9): msvc/vc9proj.head msvc/vc9proj.foot Makefile.am echo "creating $(VCPROJ9)" @(cp $(srcdir)/msvc/vc9proj.head $(VCPROJ9); \ for file in $(WIN32SOURCES); do \ echo "" $(VCPROJOUT9); \ done; \ echo "" $(VCPROJOUT9); \ for file in $(WIN32HEADERS); do \ echo "" $(VCPROJOUT9); \ done; \ cat $(srcdir)/msvc/vc9proj.foot $(VCPROJOUT9) ) spandsp-0.0.6/spandsp-sim/line_model.c0000664000175000017500000003501212100775505014624 00000000000000/* * SpanDSP - a series of DSP components for telephony * * line_model.c - Model a telephone line. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #define GEN_CONST #include #endif #include "floating_fudge.h" #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES #include "spandsp.h" #include "spandsp-sim.h" #include "spandsp/g168models.h" #if !defined(NULL) #define NULL (void *) 0 #endif static const float null_line_model[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0 }; SPAN_DECLARE_DATA const float *line_models[] = { null_line_model, /* 0 */ proakis_line_model, ad_1_edd_1_model, ad_1_edd_2_model, ad_1_edd_3_model, ad_5_edd_1_model, /* 5 */ ad_5_edd_2_model, ad_5_edd_3_model, ad_6_edd_1_model, ad_6_edd_2_model, ad_6_edd_3_model, /* 10 */ ad_7_edd_1_model, ad_7_edd_2_model, ad_7_edd_3_model, ad_8_edd_1_model, ad_8_edd_2_model, /* 15 */ ad_8_edd_3_model, ad_9_edd_1_model, ad_9_edd_2_model, ad_9_edd_3_model }; static float calc_near_line_filter(one_way_line_model_state_t *s, float v) { float sum; int j; int p; /* Add the sample in the filter buffer */ p = s->near_buf_ptr; s->near_buf[p] = v; if (++p == s->near_filter_len) p = 0; s->near_buf_ptr = p; /* Apply the filter */ sum = 0.0f; for (j = 0; j < s->near_filter_len; j++) { sum += s->near_filter[j]*s->near_buf[p]; if (++p >= s->near_filter_len) p = 0; } /* Add noise */ sum += awgn(&s->near_noise); return sum; } /*- End of function --------------------------------------------------------*/ static float calc_far_line_filter(one_way_line_model_state_t *s, float v) { float sum; int j; int p; /* Add the sample in the filter buffer */ p = s->far_buf_ptr; s->far_buf[p] = v; if (++p == s->far_filter_len) p = 0; s->far_buf_ptr = p; /* Apply the filter */ sum = 0.0f; for (j = 0; j < s->far_filter_len; j++) { sum += s->far_filter[j]*s->far_buf[p]; if (++p >= s->far_filter_len) p = 0; } /* Add noise */ sum += awgn(&s->far_noise); return sum; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) one_way_line_model(one_way_line_model_state_t *s, int16_t output[], const int16_t input[], int samples) { int i; float in; float out; float out1; int16_t amp[1]; /* The path being modelled is: terminal | < hybrid | | < noise and filtering | | < hybrid CO | | < A-law distortion + bulk delay | CO | < hybrid | | < noise and filtering | | < hybrid terminal */ for (i = 0; i < samples; i++) { in = input[i]; /* Near end analogue section */ /* Line model filters & noise */ out = calc_near_line_filter(s, in); /* Long distance digital section */ amp[0] = out; codec_munge(s->munge, amp, 1); out = amp[0]; /* Introduce the bulk delay of the long distance link. */ out1 = s->bulk_delay_buf[s->bulk_delay_ptr]; s->bulk_delay_buf[s->bulk_delay_ptr] = out; out = out1; if (++s->bulk_delay_ptr >= s->bulk_delay) s->bulk_delay_ptr = 0; /* Far end analogue section */ /* Line model filters & noise */ out = calc_far_line_filter(s, out); if (s->mains_interference) { tone_gen(&s->mains_tone, amp, 1); out += amp[0]; } output[i] = out + s->dc_offset; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) one_way_line_model_set_dc(one_way_line_model_state_t *s, float dc) { s->dc_offset = dc; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) one_way_line_model_set_mains_pickup(one_way_line_model_state_t *s, int f, float level) { tone_gen_descriptor_t mains_tone_desc; if (f) { tone_gen_descriptor_init(&mains_tone_desc, f, (int) (level - 10.0f), f*3, (int) level, 1, 0, 0, 0, TRUE); tone_gen_init(&s->mains_tone, &mains_tone_desc); } s->mains_interference = f; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) both_ways_line_model(both_ways_line_model_state_t *s, int16_t output1[], const int16_t input1[], int16_t output2[], const int16_t input2[], int samples) { int i; float in1; float in2; float out1; float out2; float tmp1; float tmp2; int16_t amp[1]; /* The path being modelled is: terminal | < hybrid echo | | < noise and filtering | | < hybrid echo CO | | < A-law distortion + bulk delay | CO | < hybrid echo | | < noise and filtering | | < hybrid echo terminal */ for (i = 0; i < samples; i++) { in1 = input1[i]; in2 = input2[i]; /* Near end analogue sections */ /* Echo from each terminal's CO hybrid */ tmp1 = in1 + s->fout2*s->line1.near_co_hybrid_echo; tmp2 = in2 + s->fout1*s->line2.near_co_hybrid_echo; /* Line model filters & noise */ s->fout1 = calc_near_line_filter(&s->line1, tmp1); s->fout2 = calc_near_line_filter(&s->line2, tmp2); /* Long distance digital section */ /* Introduce distortion due to A-law or u-law munging. */ amp[0] = s->fout1; codec_munge(s->line1.munge, amp, 1); s->fout1 = amp[0]; amp[0] = s->fout2; codec_munge(s->line2.munge, amp, 1); s->fout2 = amp[0]; /* Introduce the bulk delay of the long distance digital link. */ out1 = s->line1.bulk_delay_buf[s->line1.bulk_delay_ptr]; s->line1.bulk_delay_buf[s->line1.bulk_delay_ptr] = s->fout1; s->fout1 = out1; if (++s->line1.bulk_delay_ptr >= s->line1.bulk_delay) s->line1.bulk_delay_ptr = 0; out2 = s->line2.bulk_delay_buf[s->line2.bulk_delay_ptr]; s->line2.bulk_delay_buf[s->line2.bulk_delay_ptr] = s->fout2; s->fout2 = out2; if (++s->line2.bulk_delay_ptr >= s->line2.bulk_delay) s->line2.bulk_delay_ptr = 0; /* Far end analogue sections */ /* Echo from each terminal's own hybrid */ out1 += in2*s->line1.far_cpe_hybrid_echo; out2 += in1*s->line2.far_cpe_hybrid_echo; /* Line model filters & noise */ out1 = calc_far_line_filter(&s->line1, out1); out2 = calc_far_line_filter(&s->line2, out2); output1[i] = fsaturate(out1 + s->line1.dc_offset); output2[i] = fsaturate(out2 + s->line2.dc_offset); } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) both_ways_line_model_set_dc(both_ways_line_model_state_t *s, float dc1, float dc2) { s->line1.dc_offset = dc1; s->line2.dc_offset = dc2; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) both_ways_line_model_set_mains_pickup(both_ways_line_model_state_t *s, int f, float level1, float level2) { tone_gen_descriptor_t mains_tone_desc; if (f) { tone_gen_descriptor_init(&mains_tone_desc, f, (int) (level1 - 10.0f), f*3, (int) level1, 1, 0, 0, 0, TRUE); tone_gen_init(&s->line1.mains_tone, &mains_tone_desc); tone_gen_descriptor_init(&mains_tone_desc, f, (int) (level2 - 10.0f), f*3, (int) level2, 1, 0, 0, 0, TRUE); tone_gen_init(&s->line2.mains_tone, &mains_tone_desc); } s->line1.mains_interference = f; s->line2.mains_interference = f; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(one_way_line_model_state_t *) one_way_line_model_init(int model, float noise, int codec, int rbs_pattern) { one_way_line_model_state_t *s; if ((s = (one_way_line_model_state_t *) malloc(sizeof(*s))) == NULL) return NULL; memset(s, 0, sizeof(*s)); s->bulk_delay = 8; s->bulk_delay_ptr = 0; s->munge = codec_munge_init(codec, rbs_pattern); s->near_filter = line_models[model]; s->near_filter_len = 129; s->far_filter = line_models[model]; s->far_filter_len = 129; /* Put half the noise in each analogue section */ awgn_init_dbm0(&s->near_noise, 1234567, noise - 3.02f); awgn_init_dbm0(&s->far_noise, 1234567, noise - 3.02f); s->dc_offset = 0.0f; s->mains_interference = 0; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) one_way_line_model_release(one_way_line_model_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(both_ways_line_model_state_t *) both_ways_line_model_init(int model1, float noise1, float echo_level_cpe1, float echo_level_co1, int model2, float noise2, float echo_level_cpe2, float echo_level_co2, int codec, int rbs_pattern) { both_ways_line_model_state_t *s; if ((s = (both_ways_line_model_state_t *) malloc(sizeof(*s))) == NULL) return NULL; memset(s, 0, sizeof(*s)); s->line1.munge = codec_munge_init(codec, rbs_pattern); s->line2.munge = codec_munge_init(codec, rbs_pattern); s->line1.bulk_delay = 8; s->line2.bulk_delay = 8; s->line1.bulk_delay_ptr = 0; s->line2.bulk_delay_ptr = 0; s->line1.near_filter = line_models[model1]; s->line1.near_filter_len = 129; s->line2.near_filter = line_models[model2]; s->line2.near_filter_len = 129; s->line1.far_filter = line_models[model1]; s->line1.far_filter_len = 129; s->line2.far_filter = line_models[model2]; s->line2.far_filter_len = 129; /* Put half the noise in each analogue section */ awgn_init_dbm0(&s->line1.near_noise, 1234567, noise1 - 3.02f); awgn_init_dbm0(&s->line2.near_noise, 7654321, noise2 - 3.02f); awgn_init_dbm0(&s->line1.far_noise, 1234567, noise1 - 3.02f); awgn_init_dbm0(&s->line2.far_noise, 7654321, noise2 - 3.02f); s->line1.dc_offset = 0.0f; s->line2.dc_offset = 0.0f; s->line1.mains_interference = 0; s->line2.mains_interference = 0; /* Echos */ s->line1.near_co_hybrid_echo = pow(10, echo_level_co1/20.0f); s->line2.near_co_hybrid_echo = pow(10, echo_level_co2/20.0f); s->line1.near_cpe_hybrid_echo = pow(10, echo_level_cpe1/20.0f); s->line2.near_cpe_hybrid_echo = pow(10, echo_level_cpe2/20.0f); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) both_ways_line_model_release(both_ways_line_model_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/spandsp-sim/msvc/0000775000175000017500000000000012357123347013405 500000000000000spandsp-0.0.6/spandsp-sim/msvc/vc8proj.foot0000664000175000017500000000011111210516756015577 00000000000000 spandsp-0.0.6/spandsp-sim/msvc/msvcproj.head0000664000175000017500000000717211210514676016016 00000000000000# Microsoft Developer Studio Project File - Name="spandsp" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=spandsp - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "spandsp.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "spandsp.mak" CFG="spandsp - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "spandsp - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "spandsp - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "spandsp - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D HAVE_TGMATH_H /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /Zi /O2 /I "." /I "..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D HAVE_TGMATH_H /D "_WINDLL" /FR /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib ws2_32.lib winmm.lib /nologo /dll /map /debug /machine:I386 /out:"Release/libspandsp.dll" !ELSEIF "$(CFG)" == "spandsp - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D HAVE_TGMATH_H /YX /FD /GZ /c # ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "." /I "..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D HAVE_TGMATH_H /FR /FD /GZ /c # SUBTRACT CPP /WX /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib ws2_32.lib winmm.lib /nologo /dll /incremental:no /map /debug /machine:I386 /out:"Debug/libspandsp.dll" /pdbtype:sept # SUBTRACT LINK32 /nodefaultlib !ENDIF # Begin Target # Name "spandsp - Win32 Release" # Name "spandsp - Win32 Debug" spandsp-0.0.6/spandsp-sim/msvc/make_line_models.2008.vcproj0000664000175000017500000000514011211246554020423 00000000000000 spandsp-0.0.6/spandsp-sim/msvc/vc8proj.head0000664000175000017500000000545211210514676015545 00000000000000 spandsp-0.0.6/spandsp-sim/msvc/vc9proj.foot0000664000175000017500000000011111210516756015600 00000000000000 spandsp-0.0.6/spandsp-sim/msvc/vc9proj.head0000664000175000017500000001470311211000540015522 00000000000000 spandsp-0.0.6/spandsp-sim/msvc/msvcproj.foot0000664000175000017500000000023011210514675016047 00000000000000 # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project spandsp-0.0.6/spandsp-sim/test_utils.c0000664000175000017500000003055112100775505014717 00000000000000/* * SpanDSP - a series of DSP components for telephony * * test_utils.c - Utility routines for module tests. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES #include "spandsp.h" #include "spandsp-sim.h" #define MAX_FFT_LEN 8192 struct codec_munge_state_s { int munging_codec; g726_state_t g726_enc_state; g726_state_t g726_dec_state; int rbs_pattern; int sequence; }; struct complexify_state_s { float history[128]; int ptr; }; static complex_t circle[MAX_FFT_LEN/2]; static int circle_init = FALSE; static complex_t icircle[MAX_FFT_LEN/2]; static int icircle_init = FALSE; #define SF_MAX_HANDLE 32 static int sf_close_at_exit_registered = FALSE; static SNDFILE *sf_close_at_exit_list[SF_MAX_HANDLE] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }; SPAN_DECLARE(complexify_state_t *) complexify_init(void) { complexify_state_t *s; int i; if ((s = (complexify_state_t *) malloc(sizeof(*s)))) { s->ptr = 0; for (i = 0; i < 128; i++) s->history[i] = 0.0f; } return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) complexify_release(complexify_state_t *s) { free(s); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complexf_t) complexify(complexify_state_t *s, int16_t amp) { #define HILBERT_GAIN 1.569546344 static const float hilbert_coeffs[] = { +0.0012698413f, +0.0013489483f, +0.0015105196f, +0.0017620440f, +0.0021112899f, +0.0025663788f, +0.0031358856f, +0.0038289705f, +0.0046555545f, +0.0056265487f, +0.0067541562f, +0.0080522707f, +0.0095370033f, +0.0112273888f, +0.0131463382f, +0.0153219442f, +0.0177892941f, +0.0205930381f, +0.0237910974f, +0.0274601544f, +0.0317040029f, +0.0366666667f, +0.0425537942f, +0.0496691462f, +0.0584802574f, +0.0697446887f, +0.0847739823f, +0.1060495199f, +0.1388940865f, +0.1971551103f, +0.3316207267f, +0.9994281838f }; float famp; int i; int j; int k; complexf_t res; s->history[s->ptr] = amp; i = s->ptr - 63; if (i < 0) i += 128; res.re = s->history[i]; famp = 0.0f; j = s->ptr - 126; if (j < 0) j += 128; for (i = 0, k = s->ptr; i < 32; i++) { famp += (s->history[k] - s->history[j])*hilbert_coeffs[i]; j += 2; if (j >= 128) j -= 128; k -= 2; if (k < 0) k += 128; } res.im = famp/HILBERT_GAIN; if (++s->ptr >= 128) s->ptr = 0; return res; } /*- End of function --------------------------------------------------------*/ static __inline__ complex_t expj(double theta) { return complex_set(cos(theta), sin(theta)); } /*- End of function --------------------------------------------------------*/ static void fftx(complex_t data[], complex_t temp[], int n) { int i; int h; int p; int t; int i2; complex_t wkt; if (n > 1) { h = n/2; for (i = 0; i < h; i++) { i2 = i*2; temp[i] = data[i2]; /* Even */ temp[h + i] = data[i2 + 1]; /* Odd */ } fftx(&temp[0], &data[0], h); fftx(&temp[h], &data[h], h); p = 0; t = MAX_FFT_LEN/n; for (i = 0; i < h; i++) { wkt = complex_mul(&circle[p], &temp[h + i]); data[i] = complex_add(&temp[i], &wkt); data[h + i] = complex_sub(&temp[i], &wkt); p += t; } } } /*- End of function --------------------------------------------------------*/ static void ifftx(complex_t data[], complex_t temp[], int n) { int i; int h; int p; int t; int i2; complex_t wkt; if (n > 1) { h = n/2; for (i = 0; i < h; i++) { i2 = i*2; temp[i] = data[i2]; /* Even */ temp[h + i] = data[i2 + 1]; /* Odd */ } fftx(&temp[0], &data[0], h); fftx(&temp[h], &data[h], h); p = 0; t = MAX_FFT_LEN/n; for (i = 0; i < h; i++) { wkt = complex_mul(île[p], &temp[h + i]); data[i] = complex_add(&temp[i], &wkt); data[h + i] = complex_sub(&temp[i], &wkt); p += t; } } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) fft(complex_t data[], int len) { int i; double x; complex_t temp[MAX_FFT_LEN]; /* A very slow and clunky FFT, that's just fine for tests. */ if (!circle_init) { for (i = 0; i < MAX_FFT_LEN/2; i++) { x = -(2.0*3.1415926535*i)/(double) MAX_FFT_LEN; circle[i] = expj(x); } circle_init = TRUE; } fftx(data, temp, len); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) ifft(complex_t data[], int len) { int i; double x; complex_t temp[MAX_FFT_LEN]; /* A very slow and clunky FFT, that's just fine for tests. */ if (!icircle_init) { for (i = 0; i < MAX_FFT_LEN/2; i++) { x = (2.0*3.1415926535*i)/(double) MAX_FFT_LEN; icircle[i] = expj(x); } icircle_init = TRUE; } ifftx(data, temp, len); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(codec_munge_state_t *) codec_munge_init(int codec, int info) { codec_munge_state_t *s; if ((s = (codec_munge_state_t *) malloc(sizeof(*s)))) { switch (codec) { case MUNGE_CODEC_G726_40K: g726_init(&s->g726_enc_state, 40000, G726_ENCODING_LINEAR, G726_PACKING_NONE); g726_init(&s->g726_dec_state, 40000, G726_ENCODING_LINEAR, G726_PACKING_NONE); s->munging_codec = MUNGE_CODEC_G726_32K; break; case MUNGE_CODEC_G726_32K: g726_init(&s->g726_enc_state, 32000, G726_ENCODING_LINEAR, G726_PACKING_NONE); g726_init(&s->g726_dec_state, 32000, G726_ENCODING_LINEAR, G726_PACKING_NONE); s->munging_codec = MUNGE_CODEC_G726_32K; break; case MUNGE_CODEC_G726_24K: g726_init(&s->g726_enc_state, 24000, G726_ENCODING_LINEAR, G726_PACKING_NONE); g726_init(&s->g726_dec_state, 24000, G726_ENCODING_LINEAR, G726_PACKING_NONE); s->munging_codec = MUNGE_CODEC_G726_32K; break; case MUNGE_CODEC_G726_16K: g726_init(&s->g726_enc_state, 16000, G726_ENCODING_LINEAR, G726_PACKING_NONE); g726_init(&s->g726_dec_state, 16000, G726_ENCODING_LINEAR, G726_PACKING_NONE); s->munging_codec = MUNGE_CODEC_G726_32K; break; default: s->munging_codec = codec; break; } s->sequence = 0; s->rbs_pattern = info; } return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) codec_munge_release(codec_munge_state_t *s) { free(s); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) codec_munge(codec_munge_state_t *s, int16_t amp[], int len) { uint8_t law; uint8_t adpcmdata[160]; int i; int adpcm; int x; switch (s->munging_codec) { case MUNGE_CODEC_NONE: /* Do nothing */ break; case MUNGE_CODEC_ALAW: for (i = 0; i < len; i++) { law = linear_to_alaw(amp[i]); amp[i] = alaw_to_linear(law); } break; case MUNGE_CODEC_ULAW: for (i = 0; i < len; i++) { law = linear_to_ulaw(amp[i]); if (s->rbs_pattern & (1 << s->sequence)) { /* Strip the bottom bit at the RBS rate */ law &= 0xFE; } amp[i] = ulaw_to_linear(law); } break; case MUNGE_CODEC_G726_32K: /* This could actually be any of the G.726 rates */ for (i = 0; i < len; i += x) { x = (len - i >= 160) ? 160 : (len - i); adpcm = g726_encode(&s->g726_enc_state, adpcmdata, amp + i, x); g726_decode(&s->g726_dec_state, amp + i, adpcmdata, adpcm); } break; } } /*- End of function --------------------------------------------------------*/ static void sf_close_at_exit(void) { int i; for (i = 0; i < SF_MAX_HANDLE; i++) { if (sf_close_at_exit_list[i]) { sf_close(sf_close_at_exit_list[i]); sf_close_at_exit_list[i] = NULL; } } } /*- End of function --------------------------------------------------------*/ static int sf_record_handle(SNDFILE *handle) { int i; for (i = 0; i < SF_MAX_HANDLE; i++) { if (sf_close_at_exit_list[i] == NULL) break; } if (i >= SF_MAX_HANDLE) return -1; sf_close_at_exit_list[i] = handle; if (!sf_close_at_exit_registered) { atexit(sf_close_at_exit); sf_close_at_exit_registered = TRUE; } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(SNDFILE *) sf_open_telephony_read(const char *name, int channels) { SNDFILE *handle; SF_INFO info; memset(&info, 0, sizeof(info)); if ((handle = sf_open(name, SFM_READ, &info)) == NULL) { fprintf(stderr, " Cannot open audio file '%s' for reading\n", name); exit(2); } if (info.samplerate != SAMPLE_RATE) { printf(" Unexpected sample rate in audio file '%s'\n", name); exit(2); } if (info.channels != channels) { printf(" Unexpected number of channels in audio file '%s'\n", name); exit(2); } sf_record_handle(handle); return handle; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(SNDFILE *) sf_open_telephony_write(const char *name, int channels) { SNDFILE *handle; SF_INFO info; memset(&info, 0, sizeof(info)); info.frames = 0; info.samplerate = SAMPLE_RATE; info.channels = channels; info.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16; info.sections = 1; info.seekable = 1; if ((handle = sf_open(name, SFM_WRITE, &info)) == NULL) { fprintf(stderr, " Cannot open audio file '%s' for writing\n", name); exit(2); } sf_record_handle(handle); return handle; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) sf_close_telephony(SNDFILE *handle) { int res; int i; if ((res = sf_close(handle)) == 0) { for (i = 0; i < SF_MAX_HANDLE; i++) { if (sf_close_at_exit_list[i] == handle) { sf_close(sf_close_at_exit_list[i]); sf_close_at_exit_list[i] = NULL; break; } } } return res; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/spandsp-sim/spandsp/0000775000175000017500000000000012357123347014105 500000000000000spandsp-0.0.6/spandsp-sim/spandsp/rfc2198_sim.h0000664000175000017500000000571212100775540016143 00000000000000/* * SpanDSP - a series of DSP components for telephony * * rfc2198_sim.h - Simulate the behaviour of RFC2198 (or UDPTL) redundancy. * * Written by Steve Underwood * * Copyright (C) 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page rfc2198_model_page RFC2198 simulation \section rfc2198_model_page_sec_1 What does it do? */ #if !defined(_RFC2198_SIM_H_) #define _RFC2198_SIM_H_ /*! The definition of an element in the packet queue */ typedef struct rfc2198_sim_queue_element_s { struct rfc2198_sim_queue_element_s *next; struct rfc2198_sim_queue_element_s *prev; int seq_no; double departure_time; double arrival_time; int len; uint8_t pkt[]; } rfc2198_sim_queue_element_t; /*! The model definition for a complete end-to-end path */ typedef struct { int redundancy_depth; int next_seq_no; g1050_state_t *g1050; rfc2198_sim_queue_element_t *first; rfc2198_sim_queue_element_t *last; uint8_t tx_pkt[32][1024]; int tx_pkt_len[32]; int tx_pkt_seq_no[32]; int next_pkt; uint8_t rx_pkt[32][1024]; int rx_pkt_len[32]; int rx_pkt_seq_no[32]; int rx_queued_pkts; } rfc2198_sim_state_t; #ifdef __cplusplus extern "C" { #endif SPAN_DECLARE(rfc2198_sim_state_t *) rfc2198_sim_init(int model, int speed_pattern, int packet_size, int packet_rate, int redundancy_depth); SPAN_DECLARE(int) rfc2198_sim_put(rfc2198_sim_state_t *s, const uint8_t buf[], int len, int seq_no, double departure_time); SPAN_DECLARE(int) rfc2198_sim_get(rfc2198_sim_state_t *s, uint8_t buf[], int max_len, double current_time, int *seq_no, double *departure_time, double *arrival_time); #ifdef __cplusplus } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/spandsp-sim/spandsp/line_models.h0000664000175000017500000000333612100775540016467 00000000000000/* * SpanDSP - a series of DSP components for telephony * * line_model.h - Model a telephone line. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_LINE_MODELS_H_) #define _SPANDSP_LINE_MODELS_H_ extern float proakis_line_model[]; extern float ad_1_edd_1_model[]; extern float ad_1_edd_2_model[]; extern float ad_1_edd_3_model[]; extern float ad_5_edd_1_model[]; extern float ad_5_edd_2_model[]; extern float ad_5_edd_3_model[]; extern float ad_6_edd_1_model[]; extern float ad_6_edd_2_model[]; extern float ad_6_edd_3_model[]; extern float ad_7_edd_1_model[]; extern float ad_7_edd_2_model[]; extern float ad_7_edd_3_model[]; extern float ad_8_edd_1_model[]; extern float ad_8_edd_2_model[]; extern float ad_8_edd_3_model[]; extern float ad_9_edd_1_model[]; extern float ad_9_edd_2_model[]; extern float ad_9_edd_3_model[]; #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/spandsp-sim/spandsp/test_utils.h0000664000175000017500000000420612100775540016371 00000000000000/* * SpanDSP - a series of DSP components for telephony * * test_utils.h - Utility routines for module tests. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_TEST_UTILS_H_) #define _TEST_UTILS_H_ #include enum { MUNGE_CODEC_NONE = 0, MUNGE_CODEC_ALAW, MUNGE_CODEC_ULAW, MUNGE_CODEC_G726_40K, MUNGE_CODEC_G726_32K, MUNGE_CODEC_G726_24K, MUNGE_CODEC_G726_16K, }; typedef struct codec_munge_state_s codec_munge_state_t; typedef struct complexify_state_s complexify_state_t; #ifdef __cplusplus extern "C" { #endif SPAN_DECLARE(complexify_state_t *) complexify_init(void); SPAN_DECLARE(void) complexify_release(complexify_state_t *s); SPAN_DECLARE(complexf_t) complexify(complexify_state_t *s, int16_t amp); SPAN_DECLARE(void) fft(complex_t data[], int len); SPAN_DECLARE(void) ifft(complex_t data[], int len); SPAN_DECLARE(codec_munge_state_t *) codec_munge_init(int codec, int info); SPAN_DECLARE(void) codec_munge_release(codec_munge_state_t *s); SPAN_DECLARE(void) codec_munge(codec_munge_state_t *s, int16_t amp[], int len); SPAN_DECLARE(SNDFILE *) sf_open_telephony_read(const char *name, int channels); SPAN_DECLARE(SNDFILE *) sf_open_telephony_write(const char *name, int channels); SPAN_DECLARE(int) sf_close_telephony(SNDFILE *handle); #ifdef __cplusplus } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/spandsp-sim/spandsp/g1050.h0000664000175000017500000002333112100775540014726 00000000000000/* * SpanDSP - a series of DSP components for telephony * * g1050.h - IP network modeling, as per G.1050/TIA-921. * * Written by Steve Underwood * * Copyright (C) 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page g1050_ip_network_model_page G.1050/TIA-921 IP network path model \section g1050_ip_network_model_page_sec_1 What does it do? The ITU G.1050 specification defines a model of an IP network, appropriate for the testing of how streaming media woud behave across the internet. The model is based on a path having 5 segments: - a local LAN (wired or wireless) - an access link to the internet - an internet of arbitrary complexity - an access link from the internet - a distant LAN (wired or wireless) The impairments typical of these segments at various service levels are modelled. 8 standard service level behaviours are defined, covering lightly loaded to heavily congested levels. 168 standard sets of link speeds are defined, covering typical wired and wireless LAN, broadband access link, and backbone characteristics. The G.1050 model is suitable for testing the behaviour of RTP, UDPTL and other streaming protocols for packet loss and jitter behaviour. */ #if !defined(_G1050_H_) #define _G1050_H_ /* This is the time slice at which delays, packet loss, etc. are calculated. */ #define G1050_TICKS_PER_SEC 1000 /* Search back 200 ms to preserve order of legitimately out of sequence packets. */ #define SEARCHBACK_PERIOD 200 #define G1050_LOW_LOSS 0 #define G1050_HIGH_LOSS 1 #define G1050_LAN_LINK 1 #define G1050_ACCESS_LINK 2 /*! Segment constants, as defined in G.1050. */ typedef struct { /*! Probability of changing from low to high and high to low loss states */ double prob_loss_rate_change[2]; /*! Probability of an impulse in the low and high loss states */ double prob_impulse[2][2]; /*! Impulse height, based on MTU and bit rate */ double impulse_height; /*! Impulse decay coefficient for the single pole IIR filter. */ double impulse_coeff; /*! Probability of packet loss due to occupancy. */ double prob_packet_loss; /*! Probability of packet loss due to a multiple access collision. */ double prob_packet_collision_loss; } g1050_segment_constants_t; /*! End-to-end constants, as defined in G.1050. */ typedef struct { g1050_segment_constants_t segment[4]; } g1050_constants_t; /*! The model definition for a LAN or access link segment */ typedef struct { /*! Percentage occupancy of the media */ double percentage_occupancy; /*! MTU of the media */ int mtu; /*! Maximum jitter in the segment. */ double max_jitter; } g1050_segment_model_t; /*! The model definition for the core network (backbone) segment */ typedef struct { /*! Basic delay of the backbone for regional paths */ double base_regional_delay; /*! Basic delay of the backbone for intercontinental paths */ double base_intercontinental_delay; /*! Percentage packet loss of the backbone */ /*! Percentage packet loss of the backbone. */ double percentage_packet_loss; /*! Maximum jitter in the backbone. */ double max_jitter; /*! Interval between the backbone route flapping between two paths, in seconds. */ double route_flap_interval; /*! The difference in backbone delay between the two routes we flap between, in seconds. */ double route_flap_delay; /*! The interval between link failures. */ double link_failure_interval; /*! The duration of link failures. */ double link_failure_duration; /*! Probability of packet loss in the backbone. */ double prob_packet_loss; /*! Probability of a packet going out of sequence in the backbone. */ double prob_oos; } g1050_core_model_t; /*! The model definition for a complete end-to-end path */ typedef struct { /*! The likelyhood of occurance probabilities for the A, B and C scenarios defined in G.1050 */ int loo[3]; g1050_segment_model_t sidea_lan; g1050_segment_model_t sidea_access_link; g1050_core_model_t core; g1050_segment_model_t sideb_access_link; g1050_segment_model_t sideb_lan; } g1050_model_t; /*! The speed model for a complete end-to-end path */ typedef struct { int sidea_lan_bit_rate; int sidea_lan_multiple_access; int sidea_access_link_bit_rate_ab; int sidea_access_link_bit_rate_ba; int sidea_access_link_qos_enabled; int sideb_lan_bit_rate; int sideb_lan_multiple_access; int sideb_access_link_bit_rate_ab; int sideb_access_link_bit_rate_ba; int sideb_access_link_qos_enabled; double loo; } g1050_channel_speeds_t; /*! The model state for a LAN or access link segment */ typedef struct { /*! The type of link, G1050_LAN_LINK or G_1050_ACCESS_LINK */ int link_type; /*! 1 if in the high loss state, or 0 if in the low loss state. */ int high_loss; /*! The probability of a loss rate change, for both loss rate states. */ double prob_loss_rate_change[2]; /*! The probability of a impulse occuring, for both loss rate states. */ double prob_impulse[2]; /*! The maximum permitted height of impulses. */ double impulse_height; /*! The impulse decay coefficient. */ double impulse_coeff; /*! The basic serial delay due to the link. */ double serial_delay; /*! Peak jitter in the segment. */ double max_jitter; /*! The probability of packet loss. */ double prob_packet_loss; /*! The probability of packet loss due to collision. */ double prob_packet_collision_loss; /*! The maximum addition delay due to congestion. */ double congestion_delay; /*! TRUE if QoS is enabled on the link. */ int qos_enabled; /*! TRUE if the link is a multiple access type (e.g. an ethernet hub). */ int multiple_access; /*! The latest packet arrival time seen on the link. */ double last_arrival_time; /*! 3 seconds of predicted delays for the link */ double delays[3*G1050_TICKS_PER_SEC]; /*! A count of packets lost on the link. */ uint32_t lost_packets; /*! An extra debug count of packets lost on the link. */ uint32_t lost_packets_2; } g1050_segment_state_t; /*! The model state for the core network (backbone) segment */ typedef struct { /* Router model. */ int32_t route_flap_counter; int32_t route_flap_interval; double route_flap_delta; /* Link failure model. */ int32_t link_failure_counter; int32_t link_recovery_counter; int32_t link_failure_interval_ticks; int32_t link_failure_duration_ticks; /*! Basic backbone delay */ double base_delay; /*! Peak jitter in the backbone delay */ double max_jitter; /*! Probability of packet loss in the backbone, in percent */ double prob_packet_loss; /*! Probability of a packet going out of sequence in the backbone. */ double prob_oos; /*! The latest packet arrival time seen on the link. */ double last_arrival_time; double delay_delta; /*! 3 seconds of predicted delays for the link */ double delays[3*G1050_TICKS_PER_SEC]; /*! A count of packets lost on the link. */ uint32_t lost_packets; /*! An extra debug count of packets lost on the link. */ uint32_t lost_packets_2; } g1050_core_state_t; /*! The definition of an element in the packet queue */ typedef struct g1050_queue_element_s { struct g1050_queue_element_s *next; struct g1050_queue_element_s *prev; int seq_no; double departure_time; double arrival_time; int len; uint8_t pkt[]; } g1050_queue_element_t; /*! The model definition for a complete end-to-end path */ typedef struct { int packet_rate; int packet_size; float base_time; g1050_segment_state_t segment[4]; g1050_core_state_t core; double arrival_times_1[3*G1050_TICKS_PER_SEC]; double arrival_times_2[3*G1050_TICKS_PER_SEC]; g1050_queue_element_t *first; g1050_queue_element_t *last; } g1050_state_t; extern g1050_constants_t g1050_constants[1]; extern g1050_channel_speeds_t g1050_speed_patterns[168]; extern g1050_model_t g1050_standard_models[9]; #ifdef __cplusplus extern "C" { #endif SPAN_DECLARE(g1050_state_t *) g1050_init(int model, int speed_pattern, int packet_size, int packet_rate); SPAN_DECLARE(void) g1050_dump_parms(int model, int speed_pattern); SPAN_DECLARE(int) g1050_put(g1050_state_t *s, const uint8_t buf[], int len, int seq_no, double departure_time); SPAN_DECLARE(int) g1050_get(g1050_state_t *s, uint8_t buf[], int max_len, double current_time, int *seq_no, double *departure_time, double *arrival_time); SPAN_DECLARE(void) g1050_queue_dump(g1050_state_t *s); #ifdef __cplusplus } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/spandsp-sim/spandsp/line_model.h0000664000175000017500000001445012100775540016303 00000000000000/* * SpanDSP - a series of DSP components for telephony * * line_model.h - Model a telephone line. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page line_model_page Telephone line model \section line_model_page_sec_1 What does it do? The telephone line modelling module provides simple modelling of one way and two way telephone lines. The path being modelled is: - terminal - | < hybrid echo (2-way models) - | - | < noise and filtering - | - | < hybrid echo (2-way models) - CO - | - | < A-law distortion + bulk delay - | - CO - | < hybrid echo (2-way models) - | - | < noise and filtering - | - | < hybrid echo (2-way models) - terminal */ #if !defined(_SPANDSP_LINE_MODEL_H_) #define _SPANDSP_LINE_MODEL_H_ #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES #include #define LINE_FILTER_SIZE 129 /*! One way line model descriptor. This holds the complete state of a line model with transmission in only one direction. */ typedef struct { codec_munge_state_t *munge; /*! The coefficients for the near end analogue section simulation filter */ const float *near_filter; /*! The number of coefficients for the near end analogue section simulation filter */ int near_filter_len; /*! Last transmitted samples (ring buffer, used by the line filter) */ float near_buf[LINE_FILTER_SIZE]; /*! Pointer of the last transmitted sample in buf */ int near_buf_ptr; /*! The noise source for local analogue section of the line */ awgn_state_t near_noise; /*! The bulk delay of the path, in samples */ int bulk_delay; /*! A pointer to the current write position in the bulk delay store. */ int bulk_delay_ptr; /*! The data store for simulating the bulk delay */ int16_t bulk_delay_buf[8000]; /*! The coefficients for the far end analogue section simulation filter */ const float *far_filter; /*! The number of coefficients for the far end analogue section simulation filter */ int far_filter_len; /*! Last transmitted samples (ring buffer, used by the line filter) */ float far_buf[LINE_FILTER_SIZE]; /*! Pointer of the last transmitted sample in buf */ int far_buf_ptr; /*! The noise source for distant analogue section of the line */ awgn_state_t far_noise; /*! The scaling factor for the local CPE hybrid echo */ float near_cpe_hybrid_echo; /*! The scaling factor for the local CO hybrid echo */ float near_co_hybrid_echo; /*! The scaling factor for the far CPE hybrid echo */ float far_cpe_hybrid_echo; /*! The scaling factor for the far CO hybrid echo */ float far_co_hybrid_echo; /*! DC offset impairment */ float dc_offset; /*! Mains pickup impairment */ int mains_interference; tone_gen_state_t mains_tone; } one_way_line_model_state_t; /*! Two way line model descriptor. This holds the complete state of a line model with transmission in both directions. */ typedef struct { one_way_line_model_state_t line1; one_way_line_model_state_t line2; float fout1; float fout2; } both_ways_line_model_state_t; #ifdef __cplusplus extern "C" { #endif SPAN_DECLARE_DATA extern const float *line_models[]; SPAN_DECLARE(void) both_ways_line_model(both_ways_line_model_state_t *s, int16_t output1[], const int16_t input1[], int16_t output2[], const int16_t input2[], int samples); SPAN_DECLARE(void) both_ways_line_model_set_dc(both_ways_line_model_state_t *s, float dc1, float dc2); SPAN_DECLARE(void) both_ways_line_model_set_mains_pickup(both_ways_line_model_state_t *s, int f, float level1, float level2); SPAN_DECLARE(both_ways_line_model_state_t *) both_ways_line_model_init(int model1, float noise1, float echo_level_cpe1, float echo_level_co1, int model2, float noise2, float echo_level_cpe2, float echo_level_co2, int codec, int rbs_pattern); SPAN_DECLARE(int) both_ways_line_model_release(both_ways_line_model_state_t *s); SPAN_DECLARE(void) one_way_line_model(one_way_line_model_state_t *s, int16_t output[], const int16_t input[], int samples); SPAN_DECLARE(void) one_way_line_model_set_dc(one_way_line_model_state_t *s, float dc); SPAN_DECLARE(void) one_way_line_model_set_mains_pickup(one_way_line_model_state_t *s, int f, float level); SPAN_DECLARE(one_way_line_model_state_t *) one_way_line_model_init(int model, float noise, int codec, int rbs_pattern); SPAN_DECLARE(int) one_way_line_model_release(one_way_line_model_state_t *s); #ifdef __cplusplus } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/unpack_g726_data.sh0000775000175000017500000000303511422612260013463 00000000000000#!/bin/sh # # SpanDSP - a series of DSP components for telephony # # unpack_g726_data.sh # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 2.1, # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ITUDATA="../../../T-REC-G.726-199103-I!AppII!SOFT-ZST-E.zip" cd test-data/itu if [ -d g726 ] then cd g726 else mkdir g726 RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot create test-data/itu/g726! exit $RETVAL fi cd g726 fi rm -rf DISK1 rm -rf DISK2 rm -rf G726piiE.WW7.doc rm -rf Software.zip unzip ${ITUDATA} >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot unpack the ITU test vectors for G.726! exit $RETVAL fi #rm $(ITUDATA} rm G726piiE.WW7.doc unzip Software.zip >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot unpack the ITU test vectors for G.726! exit $RETVAL fi rm Software.zip mv ./software/G726ap2/G726ap2e/DISK1 . mv ./software/G726ap2/G726ap2e/DISK2 . rm -rf ./software echo The ITU test vectors for G.726 should now be in the g726 directory spandsp-0.0.6/Makefile.in0000664000175000017500000007274612343626375012210 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/spandsp.pc.in $(srcdir)/spandsp.spec.in COPYING \ config/config.guess config/config.sub config/depcomp \ config/install-sh config/missing config/ltmain.sh \ $(top_srcdir)/config/config.guess \ $(top_srcdir)/config/config.sub \ $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ $(top_srcdir)/config/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_check_real_file.m4 \ $(top_srcdir)/m4/ax_fixed_point_machine.m4 \ $(top_srcdir)/m4/ax_misaligned_access_fails.m4 \ $(top_srcdir)/m4/ax_c99_features.m4 \ $(top_srcdir)/m4/ax_check_export_capability.m4 \ $(top_srcdir)/m4/ax_check_arm_neon.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = spandsp.pc spandsp.spec CONFIG_CLEAN_VPATH_FILES = SCRIPTS = $(noinst_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(pkgconfigdir)" DATA = $(pkgconfig_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config-h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ COMP_VENDOR_CFLAGS = @COMP_VENDOR_CFLAGS@ COMP_VENDOR_LDFLAGS = @COMP_VENDOR_LDFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_FAX2TIFF = @HAVE_FAX2TIFF@ HAVE_PBMTOG3 = @HAVE_PBMTOG3@ HAVE_SOX = @HAVE_SOX@ INSERT_INTTYPES_HEADER = @INSERT_INTTYPES_HEADER@ INSERT_MATH_HEADER = @INSERT_MATH_HEADER@ INSERT_STDBOOL_HEADER = @INSERT_STDBOOL_HEADER@ INSERT_STDINT_HEADER = @INSERT_STDINT_HEADER@ INSERT_TGMATH_HEADER = @INSERT_TGMATH_HEADER@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIMLIBS = @SIMLIBS@ SPANDSP_LT_AGE = @SPANDSP_LT_AGE@ SPANDSP_LT_CURRENT = @SPANDSP_LT_CURRENT@ SPANDSP_LT_REVISION = @SPANDSP_LT_REVISION@ SPANDSP_MISALIGNED_ACCESS_FAILS = @SPANDSP_MISALIGNED_ACCESS_FAILS@ SPANDSP_SUPPORT_T85 = @SPANDSP_SUPPORT_T85@ SPANDSP_SUPPORT_V34 = @SPANDSP_SUPPORT_V34@ SPANDSP_USE_EXPORT_CAPABILITY = @SPANDSP_USE_EXPORT_CAPABILITY@ SPANDSP_USE_FIXED_POINT = @SPANDSP_USE_FIXED_POINT@ STRIP = @STRIP@ TESTLIBS = @TESTLIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = $(COMP_VENDOR_CFLAGS) AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS) noinst_SCRIPTS = spandsp.spec MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = autogen.sh \ DueDiligence \ debian/changelog \ debian/compat \ debian/control \ debian/copyright \ debian/libspandsp6.install \ debian/libspandsp-dev.install \ debian/libspandsp-doc.install \ debian/rules \ debian/watch \ README.testdata \ spandsp.spec \ spandsp/fax-tests.dtd \ spandsp/fax-tests.xml \ spandsp/global-tones.xml \ spandsp/tones.dtd \ spandsp/tsb85.xml \ unpack_g722_data.sh \ unpack_g726_data.sh \ unpack_gsm0610_data.sh \ unpack_v56ter_data.sh \ wrapper.xsl @COND_DOC_TRUE@MAYBE_DOC = doc @COND_TESTDATA_TRUE@MAYBE_TESTDATA = test-data @COND_TESTS_TRUE@MAYBE_TESTDATA = test-data @COND_TESTS_TRUE@MAYBE_TESTS = spandsp-sim tests SUBDIRS = src $(MAYBE_DOC) $(MAYBE_TESTDATA) $(MAYBE_TESTS) DIST_SUBDIRS = src doc test-data spandsp-sim tests pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = spandsp.pc all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): spandsp.pc: $(top_builddir)/config.status $(srcdir)/spandsp.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ spandsp.spec: $(top_builddir)/config.status $(srcdir)/spandsp.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs distclean-libtool: -rm -f libtool config.lt install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(pkgconfigdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pkgconfigdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(pkgconfigdir)" || exit $$?; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; test -n "$(pkgconfigdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(pkgconfigdir)'; $(am__uninstall_files_from_dir) # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(SCRIPTS) $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(pkgconfigdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-libtool \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-pkgconfigDATA install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-pkgconfigDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ dist-xz dist-zip distcheck distclean distclean-generic \ distclean-libtool distclean-tags distcleancheck distdir \ distuninstallcheck dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-pkgconfigDATA install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs installdirs-am maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-pkgconfigDATA faq: faq.xml cd faq ; xsltproc ../wrapper.xsl ../faq.xml rpm: rpm-build rpm-build: $(MAKE) -$(MAKEFLAGS) bump.rpm.release $(MAKE) -$(MAKEFLAGS) dist rm -rf rpm/BUILD/* rm -f rpm/RPMS/*/* rm -f rpm/SOURCES/* rm -f rpm/SPECS/* rm -f rpm/SRPMS/* rpmbuild -ta --sign @PACKAGE@-@VERSION@.tar.gz bump.rpm.release: spandsp.spec VERSION="x"; \ test -f $(srcdir)/rpm.release && . $(srcdir)/rpm.release; \ NEXT_RELEASE=0; \ test "$$VERSION" = "@VERSION@" && NEXT_RELEASE="$$RELEASE"; \ RELEASE=`expr $$NEXT_RELEASE + 1`; \ echo "VERSION=@VERSION@" >$(srcdir)/rpm.release; \ echo "RELEASE=$$RELEASE" >>$(srcdir)/rpm.release; \ sed 's/^Release: .*/Release: '$$RELEASE'/' \ spandsp.spec.new; \ mv spandsp.spec.new spandsp.spec # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: spandsp-0.0.6/spandsp.pc.in0000664000175000017500000000036512101131643012505 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: spandsp Description: A DSP library for telephony. Requires: Version: @VERSION@ Libs: -L${libdir} -lspandsp Libs.private: -ltiff -lm Cflags: -I${includedir} spandsp-0.0.6/config/0000775000175000017500000000000012357123346011443 500000000000000spandsp-0.0.6/config/missing0000755000175000017500000002540611516506031012757 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2005-06-08.21 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case "$1" in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: spandsp-0.0.6/config/ltmain.sh0000644000175000017500000105152212343626372013211 00000000000000 # libtool (GNU libtool) 2.4.2 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, # 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --no-quiet, --no-silent # print informational messages (default) # --no-warn don't display warning messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print more informational messages than default # --no-verbose don't print the extra informational messages # --version print version information # -h, --help, --help-all print short, long, or detailed help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. When passed as first option, # `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.4.2 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . # GNU libtool home page: . # General help using GNU software: . PROGRAM=libtool PACKAGE=libtool VERSION=2.4.2 TIMESTAMP="" package_revision=1.3337 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # NLS nuisances: We save the old values to restore during execute mode. lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done LC_ALL=C LANGUAGE=C export LANGUAGE LC_ALL $lt_unset CDPATH # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" : ${CP="cp -f"} test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_dirname may be replaced by extended shell implementation # func_basename file func_basename () { func_basename_result=`$ECHO "${1}" | $SED "$basename"` } # func_basename may be replaced by extended shell implementation # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` } # func_dirname_and_basename may be replaced by extended shell implementation # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname may be replaced by extended shell implementation # These SED scripts presuppose an absolute path with a trailing slash. pathcar='s,^/\([^/]*\).*$,\1,' pathcdr='s,^/[^/]*,,' removedotparts=':dotsl s@/\./@/@g t dotsl s,/\.$,/,' collapseslashes='s@/\{1,\}@/@g' finalslash='s,/*$,/,' # func_normal_abspath PATH # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. # value returned in "$func_normal_abspath_result" func_normal_abspath () { # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` while :; do # Processed it all yet? if test "$func_normal_abspath_tpath" = / ; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result" ; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_relative_path SRCDIR DSTDIR # generates a relative path from SRCDIR to DSTDIR, with a trailing # slash if non-empty, suitable for immediately appending a filename # without needing to append a separator. # value returned in "$func_relative_path_result" func_relative_path () { func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=${func_dirname_result} if test "x$func_relative_path_tlibdir" = x ; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test "x$func_stripname_result" != x ; then func_relative_path_result=${func_relative_path_result}/${func_stripname_result} fi # Normalisation. If bindir is libdir, return empty string, # else relative path ending with a slash; either way, target # file name can be directly appended. if test ! -z "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result/" func_relative_path_result=$func_stripname_result fi } # The name of this program: func_dirname_and_basename "$progpath" progname=$func_basename_result # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' # Sed substitution that converts a w32 file name or path # which contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname: ${opt_mode+$opt_mode: }$*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` done my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "$my_tmpdir" } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "$1" | $SED \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_tr_sh # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_version # Echo version message to standard output and exit. func_version () { $opt_debug $SED -n '/(C)/!b go :more /\./!{ N s/\n# / / b more } :go /^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $opt_debug $SED -n '/^# Usage:/,/^# *.*--help/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" echo $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help [NOEXIT] # Echo long help message to standard output and exit, # unless 'noexit' is passed as argument. func_help () { $opt_debug $SED -n '/^# Usage:/,/# Report bugs to/ { :print s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ p d } /^# .* home page:/b print /^# General help using/b print ' < "$progpath" ret=$? if test -z "$1"; then exit $ret fi } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $opt_debug func_error "missing argument for $1." exit_cmd=exit } # func_split_short_opt shortopt # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. func_split_short_opt () { my_sed_short_opt='1s/^\(..\).*$/\1/;q' my_sed_short_rest='1s/^..\(.*\)$/\1/;q' func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` } # func_split_short_opt may be replaced by extended shell implementation # func_split_long_opt longopt # Set func_split_long_opt_name and func_split_long_opt_arg shell # variables after splitting LONGOPT at the `=' sign. func_split_long_opt () { my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^--[^=]*=//' func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` } # func_split_long_opt may be replaced by extended shell implementation exit_cmd=: magic="%%%MAGIC variable%%%" magic_exe="%%%MAGIC EXE variable%%%" # Global variables. nonopt= preserve_args= lo2o="s/\\.lo\$/.${objext}/" o2lo="s/\\.${objext}\$/.lo/" extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "${1}=\$${1}\${2}" } # func_append may be replaced by extended shell implementation # func_append_quoted var value # Quote VALUE and append to the end of shell variable VAR, separated # by a space. func_append_quoted () { func_quote_for_eval "${2}" eval "${1}=\$${1}\\ \$func_quote_for_eval_result" } # func_append_quoted may be replaced by extended shell implementation # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "${@}"` } # func_arith may be replaced by extended shell implementation # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` } # func_len may be replaced by extended shell implementation # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` } # func_lo2o may be replaced by extended shell implementation # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` } # func_xform may be replaced by extended shell implementation # func_fatal_configuration arg... # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func_error ${1+"$@"} func_error "See the $PACKAGE documentation for more information." func_fatal_error "Fatal configuration error." } # func_config # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # Display the features supported by this script. func_features () { echo "host: $host" if test "$build_libtool_libs" = yes; then echo "enable shared libraries" else echo "disable shared libraries" fi if test "$build_old_libs" = yes; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag tagname # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname="$1" re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf="/$re_begincf/,/$re_endcf/p" # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Option defaults: opt_debug=: opt_dry_run=false opt_config=false opt_preserve_dup_deps=false opt_features=false opt_finish=false opt_help=false opt_help_all=false opt_silent=: opt_warning=: opt_verbose=: opt_silent=false opt_verbose=false # Parse options once, thoroughly. This comes as soon as possible in the # script to make things like `--version' happen as quickly as we can. { # this just eases exit handling while test $# -gt 0; do opt="$1" shift case $opt in --debug|-x) opt_debug='set -x' func_echo "enabling shell trace mode" $opt_debug ;; --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) opt_config=: func_config ;; --dlopen|-dlopen) optarg="$1" opt_dlopen="${opt_dlopen+$opt_dlopen }$optarg" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) opt_features=: func_features ;; --finish) opt_finish=: set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help_all=: opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_mode="$optarg" case $optarg in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_silent=false func_append preserve_args " $opt" ;; --no-warning|--no-warn) opt_warning=false func_append preserve_args " $opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $opt" ;; --silent|--quiet) opt_silent=: func_append preserve_args " $opt" opt_verbose=false ;; --verbose|-v) opt_verbose=: func_append preserve_args " $opt" opt_silent=false ;; --tag) test $# = 0 && func_missing_arg $opt && break optarg="$1" opt_tag="$optarg" func_append preserve_args " $opt $optarg" func_enable_tag "$optarg" shift ;; -\?|-h) func_usage ;; --help) func_help ;; --version) func_version ;; # Separate optargs to long options: --*=*) func_split_long_opt "$opt" set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-n*|-v*) func_split_short_opt "$opt" set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) break ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) set dummy "$opt" ${1+"$@"}; shift; break ;; esac done # Validate options: # save first non-option argument if test "$#" -gt 0; then nonopt="$opt" shift fi # preserve --debug test "$opt_debug" = : || func_append preserve_args " --debug" case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test "$opt_mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$opt_mode' for more information." } # Bail if the options were screwed $exit_cmd $EXIT_FAILURE } ## ----------- ## ## Main. ## ## ----------- ## # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case "$lt_sysroot:$1" in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result="=$func_stripname_result" ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$lt_sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $opt_debug # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result="" if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result" ; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $opt_debug if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $opt_debug # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $opt_debug if test -z "$2" && test -n "$1" ; then func_error "Could not determine host file name corresponding to" func_error " \`$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result="$1" fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $opt_debug if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " \`$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result="$3" fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $opt_debug case $4 in $1 ) func_to_host_path_result="$3$func_to_host_path_result" ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via `$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $opt_debug $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $opt_debug case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result="$1" } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result="$func_convert_core_msys_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $opt_debug func_to_host_file_result="$1" if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result="$func_cygpath_result" fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via `$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $opt_debug if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd="func_convert_path_${func_stripname_result}" fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $opt_debug func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result="$1" } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_msys_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $opt_debug func_to_host_path_result="$1" if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result="$func_cygpath_result" func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_mode_compile arg... func_mode_compile () { $opt_debug # Get the compilation command and the source file. base_compile= srcfile="$nonopt" # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg="$arg" arg_mode=normal ;; target ) libobj="$arg" arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify \`-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs="$IFS"; IFS=',' for arg in $args; do IFS="$save_ifs" func_append_quoted lastarg "$arg" done IFS="$save_ifs" func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg="$srcfile" srcfile="$arg" ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with \`-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj="$func_basename_result" } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from \`$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$opt_mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$opt_mode'" ;; esac echo $ECHO "Try \`$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test "$opt_help" = :; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | sed -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | sed '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$opt_mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "\`$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument \`$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and \`=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the \`-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the \`$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the \`$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test "$opt_mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test "x$prev" = x-m && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$opt_mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename="" if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname" ; then func_basename "$dlprefile_dlname" dlprefile_dlbasename="$func_basename_result" else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename" ; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $opt_debug sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $opt_debug match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive which possess that section. Heuristic: eliminate # all those which have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $opt_debug func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $opt_debug if func_cygming_gnu_implib_p "$1" ; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1" ; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result="" fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" if test "$lock_old_archive_extraction" = yes; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test "$lock_old_archive_extraction" = yes; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ which is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options which match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include /* declarations of non-ANSI functions */ #if defined(__MINGW32__) # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined(__CYGWIN__) # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined (other platforms) ... */ #endif /* portability defines, excluding path handling macros */ #if defined(_MSC_VER) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC # ifndef _INTPTR_T_DEFINED # define _INTPTR_T_DEFINED # define intptr_t int # endif #elif defined(__MINGW32__) # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined(__CYGWIN__) # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined (other platforms) ... */ #endif #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #if defined(LT_DEBUGWRAPPER) static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $opt_debug case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir="$arg" prev= continue ;; dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-flto*|-fwhopr*|-fuse-linker-plugin) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test "$prev" = dlfiles; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps ; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." else echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test "$prefer_static_libs" = yes || test "$prefer_static_libs,$installed" = "built,no"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib="$l" done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$lt_sysroot$libdir" absdir="$lt_sysroot$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later func_append notinst_path " $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi case "$host" in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test "$installed" = no; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then echo if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$opt_mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$absdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$opt_mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system can not link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs="$temp_deplibs" fi func_append newlib_search_path " $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps ; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path="$deplib" ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|qnx|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. func_append verstring ":${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" func_append libobjs " $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$opt_mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test "X$deplibs_check_method" = "Xnone"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using \`nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then # Remove ${wl} instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$opt_mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd1 in $cmds; do IFS="$save_ifs" # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test "$try_normal_branch" = yes \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=${output_objdir}/${output_la}.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\${concat_cmds}$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$opt_mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$opt_mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` else gentop="$output_objdir/${obj}x" func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " ${wl}-bind_at_load" func_append finalize_command " ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs="$new_libs" func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=no ;; *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then func_append oldobjs " $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" func_resolve_sysroot "$deplib" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test "x$bindir" != x ; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$opt_mode" = link || test "$opt_mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) func_append RM " $arg"; rmforce=yes ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then odir="$objdir" else odir="$dir/$objdir" fi func_basename "$file" name="$func_basename_result" test "$opt_mode" = uninstall && odir="$dir" # Remember odir for removal later, being careful to avoid duplicates if test "$opt_mode" = clean; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case "$opt_mode" in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test "$opt_mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name" ; then func_append rmfiles " $odir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$opt_mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 spandsp-0.0.6/config/config.sub0000755000175000017500000010115311027370066013341 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. timestamp='2008-01-16' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: spandsp-0.0.6/config/config.guess0000755000175000017500000012753411027370066013711 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. timestamp='2008-01-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else echo ${UNAME_MACHINE}-unknown-linux-gnueabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: spandsp-0.0.6/config/depcomp0000755000175000017500000003710011516506031012727 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2005-07-09.11 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mecanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: spandsp-0.0.6/config/install-sh0000755000175000017500000002202111516506031013352 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2005-05-14.22 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" chmodcmd="$chmodprog 0755" chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test -n "$1"; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; *) # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. test -n "$dir_arg$dstarg" && break # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done break;; esac done if test -z "$1"; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src src= if test -d "$dst"; then mkdircmd=: chmodcmd= else mkdircmd=$mkdirprog fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dst=$dst/`basename "$src"` fi fi # This sed command emulates the dirname command. dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'` # Make sure that the destination directory exists. # Skip lots of stat calls in the usual case. if test ! -d "$dstdir"; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` shift IFS=$oIFS pathcomp= while test $# -ne 0 ; do pathcomp=$pathcomp$1 shift if test ! -d "$pathcomp"; then $mkdirprog "$pathcomp" # mkdir can fail with a `File exist' error in case several # install-sh are creating the directory concurrently. This # is OK. test -d "$pathcomp" || exit fi pathcomp=$pathcomp/ done fi if test -n "$dir_arg"; then $doit $mkdircmd "$dst" \ && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; } else dstfile=`basename "$dst"` # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 trap '(exit $?); exit' 1 2 13 15 # Copy the file name to the temp name. $doit $cpprog "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dstdir/$dstfile"; then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \ || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \ || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" } } fi || { (exit 1); exit 1; } done # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit 0 } # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: spandsp-0.0.6/README.testdata0000664000175000017500000000465210763521117012612 00000000000000Setting up test data for the supplied suite of test programs. ------------------------------------------------------------- Some of the tests in the test suite for this package require test data files. These test data files fall into four categories: - Some data files, such as those for some of the FAX tests, are generated by programs in the package. - Some are freely distributable data files, from various sources. These are supplied with the package. - Some are test data files from a standards body. These are the copyright material of the standards body, and so cannot be distributed with this package. However, most of these files can currently be downloaded at no charge from the standards body's web site. This file describes which files are needed, and how they may be processed to produce the right files in the right places for the tests. - The two industry standard sources of test data for DTMF decoders are Bellcore/Telcordia and Mitel. Neither of these is either free, or supplied in a form directly usable with the test suite. These data sources are expected by several tests, and not just the DTMF decoder tests. Sad to say, you are on your own when trying to source data for these tests. For the G.722 tests, obtain the file T-REC-G.722-198703-I!AppII!ZPF-E.zip from the ITU web site, and place it in this directory. Then run ./unpack_g722_data.sh For the G.726 tests, obtain the file T-REC-G.726-199103-I!AppII!SOFT-ZST-E.zip from the ITU web site, and place it in this directory. Then run ./unpack_g726_data.sh For the GSM 06.10 tests, obtain the file en_300961v080101p0.zip from the ETSI web site, and place it in this directory. If you are able to run .exe (i.e. MS DOS or Windows) files you can simply run ./unpack_gsm0610_data.sh If you are unable to run .exe files on the machine you are using (e.e. you are not using Cygwin, Mingw, Wine, FreeDOS or something of that sort) you will need to find a machine which will. First, run ./unpack_gsm0610_data.sh --no-exe This will leave 6 .EXE files in the etsitetss/gsm0610 directory. Take these to a machine which can run .EXE files, and execute all of them. This should result in a number of files which end with .COD, INP and .OUT. Copy these to the etsitests/gsm0610 directory, and run ./unpack_gsm0610_data.sh --no-exe-continue The remainder of the extraction and repacking of files should then take place. spandsp-0.0.6/ChangeLog0000664000175000017500000000533610665410102011664 0000000000000007.08.29 - 0.0.4 - Steve Underwood - 06.05.23 - 0.0.3 - Steve Underwood - T.38 now implemented, though it needs further polishing. - G.726 and G.722 now implemented. 04.08.29 - 0.0.2 - Steve Underwood - T.4 no longer uses libtiff for compresion and decompression on the line side (it is still used to handle the TIFF files). Spandsp no longer depends on accessing the "internals" of libtiff. New 1D and 2D compression and decompression code now handles the line side. This should be more robust than using libtiff, and handles the fudging of bad scan lines rather better. - T.30 line turn-around timing corrected. - T.30 DCS header contents corrected. - T.30 provision for V.17 added, as an option. - T.30 now has a statistics interface, for applications to find details about image transfers. - T.30 processing now correctly closes TIFF files are they have been sent. - FAX header line insertion is now supported for transmitted FAXes. - asynchronous serial processing now has a V.14 compatible rate adaption option. - V.8 modem negotiation module added. - OKI ADPCM now supports Dialogic compatible operation at 6k samples/second, as well as 8k samples/second, using its own sample rate converter. - message queuing added to ease things like T.31 handling - incomplete skeleton (still rather nasty, to be honest) T.31 processing. - incomplete skeleton of V.22bis added. There is probably quite a bit to do to get this complete and robust. It probably requires the T.31 processing be expanded to something more like V.250, so it doesn't just handle FAX. - Incomplete V.17 added (there could be an IBM patent related to the TCM part of V.17, but I think it has expired. Don't distribute binaries of spandsp built with V.17 enabled until this is resolved - and the modem is completed, of course :-) ). The current version transmits OK. It receives OK with the long training sequence, but the symbol and carrier syncing isn't good enough for robust receiving with the short training sequence. - A basic BER tester has been added. - The faster modems now have proper shutdown procedures, whether one is defined in the spec. or not. - The modems (except simple FSK) now have APIs to access performance information. - A common GUI (using FLTK) added for the modem tests. - A bit more documentation added. - Some API inconsistencies cleaned up. - The usual bundle of assorted buglet fixes and polishing. 04.04.29 - 0.0.1k - Steve Underwood - The first version which gives solid faxing for a large number of people. spandsp-0.0.6/configure0000775000175000017500000247225512343626376012054 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for spandsp 0.0.6. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1 test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" SHELL=${CONFIG_SHELL-/bin/sh} test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='spandsp' PACKAGE_TARNAME='spandsp' PACKAGE_VERSION='0.0.6' PACKAGE_STRING='spandsp 0.0.6' PACKAGE_BUGREPORT='' PACKAGE_URL='' ac_unique_file="src/tone_generate.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS INSERT_STDBOOL_HEADER INSERT_MATH_HEADER INSERT_TGMATH_HEADER INSERT_STDINT_HEADER INSERT_INTTYPES_HEADER SPANDSP_SUPPORT_V34 SPANDSP_SUPPORT_T85 SPANDSP_USE_EXPORT_CAPABILITY SPANDSP_MISALIGNED_ACCESS_FAILS SPANDSP_USE_FIXED_POINT TESTLIBS SIMLIBS COMP_VENDOR_LDFLAGS COMP_VENDOR_CFLAGS CPPFLAGS_FOR_BUILD CC_FOR_BUILD COND_AVX_FALSE COND_AVX_TRUE COND_SSE5_FALSE COND_SSE5_TRUE COND_SSE4A_FALSE COND_SSE4A_TRUE COND_SSE4_2_FALSE COND_SSE4_2_TRUE COND_SSE4_1_FALSE COND_SSE4_1_TRUE COND_SSSE3_FALSE COND_SSSE3_TRUE COND_SSE3_FALSE COND_SSE3_TRUE COND_SSE2_FALSE COND_SSE2_TRUE COND_SSE_FALSE COND_SSE_TRUE COND_MMX_FALSE COND_MMX_TRUE COND_TESTDATA_FALSE COND_TESTDATA_TRUE COND_TESTS_FALSE COND_TESTS_TRUE COND_DOC_FALSE COND_DOC_TRUE HAVE_FAX2TIFF HAVE_PBMTOG3 HAVE_SOX LIBOBJS CXXCPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL MANIFEST_TOOL RANLIB ac_ct_AR AR DLLTOOL OBJDUMP LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP SED LIBTOOL EGREP GREP CPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM SPANDSP_LT_AGE SPANDSP_LT_REVISION SPANDSP_LT_CURRENT target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_shared enable_static with_pic enable_fast_install with_gnu_ld with_sysroot enable_libtool_lock enable_doc enable_tests enable_test_data enable_mmx enable_sse enable_sse2 enable_sse3 enable_ssse3 enable_sse4_1 enable_sse4_2 enable_sse4a enable_sse5 enable_avx enable_fixed_point enable_builtin_tiff ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CPP CXXCPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures spandsp 0.0.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/spandsp] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of spandsp 0.0.6:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --enable-doc Build the documentation --enable-tests Build the test programs --enable-test-data Build TIFF test files for some ITU test images --enable-mmx Enable MMX support --enable-sse Enable SSE support --enable-sse2 Enable SSE2 support --enable-sse3 Enable SSE3 support --enable-ssse3 Enable SSSE3 support --enable-sse4-1 Enable SSE4.1 support --enable-sse4-2 Enable SSE4.2 support --enable-sse4a Enable SSE4A support --enable-sse5 Enable SSE5 support --enable-avx Enable AVX support --enable-fixed-point Enable fixed point support --enable-builtin-tiff build with builtin libtiff Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor CXXCPP C++ preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF spandsp configure 0.0.6 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func # ac_fn_cxx_try_cpp LINENO # ------------------------ # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_cpp # ac_fn_cxx_try_link LINENO # ------------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_link # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_cxx_check_header_mongrel LINENO HEADER VAR INCLUDES # --------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_cxx_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_cxx_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_cxx_check_header_mongrel cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by spandsp $as_me 0.0.6, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu SPANDSP_MAJOR_VERSION=0 SPANDSP_MINOR_VERSION=0 SPANDSP_MICRO_VERSION=6 SPANDSP_LT_CURRENT=2 SPANDSP_LT_REVISION=0 SPANDSP_LT_AGE=0 # =========================================================================== # http://autoconf-archive.cryp.to/ax_compiler_vendor.html # =========================================================================== # # SYNOPSIS # # AX_COMPILER_VENDOR # # DESCRIPTION # # Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, sun, # hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, microsoft, # watcom, etc. The vendor is returned in the cache variable # $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++. # # LAST MODIFICATION # # 2008-04-12 # # COPYLEFT # # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2008 Matteo Frigo # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Macro Archive. When you make and # distribute a modified version of the Autoconf Macro, you may extend this # special exception to the GPL to apply to your modified version as well. # AX_CHECK_REAL_FILE(FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # ------------------------------------------------------------------ # # Check for the existence of FILE, and make sure it is a real file or # directory, and not a symbolic link. # # AX_CHECK_REAL_FILE # AX_FIXED_POINT_MACHINE(MACHINE, [ACTION-IF-FIXED-POINT], [ACTION-IF-NOT-FIXED-POINT]) # ------------------------------------------------------------------------------------- # # Check if a specified machine type is a fixed point only machine. That is, if it lacks # fast floating point support. # # This is a simple lookup amongst machines known to the current autotools. So far we deal # with the embedded ARM, Blackfin, MIPS, TI DSP and XScale processors as things which lack # fast hardware floating point. # # Other candidates would be the small embedded Power PCs. # # AX_FIXED_POINT_MACHINE # AX_MISALIGNED_ACCESS_FAILS(MACHINE, [ACTION-IF-MISALIGNED-FAILS], [ACTION-IF-MISALIGNED-OK]) # ------------------------------------------------------------------------------------- # # Check if a specified machine type cannot handle misaligned data. That is, multi-byte data # types which are not properly aligned in memory fail. Many machines are happy to work with # misaligned data, but slowing down a bit. Other machines just won't tolerate such data. # # This is a simple lookup amongst machines known to the current autotools. So far we only deal # with the ARM and sparc. # A lookup is used, as many of the devices which cannot handled misaligned access are embedded # processors, for which the code normally be cross-compiled. # # MISALIGNED_ACCESS_FAILS # @synopsis AX_C99_FLEXIBLE_ARRAY # # Does the compiler support the 1999 ISO C Standard "struct hack". # @version 1.1 Mar 15 2004 # @author Erik de Castro Lopo # # Permission to use, copy, modify, distribute, and sell this file for any # purpose is hereby granted without fee, provided that the above copyright # and this permission notice appear in all copies. No representations are # made about the suitability of this software for any purpose. It is # provided "as is" without express or implied warranty. # AX_C99_FLEXIBLE_ARRAY # @synopsis AX_C99_FUNC_LRINT # # Check whether C99's lrint function is available. # @version 1.3 Feb 12 2002 # @author Erik de Castro Lopo # # Permission to use, copy, modify, distribute, and sell this file for any # purpose is hereby granted without fee, provided that the above copyright # and this permission notice appear in all copies. No representations are # made about the suitability of this software for any purpose. It is # provided "as is" without express or implied warranty. # # AX_C99_FUNC_LRINT # @synopsis AX_C99_FUNC_LRINTF # # Check whether C99's lrintf function is available. # @version 1.3 Feb 12 2002 # @author Erik de Castro Lopo # # Permission to use, copy, modify, distribute, and sell this file for any # purpose is hereby granted without fee, provided that the above copyright # and this permission notice appear in all copies. No representations are # made about the suitability of this software for any purpose. It is # provided "as is" without express or implied warranty. # # AX_C99_FUNC_LRINTF # @synopsis AX_C99_FUNC_LLRINT # # Check whether C99's llrint function is available. # @version 1.1 Sep 30 2002 # @author Erik de Castro Lopo # # Permission to use, copy, modify, distribute, and sell this file for any # purpose is hereby granted without fee, provided that the above copyright # and this permission notice appear in all copies. No representations are # made about the suitability of this software for any purpose. It is # provided "as is" without express or implied warranty. # # AX_C99_FUNC_LLRINT # @synopsis AX_C99_FUNC_LLRINTF # # Check whether C99's llrintf function is available. # @version 1.1 Sep 30 2002 # @author Erik de Castro Lopo # # Permission to use, copy, modify, distribute, and sell this file for any # purpose is hereby granted without fee, provided that the above copyright # and this permission notice appear in all copies. No representations are # made about the suitability of this software for any purpose. It is # provided "as is" without express or implied warranty. # # AX_C99_FUNC_LLRINTF # @synopsis AX_CHECK_EXPORT_CAPABILITY # # Does the compiler support the exporting of library symbols? # @version 1.0 Jan 31 2009 # @author Steve Underwood # # Permission to use, copy, modify, distribute, and sell this file for any # purpose is hereby granted without fee, provided that the above copyright # and this permission notice appear in all copies. No representations are # made about the suitability of this software for any purpose. It is # provided "as is" without express or implied warranty. # AX_CHECK_EXPORT_CAPABILITY # @synopsis AX_CHECK_ARM_NEON # # Does the machine support the ARM NEON instruction set? # @version 1.01 Feb 11 2013 # @author Steve Underwood # # Permission to use, copy, modify, distribute, and sell this file for any # purpose is hereby granted without fee, provided that the above copyright # and this permission notice appear in all copies. No representations are # made about the suitability of this software for any purpose. It is # provided "as is" without express or implied warranty. # AX_CHECK_ARM_NEON VERSION=$SPANDSP_MAJOR_VERSION.$SPANDSP_MINOR_VERSION.$SPANDSP_MICRO_VERSION PACKAGE=spandsp ac_aux_dir= for ac_dir in config "$srcdir"/config; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. ac_config_headers="$ac_config_headers src/config.h:config-h.in" am__api_version='1.13' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='spandsp' VERSION='0.0.6' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac #AC_CANONICAL_BUILD ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" if test $ac_cv_c_compiler_gnu = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 $as_echo_n "checking whether $CC needs -traditional... " >&6; } if ${ac_cv_prog_gcc_traditional+:} false; then : $as_echo_n "(cached) " >&6 else ac_pattern="Autoconf.*'x'" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TIOCGETP _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes else ac_cv_prog_gcc_traditional=no fi rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include Autoconf TCGETA _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "$ac_pattern" >/dev/null 2>&1; then : ac_cv_prog_gcc_traditional=yes fi rm -f conftest* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 $as_echo "$ac_cv_prog_gcc_traditional" >&6; } if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi case `pwd` in *\ * | *\ *) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.4.2' macro_revision='1.3337' ltmain="$ac_aux_dir/ltmain.sh" # Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 $as_echo_n "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "" } case "$ECHO" in printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 $as_echo "printf" >&6; } ;; print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 $as_echo "print -r" >&6; } ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 $as_echo "cat" >&6; } ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if ${ac_cv_path_SED+:} false; then : $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed { ac_script=; unset ac_script;} if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if ${ac_cv_path_FGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if ${lt_cv_path_NM+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else if test -n "$ac_tool_prefix"; then for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in dumpbin "link -dump" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:$LINENO: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if ${lt_cv_sys_max_cmd_len+:} false; then : $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 $as_echo_n "checking how to convert $build file names to $host format... " >&6; } if ${lt_cv_to_host_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac fi to_host_file_cmd=$lt_cv_to_host_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 $as_echo "$lt_cv_to_host_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 $as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } if ${lt_cv_to_tool_file_cmd+:} false; then : $as_echo_n "(cached) " >&6 else #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 $as_echo "$lt_cv_to_tool_file_cmd" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if ${lt_cv_ld_reload_flag+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in cygwin* | mingw* | pw32* | cegcc*) if test "$GCC" != yes; then reload_cmds=false fi ;; darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if ${lt_cv_deplibs_check_method+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi test -z "$DLLTOOL" && DLLTOOL=dlltool { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 $as_echo_n "checking how to associate runtime and link libraries... " >&6; } if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 $as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO if test -n "$ac_tool_prefix"; then for ac_prog in ar do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} : ${AR_FLAGS=cru} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 $as_echo_n "checking for archiver @FILE support... " >&6; } if ${lt_cv_ar_at_file+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 $as_echo "$lt_cv_ar_at_file" >&6; } if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if ${lt_cv_sys_global_symbol_pipe+:} false; then : $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 $as_echo "ok" >&6; } fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then nm_file_list_spec='@' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 $as_echo_n "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. if test "${with_sysroot+set}" = set; then : withval=$with_sysroot; else with_sysroot=no fi lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5 $as_echo "${with_sysroot}" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 $as_echo "${lt_sysroot:-no}" >&6; } # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then : enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line '$LINENO' "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if ${lt_cv_cc_needs_belf+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_cc_needs_belf=yes else lt_cv_cc_needs_belf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 $as_echo "$MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_MANIFEST_TOOL"; then ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 $as_echo "$ac_ct_MANIFEST_TOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then MANIFEST_TOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL fi else MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL" fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 $as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } if ${lt_cv_path_mainfest_tool+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&5 if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 $as_echo "$lt_cv_path_mainfest_tool" >&6; } if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_LIPO+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if ${lt_cv_apple_cc_single_mod+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&5 # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if ${lt_cv_ld_exported_symbols_list+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_ld_exported_symbols_list=yes else lt_cv_ld_exported_symbols_list=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 $as_echo_n "checking for -force_load linker flag... " >&6; } if ${lt_cv_ld_force_load+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 echo "$AR cru libconftest.a conftest.o" >&5 $AR cru libconftest.a conftest.o 2>&5 echo "$RANLIB libconftest.a" >&5 $RANLIB libconftest.a 2>&5 cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&5 elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&5 fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 $as_echo "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do : ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " if test "x$ac_cv_header_dlfcn_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DLFCN_H 1 _ACEOF fi done func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf # Set options enable_dlopen=no enable_win32_dll=no # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if ${lt_cv_objdir+:} false; then : $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if ${lt_cv_path_MAGIC_CMD+:} false; then : $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then case $cc_basename in nvcc*) lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; *) lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 lt_prog_compiler_wl='-Xlinker ' if test -n "$lt_prog_compiler_pic"; then lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; nagfor*) # NAG Fortran compiler lt_prog_compiler_wl='-Wl,-Wl,,' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; *Sun\ F* | *Sun*Fortran*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Intel*\ [CF]*Compiler*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; *Portland\ Group*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 $as_echo "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if ${lt_cv_prog_compiler_pic_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; *\ \(GNU\ Binutils\)\ [3-9]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' export_dynamic_flag_spec='${wl}--export-all-symbols' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; haiku*) archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs=yes ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath_+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath_ fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' fi archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported always_export_symbols=yes file_list_spec='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, )='true' enable_shared_with_static_runtimes=yes exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib old_postinstall_cmds='chmod 644 $oldlib' postlink_cmds='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' enable_shared_with_static_runtimes=yes ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec='' fi link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 $as_echo_n "checking if $CC understands -b... " >&6; } if ${lt_cv_prog_compiler__b+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler__b=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -b" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler__b=yes fi else lt_cv_prog_compiler__b=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 $as_echo "$lt_cv_prog_compiler__b" >&6; } if test x"$lt_cv_prog_compiler__b" = xyes; then archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 $as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } if ${lt_cv_irix_exported_symbol+:} false; then : $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : lt_cv_irix_exported_symbol=yes else lt_cv_irix_exported_symbol=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 $as_echo "$lt_cv_irix_exported_symbol" >&6; } if test "$lt_cv_irix_exported_symbol" = yes; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no else lt_cv_archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 $as_echo "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([A-Za-z]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" if test "x$ac_cv_func_shl_load" = xyes; then : lt_cv_dlopen="shl_load" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if ${ac_cv_lib_dld_shl_load+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_shl_load=yes else ac_cv_lib_dld_shl_load=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = xyes; then : lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" if test "x$ac_cv_func_dlopen" = xyes; then : lt_cv_dlopen="dlopen" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if ${ac_cv_lib_svld_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_svld_dlopen=yes else ac_cv_lib_svld_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = xyes; then : lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if ${ac_cv_lib_dld_dld_link+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dld_dld_link=yes else ac_cv_lib_dld_dld_link=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = xyes; then : lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if ${lt_cv_dlopen_self_static+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if ${ac_cv_prog_CXXCPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_cxx_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds reload_flag_CXX=$reload_flag reload_cmds_CXX=$reload_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then : withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if ${lt_cv_path_LD+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if ${lt_cv_prog_gnu_ld+:} false; then : $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec_CXX='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else if ${lt_cv_aix_libpath__CXX+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }' lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath__CXX"; then lt_cv_aix_libpath__CXX="/usr/lib:/lib" fi fi aix_libpath=$lt_cv_aix_libpath__CXX fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' fi archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec_CXX=' ' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=yes file_list_spec_CXX='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true' enable_shared_with_static_runtimes_CXX=yes # Don't use ranlib old_postinstall_cmds_CXX='chmod 644 $oldlib' postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' export_dynamic_flag_spec_CXX='${wl}--export-all-symbols' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; esac ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported if test "$lt_cv_ld_force_load" = "yes"; then whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' else whole_archive_flag_spec_CXX='' fi link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi else ld_shlibs_CXX=no fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; haiku*) archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' link_all_deplibs_CXX=yes ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5].* | *pgcpp\ [1-5].*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~ '"$old_archive_cmds_CXX" reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~ '"$reload_cmds_CXX" ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. lt_prog_compiler_static_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC* | bgxl[cC]* | mpixl[cC]*) # IBM XL 8.0, 9.0 on PPC and BlueGene lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if ${lt_cv_prog_compiler_pic_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; } lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if ${lt_cv_prog_compiler_static_works_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if ${lt_cv_prog_compiler_c_o_CXX+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname' ;; esac ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then : $as_echo_n "(cached) " >&6 else $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc_CXX=no else lt_cv_archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5 $as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; } archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX ;; esac fi ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[23].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[3-9]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH if ${lt_cv_shlibpath_overrides_runpath+:} false; then : $as_echo_n "(cached) " >&6 else lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : lt_cv_shlibpath_overrides_runpath=yes fi fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir fi shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink || test "$inherit_rpath_CXX" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_commands="$ac_config_commands libtool" # Only expand once: ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler vendor" >&5 $as_echo_n "checking for C compiler vendor... " >&6; } if ${ax_cv_c_compiler_vendor+:} false; then : $as_echo_n "(cached) " >&6 else ax_cv_c_compiler_vendor=unknown # note: don't check for gcc first since some other compilers define __GNUC__ for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #if !($vencpp) thisisanerror; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ax_cv_c_compiler_vendor=`echo $ventest | cut -d: -f1`; break fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_c_compiler_vendor" >&5 $as_echo "$ax_cv_c_compiler_vendor" >&6; } if test "${build}" != "${host}" then # If we are doing a Canadian Cross, in which the host and build systems # are not the same, we set reasonable default values for the tools. CC_FOR_BUILD=${CC_FOR_BUILD-gcc} CPPFLAGS_FOR_BUILD="\$(CPPFLAGS)" CC=${CC-${host_alias}-gcc} CFLAGS=${CFLAGS-"-g -O2"} CXX=${CXX-${host_alias}-c++} CXXFLAGS=${CXXFLAGS-"-g -O2"} else # Set reasonable default values for some tools even if not Canadian. # Of course, these are different reasonable default values, originally # specified directly in the Makefile. # We don't export, so that autoconf can do its job. # Note that all these settings are above the fragment inclusion point # in Makefile.in, so can still be overridden by fragments. # This is all going to change when we autoconfiscate... CC_FOR_BUILD="\$(CC)" CPPFLAGS_FOR_BUILD="\$(CPPFLAGS)" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi # We must set the default linker to the linker used by gcc for the correct # operation of libtool. If LD is not defined and we are using gcc, try to # set the LD default to the ld used by gcc. if test -z "$LD" then if test "$GCC" = yes then case $build in *-*-mingw*) gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;; *) gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;; esac case $gcc_prog_ld in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) LD="$gcc_prog_ld" ;; esac fi fi CXX=${CXX-"c++"} CFLAGS=${CFLAGS-"-g -O2"} CXXFLAGS=${CXXFLAGS-"-g -O2"} fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this sort of thing. */ char tx; char *t = &tx; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_const=yes else ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then $as_echo "#define const /**/" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working volatile" >&5 $as_echo_n "checking for working volatile... " >&6; } if ${ac_cv_c_volatile+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { volatile int x; int * volatile y = (int *) 0; return !x && !y; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_volatile=yes else ac_cv_c_volatile=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 $as_echo "$ac_cv_c_volatile" >&6; } if test $ac_cv_c_volatile = no; then $as_echo "#define volatile /**/" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "long long" "ac_cv_type_long_long" "$ac_includes_default" if test "x$ac_cv_type_long_long" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LONG_LONG 1 _ACEOF fi ac_fn_c_check_type "$LINENO" "long double" "ac_cv_type_long_double" "$ac_includes_default" if test "x$ac_cv_type_long_double" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LONG_DOUBLE 1 _ACEOF fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include int main () { return *(signal (0, 0)) (0) == 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_type_signal=int else ac_cv_type_signal=void fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 $as_echo "$ac_cv_type_signal" >&6; } cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF # Check whether --enable-doc was given. if test "${enable_doc+set}" = set; then : enableval=$enable_doc; fi # Check whether --enable-tests was given. if test "${enable_tests+set}" = set; then : enableval=$enable_tests; fi # Check whether --enable-test_data was given. if test "${enable_test_data+set}" = set; then : enableval=$enable_test_data; fi # Check whether --enable-mmx was given. if test "${enable_mmx+set}" = set; then : enableval=$enable_mmx; fi # Check whether --enable-sse was given. if test "${enable_sse+set}" = set; then : enableval=$enable_sse; fi # Check whether --enable-sse2 was given. if test "${enable_sse2+set}" = set; then : enableval=$enable_sse2; fi # Check whether --enable-sse3 was given. if test "${enable_sse3+set}" = set; then : enableval=$enable_sse3; fi # Check whether --enable-ssse3 was given. if test "${enable_ssse3+set}" = set; then : enableval=$enable_ssse3; fi # Check whether --enable-sse4_1 was given. if test "${enable_sse4_1+set}" = set; then : enableval=$enable_sse4_1; fi # Check whether --enable-sse4_2 was given. if test "${enable_sse4_2+set}" = set; then : enableval=$enable_sse4_2; fi # Check whether --enable-sse4a was given. if test "${enable_sse4a+set}" = set; then : enableval=$enable_sse4a; fi # Check whether --enable-sse5 was given. if test "${enable_sse5+set}" = set; then : enableval=$enable_sse5; fi # Check whether --enable-avx was given. if test "${enable_avx+set}" = set; then : enableval=$enable_avx; fi # Check whether --enable-fixed_point was given. if test "${enable_fixed_point+set}" = set; then : enableval=$enable_fixed_point; fi # The following is for MSVC, where we may be using a local copy of libtiff, built alongside spandsp # Check whether --enable-builtin_tiff was given. if test "${enable_builtin_tiff+set}" = set; then : enableval=$enable_builtin_tiff; enable_builtin_tiff="$enableval" else enable_builtin_tiff="no" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5 $as_echo_n "checking for error_at_line... " >&6; } if ${ac_cv_lib_error_at_line+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { error_at_line (0, 0, "", 0, "an error occurred"); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_error_at_line=yes else ac_cv_lib_error_at_line=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5 $as_echo "$ac_cv_lib_error_at_line" >&6; } if test $ac_cv_lib_error_at_line = no; then case " $LIBOBJS " in *" error.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS error.$ac_objext" ;; esac fi for ac_func in vprintf do : ac_fn_c_check_func "$LINENO" "vprintf" "ac_cv_func_vprintf" if test "x$ac_cv_func_vprintf" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VPRINTF 1 _ACEOF ac_fn_c_check_func "$LINENO" "_doprnt" "ac_cv_func__doprnt" if test "x$ac_cv_func__doprnt" = xyes; then : $as_echo "#define HAVE_DOPRNT 1" >>confdefs.h fi fi done for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } if ${ac_cv_func_malloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_malloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_malloc_0_nonnull=yes else ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then : $as_echo "#define HAVE_MALLOC 1" >>confdefs.h else $as_echo "#define HAVE_MALLOC 0" >>confdefs.h case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac $as_echo "#define malloc rpl_malloc" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 $as_echo_n "checking for working memcmp... " >&6; } if ${ac_cv_func_memcmp_working+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_memcmp_working=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* Some versions of memcmp are not 8-bit clean. */ char c0 = '\100', c1 = '\200', c2 = '\201'; if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) return 1; /* The Next x86 OpenStep bug shows up only when comparing 16 bytes or more and with at least one buffer not starting on a 4-byte boundary. William Lewis provided this test program. */ { char foo[21]; char bar[21]; int i; for (i = 0; i < 4; i++) { char *a = foo + i; char *b = bar + i; strcpy (a, "--------01111111"); strcpy (b, "--------10000000"); if (memcmp (a, b, 16) >= 0) return 1; } return 0; } ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_memcmp_working=yes else ac_cv_func_memcmp_working=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 $as_echo "$ac_cv_func_memcmp_working" >&6; } test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in *" memcmp.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" ;; esac for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 $as_echo_n "checking for GNU libc compatible realloc... " >&6; } if ${ac_cv_func_realloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_realloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *realloc (); #endif int main () { return ! realloc (0, 0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_realloc_0_nonnull=yes else ac_cv_func_realloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 $as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } if test $ac_cv_func_realloc_0_nonnull = yes; then : $as_echo "#define HAVE_REALLOC 1" >>confdefs.h else $as_echo "#define HAVE_REALLOC 0" >>confdefs.h case " $LIBOBJS " in *" realloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; esac $as_echo "#define realloc rpl_realloc" >>confdefs.h fi for ac_header in sys/select.h sys/socket.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking types of arguments for select" >&5 $as_echo_n "checking types of arguments for select... " >&6; } if ${ac_cv_func_select_args+:} false; then : $as_echo_n "(cached) " >&6 else for ac_arg234 in 'fd_set *' 'int *' 'void *'; do for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #ifdef HAVE_SYS_SELECT_H # include #endif #ifdef HAVE_SYS_SOCKET_H # include #endif int main () { extern int select ($ac_arg1, $ac_arg234, $ac_arg234, $ac_arg234, $ac_arg5); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_func_select_args="$ac_arg1,$ac_arg234,$ac_arg5"; break 3 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done done done # Provide a safe default value. : "${ac_cv_func_select_args=int,int *,struct timeval *}" fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5 $as_echo "$ac_cv_func_select_args" >&6; } ac_save_IFS=$IFS; IFS=',' set dummy `echo "$ac_cv_func_select_args" | sed 's/\*/\*/g'` IFS=$ac_save_IFS shift cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG1 $1 _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG234 ($2) _ACEOF cat >>confdefs.h <<_ACEOF #define SELECT_TYPE_ARG5 ($3) _ACEOF rm -f conftest* { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lrint" >&5 $as_echo_n "checking for lrint... " >&6; } if ${ac_cv_c99_lrint+:} false; then : $as_echo_n "(cached) " >&6 else lrint_save_LIBS=$LIBS LIBS="-lm" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _ISOC9X_SOURCE 1 #define _ISOC99_SOURCE 1 #define __USE_ISOC99 1 #define __USE_ISOC9X 1 #include int main () { if (!lrint(3.14159)) lrint(2.7183); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_c99_lrint=yes else ac_cv_c99_lrint=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$lrint_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c99_lrint" >&5 $as_echo "$ac_cv_c99_lrint" >&6; } if test "$ac_cv_c99_lrint" = yes; then $as_echo "#define HAVE_LRINT 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lrintf" >&5 $as_echo_n "checking for lrintf... " >&6; } if ${ac_cv_c99_lrintf+:} false; then : $as_echo_n "(cached) " >&6 else lrintf_save_LIBS=$LIBS LIBS="-lm" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _ISOC9X_SOURCE 1 #define _ISOC99_SOURCE 1 #define __USE_ISOC99 1 #define __USE_ISOC9X 1 #include int main () { if (!lrintf(3.14159)) lrintf(2.7183); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_c99_lrintf=yes else ac_cv_c99_lrintf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$lrintf_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c99_lrintf" >&5 $as_echo "$ac_cv_c99_lrintf" >&6; } if test "$ac_cv_c99_lrintf" = yes; then $as_echo "#define HAVE_LRINTF 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for llrint" >&5 $as_echo_n "checking for llrint... " >&6; } if ${ac_cv_c99_llrint+:} false; then : $as_echo_n "(cached) " >&6 else llrint_save_LIBS=$LIBS LIBS="-lm" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define ISOC9X_SOURCE 1 #define _ISOC99_SOURCE 1 #define __USE_ISOC99 1 #define __USE_ISOC9X 1 #include int main () { long long int x ; x = llrint(3.14159) ; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_c99_llrint=yes else ac_cv_c99_llrint=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$llrint_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c99_llrint" >&5 $as_echo "$ac_cv_c99_llrint" >&6; } if test "$ac_cv_c99_llrint" = yes; then $as_echo "#define HAVE_LLRINT 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for llrintf" >&5 $as_echo_n "checking for llrintf... " >&6; } if ${ac_cv_c99_llrintf+:} false; then : $as_echo_n "(cached) " >&6 else llrintf_save_LIBS=$LIBS LIBS="-lm" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _ISOC9X_SOURCE 1 #define _ISOC99_SOURCE 1 #define __USE_ISOC99 1 #define __USE_ISOC9X 1 #include int main () { long long int x ; x = llrintf(3.14159) ; ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_c99_llrintf=yes else ac_cv_c99_llrintf=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$llrintf_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c99_llrintf" >&5 $as_echo "$ac_cv_c99_llrintf" >&6; } if test "$ac_cv_c99_llrintf" = yes; then $as_echo "#define HAVE_LLRINTF 1" >>confdefs.h fi if test "x$ac_cv_c99_lrint" = "xno" ; then if test "x$ac_cv_c99_lrintf" = "xno" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** Missing C99 standard functions lrint() and lrintf()." >&5 $as_echo "$as_me: WARNING: *** Missing C99 standard functions lrint() and lrintf()." >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** This may cause benign compiler warnings on some systems (ie Solaris)." >&5 $as_echo "$as_me: WARNING: *** This may cause benign compiler warnings on some systems (ie Solaris)." >&2;} fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if have C99 struct flexible array support" >&5 $as_echo_n "checking if have C99 struct flexible array support... " >&6; } if ${ac_cv_c99_flexible_array+:} false; then : $as_echo_n "(cached) " >&6 else # Initialize to unknown ac_cv_c99_flexible_array=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include typedef struct { int k; char buffer [] ; } MY_STRUCT ; int main () { MY_STRUCT *p = calloc (1, sizeof (MY_STRUCT) + 42); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_c99_flexible_array=yes else ac_cv_c99_flexible_array=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c99_flexible_array" >&5 $as_echo "$ac_cv_c99_flexible_array" >&6; } for ac_func in memmove do : ac_fn_c_check_func "$LINENO" "memmove" "ac_cv_func_memmove" if test "x$ac_cv_func_memmove" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MEMMOVE 1 _ACEOF fi done for ac_func in memset do : ac_fn_c_check_func "$LINENO" "memset" "ac_cv_func_memset" if test "x$ac_cv_func_memset" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MEMSET 1 _ACEOF fi done for ac_func in select do : ac_fn_c_check_func "$LINENO" "select" "ac_cv_func_select" if test "x$ac_cv_func_select" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SELECT 1 _ACEOF fi done for ac_func in strcasecmp do : ac_fn_c_check_func "$LINENO" "strcasecmp" "ac_cv_func_strcasecmp" if test "x$ac_cv_func_strcasecmp" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRCASECMP 1 _ACEOF fi done for ac_func in strchr do : ac_fn_c_check_func "$LINENO" "strchr" "ac_cv_func_strchr" if test "x$ac_cv_func_strchr" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRCHR 1 _ACEOF fi done for ac_func in strdup do : ac_fn_c_check_func "$LINENO" "strdup" "ac_cv_func_strdup" if test "x$ac_cv_func_strdup" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRDUP 1 _ACEOF fi done for ac_func in strerror do : ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" if test "x$ac_cv_func_strerror" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRERROR 1 _ACEOF fi done for ac_func in strstr do : ac_fn_c_check_func "$LINENO" "strstr" "ac_cv_func_strstr" if test "x$ac_cv_func_strstr" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRSTR 1 _ACEOF fi done for ac_func in strtol do : ac_fn_c_check_func "$LINENO" "strtol" "ac_cv_func_strtol" if test "x$ac_cv_func_strtol" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRTOL 1 _ACEOF fi done for ac_func in gettimeofday do : ac_fn_c_check_func "$LINENO" "gettimeofday" "ac_cv_func_gettimeofday" if test "x$ac_cv_func_gettimeofday" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GETTIMEOFDAY 1 _ACEOF fi done for ac_func in drand48 do : ac_fn_c_check_func "$LINENO" "drand48" "ac_cv_func_drand48" if test "x$ac_cv_func_drand48" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_DRAND48 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if ${ac_cv_header_sys_wait_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_sys_wait_h=yes else ac_cv_header_sys_wait_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 $as_echo "$ac_cv_header_sys_wait_h" >&6; } if test $ac_cv_header_sys_wait_h = yes; then $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi # Check for header files. for ac_header in socket.h do : ac_fn_c_check_header_mongrel "$LINENO" "socket.h" "ac_cv_header_socket_h" "$ac_includes_default" if test "x$ac_cv_header_socket_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SOCKET_H 1 _ACEOF fi done for ac_header in inttypes.h do : ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default" if test "x$ac_cv_header_inttypes_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_INTTYPES_H 1 _ACEOF INSERT_INTTYPES_HEADER="#include " fi done for ac_header in stdint.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default" if test "x$ac_cv_header_stdint_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDINT_H 1 _ACEOF INSERT_STDINT_HEADER="#include " fi done for ac_header in stdatomic.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdatomic.h" "ac_cv_header_stdatomic_h" "$ac_includes_default" if test "x$ac_cv_header_stdatomic_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDATOMIC_H 1 _ACEOF fi done for ac_header in stdbool.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdbool.h" "ac_cv_header_stdbool_h" "$ac_includes_default" if test "x$ac_cv_header_stdbool_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDBOOL_H 1 _ACEOF INSERT_STDBOOL_HEADER="#include " else INSERT_STDBOOL_HEADER="#include " fi done for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNISTD_H 1 _ACEOF fi done for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done for ac_header in string.h do : ac_fn_c_check_header_mongrel "$LINENO" "string.h" "ac_cv_header_string_h" "$ac_includes_default" if test "x$ac_cv_header_string_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRING_H 1 _ACEOF fi done for ac_header in strings.h do : ac_fn_c_check_header_mongrel "$LINENO" "strings.h" "ac_cv_header_strings_h" "$ac_includes_default" if test "x$ac_cv_header_strings_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STRINGS_H 1 _ACEOF fi done for ac_header in malloc.h do : ac_fn_c_check_header_mongrel "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default" if test "x$ac_cv_header_malloc_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MALLOC_H 1 _ACEOF fi done for ac_header in tgmath.h do : ac_fn_c_check_header_mongrel "$LINENO" "tgmath.h" "ac_cv_header_tgmath_h" "$ac_includes_default" if test "x$ac_cv_header_tgmath_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_TGMATH_H 1 _ACEOF INSERT_TGMATH_HEADER="#include " fi done for ac_header in math.h do : ac_fn_c_check_header_mongrel "$LINENO" "math.h" "ac_cv_header_math_h" "$ac_includes_default" if test "x$ac_cv_header_math_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MATH_H 1 _ACEOF INSERT_MATH_HEADER="#include " fi done for ac_header in float.h do : ac_fn_c_check_header_mongrel "$LINENO" "float.h" "ac_cv_header_float_h" "$ac_includes_default" if test "x$ac_cv_header_float_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FLOAT_H 1 _ACEOF fi done for ac_header in fcntl.h do : ac_fn_c_check_header_mongrel "$LINENO" "fcntl.h" "ac_cv_header_fcntl_h" "$ac_includes_default" if test "x$ac_cv_header_fcntl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FCNTL_H 1 _ACEOF fi done for ac_header in sys/time.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default" if test "x$ac_cv_header_sys_time_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_TIME_H 1 _ACEOF fi done for ac_header in sys/select.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/select.h" "ac_cv_header_sys_select_h" "$ac_includes_default" if test "x$ac_cv_header_sys_select_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_SELECT_H 1 _ACEOF fi done for ac_header in sys/ioctl.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/ioctl.h" "ac_cv_header_sys_ioctl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_ioctl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_IOCTL_H 1 _ACEOF fi done for ac_header in sys/fcntl.h do : ac_fn_c_check_header_mongrel "$LINENO" "sys/fcntl.h" "ac_cv_header_sys_fcntl_h" "$ac_includes_default" if test "x$ac_cv_header_sys_fcntl_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SYS_FCNTL_H 1 _ACEOF fi done for ac_header in sndfile.h do : ac_fn_c_check_header_mongrel "$LINENO" "sndfile.h" "ac_cv_header_sndfile_h" "$ac_includes_default" if test "x$ac_cv_header_sndfile_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SNDFILE_H 1 _ACEOF fi done for ac_header in fenv.h do : ac_fn_c_check_header_mongrel "$LINENO" "fenv.h" "ac_cv_header_fenv_h" "$ac_includes_default" if test "x$ac_cv_header_fenv_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FENV_H 1 _ACEOF fi done for ac_header in fftw3.h do : ac_fn_c_check_header_mongrel "$LINENO" "fftw3.h" "ac_cv_header_fftw3_h" "$ac_includes_default" if test "x$ac_cv_header_fftw3_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FFTW3_H 1 _ACEOF else for ac_header in fftw.h do : ac_fn_c_check_header_mongrel "$LINENO" "fftw.h" "ac_cv_header_fftw_h" "$ac_includes_default" if test "x$ac_cv_header_fftw_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FFTW_H 1 _ACEOF fi done fi done for ac_header in pcap.h do : ac_fn_c_check_header_mongrel "$LINENO" "pcap.h" "ac_cv_header_pcap_h" "$ac_includes_default" if test "x$ac_cv_header_pcap_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PCAP_H 1 _ACEOF fi done for ac_header in pthread.h do : ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" if test "x$ac_cv_header_pthread_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PTHREAD_H 1 _ACEOF fi done if test "${build}" == "${host}" then for ac_header in X11/X.h do : ac_fn_c_check_header_mongrel "$LINENO" "X11/X.h" "ac_cv_header_X11_X_h" "$ac_includes_default" if test "x$ac_cv_header_X11_X_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_X11_X_H 1 _ACEOF fi done fi # Determine XML2 include path { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml/xmlmemory.h" >&5 $as_echo_n "checking for libxml/xmlmemory.h... " >&6; } # Can we include headers using system include dirs? cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : XML2_INCLUDE=" " else XML2_INCLUDE= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Hunt through several possible directories to find the includes for libxml2 if test "x$XML2_INCLUDE" = "x"; then old_CPPFLAGS="$CPPFLAGS" for i in $xml2_include_dir /usr/include /usr/local/include /usr/include/libxml2 /usr/local/include/libxml2 ; do CPPFLAGS="$old_CPPFLAGS -I$i" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { int a = 1; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : XML2_INCLUDE="-I$i" else XML2_INCLUDE= fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test "x$XML2_INCLUDE" != "x"; then break; fi done CPPFLAGS="$old_CPPFLAGS $XML2_INCLUDE" fi for ac_header in libxml/xmlmemory.h do : ac_fn_c_check_header_mongrel "$LINENO" "libxml/xmlmemory.h" "ac_cv_header_libxml_xmlmemory_h" "$ac_includes_default" if test "x$ac_cv_header_libxml_xmlmemory_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXML_XMLMEMORY_H 1 _ACEOF fi done for ac_header in libxml/parser.h do : ac_fn_c_check_header_mongrel "$LINENO" "libxml/parser.h" "ac_cv_header_libxml_parser_h" "$ac_includes_default" if test "x$ac_cv_header_libxml_parser_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXML_PARSER_H 1 _ACEOF fi done for ac_header in libxml/xinclude.h do : ac_fn_c_check_header_mongrel "$LINENO" "libxml/xinclude.h" "ac_cv_header_libxml_xinclude_h" "$ac_includes_default" if test "x$ac_cv_header_libxml_xinclude_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXML_XINCLUDE_H 1 _ACEOF fi done ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu for ac_header in FL/Fl.H do : ac_fn_cxx_check_header_mongrel "$LINENO" "FL/Fl.H" "ac_cv_header_FL_Fl_H" "$ac_includes_default" if test "x$ac_cv_header_FL_Fl_H" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FL_FL_H 1 _ACEOF fi done for ac_header in FL/Fl_Overlay_Window.H do : ac_fn_cxx_check_header_mongrel "$LINENO" "FL/Fl_Overlay_Window.H" "ac_cv_header_FL_Fl_Overlay_Window_H" "$ac_includes_default" if test "x$ac_cv_header_FL_Fl_Overlay_Window_H" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FL_FL_OVERLAY_WINDOW_H 1 _ACEOF fi done for ac_header in FL/Fl_Light_Button.H do : ac_fn_cxx_check_header_mongrel "$LINENO" "FL/Fl_Light_Button.H" "ac_cv_header_FL_Fl_Light_Button_H" "$ac_includes_default" if test "x$ac_cv_header_FL_Fl_Light_Button_H" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FL_FL_LIGHT_BUTTON_H 1 _ACEOF fi done for ac_header in FL/fl_draw.H do : ac_fn_cxx_check_header_mongrel "$LINENO" "FL/fl_draw.H" "ac_cv_header_FL_fl_draw_H" "$ac_includes_default" if test "x$ac_cv_header_FL_fl_draw_H" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FL_FL_DRAW_H 1 _ACEOF fi done for ac_header in FL/Fl_Cartesian.H do : ac_fn_cxx_check_header_mongrel "$LINENO" "FL/Fl_Cartesian.H" "ac_cv_header_FL_Fl_Cartesian_H" "$ac_includes_default" if test "x$ac_cv_header_FL_Fl_Cartesian_H" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FL_FL_CARTESIAN_H 1 _ACEOF fi done for ac_header in FL/Fl_Audio_Meter.H do : ac_fn_cxx_check_header_mongrel "$LINENO" "FL/Fl_Audio_Meter.H" "ac_cv_header_FL_Fl_Audio_Meter_H" "$ac_includes_default" if test "x$ac_cv_header_FL_Fl_Audio_Meter_H" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_FL_FL_AUDIO_METER_H 1 _ACEOF fi done ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "${build}" == "${host}" then case "${host}" in x86_64-*) # X86_64 Linux machines may have both 64 bit and 32 bit libraries. We need to choose the right set as_ac_RealFile=`$as_echo "ac_cv_real_file_${prefix}/lib64" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${prefix}/lib64" >&5 $as_echo_n "checking for ${prefix}/lib64... " >&6; } if eval \${$as_ac_RealFile+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "${prefix}/lib64" then if test -h "${prefix}/lib64" then eval "$as_ac_RealFile=no" else eval "$as_ac_RealFile=yes" fi else eval "$as_ac_RealFile=no" fi fi eval ac_res=\$$as_ac_RealFile { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test `eval 'as_val=${'$as_ac_RealFile'};$as_echo "$as_val"'` = yes; then : libdir='${exec_prefix}/lib64' fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/X11R6/lib64" >&5 $as_echo_n "checking for /usr/X11R6/lib64... " >&6; } if ${ac_cv_real_file__usr_X11R6_lib64+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/X11R6/lib64" then if test -h "/usr/X11R6/lib64" then ac_cv_real_file__usr_X11R6_lib64=no else ac_cv_real_file__usr_X11R6_lib64=yes fi else ac_cv_real_file__usr_X11R6_lib64=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_real_file__usr_X11R6_lib64" >&5 $as_echo "$ac_cv_real_file__usr_X11R6_lib64" >&6; } if test $ac_cv_real_file__usr_X11R6_lib64 = yes; then : TESTLIBS="$TESTLIBS -L/usr/X11R6/lib64" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for /usr/X11R6/lib" >&5 $as_echo_n "checking for /usr/X11R6/lib... " >&6; } if ${ac_cv_file__usr_X11R6_lib+:} false; then : $as_echo_n "(cached) " >&6 else test "$cross_compiling" = yes && as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5 if test -r "/usr/X11R6/lib"; then ac_cv_file__usr_X11R6_lib=yes else ac_cv_file__usr_X11R6_lib=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_file__usr_X11R6_lib" >&5 $as_echo "$ac_cv_file__usr_X11R6_lib" >&6; } if test "x$ac_cv_file__usr_X11R6_lib" = xyes; then : TESTLIBS="$TESTLIBS -L/usr/X11R6/lib" fi fi # The very oldest AMD 64 bit chips support SSE2, SSE and MMX enable_sse2="yes" ;; esac fi #AC_DEFINE([SPANDSP_SUPPORT_T85], [0], [Support T.85 JBIG compression]) SPANDSP_SUPPORT_T85="#undef SPANDSP_SUPPORT_T85" #AC_DEFINE([SPANDSP_SUPPORT_V34], [0], [Support the V.34 FAX modem]) SPANDSP_SUPPORT_V34="#undef SPANDSP_SUPPORT_V34" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 $as_echo_n "checking for cos in -lm... " >&6; } if ${ac_cv_lib_m_cos+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cos (); int main () { return cos (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_cos=yes else ac_cv_lib_m_cos=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 $as_echo "$ac_cv_lib_m_cos" >&6; } if test "x$ac_cv_lib_m_cos" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" fi # Some platforms still seem to lack the basic single precision trig and power related function. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing sinf" >&5 $as_echo_n "checking for library containing sinf... " >&6; } if ${ac_cv_search_sinf+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sinf (); int main () { return sinf (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_sinf=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_sinf+:} false; then : break fi done if ${ac_cv_search_sinf+:} false; then : else ac_cv_search_sinf=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_sinf" >&5 $as_echo "$ac_cv_search_sinf" >&6; } ac_res=$ac_cv_search_sinf if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_SINF 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing cosf" >&5 $as_echo_n "checking for library containing cosf... " >&6; } if ${ac_cv_search_cosf+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cosf (); int main () { return cosf (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_cosf=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_cosf+:} false; then : break fi done if ${ac_cv_search_cosf+:} false; then : else ac_cv_search_cosf=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_cosf" >&5 $as_echo "$ac_cv_search_cosf" >&6; } ac_res=$ac_cv_search_cosf if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_COSF 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing tanf" >&5 $as_echo_n "checking for library containing tanf... " >&6; } if ${ac_cv_search_tanf+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char tanf (); int main () { return tanf (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_tanf=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_tanf+:} false; then : break fi done if ${ac_cv_search_tanf+:} false; then : else ac_cv_search_tanf=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_tanf" >&5 $as_echo "$ac_cv_search_tanf" >&6; } ac_res=$ac_cv_search_tanf if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_TANF 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing asinf" >&5 $as_echo_n "checking for library containing asinf... " >&6; } if ${ac_cv_search_asinf+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char asinf (); int main () { return asinf (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_asinf=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_asinf+:} false; then : break fi done if ${ac_cv_search_asinf+:} false; then : else ac_cv_search_asinf=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_asinf" >&5 $as_echo "$ac_cv_search_asinf" >&6; } ac_res=$ac_cv_search_asinf if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_ASINF 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing acosf" >&5 $as_echo_n "checking for library containing acosf... " >&6; } if ${ac_cv_search_acosf+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char acosf (); int main () { return acosf (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_acosf=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_acosf+:} false; then : break fi done if ${ac_cv_search_acosf+:} false; then : else ac_cv_search_acosf=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_acosf" >&5 $as_echo "$ac_cv_search_acosf" >&6; } ac_res=$ac_cv_search_acosf if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_ACOSF 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing atanf" >&5 $as_echo_n "checking for library containing atanf... " >&6; } if ${ac_cv_search_atanf+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char atanf (); int main () { return atanf (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_atanf=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_atanf+:} false; then : break fi done if ${ac_cv_search_atanf+:} false; then : else ac_cv_search_atanf=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_atanf" >&5 $as_echo "$ac_cv_search_atanf" >&6; } ac_res=$ac_cv_search_atanf if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_ATANF 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing atan2f" >&5 $as_echo_n "checking for library containing atan2f... " >&6; } if ${ac_cv_search_atan2f+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char atan2f (); int main () { return atan2f (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_atan2f=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_atan2f+:} false; then : break fi done if ${ac_cv_search_atan2f+:} false; then : else ac_cv_search_atan2f=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_atan2f" >&5 $as_echo "$ac_cv_search_atan2f" >&6; } ac_res=$ac_cv_search_atan2f if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_ATAN2F 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ceilf" >&5 $as_echo_n "checking for library containing ceilf... " >&6; } if ${ac_cv_search_ceilf+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ceilf (); int main () { return ceilf (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_ceilf=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_ceilf+:} false; then : break fi done if ${ac_cv_search_ceilf+:} false; then : else ac_cv_search_ceilf=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ceilf" >&5 $as_echo "$ac_cv_search_ceilf" >&6; } ac_res=$ac_cv_search_ceilf if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_CEILF 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing floorf" >&5 $as_echo_n "checking for library containing floorf... " >&6; } if ${ac_cv_search_floorf+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char floorf (); int main () { return floorf (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_floorf=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_floorf+:} false; then : break fi done if ${ac_cv_search_floorf+:} false; then : else ac_cv_search_floorf=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_floorf" >&5 $as_echo "$ac_cv_search_floorf" >&6; } ac_res=$ac_cv_search_floorf if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_FLOORF 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing powf" >&5 $as_echo_n "checking for library containing powf... " >&6; } if ${ac_cv_search_powf+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char powf (); int main () { return powf (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_powf=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_powf+:} false; then : break fi done if ${ac_cv_search_powf+:} false; then : else ac_cv_search_powf=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_powf" >&5 $as_echo "$ac_cv_search_powf" >&6; } ac_res=$ac_cv_search_powf if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_POWF 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing expf" >&5 $as_echo_n "checking for library containing expf... " >&6; } if ${ac_cv_search_expf+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char expf (); int main () { return expf (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_expf=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_expf+:} false; then : break fi done if ${ac_cv_search_expf+:} false; then : else ac_cv_search_expf=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_expf" >&5 $as_echo "$ac_cv_search_expf" >&6; } ac_res=$ac_cv_search_expf if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_EXPF 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing logf" >&5 $as_echo_n "checking for library containing logf... " >&6; } if ${ac_cv_search_logf+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char logf (); int main () { return logf (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_logf=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_logf+:} false; then : break fi done if ${ac_cv_search_logf+:} false; then : else ac_cv_search_logf=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_logf" >&5 $as_echo "$ac_cv_search_logf" >&6; } ac_res=$ac_cv_search_logf if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_LOGF 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing log10f" >&5 $as_echo_n "checking for library containing log10f... " >&6; } if ${ac_cv_search_log10f+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char log10f (); int main () { return log10f (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_log10f=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_log10f+:} false; then : break fi done if ${ac_cv_search_log10f+:} false; then : else ac_cv_search_log10f=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_log10f" >&5 $as_echo "$ac_cv_search_log10f" >&6; } ac_res=$ac_cv_search_log10f if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_LOG10F 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing open_memstream" >&5 $as_echo_n "checking for library containing open_memstream... " >&6; } if ${ac_cv_search_open_memstream+:} false; then : $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char open_memstream (); int main () { return open_memstream (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO"; then : ac_cv_search_open_memstream=$ac_res fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext if ${ac_cv_search_open_memstream+:} false; then : break fi done if ${ac_cv_search_open_memstream+:} false; then : else ac_cv_search_open_memstream=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_open_memstream" >&5 $as_echo "$ac_cv_search_open_memstream" >&6; } ac_res=$ac_cv_search_open_memstream if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" $as_echo "#define HAVE_OPEN_MEMSTREAM 1" >>confdefs.h fi if test -n "$enable_tests" ; then # Extract the first word of "sox", so it can be a program name with args. set dummy sox; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_SOX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_SOX"; then ac_cv_prog_HAVE_SOX="$HAVE_SOX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_SOX="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi HAVE_SOX=$ac_cv_prog_HAVE_SOX if test -n "$HAVE_SOX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_SOX" >&5 $as_echo "$HAVE_SOX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$HAVE_SOX" != "xyes" ; then as_fn_error $? "\"Cannot make tests without sox installed\"" "$LINENO" 5 fi # Extract the first word of "pbmtog3", so it can be a program name with args. set dummy pbmtog3; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_PBMTOG3+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_PBMTOG3"; then ac_cv_prog_HAVE_PBMTOG3="$HAVE_PBMTOG3" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_PBMTOG3="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi HAVE_PBMTOG3=$ac_cv_prog_HAVE_PBMTOG3 if test -n "$HAVE_PBMTOG3"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_PBMTOG3" >&5 $as_echo "$HAVE_PBMTOG3" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$HAVE_PBMTOG3" != "xyes" ; then as_fn_error $? "\"Cannot make tests without pbmtog3 installed (does your system require a netpbm-progs package?)\"" "$LINENO" 5 fi # Extract the first word of "fax2tiff", so it can be a program name with args. set dummy fax2tiff; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_HAVE_FAX2TIFF+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$HAVE_FAX2TIFF"; then ac_cv_prog_HAVE_FAX2TIFF="$HAVE_FAX2TIFF" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_HAVE_FAX2TIFF="yes" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi HAVE_FAX2TIFF=$ac_cv_prog_HAVE_FAX2TIFF if test -n "$HAVE_FAX2TIFF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_FAX2TIFF" >&5 $as_echo "$HAVE_FAX2TIFF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$HAVE_FAX2TIFF" != "xyes" ; then as_fn_error $? "\"Cannot make tests without fax2tiff installed (does your system require a libtiff-tools package?)\"" "$LINENO" 5 fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Checks for libraries. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sf_open in -lsndfile" >&5 $as_echo_n "checking for sf_open in -lsndfile... " >&6; } if ${ac_cv_lib_sndfile_sf_open+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsndfile $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sf_open (); int main () { return sf_open (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_sndfile_sf_open=yes else ac_cv_lib_sndfile_sf_open=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sndfile_sf_open" >&5 $as_echo "$ac_cv_lib_sndfile_sf_open" >&6; } if test "x$ac_cv_lib_sndfile_sf_open" = xyes; then : SIMLIBS="$SIMLIBS -lsndfile" else as_fn_error $? "\"Cannot make tests without libsndfile (does your system require a libsndfile-devel package?)\"" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftw_plan_dft_1d in -lfftw3" >&5 $as_echo_n "checking for fftw_plan_dft_1d in -lfftw3... " >&6; } if ${ac_cv_lib_fftw3_fftw_plan_dft_1d+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfftw3 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fftw_plan_dft_1d (); int main () { return fftw_plan_dft_1d (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fftw3_fftw_plan_dft_1d=yes else ac_cv_lib_fftw3_fftw_plan_dft_1d=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fftw3_fftw_plan_dft_1d" >&5 $as_echo "$ac_cv_lib_fftw3_fftw_plan_dft_1d" >&6; } if test "x$ac_cv_lib_fftw3_fftw_plan_dft_1d" = xyes; then : SIMLIBS="$SIMLIBS -lfftw3" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fftw_create_plan in -lfftw" >&5 $as_echo_n "checking for fftw_create_plan in -lfftw... " >&6; } if ${ac_cv_lib_fftw_fftw_create_plan+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfftw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char fftw_create_plan (); int main () { return fftw_create_plan (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_fftw_fftw_create_plan=yes else ac_cv_lib_fftw_fftw_create_plan=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fftw_fftw_create_plan" >&5 $as_echo "$ac_cv_lib_fftw_fftw_create_plan" >&6; } if test "x$ac_cv_lib_fftw_fftw_create_plan" = xyes; then : SIMLIBS="$SIMLIBS -lfftw" else as_fn_error $? "\"Cannot make tests without FFTW 2 or 3 (does your system require an fftw?-devel package?)\"" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for xmlParseFile in -lxml2" >&5 $as_echo_n "checking for xmlParseFile in -lxml2... " >&6; } if ${ac_cv_lib_xml2_xmlParseFile+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lxml2 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char xmlParseFile (); int main () { return xmlParseFile (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_xml2_xmlParseFile=yes else ac_cv_lib_xml2_xmlParseFile=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xml2_xmlParseFile" >&5 $as_echo "$ac_cv_lib_xml2_xmlParseFile" >&6; } if test "x$ac_cv_lib_xml2_xmlParseFile" = xyes; then : TESTLIBS="$TESTLIBS -lxml2" else as_fn_error $? "\"Cannot make tests without libxml2 (does your system require a libxml2-devel package?)\"" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcap_open_offline in -lpcap" >&5 $as_echo_n "checking for pcap_open_offline in -lpcap... " >&6; } if ${ac_cv_lib_pcap_pcap_open_offline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpcap $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pcap_open_offline (); int main () { return pcap_open_offline (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pcap_pcap_open_offline=yes else ac_cv_lib_pcap_pcap_open_offline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcap_pcap_open_offline" >&5 $as_echo "$ac_cv_lib_pcap_pcap_open_offline" >&6; } if test "x$ac_cv_lib_pcap_pcap_open_offline" = xyes; then : TESTLIBS="$TESTLIBS -lpcap" else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcap_open_offline in -lwpcap" >&5 $as_echo_n "checking for pcap_open_offline in -lwpcap... " >&6; } if ${ac_cv_lib_wpcap_pcap_open_offline+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lwpcap $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pcap_open_offline (); int main () { return pcap_open_offline (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_wpcap_pcap_open_offline=yes else ac_cv_lib_wpcap_pcap_open_offline=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wpcap_pcap_open_offline" >&5 $as_echo "$ac_cv_lib_wpcap_pcap_open_offline" >&6; } if test "x$ac_cv_lib_wpcap_pcap_open_offline" = xyes; then : TESTLIBS="$TESTLIBS -lwpcap" else as_fn_error $? "\"Cannot make tests without libpcap (does your system require an libpcap-devel package?)\"" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_attr_init in -lpthread" >&5 $as_echo_n "checking for pthread_attr_init in -lpthread... " >&6; } if ${ac_cv_lib_pthread_pthread_attr_init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_attr_init (); int main () { return pthread_attr_init (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_pthread_pthread_attr_init=yes else ac_cv_lib_pthread_pthread_attr_init=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_attr_init" >&5 $as_echo "$ac_cv_lib_pthread_pthread_attr_init" >&6; } if test "x$ac_cv_lib_pthread_pthread_attr_init" = xyes; then : TESTLIBS="$TESTLIBS -lpthread" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_dl_dlopen=yes else ac_cv_lib_dl_dlopen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = xyes; then : TESTLIBS="$TESTLIBS -ldl" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XftFontOpen in -lXft" >&5 $as_echo_n "checking for XftFontOpen in -lXft... " >&6; } if ${ac_cv_lib_Xft_XftFontOpen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXft $TESTLIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XftFontOpen (); int main () { return XftFontOpen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xft_XftFontOpen=yes else ac_cv_lib_Xft_XftFontOpen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xft_XftFontOpen" >&5 $as_echo "$ac_cv_lib_Xft_XftFontOpen" >&6; } if test "x$ac_cv_lib_Xft_XftFontOpen" = xyes; then : TESTLIBS="$TESTLIBS -lXft" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XextCreateExtension in -lXext" >&5 $as_echo_n "checking for XextCreateExtension in -lXext... " >&6; } if ${ac_cv_lib_Xext_XextCreateExtension+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $TESTLIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XextCreateExtension (); int main () { return XextCreateExtension (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xext_XextCreateExtension=yes else ac_cv_lib_Xext_XextCreateExtension=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XextCreateExtension" >&5 $as_echo "$ac_cv_lib_Xext_XextCreateExtension" >&6; } if test "x$ac_cv_lib_Xext_XextCreateExtension" = xyes; then : TESTLIBS="$TESTLIBS -lXext" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XOpenDisplay in -lX11" >&5 $as_echo_n "checking for XOpenDisplay in -lX11... " >&6; } if ${ac_cv_lib_X11_XOpenDisplay+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 $TESTLIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_X11_XOpenDisplay=yes else ac_cv_lib_X11_XOpenDisplay=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XOpenDisplay" >&5 $as_echo "$ac_cv_lib_X11_XOpenDisplay" >&6; } if test "x$ac_cv_lib_X11_XOpenDisplay" = xyes; then : TESTLIBS="$TESTLIBS -lX11" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lfltk" >&5 $as_echo_n "checking for main in -lfltk... " >&6; } if ${ac_cv_lib_fltk_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfltk $TESTLIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_fltk_main=yes else ac_cv_lib_fltk_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fltk_main" >&5 $as_echo "$ac_cv_lib_fltk_main" >&6; } if test "x$ac_cv_lib_fltk_main" = xyes; then : TESTLIBS="$TESTLIBS -lfltk -lsupc++" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lfltk_cartesian" >&5 $as_echo_n "checking for main in -lfltk_cartesian... " >&6; } if ${ac_cv_lib_fltk_cartesian_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfltk_cartesian $TESTLIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_fltk_cartesian_main=yes else ac_cv_lib_fltk_cartesian_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fltk_cartesian_main" >&5 $as_echo "$ac_cv_lib_fltk_cartesian_main" >&6; } if test "x$ac_cv_lib_fltk_cartesian_main" = xyes; then : TESTLIBS="-lfltk_cartesian $TESTLIBS" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lfltk_audio_meter" >&5 $as_echo_n "checking for main in -lfltk_audio_meter... " >&6; } if ${ac_cv_lib_fltk_audio_meter_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lfltk_audio_meter $TESTLIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_cxx_try_link "$LINENO"; then : ac_cv_lib_fltk_audio_meter_main=yes else ac_cv_lib_fltk_audio_meter_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_fltk_audio_meter_main" >&5 $as_echo "$ac_cv_lib_fltk_audio_meter_main" >&6; } if test "x$ac_cv_lib_fltk_audio_meter_main" = xyes; then : TESTLIBS="-lfltk_audio_meter $TESTLIBS" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $host supports library symbol export" >&5 $as_echo_n "checking if $host supports library symbol export... " >&6; } if ${ac_cv_symbol_export_capability+:} false; then : $as_echo_n "(cached) " >&6 else # Initialize to unknown ac_cv_symbol_export_capability="no" case "${ax_cv_c_compiler_vendor}" in gnu) save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} -fvisibility=hidden" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo __attribute__ ((visibility("default"))); int main () { ; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } COMP_VENDOR_CFLAGS="-fvisibility=hidden -DHAVE_VISIBILITY=1 $COMP_VENDOR_CFLAGS" COMP_VENDOR_CXXFLAGS="-fvisibility=hidden -DHAVE_VISIBILITY=1 $COMP_VENDOR_CXXFLAGS" ac_cv_symbol_export_capability="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="${save_CFLAGS}" ;; sun) save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} -xldscope=hidden" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo __attribute__ ((visibility("default"))); int main () { ; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } COMP_VENDOR_CFLAGS="-xldscope=hidden -DHAVE_VISIBILITY=1 $COMP_VENDOR_CFLAGS" COMP_VENDOR_CXXFLAGS="-xldscope=hidden -DHAVE_VISIBILITY=1 $COMP_VENDOR_CXXFLAGS" ac_cv_symbol_export_capability="yes" else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext CFLAGS="${save_CFLAGS}" ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_symbol_export_capability" >&5 $as_echo "$ac_cv_symbol_export_capability" >&6; } if test $ac_cv_symbol_export_capability = yes; then : $as_echo "#define SPANDSP_USE_EXPORT_CAPABILITY 1" >>confdefs.h SPANDSP_USE_EXPORT_CAPABILITY="#define SPANDSP_USE_EXPORT_CAPABILITY 1" else SPANDSP_USE_EXPORT_CAPABILITY="#undef SPANDSP_USE_EXPORT_CAPABILITY" fi case "${ax_cv_c_compiler_vendor}" in gnu) COMP_VENDOR_CFLAGS="-std=gnu99 -ffast-math -Wall -Wunused-variable -Wunused-but-set-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes $COMP_VENDOR_CFLAGS" if test "$enable_avx" = "yes" ; then COMP_VENDOR_CFLAGS="-mavx $COMP_VENDOR_CFLAGS" fi if test "$enable_sse5" = "yes" ; then COMP_VENDOR_CFLAGS="-msse5 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse4a" = "yes" ; then COMP_VENDOR_CFLAGS="-msse4a $COMP_VENDOR_CFLAGS" fi if test "$enable_sse4_2" = "yes" ; then COMP_VENDOR_CFLAGS="-msse42 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse4_1" = "yes" ; then COMP_VENDOR_CFLAGS="-msse41 $COMP_VENDOR_CFLAGS" fi if test "$enable_ssse3" = "yes" ; then COMP_VENDOR_CFLAGS="-mssse3 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse3" = "yes" ; then COMP_VENDOR_CFLAGS="-msse3 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse2" = "yes" ; then COMP_VENDOR_CFLAGS="-msse2 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse" = "yes" ; then COMP_VENDOR_CFLAGS="-msse $COMP_VENDOR_CFLAGS" fi if test "$enable_mmx" = "yes" ; then COMP_VENDOR_CFLAGS="-mmmx $COMP_VENDOR_CFLAGS" fi case $host_os in cygwin*) COMP_VENDOR_LDFLAGS="-no-undefined" ;; mingw*) COMP_VENDOR_LDFLAGS="-no-undefined -lws2_32" ;; *) COMP_VENDOR_LDFLAGS= ;; esac ;; sun) COMP_VENDOR_CFLAGS="-xc99=all -mt -xCC -errwarn=%all -xvpara $COMP_VENDOR_CFLAGS" if test "$enable_sse3" = "yes" ; then COMP_VENDOR_CFLAGS="-native -fast $COMP_VENDOR_CFLAGS" fi if test "$enable_sse2" = "yes" ; then COMP_VENDOR_CFLAGS="-native -fast $COMP_VENDOR_CFLAGS" fi if test "$enable_sse" = "yes" ; then COMP_VENDOR_CFLAGS="-native -fast $COMP_VENDOR_CFLAGS" fi if test "$enable_mmx" = "yes" ; then COMP_VENDOR_CFLAGS="-native -fast $COMP_VENDOR_CFLAGS" fi COMP_VENDOR_LDFLAGS= new_val="" removed=0 for i in $CFLAGS; do if test "x$i" != "x-Xc"; then new_val="$new_val $i" else removed=1 fi done if test $removed = "1"; then echo " removed \"-Xc\" from CFLAGS" CFLAGS=$new_val fi ;; intel) COMP_VENDOR_CFLAGS="-std=c99 -D_POSIX_C_SOURCE=2 -D_GNU_SOURCE=1 -Wall -Wunused-variable -Wunused-but-set-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes $COMP_VENDOR_CFLAGS" if test "$enable_avx" = "yes" ; then COMP_VENDOR_CFLAGS="-mavx $COMP_VENDOR_CFLAGS" fi if test "$enable_sse5" = "yes" ; then COMP_VENDOR_CFLAGS="-msse5 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse4a" = "yes" ; then COMP_VENDOR_CFLAGS="-msse4a $COMP_VENDOR_CFLAGS" fi if test "$enable_sse4_2" = "yes" ; then COMP_VENDOR_CFLAGS="-msse42 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse4_1" = "yes" ; then COMP_VENDOR_CFLAGS="-msse41 $COMP_VENDOR_CFLAGS" fi if test "$enable_ssse3" = "yes" ; then COMP_VENDOR_CFLAGS="-mssse3 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse3" = "yes" ; then COMP_VENDOR_CFLAGS="-msse3 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse2" = "yes" ; then COMP_VENDOR_CFLAGS="-msse2 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse" = "yes" ; then COMP_VENDOR_CFLAGS="-msse $COMP_VENDOR_CFLAGS" fi if test "$enable_mmx" = "yes" ; then COMP_VENDOR_CFLAGS="-mmmx $COMP_VENDOR_CFLAGS" fi COMP_VENDOR_LDFLAGS= ;; *) COMP_VENDOR_CFLAGS="-std=c99 -Wall -Wunused-variable -Wunused-but-set-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes $COMP_VENDOR_CFLAGS" COMP_VENDOR_LDFLAGS= ;; esac COMP_VENDOR_CFLAGS="-DNDEBUG $COMP_VENDOR_CFLAGS" if test "$enable_fixed_point" = "yes" ; then $as_echo "#define SPANDSP_USE_FIXED_POINT 1" >>confdefs.h SPANDSP_USE_FIXED_POINT="#define SPANDSP_USE_FIXED_POINT 1" else as_ac_FixedPoint=`$as_echo "ac_cv_fixed_point_machine_$host" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $host is fixed point only" >&5 $as_echo_n "checking if $host is fixed point only... " >&6; } if eval \${$as_ac_FixedPoint+:} false; then : $as_echo_n "(cached) " >&6 else case $host in arc \ | arm | armble | armebl | armv2345 | armv345bl \ | arm-* | armble-* | armebl-* | armv345-* \ | bfin | bfin-* \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | tic54x | c54x* | tic55x | c55x* | tic6x | c6x* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | xscale | xscaleebl \ | xscale-* | xscaleebl-* ) eval "$as_ac_FixedPoint=yes" ;; *) eval "$as_ac_FixedPoint=no" ;; esac fi eval ac_res=\$$as_ac_FixedPoint { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test `eval 'as_val=${'$as_ac_FixedPoint'};$as_echo "$as_val"'` = yes; then : $as_echo "#define SPANDSP_USE_FIXED_POINT 1" >>confdefs.h SPANDSP_USE_FIXED_POINT="#define SPANDSP_USE_FIXED_POINT 1" else SPANDSP_USE_FIXED_POINT="#undef SPANDSP_USE_FIXED_POINT" fi fi as_ac_MisalignedAccessFails=`$as_echo "ac_cv_misaligned_access_fails_$host" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $host fails on misaligned memory access" >&5 $as_echo_n "checking if $host fails on misaligned memory access... " >&6; } if eval \${$as_ac_MisalignedAccessFails+:} false; then : $as_echo_n "(cached) " >&6 else case $host in arc | arm | armble | armelb | armv2345 | armv345lb \ | bfin \ | sparc \ | xscale | xscaleebl \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | bfin-* \ | sparc-* \ | xscale-* | xscaleebl-* ) eval "$as_ac_MisalignedAccessFails=yes" ;; *) eval "$as_ac_MisalignedAccessFails=no" ;; esac fi eval ac_res=\$$as_ac_MisalignedAccessFails { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test `eval 'as_val=${'$as_ac_MisalignedAccessFails'};$as_echo "$as_val"'` = yes; then : $as_echo "#define SPANDSP_MISALIGNED_ACCESS_FAILS 1" >>confdefs.h SPANDSP_MISALIGNED_ACCESS_FAILS="#define SPANDSP_MISALIGNED_ACCESS_FAILS 1" else SPANDSP_MISALIGNED_ACCESS_FAILS="#undef SPANDSP_MISALIGNED_ACCESS_FAILS" fi if test "$enable_avx" = "yes" ; then $as_echo "#define SPANDSP_USE_AVX 1" >>confdefs.h enable_sse5"yes" fi if test "$enable_sse5" = "yes" ; then $as_echo "#define SPANDSP_USE_SSE5 1" >>confdefs.h enable_sse4a="yes" fi if test "$enable_sse4a" = "yes" ; then $as_echo "#define SPANDSP_USE_SSE4A 1" >>confdefs.h enable_sse4_2="yes" fi if test "$enable_sse4_2" = "yes" ; then $as_echo "#define SPANDSP_USE_SSE4_2 1" >>confdefs.h enable_sse4_1="yes" fi if test "$enable_sse4_1" = "yes" ; then $as_echo "#define SPANDSP_USE_SSE4_1 1" >>confdefs.h enable_ssse3="yes" fi if test "$enable_ssse3" = "yes" ; then $as_echo "#define SPANDSP_USE_SSSE3 1" >>confdefs.h enable_sse3="yes" fi if test "$enable_sse3" = "yes" ; then $as_echo "#define SPANDSP_USE_SSE3 1" >>confdefs.h enable_sse2="yes" fi if test "$enable_sse2" = "yes" ; then $as_echo "#define SPANDSP_USE_SSE2 1" >>confdefs.h enable_sse="yes" fi if test "$enable_sse" = "yes" ; then $as_echo "#define SPANDSP_USE_SSE 1" >>confdefs.h enable_mmx="yes" fi if test "$enable_mmx" = "yes" ; then $as_echo "#define SPANDSP_USE_MMX 1" >>confdefs.h fi if test "$enable_doc" = yes; then COND_DOC_TRUE= COND_DOC_FALSE='#' else COND_DOC_TRUE='#' COND_DOC_FALSE= fi if test "$enable_tests" = yes; then COND_TESTS_TRUE= COND_TESTS_FALSE='#' else COND_TESTS_TRUE='#' COND_TESTS_FALSE= fi if test "$enable_test_data" = yes; then COND_TESTDATA_TRUE= COND_TESTDATA_FALSE='#' else COND_TESTDATA_TRUE='#' COND_TESTDATA_FALSE= fi if test "$enable_mmx" = yes; then COND_MMX_TRUE= COND_MMX_FALSE='#' else COND_MMX_TRUE='#' COND_MMX_FALSE= fi if test "$enable_sse" = yes; then COND_SSE_TRUE= COND_SSE_FALSE='#' else COND_SSE_TRUE='#' COND_SSE_FALSE= fi if test "$enable_sse2" = yes; then COND_SSE2_TRUE= COND_SSE2_FALSE='#' else COND_SSE2_TRUE='#' COND_SSE2_FALSE= fi if test "$enable_sse3" = yes; then COND_SSE3_TRUE= COND_SSE3_FALSE='#' else COND_SSE3_TRUE='#' COND_SSE3_FALSE= fi if test "$enable_ssse3" = yes; then COND_SSSE3_TRUE= COND_SSSE3_FALSE='#' else COND_SSSE3_TRUE='#' COND_SSSE3_FALSE= fi if test "$enable_sse4_1" = yes; then COND_SSE4_1_TRUE= COND_SSE4_1_FALSE='#' else COND_SSE4_1_TRUE='#' COND_SSE4_1_FALSE= fi if test "$enable_sse4_2" = yes; then COND_SSE4_2_TRUE= COND_SSE4_2_FALSE='#' else COND_SSE4_2_TRUE='#' COND_SSE4_2_FALSE= fi if test "$enable_sse4a" = yes; then COND_SSE4A_TRUE= COND_SSE4A_FALSE='#' else COND_SSE4A_TRUE='#' COND_SSE4A_FALSE= fi if test "$enable_sse5" = yes; then COND_SSE5_TRUE= COND_SSE5_FALSE='#' else COND_SSE5_TRUE='#' COND_SSE5_FALSE= fi if test "$enable_avx" = yes; then COND_AVX_TRUE= COND_AVX_FALSE='#' else COND_AVX_TRUE='#' COND_AVX_FALSE= fi if test "$enable_builtin_tiff" = "yes" ; then abs_tiffdir="`cd $srcdir/../tiff-3.8.2/ && pwd`" save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -I$abs_tiffdir/libtiff" for ac_header in tiffio.h do : ac_fn_c_check_header_mongrel "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" "$ac_includes_default" if test "x$ac_cv_header_tiffio_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_TIFFIO_H 1 _ACEOF fi done CFLAGS="$save_CFLAGS" COMP_VENDOR_CFLAGS="-I$abs_tiffdir/libtiff $COMP_VENDOR_CFLAGS" COMP_VENDOR_LDFLAGS="-L$abs_tiffdir/libtiff $COMP_VENDOR_LDFLAGS" LIBS="$LIBS $abs_tiffdir/libtiff/libtiff.la" $as_echo "#define HAVE_LIBTIFF 1" >>confdefs.h else for ac_header in tiffio.h do : ac_fn_c_check_header_mongrel "$LINENO" "tiffio.h" "ac_cv_header_tiffio_h" "$ac_includes_default" if test "x$ac_cv_header_tiffio_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_TIFFIO_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for TIFFOpen in -ltiff" >&5 $as_echo_n "checking for TIFFOpen in -ltiff... " >&6; } if ${ac_cv_lib_tiff_TIFFOpen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ltiff -lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char TIFFOpen (); int main () { return TIFFOpen (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_tiff_TIFFOpen=yes else ac_cv_lib_tiff_TIFFOpen=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tiff_TIFFOpen" >&5 $as_echo "$ac_cv_lib_tiff_TIFFOpen" >&6; } if test "x$ac_cv_lib_tiff_TIFFOpen" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBTIFF 1 _ACEOF LIBS="-ltiff $LIBS" else as_fn_error $? "\"Cannot build without libtiff (does your system require a libtiff-devel package?)\"" "$LINENO" 5 fi fi for ac_header in jpeglib.h do : ac_fn_c_check_header_mongrel "$LINENO" "jpeglib.h" "ac_cv_header_jpeglib_h" "$ac_includes_default" if test "x$ac_cv_header_jpeglib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_JPEGLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jpeg_start_compress in -ljpeg" >&5 $as_echo_n "checking for jpeg_start_compress in -ljpeg... " >&6; } if ${ac_cv_lib_jpeg_jpeg_start_compress+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljpeg $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char jpeg_start_compress (); int main () { return jpeg_start_compress (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_jpeg_jpeg_start_compress=yes else ac_cv_lib_jpeg_jpeg_start_compress=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_jpeg_jpeg_start_compress" >&5 $as_echo "$ac_cv_lib_jpeg_jpeg_start_compress" >&6; } if test "x$ac_cv_lib_jpeg_jpeg_start_compress" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBJPEG 1 _ACEOF LIBS="-ljpeg $LIBS" fi TESTLIBS="$SIMLIBS $TESTLIBS" ac_config_files="$ac_config_files Makefile doc/Makefile doc/doxygen src/Makefile src/spandsp.h spandsp-sim/Makefile test-data/Makefile test-data/etsi/Makefile test-data/etsi/fax/Makefile test-data/itu/Makefile test-data/itu/fax/Makefile test-data/local/Makefile tests/Makefile spandsp.pc spandsp.spec" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${COND_DOC_TRUE}" && test -z "${COND_DOC_FALSE}"; then as_fn_error $? "conditional \"COND_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${COND_TESTS_TRUE}" && test -z "${COND_TESTS_FALSE}"; then as_fn_error $? "conditional \"COND_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${COND_TESTDATA_TRUE}" && test -z "${COND_TESTDATA_FALSE}"; then as_fn_error $? "conditional \"COND_TESTDATA\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${COND_MMX_TRUE}" && test -z "${COND_MMX_FALSE}"; then as_fn_error $? "conditional \"COND_MMX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${COND_SSE_TRUE}" && test -z "${COND_SSE_FALSE}"; then as_fn_error $? "conditional \"COND_SSE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${COND_SSE2_TRUE}" && test -z "${COND_SSE2_FALSE}"; then as_fn_error $? "conditional \"COND_SSE2\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${COND_SSE3_TRUE}" && test -z "${COND_SSE3_FALSE}"; then as_fn_error $? "conditional \"COND_SSE3\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${COND_SSSE3_TRUE}" && test -z "${COND_SSSE3_FALSE}"; then as_fn_error $? "conditional \"COND_SSSE3\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${COND_SSE4_1_TRUE}" && test -z "${COND_SSE4_1_FALSE}"; then as_fn_error $? "conditional \"COND_SSE4_1\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${COND_SSE4_2_TRUE}" && test -z "${COND_SSE4_2_FALSE}"; then as_fn_error $? "conditional \"COND_SSE4_2\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${COND_SSE4A_TRUE}" && test -z "${COND_SSE4A_FALSE}"; then as_fn_error $? "conditional \"COND_SSE4A\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${COND_SSE5_TRUE}" && test -z "${COND_SSE5_FALSE}"; then as_fn_error $? "conditional \"COND_SSE5\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${COND_AVX_TRUE}" && test -z "${COND_AVX_FALSE}"; then as_fn_error $? "conditional \"COND_AVX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by spandsp $as_me 0.0.6, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to the package provider." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ spandsp config.status 0.0.6 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`' host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`' lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`' reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`' want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`' sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`' AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`' STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`' lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`' objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`' file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`' predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`' postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`' predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`' postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`' LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`' reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`' reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`' postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } # Quote evaled strings. for var in SHELL \ ECHO \ PATH_SEPARATOR \ SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ OBJDUMP \ deplibs_check_method \ file_magic_cmd \ file_magic_glob \ want_nocaseglob \ DLLTOOL \ sharedlib_from_linklib_cmd \ AR \ AR_FLAGS \ archiver_list_spec \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ nm_file_list_spec \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_pic \ lt_prog_compiler_wl \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ MANIFEST_TOOL \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_separator \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ install_override_mode \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_CXX \ reload_flag_CXX \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_CXX \ compiler_needs_object_CXX \ with_gnu_ld_CXX \ allow_undefined_flag_CXX \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_separator_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX \ file_list_spec_CXX \ compiler_lib_search_dirs_CXX \ predep_objects_CXX \ postdep_objects_CXX \ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postlink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ reload_cmds_CXX \ old_archive_cmds_CXX \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ module_cmds_CXX \ module_expsym_cmds_CXX \ export_symbols_cmds_CXX \ prelink_cmds_CXX \ postlink_cmds_CXX; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h:config-h.in" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/doxygen") CONFIG_FILES="$CONFIG_FILES doc/doxygen" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/spandsp.h") CONFIG_FILES="$CONFIG_FILES src/spandsp.h" ;; "spandsp-sim/Makefile") CONFIG_FILES="$CONFIG_FILES spandsp-sim/Makefile" ;; "test-data/Makefile") CONFIG_FILES="$CONFIG_FILES test-data/Makefile" ;; "test-data/etsi/Makefile") CONFIG_FILES="$CONFIG_FILES test-data/etsi/Makefile" ;; "test-data/etsi/fax/Makefile") CONFIG_FILES="$CONFIG_FILES test-data/etsi/fax/Makefile" ;; "test-data/itu/Makefile") CONFIG_FILES="$CONFIG_FILES test-data/itu/Makefile" ;; "test-data/itu/fax/Makefile") CONFIG_FILES="$CONFIG_FILES test-data/itu/fax/Makefile" ;; "test-data/local/Makefile") CONFIG_FILES="$CONFIG_FILES test-data/local/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "spandsp.pc") CONFIG_FILES="$CONFIG_FILES spandsp.pc" ;; "spandsp.spec") CONFIG_FILES="$CONFIG_FILES spandsp.spec" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="CXX " # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that protects backslashes. ECHO=$lt_ECHO # The PATH separator for the build system. PATH_SEPARATOR=$lt_PATH_SEPARATOR # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # convert \$build file names to \$host format. to_host_file_cmd=$lt_cv_to_host_file_cmd # convert \$build files to toolchain format. to_tool_file_cmd=$lt_cv_to_tool_file_cmd # An object symbol dumper. OBJDUMP=$lt_OBJDUMP # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method = "file_magic". file_magic_cmd=$lt_file_magic_cmd # How to find potential files when deplibs_check_method = "file_magic". file_magic_glob=$lt_file_magic_glob # Find potential files using nocaseglob when deplibs_check_method = "file_magic". want_nocaseglob=$lt_want_nocaseglob # DLL creation program. DLLTOOL=$lt_DLLTOOL # Command to associate shared and link libraries. sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd # The archiver. AR=$lt_AR # Flags to create an archive. AR_FLAGS=$lt_AR_FLAGS # How to feed a file listing to the archiver. archiver_list_spec=$lt_archiver_list_spec # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Whether to use a lock for old archive extraction. lock_old_archive_extraction=$lock_old_archive_extraction # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # Specify filename containing input files for \$NM. nm_file_list_spec=$lt_nm_file_list_spec # The root where to search for dependent libraries,and in which our libraries should be installed. lt_sysroot=$lt_sysroot # The name of the directory that contains temporary libtool files. objdir=$objdir # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Manifest tool. MANIFEST_TOOL=$lt_MANIFEST_TOOL # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Permission mode override for installation of shared libraries. install_override_mode=$lt_install_override_mode # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) if test x"$xsi_shell" = xyes; then sed -e '/^func_dirname ()$/,/^} # func_dirname /c\ func_dirname ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ } # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_basename ()$/,/^} # func_basename /c\ func_basename ()\ {\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\ func_dirname_and_basename ()\ {\ \ case ${1} in\ \ */*) func_dirname_result="${1%/*}${2}" ;;\ \ * ) func_dirname_result="${3}" ;;\ \ esac\ \ func_basename_result="${1##*/}"\ } # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_stripname ()$/,/^} # func_stripname /c\ func_stripname ()\ {\ \ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\ \ # positional parameters, so assign one to ordinary parameter first.\ \ func_stripname_result=${3}\ \ func_stripname_result=${func_stripname_result#"${1}"}\ \ func_stripname_result=${func_stripname_result%"${2}"}\ } # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\ func_split_long_opt ()\ {\ \ func_split_long_opt_name=${1%%=*}\ \ func_split_long_opt_arg=${1#*=}\ } # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\ func_split_short_opt ()\ {\ \ func_split_short_opt_arg=${1#??}\ \ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\ } # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\ func_lo2o ()\ {\ \ case ${1} in\ \ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\ \ *) func_lo2o_result=${1} ;;\ \ esac\ } # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_xform ()$/,/^} # func_xform /c\ func_xform ()\ {\ func_xform_result=${1%.*}.lo\ } # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_arith ()$/,/^} # func_arith /c\ func_arith ()\ {\ func_arith_result=$(( $* ))\ } # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_len ()$/,/^} # func_len /c\ func_len ()\ {\ func_len_result=${#1}\ } # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$lt_shell_append" = xyes; then sed -e '/^func_append ()$/,/^} # func_append /c\ func_append ()\ {\ eval "${1}+=\\${2}"\ } # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\ func_append_quoted ()\ {\ \ func_quote_for_eval "${2}"\ \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\ } # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5 $as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;} fi mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # How to create reloadable object files. reload_flag=$lt_reload_flag_CXX reload_cmds=$lt_reload_cmds_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Commands necessary for finishing linking programs. postlink_cmds=$lt_postlink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi # @end 1 spandsp-0.0.6/NEWS0000664000175000017500000000002507741030033010601 00000000000000No news is good news!spandsp-0.0.6/config-h.in0000664000175000017500000002237612343627152012151 00000000000000/* config-h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the acosf() function. */ #undef HAVE_ACOSF /* Define to 1 if you have the asinf() function. */ #undef HAVE_ASINF /* Define to 1 if you have the atan2f() function. */ #undef HAVE_ATAN2F /* Define to 1 if you have the atanf() function. */ #undef HAVE_ATANF /* Define to 1 if you have the ceilf() function. */ #undef HAVE_CEILF /* Define to 1 if you have the cosf() function. */ #undef HAVE_COSF /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */ #undef HAVE_DOPRNT /* Define to 1 if you have the `drand48' function. */ #undef HAVE_DRAND48 /* Define to 1 if you have the expf() function. */ #undef HAVE_EXPF /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_FENV_H /* Define to 1 if you have the header file. */ #undef HAVE_FFTW3_H /* Define to 1 if you have the header file. */ #undef HAVE_FFTW_H /* Define to 1 if you have the header file. */ #undef HAVE_FLOAT_H /* Define to 1 if you have the floorf() function. */ #undef HAVE_FLOORF /* Define to 1 if you have the header file. */ #undef HAVE_FL_FL_AUDIO_METER_H /* Define to 1 if you have the header file. */ #undef HAVE_FL_FL_CARTESIAN_H /* Define to 1 if you have the header file. */ #undef HAVE_FL_FL_DRAW_H /* Define to 1 if you have the header file. */ #undef HAVE_FL_FL_H /* Define to 1 if you have the header file. */ #undef HAVE_FL_FL_LIGHT_BUTTON_H /* Define to 1 if you have the header file. */ #undef HAVE_FL_FL_OVERLAY_WINDOW_H /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_JPEGLIB_H /* Define to 1 if you have the `jpeg' library (-ljpeg). */ #undef HAVE_LIBJPEG /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the `tiff' library (-ltiff). */ #undef HAVE_LIBTIFF /* Define to 1 if you have the header file. */ #undef HAVE_LIBXML_PARSER_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBXML_XINCLUDE_H /* Define to 1 if you have the header file. */ #undef HAVE_LIBXML_XMLMEMORY_H /* Define if you have C99's llrint function. */ #undef HAVE_LLRINT /* Define if you have C99's llrintf function. */ #undef HAVE_LLRINTF /* Define to 1 if you have the log10f() function. */ #undef HAVE_LOG10F /* Define to 1 if you have the logf() function. */ #undef HAVE_LOGF /* Define to 1 if the system has the type `long double'. */ #undef HAVE_LONG_DOUBLE /* Define to 1 if the system has the type `long long'. */ #undef HAVE_LONG_LONG /* Define if you have C99's lrint function. */ #undef HAVE_LRINT /* Define if you have C99's lrintf function. */ #undef HAVE_LRINTF /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the header file. */ #undef HAVE_MATH_H /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the open_memstream() function. */ #undef HAVE_OPEN_MEMSTREAM /* Define to 1 if you have the header file. */ #undef HAVE_PCAP_H /* Define to 1 if you have the powf() function. */ #undef HAVE_POWF /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_H /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the sinf() function. */ #undef HAVE_SINF /* Define to 1 if you have the header file. */ #undef HAVE_SNDFILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_STDATOMIC_H /* Define to 1 if you have the header file. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have that is POSIX.1 compatible. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the tanf() function. */ #undef HAVE_TANF /* Define to 1 if you have the header file. */ #undef HAVE_TGMATH_H /* Define to 1 if you have the header file. */ #undef HAVE_TIFFIO_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `vprintf' function. */ #undef HAVE_VPRINTF /* Define to 1 if you have the header file. */ #undef HAVE_X11_X_H /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* Define to the type of arg 1 for `select'. */ #undef SELECT_TYPE_ARG1 /* Define to the type of args 2, 3 and 4 for `select'. */ #undef SELECT_TYPE_ARG234 /* Define to the type of arg 5 for `select'. */ #undef SELECT_TYPE_ARG5 /* Do not expect a misaligned memory access to work correctly */ #undef SPANDSP_MISALIGNED_ACCESS_FAILS /* Use the AVX instruction set (i386 and x86_64 only). */ #undef SPANDSP_USE_AVX /* Use the library symbol export capability of the compiler */ #undef SPANDSP_USE_EXPORT_CAPABILITY /* Enable fixed point processing, where possible, instead of floating point */ #undef SPANDSP_USE_FIXED_POINT /* Use the MMX instruction set (i386 and x86_64 only). */ #undef SPANDSP_USE_MMX /* Use the SSE instruction set (i386 and x86_64 only). */ #undef SPANDSP_USE_SSE /* Use the SSE2 instruction set (i386 and x86_64 only). */ #undef SPANDSP_USE_SSE2 /* Use the SSE3 instruction set (i386 and x86_64 only). */ #undef SPANDSP_USE_SSE3 /* Use the SSE4A instruction set (i386 and x86_64 only). */ #undef SPANDSP_USE_SSE4A /* Use the SSE4.1 instruction set (i386 and x86_64 only). */ #undef SPANDSP_USE_SSE4_1 /* Use the SSE4.2 instruction set (i386 and x86_64 only). */ #undef SPANDSP_USE_SSE4_2 /* Use the SSE5 instruction set (i386 and x86_64 only). */ #undef SPANDSP_USE_SSE5 /* Use the SSSE3 instruction set (i386 and x86_64 only). */ #undef SPANDSP_USE_SSSE3 /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define to empty if the keyword `volatile' does not work. Warning: valid code using `volatile' can become incorrect without. Disable with care. */ #undef volatile spandsp-0.0.6/unpack_g722_data.sh0000775000175000017500000000266211422612260013464 00000000000000#!/bin/sh # # SpanDSP - a series of DSP components for telephony # # unpack_g722_data.sh # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 2.1, # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ITUDATA="../../../T-REC-G.722-198703-I!AppII!ZPF-E.zip" cd test-data/itu if [ -d g722 ] then cd g722 else mkdir g722 RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot create test-data/itu/g722! exit $RETVAL fi cd g722 fi rm -rf T* rm -rf software unzip ${ITUDATA} >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot unpack the ITU test vectors for G.722! exit $RETVAL fi #rm ${ITUDATA} unzip ./software/G722ap2/G722E/Software.zip >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot unpack the ITU test vectors for G.722! exit $RETVAL fi mv ./software/G722ap2/G722E/T* . rm -rf software echo The ITU test vectors for G.722 should now be in the g722 directory spandsp-0.0.6/wrapper.xsl0000664000175000017500000000040411376152335012324 00000000000000 css.css spandsp-0.0.6/src/0000775000175000017500000000000012357123347010766 500000000000000spandsp-0.0.6/src/bitstream.c0000664000175000017500000001030311422612261013027 00000000000000/* * SpanDSP - a series of DSP components for telephony * * bitstream.c - Bitstream composition and decomposition routines. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include "spandsp/telephony.h" #include "spandsp/bitstream.h" #include "spandsp/private/bitstream.h" SPAN_DECLARE(void) bitstream_put(bitstream_state_t *s, uint8_t **c, uint32_t value, int bits) { value &= ((1 << bits) - 1); if (s->lsb_first) { if (s->residue + bits <= 32) { s->bitstream |= (value << s->residue); s->residue += bits; } while (s->residue >= 8) { s->residue -= 8; *(*c)++ = (uint8_t) (s->bitstream & 0xFF); s->bitstream >>= 8; } } else { if (s->residue + bits <= 32) { s->bitstream = (s->bitstream << bits) | value; s->residue += bits; } while (s->residue >= 8) { s->residue -= 8; *(*c)++ = (uint8_t) ((s->bitstream >> s->residue) & 0xFF); } } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) bitstream_emit(bitstream_state_t *s, uint8_t **c) { uint32_t bitstream; if (s->residue > 0) { bitstream = s->bitstream & ((1 << s->residue) - 1); if (s->lsb_first) *(*c) = (uint8_t) bitstream; else *(*c) = (uint8_t) (bitstream << (8 - s->residue)); } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) bitstream_flush(bitstream_state_t *s, uint8_t **c) { if (s->residue > 0) { bitstream_emit(s, c); (*c)++; s->residue = 0; } s->bitstream = 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(uint32_t) bitstream_get(bitstream_state_t *s, const uint8_t **c, int bits) { uint32_t x; if (s->lsb_first) { while (s->residue < bits) { s->bitstream |= (((uint32_t) *(*c)++) << s->residue); s->residue += 8; } s->residue -= bits; x = s->bitstream & ((1 << bits) - 1); s->bitstream >>= bits; } else { while (s->residue < bits) { s->bitstream = (s->bitstream << 8) | ((uint32_t) *(*c)++); s->residue += 8; } s->residue -= bits; x = (s->bitstream >> s->residue) & ((1 << bits) - 1); } return x; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(bitstream_state_t *) bitstream_init(bitstream_state_t *s, int lsb_first) { if (s == NULL) { if ((s = (bitstream_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } s->bitstream = 0; s->residue = 0; s->lsb_first = lsb_first; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) bitstream_release(bitstream_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) bitstream_free(bitstream_state_t *s) { if (s) free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/echo.c0000664000175000017500000005553211422612261011770 00000000000000/* * SpanDSP - a series of DSP components for telephony * * echo.c - An echo cancellor, suitable for electrical and acoustic * cancellation. This code does not currently comply with * any relevant standards (e.g. G.164/5/7/8). One day.... * * Written by Steve Underwood * * Copyright (C) 2001, 2003 Steve Underwood * * Based on a bit from here, a bit from there, eye of toad, * ear of bat, etc - plus, of course, my own 2 cents. * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /* TODO: Finish the echo suppressor option, however nasty suppression may be. Add an option to reintroduce side tone at -24dB under appropriate conditions. Improve double talk detector (iterative!) */ /* We need to differentiate between transmitted energy which will train the echo canceller well (voice, white noise, and other broadband sources) and energy which will train it badly (supervisory tones, DTMF, whistles, and other narrowband sources). There are many ways this might be done. This canceller uses a method based on the autocorrelation qualities of the transmitted signal. A rather peaky autocorrelation function is a clear sign of a narrowband signal. We only need perform the autocorrelation at well spaced intervals, so the compute load is not too great. Multiple successive autocorrelation functions with a similar peaky shape are a clear indication of a stationary narrowband signal. Using TKEO, it should be possible to greatly reduce the compute requirement for narrowband detection. */ /* The FIR taps must be adapted as 32 bit values, to get the necessary finesse in the adaption process. However, they are applied as 16 bit values (bits 30-15 of the 32 bit values) in the FIR. For the working 16 bit values, we need 4 sets. 3 of the 16 bit sets are used on a rotating basis. Normally the canceller steps round these 3 sets at regular intervals. Any time we detect double talk, we can go back to the set from two steps ago with reasonable assurance it is a well adapted set. We cannot just go back one step, as we may have rotated the sets just before double talk or tone was detected, and that set may already be somewhat corrupted. When narrowband energy is detected we need to continue adapting to it, to echo cancel it. However, the adaption will almost certainly be going astray. Broadband (or even complex sequences of narrowband) energy will normally lead to a well trained cancellor, with taps matching the impulse response of the channel. For stationary narrowband energy, there is usually has an infinite number of alternative tap sets which will cancel it well. A previously well trained set of taps will tend to drift amongst the alternatives. When broadband energy resumes, the taps may be a total mismatch for the signal, and could even amplify rather than attenuate the echo. The solution is to use a fourth set of 16 bit taps. When we first detect the narrowband energy we save the oldest of the group of three sets, but do not change back to an older set. We let the canceller cancel, and it adaption drift while the narrowband energy is present. When we detect the narrowband energy has ceased, we switch to using the fourth set of taps which was saved. When we revert to an older set of taps, we must replace both the 16 bit and 32 bit working tap sets. The saved 16 bit values are good enough to also be used as a replacement for the 32 bit values. We loose the fractions, but they should soon settle down in a reasonable way. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/logging.h" #include "spandsp/saturated.h" #include "spandsp/dc_restore.h" #include "spandsp/bit_operations.h" #include "spandsp/echo.h" #include "spandsp/private/echo.h" #if !defined(NULL) #define NULL (void *) 0 #endif #if !defined(FALSE) #define FALSE 0 #endif #if !defined(TRUE) #define TRUE (!FALSE) #endif #define NONUPDATE_DWELL_TIME 600 /* 600 samples, or 75ms */ #define MIN_TX_POWER_FOR_ADAPTION 64*64 #define MIN_RX_POWER_FOR_ADAPTION 64*64 static int narrowband_detect(echo_can_state_t *ec) { int k; int i; float temp; float scale; float sf[128]; float f_acf[128]; int32_t acf[28]; int score; int len = 32; int alen = 9; k = ec->curr_pos; for (i = 0; i < len; i++) { sf[i] = ec->fir_state.history[k++]; if (k >= 256) k = 0; } for (k = 0; k < alen; k++) { temp = 0; for (i = k; i < len; i++) temp += sf[i]*sf[i - k]; f_acf[k] = temp; } scale = 0x1FFFFFFF/f_acf[0]; for (k = 0; k < alen; k++) acf[k] = (int32_t) (f_acf[k]*scale); score = 0; for (i = 0; i < 9; i++) { if (ec->last_acf[i] >= 0 && acf[i] >= 0) { if ((ec->last_acf[i] >> 1) < acf[i] && acf[i] < (ec->last_acf[i] << 1)) score++; } else if (ec->last_acf[i] < 0 && acf[i] < 0) { if ((ec->last_acf[i] >> 1) > acf[i] && acf[i] > (ec->last_acf[i] << 1)) score++; } } memcpy(ec->last_acf, acf, alen*sizeof(ec->last_acf[0])); return score; } static __inline__ void lms_adapt(echo_can_state_t *ec, int factor) { int i; #if 0 mmx_t *mmx_taps; mmx_t *mmx_coeffs; mmx_t *mmx_hist; mmx_t mmx; mmx.w[0] = mmx.w[1] = mmx.w[2] = mmx.w[3] = factor; mmx_hist = (mmx_t *) &fir->history[fir->curr_pos]; mmx_taps = (mmx_t *) &fir->taps; mmx_coeffs = (mmx_t *) fir->coeffs; i = fir->taps; movq_m2r(mmx, mm0); while (i > 0) { movq_m2r(mmx_hist[0], mm1); movq_m2r(mmx_taps[0], mm0); movq_m2r(mmx_taps[1], mm1); movq_r2r(mm1, mm2); pmulhw(mm0, mm1); pmullw(mm0, mm2); pmaddwd_r2r(mm1, mm0); pmaddwd_r2r(mm3, mm2); paddd_r2r(mm0, mm4); paddd_r2r(mm2, mm4); movq_r2m(mm0, mmx_taps[0]); movq_r2m(mm1, mmx_taps[0]); movq_r2m(mm2, mmx_coeffs[0]); mmx_taps += 2; mmx_coeffs += 1; mmx_hist += 1; i -= 4; ) emms(); #elif 0 /* Update the FIR taps */ for (i = ec->taps - 1; i >= 0; i--) { /* Leak to avoid the coefficients drifting beyond the ability of the adaption process to bring them back under control. */ ec->fir_taps32[i] -= (ec->fir_taps32[i] >> 23); ec->fir_taps32[i] += (ec->fir_state.history[i + ec->curr_pos]*factor); ec->latest_correction = (ec->fir_state.history[i + ec->curr_pos]*factor); ec->fir_taps16[ec->tap_set][i] = ec->fir_taps32[i] >> 15; } #else int offset1; int offset2; /* Update the FIR taps */ offset2 = ec->curr_pos; offset1 = ec->taps - offset2; for (i = ec->taps - 1; i >= offset1; i--) { ec->fir_taps32[i] += (ec->fir_state.history[i - offset1]*factor); ec->fir_taps16[ec->tap_set][i] = (int16_t) (ec->fir_taps32[i] >> 15); } for ( ; i >= 0; i--) { ec->fir_taps32[i] += (ec->fir_state.history[i + offset2]*factor); ec->fir_taps16[ec->tap_set][i] = (int16_t) (ec->fir_taps32[i] >> 15); } #endif } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(echo_can_state_t *) echo_can_init(int len, int adaption_mode) { echo_can_state_t *ec; int i; int j; if ((ec = (echo_can_state_t *) malloc(sizeof(*ec))) == NULL) return NULL; memset(ec, 0, sizeof(*ec)); ec->taps = len; ec->curr_pos = ec->taps - 1; ec->tap_mask = ec->taps - 1; if ((ec->fir_taps32 = (int32_t *) malloc(ec->taps*sizeof(int32_t))) == NULL) { free(ec); return NULL; } memset(ec->fir_taps32, 0, ec->taps*sizeof(int32_t)); for (i = 0; i < 4; i++) { if ((ec->fir_taps16[i] = (int16_t *) malloc(ec->taps*sizeof(int16_t))) == NULL) { for (j = 0; j < i; j++) free(ec->fir_taps16[j]); free(ec->fir_taps32); free(ec); return NULL; } memset(ec->fir_taps16[i], 0, ec->taps*sizeof(int16_t)); } fir16_create(&ec->fir_state, ec->fir_taps16[0], ec->taps); ec->rx_power_threshold = 10000000; ec->geigel_max = 0; ec->geigel_lag = 0; ec->dtd_onset = FALSE; ec->tap_set = 0; ec->tap_rotate_counter = 1600; ec->cng_level = 1000; echo_can_adaption_mode(ec, adaption_mode); return ec; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) echo_can_release(echo_can_state_t *ec) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) echo_can_free(echo_can_state_t *ec) { int i; fir16_free(&ec->fir_state); free(ec->fir_taps32); for (i = 0; i < 4; i++) free(ec->fir_taps16[i]); free(ec); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) echo_can_adaption_mode(echo_can_state_t *ec, int adaption_mode) { ec->adaption_mode = adaption_mode; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) echo_can_flush(echo_can_state_t *ec) { int i; for (i = 0; i < 4; i++) ec->tx_power[i] = 0; for (i = 0; i < 3; i++) ec->rx_power[i] = 0; ec->clean_rx_power = 0; ec->nonupdate_dwell = 0; fir16_flush(&ec->fir_state); ec->fir_state.curr_pos = ec->taps - 1; memset(ec->fir_taps32, 0, ec->taps*sizeof(int32_t)); for (i = 0; i < 4; i++) memset(ec->fir_taps16[i], 0, ec->taps*sizeof(int16_t)); ec->curr_pos = ec->taps - 1; ec->supp_test1 = 0; ec->supp_test2 = 0; ec->supp1 = 0; ec->supp2 = 0; ec->vad = 0; ec->cng_level = 1000; ec->cng_filter = 0; ec->geigel_max = 0; ec->geigel_lag = 0; ec->dtd_onset = FALSE; ec->tap_set = 0; ec->tap_rotate_counter = 1600; ec->latest_correction = 0; memset(ec->last_acf, 0, sizeof(ec->last_acf)); ec->narrowband_count = 0; ec->narrowband_score = 0; } /*- End of function --------------------------------------------------------*/ int sample_no = 0; SPAN_DECLARE(void) echo_can_snapshot(echo_can_state_t *ec) { memcpy(ec->snapshot, ec->fir_taps16[0], ec->taps*sizeof(int16_t)); } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t echo_can_hpf(int32_t coeff[2], int16_t amp) { int32_t z; /* Filter DC, 3dB point is 160Hz (I think), note 32 bit precision required otherwise values do not track down to 0. Zero at DC, Pole at (1-Beta) only real axis. Some chip sets (like Si labs) don't need this, but something like a $10 X100P card does. Any DC really slows down convergence. Note: removes some low frequency from the signal, this reduces the speech quality when listening to samples through headphones but may not be obvious through a telephone handset. Note that the 3dB frequency in radians is approx Beta, e.g. for Beta = 2^(-3) = 0.125, 3dB freq is 0.125 rads = 159Hz. This is one of the classic DC removal filters, adjusted to provide sufficient bass rolloff to meet the above requirement to protect hybrids from things that upset them. The difference between successive samples produces a lousy HPF, and then a suitably placed pole flattens things out. The final result is a nicely rolled off bass end. The filtering is implemented with extended fractional precision, which noise shapes things, giving very clean DC removal. Make sure the gain of the HPF is 1.0. The first can still saturate a little under impulse conditions, and it might roll to 32768 and need clipping on sustained peak level signals. However, the scale of such clipping is small, and the error due to any saturation should not markedly affect the downstream processing. */ z = amp << 15; z -= (z >> 4); coeff[0] += z - (coeff[0] >> 3) - coeff[1]; coeff[1] = z; z = coeff[0] >> 15; return saturate(z); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int16_t) echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t rx) { int32_t echo_value; int clean_rx; int nsuppr; int score; int i; sample_no++; if (ec->adaption_mode & ECHO_CAN_USE_RX_HPF) rx = echo_can_hpf(ec->rx_hpf, rx); ec->latest_correction = 0; /* Evaluate the echo - i.e. apply the FIR filter */ /* Assume the gain of the FIR does not exceed unity. Exceeding unity would seem like a rather poor thing for an echo cancellor to do :) This means we can compute the result with a total disregard for overflows. 16bits x 16bits -> 31bits, so no overflow can occur in any multiply. While accumulating we may overflow and underflow the 32 bit scale often. However, if the gain does not exceed unity, everything should work itself out, and the final result will be OK, without any saturation logic. */ /* Overflow is very much possible here, and we do nothing about it because of the compute costs */ /* 16 bit coeffs for the LMS give lousy results (maths good, actual sound bad!), but 32 bit coeffs require some shifting. On balance 32 bit seems best */ echo_value = fir16(&ec->fir_state, tx); /* And the answer is..... */ clean_rx = rx - echo_value; printf("echo is %" PRId32 "\n", echo_value); /* That was the easy part. Now we need to adapt! */ if (ec->nonupdate_dwell > 0) ec->nonupdate_dwell--; /* Calculate short term power levels using very simple single pole IIRs */ /* TODO: Is the nasty modulus approach the fastest, or would a real tx*tx power calculation actually be faster? Using the squares makes the numbers grow a lot! */ ec->tx_power[3] += ((abs(tx) - ec->tx_power[3]) >> 5); ec->tx_power[2] += ((tx*tx - ec->tx_power[2]) >> 8); ec->tx_power[1] += ((tx*tx - ec->tx_power[1]) >> 5); ec->tx_power[0] += ((tx*tx - ec->tx_power[0]) >> 3); ec->rx_power[1] += ((rx*rx - ec->rx_power[1]) >> 6); ec->rx_power[0] += ((rx*rx - ec->rx_power[0]) >> 3); ec->clean_rx_power += ((clean_rx*clean_rx - ec->clean_rx_power) >> 6); score = 0; /* If there is very little being transmitted, any attempt to train is futile. We would either be training on the far end's noise or signal, the channel's own noise, or our noise. Either way, this is hardly good training, so don't do it (avoid trouble). */ if (ec->tx_power[0] > MIN_TX_POWER_FOR_ADAPTION) { /* If the received power is very low, either we are sending very little or we are already well adapted. There is little point in trying to improve the adaption under these circumstances, so don't do it (reduce the compute load). */ if (ec->tx_power[1] > ec->rx_power[0]) { /* There is no (or little) far-end speech. */ if (ec->nonupdate_dwell == 0) { if (++ec->narrowband_count >= 160) { ec->narrowband_count = 0; score = narrowband_detect(ec); printf("Do the narrowband test %d at %d\n", score, ec->curr_pos); if (score > 6) { if (ec->narrowband_score == 0) memcpy(ec->fir_taps16[3], ec->fir_taps16[(ec->tap_set + 1)%3], ec->taps*sizeof(int16_t)); ec->narrowband_score += score; } else { if (ec->narrowband_score > 200) { printf("Revert to %d at %d\n", (ec->tap_set + 1)%3, sample_no); memcpy(ec->fir_taps16[ec->tap_set], ec->fir_taps16[3], ec->taps*sizeof(int16_t)); memcpy(ec->fir_taps16[(ec->tap_set - 1)%3], ec->fir_taps16[3], ec->taps*sizeof(int16_t)); for (i = 0; i < ec->taps; i++) ec->fir_taps32[i] = ec->fir_taps16[3][i] << 15; ec->tap_rotate_counter = 1600; } ec->narrowband_score = 0; } } ec->dtd_onset = FALSE; if (--ec->tap_rotate_counter <= 0) { printf("Rotate to %d at %d\n", ec->tap_set, sample_no); ec->tap_rotate_counter = 1600; ec->tap_set++; if (ec->tap_set > 2) ec->tap_set = 0; ec->fir_state.coeffs = ec->fir_taps16[ec->tap_set]; } /* ... and we are not in the dwell time from previous speech. */ if ((ec->adaption_mode & ECHO_CAN_USE_ADAPTION) && ec->narrowband_score == 0) { //nsuppr = saturate((clean_rx << 16)/ec->tx_power[1]); //nsuppr = clean_rx/ec->tx_power[1]; /* If a sudden surge in signal level (e.g. the onset of a tone burst) cause an abnormally high instantaneous to average signal power ratio, we could kick the adaption badly in the wrong direction. This is because the tx_power takes too long to react and rise. We need to stop too rapid adaption to the new signal. We normalise to a value derived from the instantaneous signal if it exceeds the peak by too much. */ nsuppr = clean_rx; /* Divide isn't very quick, but the "where is the top bit" and shift instructions are single cycle. */ if (tx > 4*ec->tx_power[3]) i = top_bit(tx) - 8; else i = top_bit(ec->tx_power[3]) - 8; if (i > 0) nsuppr >>= i; lms_adapt(ec, nsuppr); } } //printf("%10d %10d %10d %10d %10d\n", rx, clean_rx, nsuppr, ec->tx_power[1], ec->rx_power[1]); //printf("%.4f\n", (float) ec->rx_power[1]/(float) ec->clean_rx_power); } else { if (!ec->dtd_onset) { printf("Revert to %d at %d\n", (ec->tap_set + 1)%3, sample_no); memcpy(ec->fir_taps16[ec->tap_set], ec->fir_taps16[(ec->tap_set + 1)%3], ec->taps*sizeof(int16_t)); memcpy(ec->fir_taps16[(ec->tap_set - 1)%3], ec->fir_taps16[(ec->tap_set + 1)%3], ec->taps*sizeof(int16_t)); for (i = 0; i < ec->taps; i++) ec->fir_taps32[i] = ec->fir_taps16[(ec->tap_set + 1)%3][i] << 15; ec->tap_rotate_counter = 1600; ec->dtd_onset = TRUE; } ec->nonupdate_dwell = NONUPDATE_DWELL_TIME; } } if (ec->rx_power[1]) ec->vad = (8000*ec->clean_rx_power)/ec->rx_power[1]; else ec->vad = 0; if (ec->rx_power[1] > 2048*2048 && ec->clean_rx_power > 4*ec->rx_power[1]) { /* The EC seems to be making things worse, instead of better. Zap it! */ memset(ec->fir_taps32, 0, ec->taps*sizeof(int32_t)); for (i = 0; i < 4; i++) memset(ec->fir_taps16[i], 0, ec->taps*sizeof(int16_t)); } #if defined(XYZZY) if ((ec->adaption_mode & ECHO_CAN_USE_SUPPRESSOR)) { ec->supp_test1 += (ec->fir_state.history[ec->curr_pos] - ec->fir_state.history[(ec->curr_pos - 7) & ec->tap_mask]); ec->supp_test2 += (ec->fir_state.history[(ec->curr_pos - 24) & ec->tap_mask] - ec->fir_state.history[(ec->curr_pos - 31) & ec->tap_mask]); if (ec->supp_test1 > 42 && ec->supp_test2 > 42) supp_change = 25; else supp_change = 50; supp = supp_change + k1*ec->supp1 + k2*ec->supp2; ec->supp2 = ec->supp1; ec->supp1 = supp; clean_rx *= (1 - supp); } #endif if ((ec->adaption_mode & ECHO_CAN_USE_NLP)) { /* Non-linear processor - a fancy way to say "zap small signals, to avoid residual echo due to (uLaw/ALaw) non-linearity in the channel.". */ if (ec->rx_power[1] < 30000000) { if (!ec->cng) { ec->cng_level = ec->clean_rx_power; ec->cng = TRUE; } if ((ec->adaption_mode & ECHO_CAN_USE_CNG)) { /* Very elementary comfort noise generation */ /* Just random numbers rolled off very vaguely Hoth-like */ ec->cng_rndnum = 1664525U*ec->cng_rndnum + 1013904223U; ec->cng_filter = ((ec->cng_rndnum & 0xFFFF) - 32768 + 5*ec->cng_filter) >> 3; clean_rx = (ec->cng_filter*ec->cng_level) >> 17; /* TODO: A better CNG, with more accurate (tracking) spectral shaping! */ } else { clean_rx = 0; } //clean_rx = -16000; } else { ec->cng = FALSE; } } else { ec->cng = FALSE; } printf("Narrowband score %4d %5d at %d\n", ec->narrowband_score, score, sample_no); /* Roll around the rolling buffer */ if (ec->curr_pos <= 0) ec->curr_pos = ec->taps; ec->curr_pos--; return (int16_t) clean_rx; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int16_t) echo_can_hpf_tx(echo_can_state_t *ec, int16_t tx) { if (ec->adaption_mode & ECHO_CAN_USE_TX_HPF) tx = echo_can_hpf(ec->tx_hpf, tx); return tx; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/complex_vector_int.c0000664000175000017500000000675111422612261014754 00000000000000/* * SpanDSP - a series of DSP components for telephony * * complex_vector_int.c - Integer complex vector arithmetic routines. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include #include "floating_fudge.h" #include "mmx_sse_decs.h" #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/complex.h" #include "spandsp/vector_int.h" #include "spandsp/complex_vector_int.h" SPAN_DECLARE(complexi32_t) cvec_dot_prodi16(const complexi16_t x[], const complexi16_t y[], int n) { int i; complexi32_t z; z = complex_seti32(0, 0); for (i = 0; i < n; i++) { z.re += ((int32_t) x[i].re*(int32_t) y[i].re - (int32_t) x[i].im*(int32_t) y[i].im); z.im += ((int32_t) x[i].re*(int32_t) y[i].im + (int32_t) x[i].im*(int32_t) y[i].re); } return z; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complexi32_t) cvec_dot_prodi32(const complexi32_t x[], const complexi32_t y[], int n) { int i; complexi32_t z; z = complex_seti32(0, 0); for (i = 0; i < n; i++) { z.re += (x[i].re*y[i].re - x[i].im*y[i].im); z.im += (x[i].re*y[i].im + x[i].im*y[i].re); } return z; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complexi32_t) cvec_circular_dot_prodi16(const complexi16_t x[], const complexi16_t y[], int n, int pos) { complexi32_t z; complexi32_t z1; z = cvec_dot_prodi16(&x[pos], &y[0], n - pos); z1 = cvec_dot_prodi16(&x[0], &y[n - pos], pos); z = complex_addi32(&z, &z1); return z; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) cvec_lmsi16(const complexi16_t x[], complexi16_t y[], int n, const complexi16_t *error) { int i; for (i = 0; i < n; i++) { y[i].re += (int16_t) (((int32_t) x[i].im*(int32_t) error->im + (int32_t) x[i].re*(int32_t) error->re) >> 12); y[i].im += (int16_t) (((int32_t) x[i].re*(int32_t) error->im - (int32_t) x[i].im*(int32_t) error->re) >> 12); } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) cvec_circular_lmsi16(const complexi16_t x[], complexi16_t y[], int n, int pos, const complexi16_t *error) { cvec_lmsi16(&x[pos], &y[0], n - pos, error); cvec_lmsi16(&x[0], &y[n - pos], pos, error); } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/t30_api.c0000664000175000017500000005631612101151140012277 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t30_api.c - ITU T.30 FAX transfer processing * * Written by Steve Underwood * * Copyright (C) 2003, 2004, 2005, 2006, 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/bit_operations.h" #include "spandsp/queue.h" #include "spandsp/power_meter.h" #include "spandsp/complex.h" #include "spandsp/tone_generate.h" #include "spandsp/async.h" #include "spandsp/hdlc.h" #include "spandsp/fsk.h" #include "spandsp/v29rx.h" #include "spandsp/v29tx.h" #include "spandsp/v27ter_rx.h" #include "spandsp/v27ter_tx.h" #include "spandsp/timezone.h" #include "spandsp/t4_rx.h" #include "spandsp/t4_tx.h" #if defined(SPANDSP_SUPPORT_T85) #include "spandsp/t81_t82_arith_coding.h" #include "spandsp/t85.h" #endif #include "spandsp/t4_t6_decode.h" #include "spandsp/t4_t6_encode.h" #include "spandsp/t30_fcf.h" #include "spandsp/t35.h" #include "spandsp/t30.h" #include "spandsp/t30_api.h" #include "spandsp/t30_logging.h" #include "spandsp/private/logging.h" #include "spandsp/private/timezone.h" #if defined(SPANDSP_SUPPORT_T85) #include "spandsp/private/t81_t82_arith_coding.h" #include "spandsp/private/t85.h" #endif #include "spandsp/private/t4_t6_decode.h" #include "spandsp/private/t4_t6_encode.h" #include "spandsp/private/t4_rx.h" #include "spandsp/private/t4_tx.h" #include "spandsp/private/t30.h" #include "t30_local.h" SPAN_DECLARE(int) t30_set_tx_ident(t30_state_t *s, const char *id) { if (id == NULL) { s->tx_info.ident[0] = '\0'; return 0; } if (strlen(id) > T30_MAX_IDENT_LEN) return -1; strcpy(s->tx_info.ident, id); t4_tx_set_local_ident(&s->t4.tx, s->tx_info.ident); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t30_get_tx_ident(t30_state_t *s) { if (s->tx_info.ident[0] == '\0') return NULL; return s->tx_info.ident; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t30_get_rx_ident(t30_state_t *s) { if (s->rx_info.ident[0] == '\0') return NULL; return s->rx_info.ident; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_tx_sub_address(t30_state_t *s, const char *sub_address) { if (sub_address == NULL) { s->tx_info.sub_address[0] = '\0'; return 0; } if (strlen(sub_address) > T30_MAX_IDENT_LEN) return -1; strcpy(s->tx_info.sub_address, sub_address); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t30_get_tx_sub_address(t30_state_t *s) { if (s->tx_info.sub_address[0] == '\0') return NULL; return s->tx_info.sub_address; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t30_get_rx_sub_address(t30_state_t *s) { if (s->rx_info.sub_address[0] == '\0') return NULL; return s->rx_info.sub_address; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_tx_selective_polling_address(t30_state_t *s, const char *selective_polling_address) { if (selective_polling_address == NULL) { s->tx_info.selective_polling_address[0] = '\0'; return 0; } if (strlen(selective_polling_address) > T30_MAX_IDENT_LEN) return -1; strcpy(s->tx_info.selective_polling_address, selective_polling_address); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t30_get_tx_selective_polling_address(t30_state_t *s) { if (s->tx_info.selective_polling_address[0] == '\0') return NULL; return s->tx_info.selective_polling_address; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t30_get_rx_selective_polling_address(t30_state_t *s) { if (s->rx_info.selective_polling_address[0] == '\0') return NULL; return s->rx_info.selective_polling_address; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_tx_polled_sub_address(t30_state_t *s, const char *polled_sub_address) { if (polled_sub_address == NULL) { s->tx_info.polled_sub_address[0] = '\0'; return 0; } if (strlen(polled_sub_address) > T30_MAX_IDENT_LEN) return -1; strcpy(s->tx_info.polled_sub_address, polled_sub_address); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t30_get_tx_polled_sub_address(t30_state_t *s) { if (s->tx_info.polled_sub_address[0] == '\0') return NULL; return s->tx_info.polled_sub_address; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t30_get_rx_polled_sub_address(t30_state_t *s) { if (s->rx_info.polled_sub_address[0] == '\0') return NULL; return s->rx_info.polled_sub_address; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_tx_sender_ident(t30_state_t *s, const char *sender_ident) { if (sender_ident == NULL) { s->tx_info.sender_ident[0] = '\0'; return 0; } if (strlen(sender_ident) > T30_MAX_IDENT_LEN) return -1; strcpy(s->tx_info.sender_ident, sender_ident); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t30_get_tx_sender_ident(t30_state_t *s) { if (s->tx_info.sender_ident[0] == '\0') return NULL; return s->tx_info.sender_ident; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t30_get_rx_sender_ident(t30_state_t *s) { if (s->rx_info.sender_ident[0] == '\0') return NULL; return s->rx_info.sender_ident; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_tx_password(t30_state_t *s, const char *password) { if (password == NULL) { s->tx_info.password[0] = '\0'; return 0; } if (strlen(password) > T30_MAX_IDENT_LEN) return -1; strcpy(s->tx_info.password, password); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t30_get_tx_password(t30_state_t *s) { if (s->tx_info.password[0] == '\0') return NULL; return s->tx_info.password; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t30_get_rx_password(t30_state_t *s) { if (s->rx_info.password[0] == '\0') return NULL; return s->rx_info.password; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_tx_nsf(t30_state_t *s, const uint8_t *nsf, int len) { if (s->tx_info.nsf) free(s->tx_info.nsf); if (nsf && len > 0 && (s->tx_info.nsf = malloc(len + 3))) { memcpy(s->tx_info.nsf + 3, nsf, len); s->tx_info.nsf_len = len; } else { s->tx_info.nsf = NULL; s->tx_info.nsf_len = 0; } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(size_t) t30_get_tx_nsf(t30_state_t *s, const uint8_t *nsf[]) { if (nsf) *nsf = s->tx_info.nsf; return s->tx_info.nsf_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(size_t) t30_get_rx_nsf(t30_state_t *s, const uint8_t *nsf[]) { if (nsf) *nsf = s->rx_info.nsf; return s->rx_info.nsf_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_tx_nsc(t30_state_t *s, const uint8_t *nsc, int len) { if (s->tx_info.nsc) free(s->tx_info.nsc); if (nsc && len > 0 && (s->tx_info.nsc = malloc(len + 3))) { memcpy(s->tx_info.nsc + 3, nsc, len); s->tx_info.nsc_len = len; } else { s->tx_info.nsc = NULL; s->tx_info.nsc_len = 0; } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(size_t) t30_get_tx_nsc(t30_state_t *s, const uint8_t *nsc[]) { if (nsc) *nsc = s->tx_info.nsc; return s->tx_info.nsc_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(size_t) t30_get_rx_nsc(t30_state_t *s, const uint8_t *nsc[]) { if (nsc) *nsc = s->rx_info.nsc; return s->rx_info.nsc_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_tx_nss(t30_state_t *s, const uint8_t *nss, int len) { if (s->tx_info.nss) free(s->tx_info.nss); if (nss && len > 0 && (s->tx_info.nss = malloc(len + 3))) { memcpy(s->tx_info.nss + 3, nss, len); s->tx_info.nss_len = len; } else { s->tx_info.nss = NULL; s->tx_info.nss_len = 0; } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(size_t) t30_get_tx_nss(t30_state_t *s, const uint8_t *nss[]) { if (nss) *nss = s->tx_info.nss; return s->tx_info.nss_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(size_t) t30_get_rx_nss(t30_state_t *s, const uint8_t *nss[]) { if (nss) *nss = s->rx_info.nss; return s->rx_info.nss_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_tx_tsa(t30_state_t *s, int type, const char *address, int len) { if (s->tx_info.tsa) free(s->tx_info.tsa); if (address == NULL || len == 0) { s->tx_info.tsa = NULL; s->tx_info.tsa_len = 0; return 0; } s->tx_info.tsa_type = type; if (len < 0) len = strlen(address); if ((s->tx_info.tsa = malloc(len))) { memcpy(s->tx_info.tsa, address, len); s->tx_info.tsa_len = len; } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(size_t) t30_get_tx_tsa(t30_state_t *s, int *type, const char *address[]) { if (type) *type = s->tx_info.tsa_type; if (address) *address = s->tx_info.tsa; return s->tx_info.tsa_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(size_t) t30_get_rx_tsa(t30_state_t *s, int *type, const char *address[]) { if (type) *type = s->rx_info.tsa_type; if (address) *address = s->rx_info.tsa; return s->rx_info.tsa_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_tx_ira(t30_state_t *s, int type, const char *address, int len) { if (s->tx_info.ira) free(s->tx_info.ira); if (address == NULL) { s->tx_info.ira = NULL; return 0; } s->tx_info.ira = strdup(address); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(size_t) t30_get_tx_ira(t30_state_t *s, int *type, const char *address[]) { if (type) *type = s->tx_info.ira_type; if (address) *address = s->tx_info.ira; return s->tx_info.ira_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(size_t) t30_get_rx_ira(t30_state_t *s, int *type, const char *address[]) { if (type) *type = s->rx_info.ira_type; if (address) *address = s->rx_info.ira; return s->rx_info.ira_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_tx_cia(t30_state_t *s, int type, const char *address, int len) { if (s->tx_info.cia) free(s->tx_info.cia); if (address == NULL) { s->tx_info.cia = NULL; return 0; } s->tx_info.cia = strdup(address); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(size_t) t30_get_tx_cia(t30_state_t *s, int *type, const char *address[]) { if (type) *type = s->tx_info.cia_type; if (address) *address = s->tx_info.cia; return s->tx_info.cia_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(size_t) t30_get_rx_cia(t30_state_t *s, int *type, const char *address[]) { if (type) *type = s->rx_info.cia_type; if (address) *address = s->rx_info.cia; return s->rx_info.cia_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_tx_isp(t30_state_t *s, int type, const char *address, int len) { if (s->tx_info.isp) free(s->tx_info.isp); if (address == NULL) { s->tx_info.isp = NULL; return 0; } s->tx_info.isp = strdup(address); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(size_t) t30_get_tx_isp(t30_state_t *s, int *type, const char *address[]) { if (type) *type = s->tx_info.isp_type; if (address) *address = s->tx_info.isp; return s->tx_info.isp_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(size_t) t30_get_rx_isp(t30_state_t *s, int *type, const char *address[]) { if (type) *type = s->rx_info.isp_type; if (address) *address = s->rx_info.isp; return s->rx_info.isp_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_tx_csa(t30_state_t *s, int type, const char *address, int len) { if (s->tx_info.csa) free(s->tx_info.csa); if (address == NULL) { s->tx_info.csa = NULL; return 0; } s->tx_info.csa = strdup(address); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(size_t) t30_get_tx_csa(t30_state_t *s, int *type, const char *address[]) { if (type) *type = s->tx_info.csa_type; if (address) *address = s->tx_info.csa; return s->tx_info.csa_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(size_t) t30_get_rx_csa(t30_state_t *s, int *type, const char *address[]) { if (type) *type = s->rx_info.csa_type; if (address) *address = s->rx_info.csa; return s->rx_info.csa_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_tx_page_header_overlays_image(t30_state_t *s, int header_overlays_image) { #if 0 s->header_overlays_image = header_overlays_image; t4_tx_set_header_overlays_image(&s->t4.tx, s->header_overlays_image); #endif return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_tx_page_header_info(t30_state_t *s, const char *info) { if (info == NULL) { s->header_info[0] = '\0'; return 0; } if (strlen(info) > T30_MAX_PAGE_HEADER_INFO) return -1; strcpy(s->header_info, info); t4_tx_set_header_info(&s->t4.tx, s->header_info); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(size_t) t30_get_tx_page_header_info(t30_state_t *s, char *info) { if (info) strcpy(info, s->header_info); return strlen(s->header_info); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_tx_page_header_tz(t30_state_t *s, const char *tzstring) { if (tz_init(&s->tz, tzstring)) { s->use_own_tz = TRUE; t4_tx_set_header_tz(&s->t4.tx, &s->tz); return 0; } return -1; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t30_get_rx_country(t30_state_t *s) { return s->country; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t30_get_rx_vendor(t30_state_t *s) { return s->vendor; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t30_get_rx_model(t30_state_t *s) { return s->model; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t30_set_rx_file(t30_state_t *s, const char *file, int stop_page) { strncpy(s->rx_file, file, sizeof(s->rx_file)); s->rx_file[sizeof(s->rx_file) - 1] = '\0'; s->rx_stop_page = stop_page; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t30_set_tx_file(t30_state_t *s, const char *file, int start_page, int stop_page) { strncpy(s->tx_file, file, sizeof(s->tx_file)); s->tx_file[sizeof(s->tx_file) - 1] = '\0'; s->tx_start_page = start_page; s->tx_stop_page = stop_page; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t30_set_iaf_mode(t30_state_t *s, int iaf) { s->iaf = iaf; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_ecm_capability(t30_state_t *s, int enabled) { s->ecm_allowed = enabled; t30_build_dis_or_dtc(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_rx_encoding(t30_state_t *s, int encoding) { switch (encoding) { case T4_COMPRESSION_ITU_T4_1D: case T4_COMPRESSION_ITU_T4_2D: case T4_COMPRESSION_ITU_T6: s->output_encoding = encoding; return 0; } return -1; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_minimum_scan_line_time(t30_state_t *s, int min_time) { /* There are only certain possible times supported, so we need to select the code which best matches the request. */ if (min_time == 0) s->local_min_scan_time_code = 7; else if (min_time <= 5) s->local_min_scan_time_code = 1; else if (min_time <= 10) s->local_min_scan_time_code = 2; else if (min_time <= 20) s->local_min_scan_time_code = 0; else if (min_time <= 40) s->local_min_scan_time_code = 4; else return -1; t30_build_dis_or_dtc(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_supported_modems(t30_state_t *s, int supported_modems) { s->supported_modems = supported_modems; t30_build_dis_or_dtc(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_supported_compressions(t30_state_t *s, int supported_compressions) { int mask; /* Mask out the ones we actually support today. */ mask = T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION #if defined(SPANDSP_SUPPORT_T85) | T30_SUPPORT_T85_COMPRESSION | T30_SUPPORT_T85_L0_COMPRESSION; #else | 0; #endif s->supported_compressions = supported_compressions & mask; t30_build_dis_or_dtc(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_supported_resolutions(t30_state_t *s, int supported_resolutions) { s->supported_resolutions = supported_resolutions; t30_build_dis_or_dtc(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_supported_image_sizes(t30_state_t *s, int supported_image_sizes) { s->supported_image_sizes = supported_image_sizes; t30_build_dis_or_dtc(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_supported_t30_features(t30_state_t *s, int supported_t30_features) { s->supported_t30_features = supported_t30_features; t30_build_dis_or_dtc(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t30_set_status(t30_state_t *s, int status) { if (s->current_status != status) { span_log(&s->logging, SPAN_LOG_FLOW, "Status changing to '%s'\n", t30_completion_code_to_str(status)); s->current_status = status; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_set_receiver_not_ready(t30_state_t *s, int count) { s->receiver_not_ready_count = count; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t30_set_phase_b_handler(t30_state_t *s, t30_phase_b_handler_t *handler, void *user_data) { s->phase_b_handler = handler; s->phase_b_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t30_set_phase_d_handler(t30_state_t *s, t30_phase_d_handler_t *handler, void *user_data) { s->phase_d_handler = handler; s->phase_d_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t30_set_phase_e_handler(t30_state_t *s, t30_phase_e_handler_t *handler, void *user_data) { s->phase_e_handler = handler; s->phase_e_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t30_set_document_handler(t30_state_t *s, t30_document_handler_t *handler, void *user_data) { s->document_handler = handler; s->document_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t30_set_real_time_frame_handler(t30_state_t *s, t30_real_time_frame_handler_t *handler, void *user_data) { s->real_time_frame_handler = handler; s->real_time_frame_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) t30_get_logging_state(t30_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/dds_float.c0000664000175000017500000012065012350625232013006 00000000000000/* * SpanDSP - a series of DSP components for telephony * * complex_dds.c * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/complex.h" #include "spandsp/dds.h" #define SLENK 11 #define SINELEN (1 << SLENK) /* Precreating this table allows it to be in const memory, which might have some performance advantage. */ static const float sine_table[SINELEN] = { 0.00000000f, 0.00306796f, 0.00613588f, 0.00920375f, 0.01227154f, 0.01533921f, 0.01840673f, 0.02147408f, 0.02454123f, 0.02760815f, 0.03067480f, 0.03374117f, 0.03680722f, 0.03987293f, 0.04293826f, 0.04600318f, 0.04906767f, 0.05213170f, 0.05519524f, 0.05825826f, 0.06132074f, 0.06438263f, 0.06744392f, 0.07050457f, 0.07356456f, 0.07662386f, 0.07968244f, 0.08274026f, 0.08579731f, 0.08885355f, 0.09190896f, 0.09496350f, 0.09801714f, 0.10106986f, 0.10412163f, 0.10717242f, 0.11022221f, 0.11327095f, 0.11631863f, 0.11936521f, 0.12241068f, 0.12545498f, 0.12849811f, 0.13154003f, 0.13458071f, 0.13762012f, 0.14065824f, 0.14369503f, 0.14673047f, 0.14976453f, 0.15279719f, 0.15582840f, 0.15885814f, 0.16188639f, 0.16491312f, 0.16793829f, 0.17096189f, 0.17398387f, 0.17700422f, 0.18002290f, 0.18303989f, 0.18605515f, 0.18906866f, 0.19208040f, 0.19509032f, 0.19809841f, 0.20110463f, 0.20410897f, 0.20711138f, 0.21011184f, 0.21311032f, 0.21610680f, 0.21910124f, 0.22209362f, 0.22508391f, 0.22807208f, 0.23105811f, 0.23404196f, 0.23702361f, 0.24000302f, 0.24298018f, 0.24595505f, 0.24892761f, 0.25189782f, 0.25486566f, 0.25783110f, 0.26079412f, 0.26375468f, 0.26671276f, 0.26966833f, 0.27262136f, 0.27557182f, 0.27851969f, 0.28146494f, 0.28440754f, 0.28734746f, 0.29028468f, 0.29321916f, 0.29615089f, 0.29907983f, 0.30200595f, 0.30492923f, 0.30784964f, 0.31076715f, 0.31368174f, 0.31659338f, 0.31950203f, 0.32240768f, 0.32531029f, 0.32820984f, 0.33110631f, 0.33399965f, 0.33688985f, 0.33977688f, 0.34266072f, 0.34554132f, 0.34841868f, 0.35129276f, 0.35416353f, 0.35703096f, 0.35989504f, 0.36275572f, 0.36561300f, 0.36846683f, 0.37131719f, 0.37416406f, 0.37700741f, 0.37984721f, 0.38268343f, 0.38551605f, 0.38834505f, 0.39117038f, 0.39399204f, 0.39680999f, 0.39962420f, 0.40243465f, 0.40524131f, 0.40804416f, 0.41084317f, 0.41363831f, 0.41642956f, 0.41921689f, 0.42200027f, 0.42477968f, 0.42755509f, 0.43032648f, 0.43309382f, 0.43585708f, 0.43861624f, 0.44137127f, 0.44412214f, 0.44686884f, 0.44961133f, 0.45234959f, 0.45508359f, 0.45781330f, 0.46053871f, 0.46325978f, 0.46597650f, 0.46868882f, 0.47139674f, 0.47410021f, 0.47679923f, 0.47949376f, 0.48218377f, 0.48486925f, 0.48755016f, 0.49022648f, 0.49289819f, 0.49556526f, 0.49822767f, 0.50088538f, 0.50353838f, 0.50618665f, 0.50883014f, 0.51146885f, 0.51410274f, 0.51673180f, 0.51935599f, 0.52197529f, 0.52458968f, 0.52719913f, 0.52980362f, 0.53240313f, 0.53499762f, 0.53758708f, 0.54017147f, 0.54275078f, 0.54532499f, 0.54789406f, 0.55045797f, 0.55301671f, 0.55557023f, 0.55811853f, 0.56066158f, 0.56319934f, 0.56573181f, 0.56825895f, 0.57078075f, 0.57329717f, 0.57580819f, 0.57831380f, 0.58081396f, 0.58330865f, 0.58579786f, 0.58828155f, 0.59075970f, 0.59323230f, 0.59569930f, 0.59816071f, 0.60061648f, 0.60306660f, 0.60551104f, 0.60794978f, 0.61038281f, 0.61281008f, 0.61523159f, 0.61764731f, 0.62005721f, 0.62246128f, 0.62485949f, 0.62725182f, 0.62963824f, 0.63201874f, 0.63439328f, 0.63676186f, 0.63912444f, 0.64148101f, 0.64383154f, 0.64617601f, 0.64851440f, 0.65084668f, 0.65317284f, 0.65549285f, 0.65780669f, 0.66011434f, 0.66241578f, 0.66471098f, 0.66699992f, 0.66928259f, 0.67155895f, 0.67382900f, 0.67609270f, 0.67835004f, 0.68060100f, 0.68284555f, 0.68508367f, 0.68731534f, 0.68954054f, 0.69175926f, 0.69397146f, 0.69617713f, 0.69837625f, 0.70056879f, 0.70275474f, 0.70493408f, 0.70710678f, 0.70927283f, 0.71143220f, 0.71358487f, 0.71573083f, 0.71787005f, 0.72000251f, 0.72212819f, 0.72424708f, 0.72635916f, 0.72846439f, 0.73056277f, 0.73265427f, 0.73473888f, 0.73681657f, 0.73888732f, 0.74095113f, 0.74300795f, 0.74505779f, 0.74710061f, 0.74913639f, 0.75116513f, 0.75318680f, 0.75520138f, 0.75720885f, 0.75920919f, 0.76120239f, 0.76318842f, 0.76516727f, 0.76713891f, 0.76910334f, 0.77106052f, 0.77301045f, 0.77495311f, 0.77688847f, 0.77881651f, 0.78073723f, 0.78265060f, 0.78455660f, 0.78645521f, 0.78834643f, 0.79023022f, 0.79210658f, 0.79397548f, 0.79583690f, 0.79769084f, 0.79953727f, 0.80137617f, 0.80320753f, 0.80503133f, 0.80684755f, 0.80865618f, 0.81045720f, 0.81225059f, 0.81403633f, 0.81581441f, 0.81758481f, 0.81934752f, 0.82110251f, 0.82284978f, 0.82458930f, 0.82632106f, 0.82804505f, 0.82976123f, 0.83146961f, 0.83317016f, 0.83486287f, 0.83654773f, 0.83822471f, 0.83989379f, 0.84155498f, 0.84320824f, 0.84485357f, 0.84649094f, 0.84812034f, 0.84974177f, 0.85135519f, 0.85296060f, 0.85455799f, 0.85614733f, 0.85772861f, 0.85930182f, 0.86086694f, 0.86242396f, 0.86397286f, 0.86551362f, 0.86704625f, 0.86857071f, 0.87008699f, 0.87159509f, 0.87309498f, 0.87458665f, 0.87607009f, 0.87754529f, 0.87901223f, 0.88047089f, 0.88192126f, 0.88336334f, 0.88479710f, 0.88622253f, 0.88763962f, 0.88904836f, 0.89044872f, 0.89184071f, 0.89322430f, 0.89459949f, 0.89596625f, 0.89732458f, 0.89867447f, 0.90001589f, 0.90134885f, 0.90267332f, 0.90398929f, 0.90529676f, 0.90659570f, 0.90788612f, 0.90916798f, 0.91044129f, 0.91170603f, 0.91296219f, 0.91420976f, 0.91544872f, 0.91667906f, 0.91790078f, 0.91911385f, 0.92031828f, 0.92151404f, 0.92270113f, 0.92387953f, 0.92504924f, 0.92621024f, 0.92736253f, 0.92850608f, 0.92964090f, 0.93076696f, 0.93188427f, 0.93299280f, 0.93409255f, 0.93518351f, 0.93626567f, 0.93733901f, 0.93840353f, 0.93945922f, 0.94050607f, 0.94154407f, 0.94257320f, 0.94359346f, 0.94460484f, 0.94560733f, 0.94660091f, 0.94758559f, 0.94856135f, 0.94952818f, 0.95048607f, 0.95143502f, 0.95237501f, 0.95330604f, 0.95422810f, 0.95514117f, 0.95604525f, 0.95694034f, 0.95782641f, 0.95870347f, 0.95957151f, 0.96043052f, 0.96128049f, 0.96212140f, 0.96295327f, 0.96377607f, 0.96458979f, 0.96539444f, 0.96619000f, 0.96697647f, 0.96775384f, 0.96852209f, 0.96928124f, 0.97003125f, 0.97077214f, 0.97150389f, 0.97222650f, 0.97293995f, 0.97364425f, 0.97433938f, 0.97502535f, 0.97570213f, 0.97636973f, 0.97702814f, 0.97767736f, 0.97831737f, 0.97894818f, 0.97956977f, 0.98018214f, 0.98078528f, 0.98137919f, 0.98196387f, 0.98253930f, 0.98310549f, 0.98366242f, 0.98421009f, 0.98474850f, 0.98527764f, 0.98579751f, 0.98630810f, 0.98680940f, 0.98730142f, 0.98778414f, 0.98825757f, 0.98872169f, 0.98917651f, 0.98962202f, 0.99005821f, 0.99048508f, 0.99090264f, 0.99131086f, 0.99170975f, 0.99209931f, 0.99247953f, 0.99285041f, 0.99321195f, 0.99356414f, 0.99390697f, 0.99424045f, 0.99456457f, 0.99487933f, 0.99518473f, 0.99548076f, 0.99576741f, 0.99604470f, 0.99631261f, 0.99657115f, 0.99682030f, 0.99706007f, 0.99729046f, 0.99751146f, 0.99772307f, 0.99792529f, 0.99811811f, 0.99830154f, 0.99847558f, 0.99864022f, 0.99879546f, 0.99894129f, 0.99907773f, 0.99920476f, 0.99932238f, 0.99943060f, 0.99952942f, 0.99961882f, 0.99969882f, 0.99976941f, 0.99983058f, 0.99988235f, 0.99992470f, 0.99995764f, 0.99998118f, 0.99999529f, 1.00000000f, 0.99999529f, 0.99998118f, 0.99995764f, 0.99992470f, 0.99988235f, 0.99983058f, 0.99976941f, 0.99969882f, 0.99961882f, 0.99952942f, 0.99943060f, 0.99932238f, 0.99920476f, 0.99907773f, 0.99894129f, 0.99879546f, 0.99864022f, 0.99847558f, 0.99830154f, 0.99811811f, 0.99792529f, 0.99772307f, 0.99751146f, 0.99729046f, 0.99706007f, 0.99682030f, 0.99657115f, 0.99631261f, 0.99604470f, 0.99576741f, 0.99548076f, 0.99518473f, 0.99487933f, 0.99456457f, 0.99424045f, 0.99390697f, 0.99356414f, 0.99321195f, 0.99285041f, 0.99247953f, 0.99209931f, 0.99170975f, 0.99131086f, 0.99090264f, 0.99048508f, 0.99005821f, 0.98962202f, 0.98917651f, 0.98872169f, 0.98825757f, 0.98778414f, 0.98730142f, 0.98680940f, 0.98630810f, 0.98579751f, 0.98527764f, 0.98474850f, 0.98421009f, 0.98366242f, 0.98310549f, 0.98253930f, 0.98196387f, 0.98137919f, 0.98078528f, 0.98018214f, 0.97956977f, 0.97894818f, 0.97831737f, 0.97767736f, 0.97702814f, 0.97636973f, 0.97570213f, 0.97502535f, 0.97433938f, 0.97364425f, 0.97293995f, 0.97222650f, 0.97150389f, 0.97077214f, 0.97003125f, 0.96928124f, 0.96852209f, 0.96775384f, 0.96697647f, 0.96619000f, 0.96539444f, 0.96458979f, 0.96377607f, 0.96295327f, 0.96212140f, 0.96128049f, 0.96043052f, 0.95957151f, 0.95870347f, 0.95782641f, 0.95694034f, 0.95604525f, 0.95514117f, 0.95422810f, 0.95330604f, 0.95237501f, 0.95143502f, 0.95048607f, 0.94952818f, 0.94856135f, 0.94758559f, 0.94660091f, 0.94560733f, 0.94460484f, 0.94359346f, 0.94257320f, 0.94154407f, 0.94050607f, 0.93945922f, 0.93840353f, 0.93733901f, 0.93626567f, 0.93518351f, 0.93409255f, 0.93299280f, 0.93188427f, 0.93076696f, 0.92964090f, 0.92850608f, 0.92736253f, 0.92621024f, 0.92504924f, 0.92387953f, 0.92270113f, 0.92151404f, 0.92031828f, 0.91911385f, 0.91790078f, 0.91667906f, 0.91544872f, 0.91420976f, 0.91296219f, 0.91170603f, 0.91044129f, 0.90916798f, 0.90788612f, 0.90659570f, 0.90529676f, 0.90398929f, 0.90267332f, 0.90134885f, 0.90001589f, 0.89867447f, 0.89732458f, 0.89596625f, 0.89459949f, 0.89322430f, 0.89184071f, 0.89044872f, 0.88904836f, 0.88763962f, 0.88622253f, 0.88479710f, 0.88336334f, 0.88192126f, 0.88047089f, 0.87901223f, 0.87754529f, 0.87607009f, 0.87458665f, 0.87309498f, 0.87159509f, 0.87008699f, 0.86857071f, 0.86704625f, 0.86551362f, 0.86397286f, 0.86242396f, 0.86086694f, 0.85930182f, 0.85772861f, 0.85614733f, 0.85455799f, 0.85296060f, 0.85135519f, 0.84974177f, 0.84812034f, 0.84649094f, 0.84485357f, 0.84320824f, 0.84155498f, 0.83989379f, 0.83822471f, 0.83654773f, 0.83486287f, 0.83317016f, 0.83146961f, 0.82976123f, 0.82804505f, 0.82632106f, 0.82458930f, 0.82284978f, 0.82110251f, 0.81934752f, 0.81758481f, 0.81581441f, 0.81403633f, 0.81225059f, 0.81045720f, 0.80865618f, 0.80684755f, 0.80503133f, 0.80320753f, 0.80137617f, 0.79953727f, 0.79769084f, 0.79583690f, 0.79397548f, 0.79210658f, 0.79023022f, 0.78834643f, 0.78645521f, 0.78455660f, 0.78265060f, 0.78073723f, 0.77881651f, 0.77688847f, 0.77495311f, 0.77301045f, 0.77106052f, 0.76910334f, 0.76713891f, 0.76516727f, 0.76318842f, 0.76120239f, 0.75920919f, 0.75720885f, 0.75520138f, 0.75318680f, 0.75116513f, 0.74913639f, 0.74710061f, 0.74505779f, 0.74300795f, 0.74095113f, 0.73888732f, 0.73681657f, 0.73473888f, 0.73265427f, 0.73056277f, 0.72846439f, 0.72635916f, 0.72424708f, 0.72212819f, 0.72000251f, 0.71787005f, 0.71573083f, 0.71358487f, 0.71143220f, 0.70927283f, 0.70710678f, 0.70493408f, 0.70275474f, 0.70056879f, 0.69837625f, 0.69617713f, 0.69397146f, 0.69175926f, 0.68954054f, 0.68731534f, 0.68508367f, 0.68284555f, 0.68060100f, 0.67835004f, 0.67609270f, 0.67382900f, 0.67155895f, 0.66928259f, 0.66699992f, 0.66471098f, 0.66241578f, 0.66011434f, 0.65780669f, 0.65549285f, 0.65317284f, 0.65084668f, 0.64851440f, 0.64617601f, 0.64383154f, 0.64148101f, 0.63912444f, 0.63676186f, 0.63439328f, 0.63201874f, 0.62963824f, 0.62725182f, 0.62485949f, 0.62246128f, 0.62005721f, 0.61764731f, 0.61523159f, 0.61281008f, 0.61038281f, 0.60794978f, 0.60551104f, 0.60306660f, 0.60061648f, 0.59816071f, 0.59569930f, 0.59323230f, 0.59075970f, 0.58828155f, 0.58579786f, 0.58330865f, 0.58081396f, 0.57831380f, 0.57580819f, 0.57329717f, 0.57078075f, 0.56825895f, 0.56573181f, 0.56319934f, 0.56066158f, 0.55811853f, 0.55557023f, 0.55301671f, 0.55045797f, 0.54789406f, 0.54532499f, 0.54275078f, 0.54017147f, 0.53758708f, 0.53499762f, 0.53240313f, 0.52980362f, 0.52719913f, 0.52458968f, 0.52197529f, 0.51935599f, 0.51673180f, 0.51410274f, 0.51146885f, 0.50883014f, 0.50618665f, 0.50353838f, 0.50088538f, 0.49822767f, 0.49556526f, 0.49289819f, 0.49022648f, 0.48755016f, 0.48486925f, 0.48218377f, 0.47949376f, 0.47679923f, 0.47410021f, 0.47139674f, 0.46868882f, 0.46597650f, 0.46325978f, 0.46053871f, 0.45781330f, 0.45508359f, 0.45234959f, 0.44961133f, 0.44686884f, 0.44412214f, 0.44137127f, 0.43861624f, 0.43585708f, 0.43309382f, 0.43032648f, 0.42755509f, 0.42477968f, 0.42200027f, 0.41921689f, 0.41642956f, 0.41363831f, 0.41084317f, 0.40804416f, 0.40524131f, 0.40243465f, 0.39962420f, 0.39680999f, 0.39399204f, 0.39117038f, 0.38834505f, 0.38551605f, 0.38268343f, 0.37984721f, 0.37700741f, 0.37416406f, 0.37131719f, 0.36846683f, 0.36561300f, 0.36275572f, 0.35989504f, 0.35703096f, 0.35416353f, 0.35129276f, 0.34841868f, 0.34554132f, 0.34266072f, 0.33977688f, 0.33688985f, 0.33399965f, 0.33110631f, 0.32820984f, 0.32531029f, 0.32240768f, 0.31950203f, 0.31659338f, 0.31368174f, 0.31076715f, 0.30784964f, 0.30492923f, 0.30200595f, 0.29907983f, 0.29615089f, 0.29321916f, 0.29028468f, 0.28734746f, 0.28440754f, 0.28146494f, 0.27851969f, 0.27557182f, 0.27262136f, 0.26966833f, 0.26671276f, 0.26375468f, 0.26079412f, 0.25783110f, 0.25486566f, 0.25189782f, 0.24892761f, 0.24595505f, 0.24298018f, 0.24000302f, 0.23702361f, 0.23404196f, 0.23105811f, 0.22807208f, 0.22508391f, 0.22209362f, 0.21910124f, 0.21610680f, 0.21311032f, 0.21011184f, 0.20711138f, 0.20410897f, 0.20110463f, 0.19809841f, 0.19509032f, 0.19208040f, 0.18906866f, 0.18605515f, 0.18303989f, 0.18002290f, 0.17700422f, 0.17398387f, 0.17096189f, 0.16793829f, 0.16491312f, 0.16188639f, 0.15885814f, 0.15582840f, 0.15279719f, 0.14976453f, 0.14673047f, 0.14369503f, 0.14065824f, 0.13762012f, 0.13458071f, 0.13154003f, 0.12849811f, 0.12545498f, 0.12241068f, 0.11936521f, 0.11631863f, 0.11327095f, 0.11022221f, 0.10717242f, 0.10412163f, 0.10106986f, 0.09801714f, 0.09496350f, 0.09190896f, 0.08885355f, 0.08579731f, 0.08274026f, 0.07968244f, 0.07662386f, 0.07356456f, 0.07050457f, 0.06744392f, 0.06438263f, 0.06132074f, 0.05825826f, 0.05519524f, 0.05213170f, 0.04906767f, 0.04600318f, 0.04293826f, 0.03987293f, 0.03680722f, 0.03374117f, 0.03067480f, 0.02760815f, 0.02454123f, 0.02147408f, 0.01840673f, 0.01533921f, 0.01227154f, 0.00920375f, 0.00613588f, 0.00306796f, 0.00000000f, -0.00306796f, -0.00613588f, -0.00920375f, -0.01227154f, -0.01533921f, -0.01840673f, -0.02147408f, -0.02454123f, -0.02760815f, -0.03067480f, -0.03374117f, -0.03680722f, -0.03987293f, -0.04293826f, -0.04600318f, -0.04906767f, -0.05213170f, -0.05519524f, -0.05825826f, -0.06132074f, -0.06438263f, -0.06744392f, -0.07050457f, -0.07356456f, -0.07662386f, -0.07968244f, -0.08274026f, -0.08579731f, -0.08885355f, -0.09190896f, -0.09496350f, -0.09801714f, -0.10106986f, -0.10412163f, -0.10717242f, -0.11022221f, -0.11327095f, -0.11631863f, -0.11936521f, -0.12241068f, -0.12545498f, -0.12849811f, -0.13154003f, -0.13458071f, -0.13762012f, -0.14065824f, -0.14369503f, -0.14673047f, -0.14976453f, -0.15279719f, -0.15582840f, -0.15885814f, -0.16188639f, -0.16491312f, -0.16793829f, -0.17096189f, -0.17398387f, -0.17700422f, -0.18002290f, -0.18303989f, -0.18605515f, -0.18906866f, -0.19208040f, -0.19509032f, -0.19809841f, -0.20110463f, -0.20410897f, -0.20711138f, -0.21011184f, -0.21311032f, -0.21610680f, -0.21910124f, -0.22209362f, -0.22508391f, -0.22807208f, -0.23105811f, -0.23404196f, -0.23702361f, -0.24000302f, -0.24298018f, -0.24595505f, -0.24892761f, -0.25189782f, -0.25486566f, -0.25783110f, -0.26079412f, -0.26375468f, -0.26671276f, -0.26966833f, -0.27262136f, -0.27557182f, -0.27851969f, -0.28146494f, -0.28440754f, -0.28734746f, -0.29028468f, -0.29321916f, -0.29615089f, -0.29907983f, -0.30200595f, -0.30492923f, -0.30784964f, -0.31076715f, -0.31368174f, -0.31659338f, -0.31950203f, -0.32240768f, -0.32531029f, -0.32820984f, -0.33110631f, -0.33399965f, -0.33688985f, -0.33977688f, -0.34266072f, -0.34554132f, -0.34841868f, -0.35129276f, -0.35416353f, -0.35703096f, -0.35989504f, -0.36275572f, -0.36561300f, -0.36846683f, -0.37131719f, -0.37416406f, -0.37700741f, -0.37984721f, -0.38268343f, -0.38551605f, -0.38834505f, -0.39117038f, -0.39399204f, -0.39680999f, -0.39962420f, -0.40243465f, -0.40524131f, -0.40804416f, -0.41084317f, -0.41363831f, -0.41642956f, -0.41921689f, -0.42200027f, -0.42477968f, -0.42755509f, -0.43032648f, -0.43309382f, -0.43585708f, -0.43861624f, -0.44137127f, -0.44412214f, -0.44686884f, -0.44961133f, -0.45234959f, -0.45508359f, -0.45781330f, -0.46053871f, -0.46325978f, -0.46597650f, -0.46868882f, -0.47139674f, -0.47410021f, -0.47679923f, -0.47949376f, -0.48218377f, -0.48486925f, -0.48755016f, -0.49022648f, -0.49289819f, -0.49556526f, -0.49822767f, -0.50088538f, -0.50353838f, -0.50618665f, -0.50883014f, -0.51146885f, -0.51410274f, -0.51673180f, -0.51935599f, -0.52197529f, -0.52458968f, -0.52719913f, -0.52980362f, -0.53240313f, -0.53499762f, -0.53758708f, -0.54017147f, -0.54275078f, -0.54532499f, -0.54789406f, -0.55045797f, -0.55301671f, -0.55557023f, -0.55811853f, -0.56066158f, -0.56319934f, -0.56573181f, -0.56825895f, -0.57078075f, -0.57329717f, -0.57580819f, -0.57831380f, -0.58081396f, -0.58330865f, -0.58579786f, -0.58828155f, -0.59075970f, -0.59323230f, -0.59569930f, -0.59816071f, -0.60061648f, -0.60306660f, -0.60551104f, -0.60794978f, -0.61038281f, -0.61281008f, -0.61523159f, -0.61764731f, -0.62005721f, -0.62246128f, -0.62485949f, -0.62725182f, -0.62963824f, -0.63201874f, -0.63439328f, -0.63676186f, -0.63912444f, -0.64148101f, -0.64383154f, -0.64617601f, -0.64851440f, -0.65084668f, -0.65317284f, -0.65549285f, -0.65780669f, -0.66011434f, -0.66241578f, -0.66471098f, -0.66699992f, -0.66928259f, -0.67155895f, -0.67382900f, -0.67609270f, -0.67835004f, -0.68060100f, -0.68284555f, -0.68508367f, -0.68731534f, -0.68954054f, -0.69175926f, -0.69397146f, -0.69617713f, -0.69837625f, -0.70056879f, -0.70275474f, -0.70493408f, -0.70710678f, -0.70927283f, -0.71143220f, -0.71358487f, -0.71573083f, -0.71787005f, -0.72000251f, -0.72212819f, -0.72424708f, -0.72635916f, -0.72846439f, -0.73056277f, -0.73265427f, -0.73473888f, -0.73681657f, -0.73888732f, -0.74095113f, -0.74300795f, -0.74505779f, -0.74710061f, -0.74913639f, -0.75116513f, -0.75318680f, -0.75520138f, -0.75720885f, -0.75920919f, -0.76120239f, -0.76318842f, -0.76516727f, -0.76713891f, -0.76910334f, -0.77106052f, -0.77301045f, -0.77495311f, -0.77688847f, -0.77881651f, -0.78073723f, -0.78265060f, -0.78455660f, -0.78645521f, -0.78834643f, -0.79023022f, -0.79210658f, -0.79397548f, -0.79583690f, -0.79769084f, -0.79953727f, -0.80137617f, -0.80320753f, -0.80503133f, -0.80684755f, -0.80865618f, -0.81045720f, -0.81225059f, -0.81403633f, -0.81581441f, -0.81758481f, -0.81934752f, -0.82110251f, -0.82284978f, -0.82458930f, -0.82632106f, -0.82804505f, -0.82976123f, -0.83146961f, -0.83317016f, -0.83486287f, -0.83654773f, -0.83822471f, -0.83989379f, -0.84155498f, -0.84320824f, -0.84485357f, -0.84649094f, -0.84812034f, -0.84974177f, -0.85135519f, -0.85296060f, -0.85455799f, -0.85614733f, -0.85772861f, -0.85930182f, -0.86086694f, -0.86242396f, -0.86397286f, -0.86551362f, -0.86704625f, -0.86857071f, -0.87008699f, -0.87159509f, -0.87309498f, -0.87458665f, -0.87607009f, -0.87754529f, -0.87901223f, -0.88047089f, -0.88192126f, -0.88336334f, -0.88479710f, -0.88622253f, -0.88763962f, -0.88904836f, -0.89044872f, -0.89184071f, -0.89322430f, -0.89459949f, -0.89596625f, -0.89732458f, -0.89867447f, -0.90001589f, -0.90134885f, -0.90267332f, -0.90398929f, -0.90529676f, -0.90659570f, -0.90788612f, -0.90916798f, -0.91044129f, -0.91170603f, -0.91296219f, -0.91420976f, -0.91544872f, -0.91667906f, -0.91790078f, -0.91911385f, -0.92031828f, -0.92151404f, -0.92270113f, -0.92387953f, -0.92504924f, -0.92621024f, -0.92736253f, -0.92850608f, -0.92964090f, -0.93076696f, -0.93188427f, -0.93299280f, -0.93409255f, -0.93518351f, -0.93626567f, -0.93733901f, -0.93840353f, -0.93945922f, -0.94050607f, -0.94154407f, -0.94257320f, -0.94359346f, -0.94460484f, -0.94560733f, -0.94660091f, -0.94758559f, -0.94856135f, -0.94952818f, -0.95048607f, -0.95143502f, -0.95237501f, -0.95330604f, -0.95422810f, -0.95514117f, -0.95604525f, -0.95694034f, -0.95782641f, -0.95870347f, -0.95957151f, -0.96043052f, -0.96128049f, -0.96212140f, -0.96295327f, -0.96377607f, -0.96458979f, -0.96539444f, -0.96619000f, -0.96697647f, -0.96775384f, -0.96852209f, -0.96928124f, -0.97003125f, -0.97077214f, -0.97150389f, -0.97222650f, -0.97293995f, -0.97364425f, -0.97433938f, -0.97502535f, -0.97570213f, -0.97636973f, -0.97702814f, -0.97767736f, -0.97831737f, -0.97894818f, -0.97956977f, -0.98018214f, -0.98078528f, -0.98137919f, -0.98196387f, -0.98253930f, -0.98310549f, -0.98366242f, -0.98421009f, -0.98474850f, -0.98527764f, -0.98579751f, -0.98630810f, -0.98680940f, -0.98730142f, -0.98778414f, -0.98825757f, -0.98872169f, -0.98917651f, -0.98962202f, -0.99005821f, -0.99048508f, -0.99090264f, -0.99131086f, -0.99170975f, -0.99209931f, -0.99247953f, -0.99285041f, -0.99321195f, -0.99356414f, -0.99390697f, -0.99424045f, -0.99456457f, -0.99487933f, -0.99518473f, -0.99548076f, -0.99576741f, -0.99604470f, -0.99631261f, -0.99657115f, -0.99682030f, -0.99706007f, -0.99729046f, -0.99751146f, -0.99772307f, -0.99792529f, -0.99811811f, -0.99830154f, -0.99847558f, -0.99864022f, -0.99879546f, -0.99894129f, -0.99907773f, -0.99920476f, -0.99932238f, -0.99943060f, -0.99952942f, -0.99961882f, -0.99969882f, -0.99976941f, -0.99983058f, -0.99988235f, -0.99992470f, -0.99995764f, -0.99998118f, -0.99999529f, -1.00000000f, -0.99999529f, -0.99998118f, -0.99995764f, -0.99992470f, -0.99988235f, -0.99983058f, -0.99976941f, -0.99969882f, -0.99961882f, -0.99952942f, -0.99943060f, -0.99932238f, -0.99920476f, -0.99907773f, -0.99894129f, -0.99879546f, -0.99864022f, -0.99847558f, -0.99830154f, -0.99811811f, -0.99792529f, -0.99772307f, -0.99751146f, -0.99729046f, -0.99706007f, -0.99682030f, -0.99657115f, -0.99631261f, -0.99604470f, -0.99576741f, -0.99548076f, -0.99518473f, -0.99487933f, -0.99456457f, -0.99424045f, -0.99390697f, -0.99356414f, -0.99321195f, -0.99285041f, -0.99247953f, -0.99209931f, -0.99170975f, -0.99131086f, -0.99090264f, -0.99048508f, -0.99005821f, -0.98962202f, -0.98917651f, -0.98872169f, -0.98825757f, -0.98778414f, -0.98730142f, -0.98680940f, -0.98630810f, -0.98579751f, -0.98527764f, -0.98474850f, -0.98421009f, -0.98366242f, -0.98310549f, -0.98253930f, -0.98196387f, -0.98137919f, -0.98078528f, -0.98018214f, -0.97956977f, -0.97894818f, -0.97831737f, -0.97767736f, -0.97702814f, -0.97636973f, -0.97570213f, -0.97502535f, -0.97433938f, -0.97364425f, -0.97293995f, -0.97222650f, -0.97150389f, -0.97077214f, -0.97003125f, -0.96928124f, -0.96852209f, -0.96775384f, -0.96697647f, -0.96619000f, -0.96539444f, -0.96458979f, -0.96377607f, -0.96295327f, -0.96212140f, -0.96128049f, -0.96043052f, -0.95957151f, -0.95870347f, -0.95782641f, -0.95694034f, -0.95604525f, -0.95514117f, -0.95422810f, -0.95330604f, -0.95237501f, -0.95143502f, -0.95048607f, -0.94952818f, -0.94856135f, -0.94758559f, -0.94660091f, -0.94560733f, -0.94460484f, -0.94359346f, -0.94257320f, -0.94154407f, -0.94050607f, -0.93945922f, -0.93840353f, -0.93733901f, -0.93626567f, -0.93518351f, -0.93409255f, -0.93299280f, -0.93188427f, -0.93076696f, -0.92964090f, -0.92850608f, -0.92736253f, -0.92621024f, -0.92504924f, -0.92387953f, -0.92270113f, -0.92151404f, -0.92031828f, -0.91911385f, -0.91790078f, -0.91667906f, -0.91544872f, -0.91420976f, -0.91296219f, -0.91170603f, -0.91044129f, -0.90916798f, -0.90788612f, -0.90659570f, -0.90529676f, -0.90398929f, -0.90267332f, -0.90134885f, -0.90001589f, -0.89867447f, -0.89732458f, -0.89596625f, -0.89459949f, -0.89322430f, -0.89184071f, -0.89044872f, -0.88904836f, -0.88763962f, -0.88622253f, -0.88479710f, -0.88336334f, -0.88192126f, -0.88047089f, -0.87901223f, -0.87754529f, -0.87607009f, -0.87458665f, -0.87309498f, -0.87159509f, -0.87008699f, -0.86857071f, -0.86704625f, -0.86551362f, -0.86397286f, -0.86242396f, -0.86086694f, -0.85930182f, -0.85772861f, -0.85614733f, -0.85455799f, -0.85296060f, -0.85135519f, -0.84974177f, -0.84812034f, -0.84649094f, -0.84485357f, -0.84320824f, -0.84155498f, -0.83989379f, -0.83822471f, -0.83654773f, -0.83486287f, -0.83317016f, -0.83146961f, -0.82976123f, -0.82804505f, -0.82632106f, -0.82458930f, -0.82284978f, -0.82110251f, -0.81934752f, -0.81758481f, -0.81581441f, -0.81403633f, -0.81225059f, -0.81045720f, -0.80865618f, -0.80684755f, -0.80503133f, -0.80320753f, -0.80137617f, -0.79953727f, -0.79769084f, -0.79583690f, -0.79397548f, -0.79210658f, -0.79023022f, -0.78834643f, -0.78645521f, -0.78455660f, -0.78265060f, -0.78073723f, -0.77881651f, -0.77688847f, -0.77495311f, -0.77301045f, -0.77106052f, -0.76910334f, -0.76713891f, -0.76516727f, -0.76318842f, -0.76120239f, -0.75920919f, -0.75720885f, -0.75520138f, -0.75318680f, -0.75116513f, -0.74913639f, -0.74710061f, -0.74505779f, -0.74300795f, -0.74095113f, -0.73888732f, -0.73681657f, -0.73473888f, -0.73265427f, -0.73056277f, -0.72846439f, -0.72635916f, -0.72424708f, -0.72212819f, -0.72000251f, -0.71787005f, -0.71573083f, -0.71358487f, -0.71143220f, -0.70927283f, -0.70710678f, -0.70493408f, -0.70275474f, -0.70056879f, -0.69837625f, -0.69617713f, -0.69397146f, -0.69175926f, -0.68954054f, -0.68731534f, -0.68508367f, -0.68284555f, -0.68060100f, -0.67835004f, -0.67609270f, -0.67382900f, -0.67155895f, -0.66928259f, -0.66699992f, -0.66471098f, -0.66241578f, -0.66011434f, -0.65780669f, -0.65549285f, -0.65317284f, -0.65084668f, -0.64851440f, -0.64617601f, -0.64383154f, -0.64148101f, -0.63912444f, -0.63676186f, -0.63439328f, -0.63201874f, -0.62963824f, -0.62725182f, -0.62485949f, -0.62246128f, -0.62005721f, -0.61764731f, -0.61523159f, -0.61281008f, -0.61038281f, -0.60794978f, -0.60551104f, -0.60306660f, -0.60061648f, -0.59816071f, -0.59569930f, -0.59323230f, -0.59075970f, -0.58828155f, -0.58579786f, -0.58330865f, -0.58081396f, -0.57831380f, -0.57580819f, -0.57329717f, -0.57078075f, -0.56825895f, -0.56573181f, -0.56319934f, -0.56066158f, -0.55811853f, -0.55557023f, -0.55301671f, -0.55045797f, -0.54789406f, -0.54532499f, -0.54275078f, -0.54017147f, -0.53758708f, -0.53499762f, -0.53240313f, -0.52980362f, -0.52719913f, -0.52458968f, -0.52197529f, -0.51935599f, -0.51673180f, -0.51410274f, -0.51146885f, -0.50883014f, -0.50618665f, -0.50353838f, -0.50088538f, -0.49822767f, -0.49556526f, -0.49289819f, -0.49022648f, -0.48755016f, -0.48486925f, -0.48218377f, -0.47949376f, -0.47679923f, -0.47410021f, -0.47139674f, -0.46868882f, -0.46597650f, -0.46325978f, -0.46053871f, -0.45781330f, -0.45508359f, -0.45234959f, -0.44961133f, -0.44686884f, -0.44412214f, -0.44137127f, -0.43861624f, -0.43585708f, -0.43309382f, -0.43032648f, -0.42755509f, -0.42477968f, -0.42200027f, -0.41921689f, -0.41642956f, -0.41363831f, -0.41084317f, -0.40804416f, -0.40524131f, -0.40243465f, -0.39962420f, -0.39680999f, -0.39399204f, -0.39117038f, -0.38834505f, -0.38551605f, -0.38268343f, -0.37984721f, -0.37700741f, -0.37416406f, -0.37131719f, -0.36846683f, -0.36561300f, -0.36275572f, -0.35989504f, -0.35703096f, -0.35416353f, -0.35129276f, -0.34841868f, -0.34554132f, -0.34266072f, -0.33977688f, -0.33688985f, -0.33399965f, -0.33110631f, -0.32820984f, -0.32531029f, -0.32240768f, -0.31950203f, -0.31659338f, -0.31368174f, -0.31076715f, -0.30784964f, -0.30492923f, -0.30200595f, -0.29907983f, -0.29615089f, -0.29321916f, -0.29028468f, -0.28734746f, -0.28440754f, -0.28146494f, -0.27851969f, -0.27557182f, -0.27262136f, -0.26966833f, -0.26671276f, -0.26375468f, -0.26079412f, -0.25783110f, -0.25486566f, -0.25189782f, -0.24892761f, -0.24595505f, -0.24298018f, -0.24000302f, -0.23702361f, -0.23404196f, -0.23105811f, -0.22807208f, -0.22508391f, -0.22209362f, -0.21910124f, -0.21610680f, -0.21311032f, -0.21011184f, -0.20711138f, -0.20410897f, -0.20110463f, -0.19809841f, -0.19509032f, -0.19208040f, -0.18906866f, -0.18605515f, -0.18303989f, -0.18002290f, -0.17700422f, -0.17398387f, -0.17096189f, -0.16793829f, -0.16491312f, -0.16188639f, -0.15885814f, -0.15582840f, -0.15279719f, -0.14976453f, -0.14673047f, -0.14369503f, -0.14065824f, -0.13762012f, -0.13458071f, -0.13154003f, -0.12849811f, -0.12545498f, -0.12241068f, -0.11936521f, -0.11631863f, -0.11327095f, -0.11022221f, -0.10717242f, -0.10412163f, -0.10106986f, -0.09801714f, -0.09496350f, -0.09190896f, -0.08885355f, -0.08579731f, -0.08274026f, -0.07968244f, -0.07662386f, -0.07356456f, -0.07050457f, -0.06744392f, -0.06438263f, -0.06132074f, -0.05825826f, -0.05519524f, -0.05213170f, -0.04906767f, -0.04600318f, -0.04293826f, -0.03987293f, -0.03680722f, -0.03374117f, -0.03067480f, -0.02760815f, -0.02454123f, -0.02147408f, -0.01840673f, -0.01533921f, -0.01227154f, -0.00920375f, -0.00613588f, -0.00306796f }; SPAN_DECLARE(float) dds_phase_to_radians(uint32_t phase) { return phase*2.0f*3.1415926f/(65536.0f*65536.0f); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int32_t) dds_phase_ratef(float frequency) { return (int32_t) (frequency*65536.0f*65536.0f/SAMPLE_RATE); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) dds_frequencyf(int32_t phase_rate) { return (float) phase_rate*(float) SAMPLE_RATE/(65536.0f*65536.0f); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) dds_scaling_dbm0f(float level) { return powf(10.0f, (level - DBM0_MAX_SINE_POWER)/20.0f)*32767.0f; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) dds_scaling_dbovf(float level) { return powf(10.0f, (level - DBOV_MAX_SINE_POWER)/20.0f)*32767.0f; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) dds_advancef(uint32_t *phase_acc, int32_t phase_rate) { *phase_acc += phase_rate; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) ddsf(uint32_t *phase_acc, int32_t phase_rate) { float amp; amp = sine_table[*phase_acc >> (32 - SLENK)]; *phase_acc += phase_rate; return amp; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) dds_lookupf(uint32_t phase) { return sine_table[phase >> (32 - SLENK)]; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) dds_modf(uint32_t *phase_acc, int32_t phase_rate, float scale, int32_t phase) { float amp; amp = sine_table[*(phase_acc + phase) >> (32 - SLENK)]*scale; *phase_acc += phase_rate; return amp; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complexf_t) dds_complexf(uint32_t *phase_acc, int32_t phase_rate) { complexf_t amp; amp = complex_setf(sine_table[(*phase_acc + (1 << 30)) >> (32 - SLENK)], sine_table[*phase_acc >> (32 - SLENK)]); *phase_acc += phase_rate; return amp; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complexf_t) dds_lookup_complexf(uint32_t phase) { return complex_setf(sine_table[(phase + (1 << 30)) >> (32 - SLENK)], sine_table[phase >> (32 - SLENK)]); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complexf_t) dds_complex_modf(uint32_t *phase_acc, int32_t phase_rate, float scale, int32_t phase) { complexf_t amp; amp = complex_setf(sine_table[(*phase_acc + phase + (1 << 30)) >> (32 - SLENK)]*scale, sine_table[(*phase_acc + phase) >> (32 - SLENK)]*scale); *phase_acc += phase_rate; return amp; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/libtiff.2008.vcproj0000664000175000017500000003107311203772526014144 00000000000000 spandsp-0.0.6/src/t38_non_ecm_buffer.c0000664000175000017500000003614711422612262014521 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t38_non_ecm_buffer.c - A rate adapting buffer for T.38 non-ECM image * and TCF data * * Written by Steve Underwood * * Copyright (C) 2005, 2006, 2007, 2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/queue.h" #include "spandsp/dc_restore.h" #include "spandsp/bit_operations.h" #include "spandsp/async.h" #include "spandsp/t38_non_ecm_buffer.h" #include "spandsp/private/t38_non_ecm_buffer.h" /* Phases */ enum { TCF_AT_INITIAL_ALL_ONES = 0, TCF_AT_ALL_ZEROS = 1, IMAGE_WAITING_FOR_FIRST_EOL = 2, IMAGE_IN_PROGRESS = 3 }; static void restart_buffer(t38_non_ecm_buffer_state_t *s) { /* This should be called when draining the buffer is complete, which should occur before any fresh data can possibly arrive to begin refilling it. */ s->octet = 0xFF; s->flow_control_fill_octet = 0xFF; s->input_phase = (s->image_data_mode) ? IMAGE_WAITING_FOR_FIRST_EOL : TCF_AT_INITIAL_ALL_ONES; s->bit_stream = 0xFFFF; s->out_ptr = 0; s->in_ptr = 0; s->latest_eol_ptr = 0; s->data_finished = FALSE; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) t38_non_ecm_buffer_get_bit(void *user_data) { t38_non_ecm_buffer_state_t *s; int bit; s = (t38_non_ecm_buffer_state_t *) user_data; if (s->bit_no <= 0) { /* We need another byte */ if (s->out_ptr != s->latest_eol_ptr) { s->octet = s->data[s->out_ptr]; s->out_ptr = (s->out_ptr + 1) & (T38_NON_ECM_TX_BUF_LEN - 1); } else { if (s->data_finished) { /* The queue is empty, and we have received the end of data signal. This must really be the end to transmission. */ restart_buffer(s); return SIG_STATUS_END_OF_DATA; } /* The queue is blocked, but this does not appear to be the end of the data. Idle with fill octets, which should be safe at this point. */ s->octet = s->flow_control_fill_octet; s->flow_control_fill_octets++; } s->out_octets++; s->bit_no = 8; } s->bit_no--; bit = (s->octet >> 7) & 1; s->octet <<= 1; return bit; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_non_ecm_buffer_push(t38_non_ecm_buffer_state_t *s) { /* Don't flow control the data any more. Just push out the remainder of the data in the buffer as fast as we can, and shut down. */ s->latest_eol_ptr = s->in_ptr; s->data_finished = TRUE; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_non_ecm_buffer_inject(t38_non_ecm_buffer_state_t *s, const uint8_t *buf, int len) { int i; int upper; int lower; /* TCF consists of: - zero or more ones, followed by - about 1.5s of zeros There may be a little junk at the end, as the modem shuts down. We can stuff with extra ones in the initial period of all ones, and we can stuff with extra zeros once the zeros start. The thing we need to be wary about is the odd zero bit in the midst of the ones, due to a bit error. */ /* Non-ECM image data consists of: - zero or more ones, followed by - zero or more zeros, followed by - an EOL (end of line), which marks the start of the image, followed by - a succession of data rows, with an EOL at the end of each, followed by - an RTC (return to control) There may be a little junk at the end, as the modem shuts down. An EOL 11 zeros followed by a one in a T.4 1D image or 11 zeros followed by a one followed by a one or a zero in a T.4 2D image. An RTC consists of 6 EOLs in succession, with no pixel data between them. We can stuff with ones until we get the first EOL into our buffer, then we can stuff with zeros in front of each EOL at any point up the the RTC. We should not pad between the EOLs which make up the RTC. Most FAX machines don't care about this, but a few will not recognise the RTC if here is padding between the EOLs. We need to buffer whole rows before we output their beginning, so there is no possibility of underflow mid-row. */ /* FoIP has latency issues, because of the fairly tight timeouts in the T.30 spec. We must ensure our buffering does everything needed to avoid underflows, and to meet the minimum row length requirements imposed by many mechanical FAX machines. We cannot, however, afford to bulk up the data, by sending superfluous bytes. The resulting loop delay could provoke an erroneous timeout of the acknowledgement signal. */ i = 0; switch (s->input_phase) { case TCF_AT_INITIAL_ALL_ONES: /* Dump initial 0xFF bytes. We will add enough of our own to makes things flow smoothly. If we don't strip these off, we might end up delaying the start of forwarding by a substantial amount, as we could end up with a large block of 0xFF bytes before the real data begins. This is especially true with PC FAX systems. This test is very simplistic, as bit errors could confuse it. */ for ( ; i < len; i++) { if (buf[i] != 0xFF) { s->input_phase = TCF_AT_ALL_ZEROS; s->flow_control_fill_octet = 0x00; break; } } /* Fall through */ case TCF_AT_ALL_ZEROS: for ( ; i < len; i++) { s->data[s->in_ptr] = buf[i]; s->latest_eol_ptr = s->in_ptr; /* TODO: We can't buffer overflow, since we wrap around. However, the tail could overwrite itself if things fall badly behind. */ s->in_ptr = (s->in_ptr + 1) & (T38_NON_ECM_TX_BUF_LEN - 1); s->in_octets++; } break; case IMAGE_WAITING_FOR_FIRST_EOL: /* Dump anything up to the first EOL. Let the output side stuff with 0xFF bytes while waiting for that first EOL. What occurs before the first EOL is expected to be a period of all ones and then a period of all zeros. We really don't care what junk might be there. By definition, the image only starts at the first EOL. */ for ( ; i < len; i++) { if (buf[i]) { /* There might be an EOL here. Look for at least 11 zeros, followed by a one, split between two octets. Between those two octets we can insert numerous zero octets as a means of flow control. Note that we stuff in blocks of 8 bits, and not at the minimal level. */ /* Or'ing with 0x800 here is to avoid zero words looking like they have -1 trailing zeros */ upper = bottom_bit(s->bit_stream | 0x800); lower = top_bit(buf[i]); if ((upper - lower) > (11 - 8)) { /* This is an EOL - our first row is beginning. */ s->input_phase = IMAGE_IN_PROGRESS; /* Start a new row */ s->row_bits = lower - 8; s->latest_eol_ptr = s->in_ptr; s->flow_control_fill_octet = 0x00; /* If we push out two bytes of zero, and our latest non-zero byte we should definitely form a proper EOL to begin things, with a few harmless extra zero bits at the front. */ s->data[s->in_ptr] = 0x00; s->in_ptr = (s->in_ptr + 1) & (T38_NON_ECM_TX_BUF_LEN - 1); s->data[s->in_ptr] = 0x00; s->in_ptr = (s->in_ptr + 1) & (T38_NON_ECM_TX_BUF_LEN - 1); s->data[s->in_ptr] = buf[i]; s->in_ptr = (s->in_ptr + 1) & (T38_NON_ECM_TX_BUF_LEN - 1); s->in_octets += 3; s->bit_stream = (s->bit_stream << 8) | buf[i]; i++; break; } } s->bit_stream = (s->bit_stream << 8) | buf[i]; } if (i >= len) break; /* Fall through */ case IMAGE_IN_PROGRESS: /* Now we have seen an EOL, we can stuff with zeros just in front of that EOL, or any subsequent EOL that does not immediately follow a previous EOL (i.e. a candidate RTC). We need to track our way through the image data, allowing the output side to only send up to the last EOL. This prevents the possibility of underflow mid-row, where we cannot safely stuff anything in the bit stream. */ for ( ; i < len; i++) { if (buf[i]) { /* There might be an EOL here. Look for at least 11 zeros, followed by a one, split between two octets. Between those two octets we can insert numerous zero octets as a means of flow control. Note that we stuff in blocks of 8 bits, and not at the minimal level. */ /* Or'ing with 0x800 here is to avoid zero words looking like they have -1 trailing zeros */ upper = bottom_bit(s->bit_stream | 0x800); lower = top_bit(buf[i]); if ((upper - lower) > (11 - 8)) { /* This is an EOL. */ s->row_bits += (8 - lower); /* Make sure we don't stretch back to back EOLs, as that could spoil the RTC. This is a slightly crude check, as we don't know if we are processing a T.4 1D or T.4 2D image. Accepting 12 or 12 bits apart as meaning back to back is fine, as no 1D image row could be 1 bit long. */ if (s->row_bits < 12 || s->row_bits > 13) { /* If the row is too short, extend it in chunks of a whole byte. */ /* TODO: extend by the precise amount we should, instead of this rough approach. */ while (s->row_bits < s->min_bits_per_row) { s->min_row_bits_fill_octets++; s->data[s->in_ptr] = 0; s->row_bits += 8; /* TODO: We can't buffer overflow, since we wrap around. However, the tail could overwrite itself if things fall badly behind. */ s->in_ptr = (s->in_ptr + 1) & (T38_NON_ECM_TX_BUF_LEN - 1); } /* This is now the limit for the output side, before it starts stuffing. */ s->latest_eol_ptr = s->in_ptr; } /* Start a new row */ s->row_bits = lower - 8; s->in_rows++; } } s->bit_stream = (s->bit_stream << 8) | buf[i]; s->data[s->in_ptr] = buf[i]; s->row_bits += 8; /* TODO: We can't buffer overflow, since we wrap around. However, the tail could overwrite itself if things fall badly behind. */ s->in_ptr = (s->in_ptr + 1) & (T38_NON_ECM_TX_BUF_LEN - 1); s->in_octets++; } break; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_non_ecm_buffer_report_input_status(t38_non_ecm_buffer_state_t *s, logging_state_t *logging) { if (s->in_octets || s->min_row_bits_fill_octets) { span_log(logging, SPAN_LOG_FLOW, "%d+%d incoming non-ECM octets, %d rows.\n", s->in_octets, s->min_row_bits_fill_octets, s->in_rows); s->in_octets = 0; s->in_rows = 0; s->min_row_bits_fill_octets = 0; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_non_ecm_buffer_report_output_status(t38_non_ecm_buffer_state_t *s, logging_state_t *logging) { if (s->out_octets || s->flow_control_fill_octets) { span_log(logging, SPAN_LOG_FLOW, "%d+%d outgoing non-ECM octets, %d rows.\n", s->out_octets - s->flow_control_fill_octets, s->flow_control_fill_octets, s->out_rows); s->out_octets = 0; s->out_rows = 0; s->flow_control_fill_octets = 0; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_non_ecm_buffer_set_mode(t38_non_ecm_buffer_state_t *s, int mode, int min_bits_per_row) { s->image_data_mode = mode; s->min_bits_per_row = min_bits_per_row; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(t38_non_ecm_buffer_state_t *) t38_non_ecm_buffer_init(t38_non_ecm_buffer_state_t *s, int mode, int min_bits_per_row) { if (s == NULL) { if ((s = (t38_non_ecm_buffer_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); s->image_data_mode = mode; s->min_bits_per_row = min_bits_per_row; restart_buffer(s); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t38_non_ecm_buffer_release(t38_non_ecm_buffer_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t38_non_ecm_buffer_free(t38_non_ecm_buffer_state_t *s) { if (s) free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/cielab_luts.h0000664000175000017500000012005012101005403013316 00000000000000/* * SpanDSP - a series of DSP components for telephony * * cielab_luts.h * * Written by Steve Underwood * * Copyright (C) 2011 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(T42_USE_LUTS) static const float sRGB_to_linear[256] = { 0.000000, 0.000302, 0.000605, 0.000907, 0.001209, 0.001512, 0.001814, 0.002116, 0.002419, 0.002721, 0.003023, 0.003333, 0.003661, 0.004007, 0.004371, 0.004754, 0.005156, 0.005577, 0.006017, 0.006477, 0.006957, 0.007457, 0.007977, 0.008518, 0.009080, 0.009663, 0.010267, 0.010893, 0.011540, 0.012209, 0.012900, 0.013614, 0.014350, 0.015109, 0.015890, 0.016695, 0.017523, 0.018375, 0.019250, 0.020149, 0.021072, 0.022019, 0.022991, 0.023987, 0.025008, 0.026054, 0.027125, 0.028221, 0.029343, 0.030490, 0.031663, 0.032862, 0.034087, 0.035338, 0.036616, 0.037920, 0.039250, 0.040608, 0.041993, 0.043404, 0.044844, 0.046310, 0.047804, 0.049326, 0.050876, 0.052454, 0.054060, 0.055694, 0.057357, 0.059049, 0.060769, 0.062518, 0.064296, 0.066103, 0.067940, 0.069806, 0.071701, 0.073626, 0.075581, 0.077566, 0.079581, 0.081627, 0.083702, 0.085808, 0.087945, 0.090112, 0.092311, 0.094540, 0.096800, 0.099092, 0.101414, 0.103769, 0.106155, 0.108572, 0.111021, 0.113503, 0.116016, 0.118562, 0.121139, 0.123750, 0.126392, 0.129068, 0.131776, 0.134517, 0.137291, 0.140098, 0.142938, 0.145812, 0.148719, 0.151659, 0.154633, 0.157641, 0.160683, 0.163758, 0.166868, 0.170012, 0.173190, 0.176403, 0.179650, 0.182932, 0.186248, 0.189599, 0.192985, 0.196407, 0.199863, 0.203354, 0.206881, 0.210443, 0.214041, 0.217675, 0.221344, 0.225049, 0.228789, 0.232566, 0.236379, 0.240229, 0.244114, 0.248036, 0.251995, 0.255990, 0.260021, 0.264090, 0.268196, 0.272338, 0.276518, 0.280734, 0.284988, 0.289280, 0.293609, 0.297975, 0.302379, 0.306821, 0.311301, 0.315818, 0.320374, 0.324967, 0.329599, 0.334269, 0.338978, 0.343725, 0.348510, 0.353334, 0.358197, 0.363099, 0.368040, 0.373019, 0.378038, 0.383096, 0.388193, 0.393329, 0.398505, 0.403721, 0.408976, 0.414270, 0.419605, 0.424979, 0.430393, 0.435848, 0.441342, 0.446877, 0.452452, 0.458067, 0.463722, 0.469419, 0.475156, 0.480933, 0.486751, 0.492610, 0.498510, 0.504452, 0.510434, 0.516457, 0.522522, 0.528628, 0.534775, 0.540964, 0.547194, 0.553466, 0.559780, 0.566136, 0.572533, 0.578973, 0.585455, 0.591978, 0.598544, 0.605152, 0.611803, 0.618496, 0.625232, 0.632010, 0.638831, 0.645694, 0.652600, 0.659550, 0.666542, 0.673577, 0.680656, 0.687777, 0.694942, 0.702151, 0.709402, 0.716698, 0.724036, 0.731419, 0.738845, 0.746315, 0.753829, 0.761386, 0.768988, 0.776634, 0.784324, 0.792058, 0.799837, 0.807660, 0.815527, 0.823439, 0.831396, 0.839397, 0.847443, 0.855533, 0.863669, 0.871850, 0.880075, 0.888346, 0.896662, 0.905023, 0.913429, 0.921881, 0.930378, 0.938921, 0.947509, 0.956143, 0.964823, 0.973548, 0.982319, 0.991137 }; static const uint8_t linear_to_sRGB[4096] = { 0, 0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 8, 9, 10, 11, 12, 12, 13, 14, 14, 15, 15, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 23, 24, 24, 25, 25, 25, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 35, 35, 35, 36, 36, 36, 36, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43, 44, 44, 44, 44, 45, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47, 47, 48, 48, 48, 48, 49, 49, 49, 49, 49, 50, 50, 50, 50, 50, 51, 51, 51, 51, 51, 52, 52, 52, 52, 52, 53, 53, 53, 53, 53, 54, 54, 54, 54, 54, 54, 55, 55, 55, 55, 55, 56, 56, 56, 56, 56, 56, 57, 57, 57, 57, 57, 57, 58, 58, 58, 58, 58, 59, 59, 59, 59, 59, 59, 60, 60, 60, 60, 60, 60, 61, 61, 61, 61, 61, 61, 62, 62, 62, 62, 62, 62, 62, 63, 63, 63, 63, 63, 63, 64, 64, 64, 64, 64, 64, 65, 65, 65, 65, 65, 65, 65, 66, 66, 66, 66, 66, 66, 66, 67, 67, 67, 67, 67, 67, 68, 68, 68, 68, 68, 68, 68, 69, 69, 69, 69, 69, 69, 69, 70, 70, 70, 70, 70, 70, 70, 70, 71, 71, 71, 71, 71, 71, 71, 72, 72, 72, 72, 72, 72, 72, 73, 73, 73, 73, 73, 73, 73, 73, 74, 74, 74, 74, 74, 74, 74, 75, 75, 75, 75, 75, 75, 75, 75, 76, 76, 76, 76, 76, 76, 76, 76, 77, 77, 77, 77, 77, 77, 77, 77, 78, 78, 78, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79, 79, 79, 79, 80, 80, 80, 80, 80, 80, 80, 80, 80, 81, 81, 81, 81, 81, 81, 81, 81, 82, 82, 82, 82, 82, 82, 82, 82, 82, 83, 83, 83, 83, 83, 83, 83, 83, 83, 84, 84, 84, 84, 84, 84, 84, 84, 84, 85, 85, 85, 85, 85, 85, 85, 85, 85, 86, 86, 86, 86, 86, 86, 86, 86, 86, 87, 87, 87, 87, 87, 87, 87, 87, 87, 88, 88, 88, 88, 88, 88, 88, 88, 88, 89, 89, 89, 89, 89, 89, 89, 89, 89, 89, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 91, 91, 91, 91, 91, 91, 91, 91, 91, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 93, 93, 93, 93, 93, 93, 93, 93, 93, 93, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 101, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 103, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 105, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 108, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 110, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 111, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 112, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 114, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 115, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 117, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 122, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 130, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 131, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 132, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 133, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 138, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 141, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 144, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 147, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 149, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 151, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 155, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 156, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 159, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 164, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 166, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 168, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 169, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 175, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 176, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 177, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 178, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 181, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 183, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 184, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 189, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 190, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 191, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 192, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 193, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 194, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 196, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 197, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 202, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 205, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 206, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 210, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 217, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 222, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 223, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 226, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 229, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 231, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 234, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 235, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 237, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 239, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 242, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 245, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 247, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 251, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 252, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255 }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/t30_logging.c0000664000175000017500000007770012100773730013172 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t30_logging.c - ITU T.30 FAX transfer processing * * Written by Steve Underwood * * Copyright (C) 2003, 2004, 2005, 2006, 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/bit_operations.h" #include "spandsp/queue.h" #include "spandsp/power_meter.h" #include "spandsp/complex.h" #include "spandsp/tone_generate.h" #include "spandsp/async.h" #include "spandsp/hdlc.h" #include "spandsp/fsk.h" #include "spandsp/v29rx.h" #include "spandsp/v29tx.h" #include "spandsp/v27ter_rx.h" #include "spandsp/v27ter_tx.h" #include "spandsp/timezone.h" #include "spandsp/t4_rx.h" #include "spandsp/t4_tx.h" #if defined(SPANDSP_SUPPORT_T85) #include "spandsp/t81_t82_arith_coding.h" #include "spandsp/t85.h" #endif #include "spandsp/t4_t6_decode.h" #include "spandsp/t4_t6_encode.h" #include "spandsp/t30_fcf.h" #include "spandsp/t35.h" #include "spandsp/t30.h" #include "spandsp/t30_logging.h" #include "spandsp/private/logging.h" #include "spandsp/private/timezone.h" #if defined(SPANDSP_SUPPORT_T85) #include "spandsp/private/t81_t82_arith_coding.h" #include "spandsp/private/t85.h" #endif #include "spandsp/private/t4_t6_decode.h" #include "spandsp/private/t4_t6_encode.h" #include "spandsp/private/t4_rx.h" #include "spandsp/private/t4_tx.h" #include "spandsp/private/t30.h" #include "t30_local.h" /*! Value string pair structure */ typedef struct { int val; const char *str; } value_string_t; enum { DISBIT1 = 0x01, DISBIT2 = 0x02, DISBIT3 = 0x04, DISBIT4 = 0x08, DISBIT5 = 0x10, DISBIT6 = 0x20, DISBIT7 = 0x40, DISBIT8 = 0x80 }; SPAN_DECLARE(const char *) t30_completion_code_to_str(int result) { switch (result) { case T30_ERR_OK: return "OK"; case T30_ERR_CEDTONE: return "The CED tone exceeded 5s"; case T30_ERR_T0_EXPIRED: return "Timed out waiting for initial communication"; case T30_ERR_T1_EXPIRED: return "Timed out waiting for the first message"; case T30_ERR_T3_EXPIRED: return "Timed out waiting for procedural interrupt"; case T30_ERR_HDLC_CARRIER: return "The HDLC carrier did not stop in a timely manner"; case T30_ERR_CANNOT_TRAIN: return "Failed to train with any of the compatible modems"; case T30_ERR_OPER_INT_FAIL: return "Operator intervention failed"; case T30_ERR_INCOMPATIBLE: return "Far end is not compatible"; case T30_ERR_RX_INCAPABLE: return "Far end is not able to receive"; case T30_ERR_TX_INCAPABLE: return "Far end is not able to transmit"; case T30_ERR_NORESSUPPORT: return "Far end cannot receive at the resolution of the image"; case T30_ERR_NOSIZESUPPORT: return "Far end cannot receive at the size of image"; case T30_ERR_UNEXPECTED: return "Unexpected message received"; case T30_ERR_TX_BADDCS: return "Received bad response to DCS or training"; case T30_ERR_TX_BADPG: return "Received a DCN from remote after sending a page"; case T30_ERR_TX_ECMPHD: return "Invalid ECM response received from receiver"; case T30_ERR_TX_GOTDCN: return "Received a DCN while waiting for a DIS"; case T30_ERR_TX_INVALRSP: return "Invalid response after sending a page"; case T30_ERR_TX_NODIS: return "Received other than DIS while waiting for DIS"; case T30_ERR_TX_PHBDEAD: return "Received no response to DCS or TCF"; case T30_ERR_TX_PHDDEAD: return "No response after sending a page"; case T30_ERR_TX_T5EXP: return "Timed out waiting for receiver ready (ECM mode)"; case T30_ERR_RX_ECMPHD: return "Invalid ECM response received from transmitter"; case T30_ERR_RX_GOTDCS: return "DCS received while waiting for DTC"; case T30_ERR_RX_INVALCMD: return "Unexpected command after page received"; case T30_ERR_RX_NOCARRIER: return "Carrier lost during fax receive"; case T30_ERR_RX_NOEOL: return "Timed out while waiting for EOL (end Of line)"; case T30_ERR_RX_NOFAX: return "Timed out while waiting for first line"; case T30_ERR_RX_T2EXPDCN: return "Timer T2 expired while waiting for DCN"; case T30_ERR_RX_T2EXPD: return "Timer T2 expired while waiting for phase D"; case T30_ERR_RX_T2EXPFAX: return "Timer T2 expired while waiting for fax page"; case T30_ERR_RX_T2EXPMPS: return "Timer T2 expired while waiting for next fax page"; case T30_ERR_RX_T2EXPRR: return "Timer T2 expired while waiting for RR command"; case T30_ERR_RX_T2EXP: return "Timer T2 expired while waiting for NSS, DCS or MCF"; case T30_ERR_RX_DCNWHY: return "Unexpected DCN while waiting for DCS or DIS"; case T30_ERR_RX_DCNDATA: return "Unexpected DCN while waiting for image data"; case T30_ERR_RX_DCNFAX: return "Unexpected DCN while waiting for EOM, EOP or MPS"; case T30_ERR_RX_DCNPHD: return "Unexpected DCN after EOM or MPS sequence"; case T30_ERR_RX_DCNRRD: return "Unexpected DCN after RR/RNR sequence"; case T30_ERR_RX_DCNNORTN: return "Unexpected DCN after requested retransmission"; case T30_ERR_FILEERROR: return "TIFF/F file cannot be opened"; case T30_ERR_NOPAGE: return "TIFF/F page not found"; case T30_ERR_BADTIFF: return "TIFF/F format is not compatible"; case T30_ERR_BADPAGE: return "TIFF/F page number tag missing"; case T30_ERR_BADTAG: return "Incorrect values for TIFF/F tags"; case T30_ERR_BADTIFFHDR: return "Bad TIFF/F header - incorrect values in fields"; case T30_ERR_NOMEM: return "Cannot allocate memory for more pages"; case T30_ERR_RETRYDCN: return "Disconnected after permitted retries"; case T30_ERR_CALLDROPPED: return "The call dropped prematurely"; case T30_ERR_NOPOLL: return "Poll not accepted"; case T30_ERR_IDENT_UNACCEPTABLE: return "Ident not accepted"; case T30_ERR_PSA_UNACCEPTABLE: return "Polled sub-address not accepted"; case T30_ERR_SEP_UNACCEPTABLE: return "Selective polling address not accepted"; case T30_ERR_SID_UNACCEPTABLE: return "Sender identification not accepted"; case T30_ERR_PWD_UNACCEPTABLE: return "Password not accepted"; case T30_ERR_SUB_UNACCEPTABLE: return "Sub-address not accepted"; case T30_ERR_TSA_UNACCEPTABLE: return "Transmitting subscriber internet address not accepted"; case T30_ERR_IRA_UNACCEPTABLE: return "Internet routing address not accepted"; case T30_ERR_CIA_UNACCEPTABLE: return "Calling subscriber internet address not accepted"; case T30_ERR_ISP_UNACCEPTABLE: return "Internet selective polling address not accepted"; case T30_ERR_CSA_UNACCEPTABLE: return "Called subscriber internet address not accepted"; } return "???"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t30_frametype(uint8_t x) { switch (x) { case T30_DIS: return "DIS"; case T30_CSI: return "CSI"; case T30_NSF: return "NSF"; case T30_DTC: return "DTC"; case T30_CIG: return "CIG"; case T30_NSC: return "NSC"; case T30_PWD: return "PWD"; case T30_SEP: return "SEP"; case T30_PSA: return "PSA"; case T30_CIA: return "CIA"; case T30_ISP: return "ISP"; case T30_DCS: case T30_DCS | 0x01: return "DCS"; case T30_TSI: case T30_TSI | 0x01: return "TSI"; case T30_NSS: case T30_NSS | 0x01: return "NSS"; case T30_SUB: case T30_SUB | 0x01: return "SUB"; case T30_SID: case T30_SID | 0x01: return "SID"; case T30_CTC: case T30_CTC | 0x01: return "CTC"; case T30_TSA: case T30_TSA | 0x01: return "TSA"; case T30_IRA: case T30_IRA | 0x01: return "IRA"; case T30_CFR: case T30_CFR | 0x01: return "CFR"; case T30_FTT: case T30_FTT | 0x01: return "FTT"; case T30_CTR: case T30_CTR | 0x01: return "CTR"; case T30_CSA: case T30_CSA | 0x01: return "CSA"; case T30_EOM: case T30_EOM | 0x01: return "EOM"; case T30_MPS: case T30_MPS | 0x01: return "MPS"; case T30_EOP: case T30_EOP | 0x01: return "EOP"; case T30_PRI_EOM: case T30_PRI_EOM | 0x01: return "PRI-EOM"; case T30_PRI_MPS: case T30_PRI_MPS | 0x01: return "PRI-MPS"; case T30_PRI_EOP: case T30_PRI_EOP | 0x01: return "PRI-EOP"; case T30_EOS: case T30_EOS | 0x01: return "EOS"; case T30_PPS: case T30_PPS | 0x01: return "PPS"; case T30_EOR: case T30_EOR | 0x01: return "EOR"; case T30_RR: case T30_RR | 0x01: return "RR"; case T30_MCF: case T30_MCF | 0x01: return "MCF"; case T30_RTP: case T30_RTP | 0x01: return "RTP"; case T30_RTN: case T30_RTN | 0x01: return "RTN"; case T30_PIP: case T30_PIP | 0x01: return "PIP"; case T30_PIN: case T30_PIN | 0x01: return "PIN"; case T30_PPR: case T30_PPR | 0x01: return "PPR"; case T30_RNR: case T30_RNR | 0x01: return "RNR"; case T30_ERR: case T30_ERR | 0x01: return "ERR"; case T30_FDM: case T30_FDM | 0x01: return "FDM"; case T30_DCN: case T30_DCN | 0x01: return "DCN"; case T30_CRP: case T30_CRP | 0x01: return "CRP"; case T30_FNV: case T30_FNV | 0x01: return "FNV"; case T30_TNR: case T30_TNR | 0x01: return "TNR"; case T30_TR: case T30_TR | 0x01: return "TR"; case T30_TK: return "TK"; case T30_RK: return "RK"; #if 0 case T30_PSS: return "PSS"; #endif case T30_DES: return "DES"; case T30_DEC: return "DEC"; case T30_DER: return "DER"; #if 0 case T30_DTR: return "DTR"; #endif case T30_DNK: case T30_DNK | 0x01: return "DNK"; case T30_PID: case T30_PID | 0x01: return "PID"; case T30_NULL: return "NULL"; case T4_FCD: return "FCD"; case T4_RCP: return "RCP"; } return "???"; } /*- End of function --------------------------------------------------------*/ static void octet_reserved_bit(logging_state_t *log, const uint8_t *msg, int bit_no, int expected) { char s[10] = ".... ...."; int bit; uint8_t octet; /* Break out the octet and the bit number within it. */ octet = msg[((bit_no - 1) >> 3) + 3]; bit_no = (bit_no - 1) & 7; /* Now get the actual bit. */ bit = (octet >> bit_no) & 1; /* Is it what it should be. */ if (bit ^ expected) { /* Only log unexpected values. */ s[7 - bit_no + ((bit_no < 4) ? 1 : 0)] = (uint8_t) (bit + '0'); span_log(log, SPAN_LOG_FLOW, " %s= Unexpected state for reserved bit: %d\n", s, bit); } } /*- End of function --------------------------------------------------------*/ static void octet_bit_field(logging_state_t *log, const uint8_t *msg, int bit_no, const char *desc, const char *yeah, const char *neigh) { char s[10] = ".... ...."; int bit; uint8_t octet; const char *tag; /* Break out the octet and the bit number within it. */ octet = msg[((bit_no - 1) >> 3) + 3]; bit_no = (bit_no - 1) & 7; /* Now get the actual bit. */ bit = (octet >> bit_no) & 1; /* Edit the bit string for display. */ s[7 - bit_no + ((bit_no < 4) ? 1 : 0)] = (uint8_t) (bit + '0'); /* Find the right tag to display. */ if (bit) { if ((tag = yeah) == NULL) tag = "Set"; } else { if ((tag = neigh) == NULL) tag = "Not set"; } /* Eh, voila! */ span_log(log, SPAN_LOG_FLOW, " %s= %s: %s\n", s, desc, tag); } /*- End of function --------------------------------------------------------*/ static void octet_field(logging_state_t *log, const uint8_t *msg, int start, int end, const char *desc, const value_string_t tags[]) { char s[10] = ".... ...."; int i; uint8_t octet; const char *tag; /* Break out the octet and the bit number range within it. */ octet = msg[((start - 1) >> 3) + 3]; start = (start - 1) & 7; end = ((end - 1) & 7) + 1; /* Edit the bit string for display. */ for (i = start; i < end; i++) s[7 - i + ((i < 4) ? 1 : 0)] = (uint8_t) ((octet >> i) & 1) + '0'; /* Find the right tag to display. */ octet = (uint8_t) ((octet >> start) & ((0xFF + (1 << (end - start))) & 0xFF)); tag = "Invalid"; for (i = 0; tags[i].str; i++) { if (octet == tags[i].val) { tag = tags[i].str; break; } } /* Eh, voila! */ span_log(log, SPAN_LOG_FLOW, " %s= %s: %s\n", s, desc, tag); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t30_decode_dis_dtc_dcs(t30_state_t *s, const uint8_t *pkt, int len) { logging_state_t *log; uint8_t frame_type; static const value_string_t available_signalling_rate_tags[] = { { 0x00, "V.27 ter fall-back mode" }, { 0x01, "V.29" }, { 0x02, "V.27 ter" }, { 0x03, "V.27 ter and V.29" }, { 0x0B, "V.27 ter, V.29, and V.17" }, { 0x06, "Reserved" }, { 0x0A, "Reserved" }, { 0x0E, "Reserved" }, { 0x0F, "Reserved" }, { 0x04, "Not used" }, { 0x05, "Not used" }, { 0x08, "Not used" }, { 0x09, "Not used" }, { 0x0C, "Not used" }, { 0x0D, "Not used" }, { 0x00, NULL } }; static const value_string_t selected_signalling_rate_tags[] = { { 0x00, "V.27ter 2400bps" }, { 0x01, "V.29, 9600bps" }, { 0x02, "V.27ter 4800bps" }, { 0x03, "V.29 7200bps" }, { 0x08, "V.17 14400bps" }, { 0x09, "V.17 9600bps" }, { 0x0A, "V.17 12000bps" }, { 0x0B, "V.17 7200bps" }, { 0x05, "Reserved" }, { 0x07, "Reserved" }, { 0x0C, "Reserved" }, { 0x0D, "Reserved" }, { 0x0E, "Reserved" }, { 0x0F, "Reserved" }, { 0x00, NULL } }; static const value_string_t available_scan_line_length_tags[] = { { 0x00, "215mm +- 1%" }, { 0x01, "215mm +- 1% and 255mm +- 1%" }, { 0x02, "215mm +- 1%, 255mm +- 1% and 303mm +- 1%" }, { 0x00, NULL } }; static const value_string_t selected_scan_line_length_tags[] = { { 0x00, "215mm +- 1%" }, { 0x01, "255mm +- 1%" }, { 0x02, "303mm +- 1%" }, { 0x00, NULL } }; static const value_string_t available_recording_length_tags[] = { { 0x00, "A4 (297mm)" }, { 0x01, "A4 (297mm) and B4 (364mm)" }, { 0x02, "Unlimited" }, { 0x00, NULL } }; static const value_string_t selected_recording_length_tags[] = { { 0x00, "A4 (297mm)" }, { 0x01, "B4 (364mm)" }, { 0x02, "Unlimited" }, { 0x00, NULL } }; static const value_string_t available_minimum_scan_line_time_tags[] = { { 0x00, "20ms at 3.85 l/mm; T7.7 = T3.85" }, { 0x01, "5ms at 3.85 l/mm; T7.7 = T3.85" }, { 0x02, "10ms at 3.85 l/mm; T7.7 = T3.85" }, { 0x03, "20ms at 3.85 l/mm; T7.7 = 1/2 T3.85" }, { 0x04, "40ms at 3.85 l/mm; T7.7 = T3.85" }, { 0x05, "40ms at 3.85 l/mm; T7.7 = 1/2 T3.85" }, { 0x06, "10ms at 3.85 l/mm; T7.7 = 1/2 T3.85" }, { 0x07, "0ms at 3.85 l/mm; T7.7 = T3.85" }, { 0x00, NULL } }; static const value_string_t selected_minimum_scan_line_time_tags[] = { { 0x00, "20ms" }, { 0x01, "5ms" }, { 0x02, "10ms" }, { 0x04, "40ms" }, { 0x07, "0ms" }, { 0x00, NULL } }; static const value_string_t shared_data_memory_capacity_tags[] = { { 0x00, "Not available" }, { 0x01, "Level 2 = 2.0 Mbytes" }, { 0x02, "Level 1 = 1.0 Mbytes" }, { 0x03, "Level 3 = unlimited (i.e. >= 32 Mbytes)" }, { 0x00, NULL } }; static const value_string_t t89_profile_tags[] = { { 0x00, "Not used" }, { 0x01, "Profiles 2 and 3" }, { 0x02, "Profile 2" }, { 0x04, "Profile 1" }, { 0x06, "Profile 3" }, { 0x03, "Reserved" }, { 0x05, "Reserved" }, { 0x07, "Reserved" }, { 0x00, NULL } }; static const value_string_t t44_mixed_raster_content_tags[] = { { 0x00, "0" }, { 0x01, "1" }, { 0x02, "2" }, { 0x32, "3" }, { 0x04, "4" }, { 0x05, "5" }, { 0x06, "6" }, { 0x07, "7" }, { 0x00, NULL } }; if (!span_log_test(&s->logging, SPAN_LOG_FLOW)) return; frame_type = pkt[2] & 0xFE; log = &s->logging; if (len <= 2) { span_log(log, SPAN_LOG_FLOW, " Frame is short\n"); return; } span_log(log, SPAN_LOG_FLOW, "%s:\n", t30_frametype(pkt[2])); if (len <= 3) { span_log(log, SPAN_LOG_FLOW, " Frame is short\n"); return; } octet_bit_field(log, pkt, 1, "Store and forward Internet fax (T.37)", NULL, NULL); octet_reserved_bit(log, pkt, 2, 0); octet_bit_field(log, pkt, 3, "Real-time Internet fax (T.38)", NULL, NULL); octet_bit_field(log, pkt, 4, "3G mobile network", NULL, NULL); octet_reserved_bit(log, pkt, 5, 0); if (frame_type == T30_DCS) { octet_reserved_bit(log, pkt, 6, 0); octet_reserved_bit(log, pkt, 7, 0); } else { octet_bit_field(log, pkt, 6, "V.8 capabilities", NULL, NULL); octet_bit_field(log, pkt, 7, "Preferred octets", "64 octets", "256 octets"); } octet_reserved_bit(log, pkt, 8, 0); if (len <= 4) { span_log(log, SPAN_LOG_FLOW, " Frame is short\n"); return; } if (frame_type == T30_DCS) { octet_reserved_bit(log, pkt, 9, 0); octet_bit_field(log, pkt, 10, "Receive fax", NULL, NULL); octet_field(log, pkt, 11, 14, "Selected data signalling rate", selected_signalling_rate_tags); } else { octet_bit_field(log, pkt, 9, "Ready to transmit a fax document (polling)", NULL, NULL); octet_bit_field(log, pkt, 10, "Can receive fax", NULL, NULL); octet_field(log, pkt, 11, 14, "Supported data signalling rates", available_signalling_rate_tags); } octet_bit_field(log, pkt, 15, "R8x7.7lines/mm and/or 200x200pels/25.4mm", NULL, NULL); octet_bit_field(log, pkt, 16, "2-D coding", NULL, NULL); if (len <= 5) { span_log(log, SPAN_LOG_FLOW, " Frame is short\n"); return; } if (frame_type == T30_DCS) { octet_field(log, pkt, 17, 18, "Recording width", selected_scan_line_length_tags); octet_field(log, pkt, 19, 20, "Recording length", selected_recording_length_tags); octet_field(log, pkt, 21, 23, "Minimum scan line time", selected_minimum_scan_line_time_tags); } else { octet_field(log, pkt, 17, 18, "Recording width", available_scan_line_length_tags); octet_field(log, pkt, 19, 20, "Recording length", available_recording_length_tags); octet_field(log, pkt, 21, 23, "Receiver's minimum scan line time", available_minimum_scan_line_time_tags); } octet_bit_field(log, pkt, 24, "Extension indicator", NULL, NULL); if (!(pkt[5] & DISBIT8)) return; if (len <= 6) { span_log(log, SPAN_LOG_FLOW, " Frame is short\n"); return; } octet_reserved_bit(log, pkt, 25, 0); octet_bit_field(log, pkt, 26, "Compressed/uncompressed mode", "Uncompressed", "Compressed"); octet_bit_field(log, pkt, 27, "Error correction mode (ECM)", "ECM", "Non-ECM"); if (frame_type == T30_DCS) octet_bit_field(log, pkt, 28, "Frame size", "64 octets", "256 octets"); else octet_reserved_bit(log, pkt, 28, 0); octet_reserved_bit(log, pkt, 29, 0); octet_reserved_bit(log, pkt, 30, 0); octet_bit_field(log, pkt, 31, "T.6 coding", NULL, NULL); octet_bit_field(log, pkt, 32, "Extension indicator", NULL, NULL); if (!(pkt[6] & DISBIT8)) return; if (len <= 7) { span_log(log, SPAN_LOG_FLOW, " Frame is short\n"); return; } octet_bit_field(log, pkt, 33, "\"Field not valid\" supported", NULL, NULL); if (frame_type == T30_DCS) { octet_reserved_bit(log, pkt, 34, 0); octet_reserved_bit(log, pkt, 35, 0); } else { octet_bit_field(log, pkt, 34, "Multiple selective polling", NULL, NULL); octet_bit_field(log, pkt, 35, "Polled sub-address", NULL, NULL); } octet_bit_field(log, pkt, 36, "T.43 coding", NULL, NULL); octet_bit_field(log, pkt, 37, "Plane interleave", NULL, NULL); octet_bit_field(log, pkt, 38, "Voice coding with 32kbit/s ADPCM (Rec. G.726)", NULL, NULL); octet_bit_field(log, pkt, 39, "Reserved for the use of extended voice coding set", NULL, NULL); octet_bit_field(log, pkt, 40, "Extension indicator", NULL, NULL); if (!(pkt[7] & DISBIT8)) return; if (len <= 8) { span_log(log, SPAN_LOG_FLOW, " Frame is short\n"); return; } octet_bit_field(log, pkt, 41, "R8x15.4lines/mm", NULL, NULL); octet_bit_field(log, pkt, 42, "300x300pels/25.4mm", NULL, NULL); octet_bit_field(log, pkt, 43, "R16x15.4lines/mm and/or 400x400pels/25.4mm", NULL, NULL); if (frame_type == T30_DCS) { octet_bit_field(log, pkt, 44, "Resolution type selection", "Inch", "Metric"); octet_reserved_bit(log, pkt, 45, 0); octet_reserved_bit(log, pkt, 46, 0); octet_reserved_bit(log, pkt, 47, 0); } else { octet_bit_field(log, pkt, 44, "Inch-based resolution preferred", NULL, NULL); octet_bit_field(log, pkt, 45, "Metric-based resolution preferred", NULL, NULL); octet_bit_field(log, pkt, 46, "Minimum scan line time for higher resolutions", "T15.4 = 1/2 T7.7", "T15.4 = T7.7"); octet_bit_field(log, pkt, 47, "Selective polling", NULL, NULL); } octet_bit_field(log, pkt, 48, "Extension indicator", NULL, NULL); if (!(pkt[8] & DISBIT8)) return; if (len <= 9) { span_log(log, SPAN_LOG_FLOW, " Frame is short\n"); return; } octet_bit_field(log, pkt, 49, "Sub-addressing", NULL, NULL); if (frame_type == T30_DCS) { octet_bit_field(log, pkt, 50, "Sender identification transmission", NULL, NULL); octet_reserved_bit(log, pkt, 51, 0); } else { octet_bit_field(log, pkt, 50, "Password", NULL, NULL); octet_bit_field(log, pkt, 51, "Ready to transmit a data file (polling)", NULL, NULL); } octet_reserved_bit(log, pkt, 52, 0); octet_bit_field(log, pkt, 53, "Binary file transfer (BFT)", NULL, NULL); octet_bit_field(log, pkt, 54, "Document transfer mode (DTM)", NULL, NULL); octet_bit_field(log, pkt, 55, "Electronic data interchange (EDI)", NULL, NULL); octet_bit_field(log, pkt, 56, "Extension indicator", NULL, NULL); if (!(pkt[9] & DISBIT8)) return; if (len <= 10) { span_log(log, SPAN_LOG_FLOW, " Frame is short\n"); return; } octet_bit_field(log, pkt, 57, "Basic transfer mode (BTM)", NULL, NULL); octet_reserved_bit(log, pkt, 58, 0); if (frame_type == T30_DCS) octet_reserved_bit(log, pkt, 59, 0); else octet_bit_field(log, pkt, 59, "Ready to transfer a character or mixed mode document (polling)", NULL, NULL); octet_bit_field(log, pkt, 60, "Character mode", NULL, NULL); octet_reserved_bit(log, pkt, 61, 0); octet_bit_field(log, pkt, 62, "Mixed mode (Annex E/T.4)", NULL, NULL); octet_reserved_bit(log, pkt, 63, 0); octet_bit_field(log, pkt, 64, "Extension indicator", NULL, NULL); if (!(pkt[10] & DISBIT8)) return; if (len <= 11) { span_log(log, SPAN_LOG_FLOW, " Frame is short\n"); return; } octet_bit_field(log, pkt, 65, "Processable mode 26 (Rec. T.505)", NULL, NULL); octet_bit_field(log, pkt, 66, "Digital network capability", NULL, NULL); octet_bit_field(log, pkt, 67, "Duplex capability", "Full", "Half only"); if (frame_type == T30_DCS) octet_bit_field(log, pkt, 68, "Full colour mode", NULL, NULL); else octet_bit_field(log, pkt, 68, "JPEG coding", NULL, NULL); octet_bit_field(log, pkt, 69, "Full colour mode", NULL, NULL); if (frame_type == T30_DCS) octet_bit_field(log, pkt, 70, "Preferred Huffman tables", NULL, NULL); else octet_reserved_bit(log, pkt, 70, 0); octet_bit_field(log, pkt, 71, "12bits/pel component", NULL, NULL); octet_bit_field(log, pkt, 72, "Extension indicator", NULL, NULL); if (!(pkt[11] & DISBIT8)) return; if (len <= 12) { span_log(log, SPAN_LOG_FLOW, " Frame is short\n"); return; } octet_bit_field(log, pkt, 73, "No subsampling (1:1:1)", NULL, NULL); octet_bit_field(log, pkt, 74, "Custom illuminant", NULL, NULL); octet_bit_field(log, pkt, 75, "Custom gamut range", NULL, NULL); octet_bit_field(log, pkt, 76, "North American Letter (215.9mm x 279.4mm)", NULL, NULL); octet_bit_field(log, pkt, 77, "North American Legal (215.9mm x 355.6mm)", NULL, NULL); octet_bit_field(log, pkt, 78, "Single-progression sequential coding (Rec. T.85) basic", NULL, NULL); octet_bit_field(log, pkt, 79, "Single-progression sequential coding (Rec. T.85) optional L0", NULL, NULL); octet_bit_field(log, pkt, 80, "Extension indicator", NULL, NULL); if (!(pkt[12] & DISBIT8)) return; if (len <= 13) { span_log(log, SPAN_LOG_FLOW, " Frame is short\n"); return; } octet_bit_field(log, pkt, 81, "HKM key management", NULL, NULL); octet_bit_field(log, pkt, 82, "RSA key management", NULL, NULL); octet_bit_field(log, pkt, 83, "Override", NULL, NULL); octet_bit_field(log, pkt, 84, "HFX40 cipher", NULL, NULL); octet_bit_field(log, pkt, 85, "Alternative cipher number 2", NULL, NULL); octet_bit_field(log, pkt, 86, "Alternative cipher number 3", NULL, NULL); octet_bit_field(log, pkt, 87, "HFX40-I hashing", NULL, NULL); octet_bit_field(log, pkt, 88, "Extension indicator", NULL, NULL); if (!(pkt[13] & DISBIT8)) return; if (len <= 14) { span_log(log, SPAN_LOG_FLOW, " Frame is short\n"); return; } octet_bit_field(log, pkt, 89, "Alternative hashing system 2", NULL, NULL); octet_bit_field(log, pkt, 90, "Alternative hashing system 3", NULL, NULL); octet_bit_field(log, pkt, 91, "Reserved for future security features", NULL, NULL); octet_field(log, pkt, 92, 94, "T.44 (Mixed Raster Content)", t44_mixed_raster_content_tags); octet_bit_field(log, pkt, 95, "Page length maximum stripe size for T.44 (Mixed Raster Content)", NULL, NULL); octet_bit_field(log, pkt, 96, "Extension indicator", NULL, NULL); if (!(pkt[14] & DISBIT8)) return; if (len <= 15) { span_log(log, SPAN_LOG_FLOW, " Frame is short\n"); return; } octet_bit_field(log, pkt, 97, "Colour/gray-scale 300pels/25.4mm x 300lines/25.4mm or 400pels/25.4mm x 400lines/25.4mm resolution", NULL, NULL); octet_bit_field(log, pkt, 98, "100pels/25.4mm x 100lines/25.4mm for colour/gray scale", NULL, NULL); octet_bit_field(log, pkt, 99, "Simple phase C BFT negotiations", NULL, NULL); if (frame_type == T30_DCS) { octet_reserved_bit(log, pkt, 100, 0); octet_reserved_bit(log, pkt, 101, 0); } else { octet_bit_field(log, pkt, 100, "Extended BFT Negotiations capable", NULL, NULL); octet_bit_field(log, pkt, 101, "Internet Selective Polling address (ISP)", NULL, NULL); } octet_bit_field(log, pkt, 102, "Internet Routing Address (IRA)", NULL, NULL); octet_reserved_bit(log, pkt, 103, 0); octet_bit_field(log, pkt, 104, "Extension indicator", NULL, NULL); if (!(pkt[15] & DISBIT8)) return; if (len <= 16) { span_log(log, SPAN_LOG_FLOW, " Frame is short\n"); return; } octet_bit_field(log, pkt, 105, "600pels/25.4mm x 600lines/25.4mm", NULL, NULL); octet_bit_field(log, pkt, 106, "1200pels/25.4mm x 1200lines/25.4mm", NULL, NULL); octet_bit_field(log, pkt, 107, "300pels/25.4mm x 600lines/25.4mm", NULL, NULL); octet_bit_field(log, pkt, 108, "400pels/25.4mm x 800lines/25.4mm", NULL, NULL); octet_bit_field(log, pkt, 109, "600pels/25.4mm x 1200lines/25.4mm", NULL, NULL); octet_bit_field(log, pkt, 110, "Colour/gray scale 600pels/25.4mm x 600lines/25.4mm", NULL, NULL); octet_bit_field(log, pkt, 111, "Colour/gray scale 1200pels/25.4mm x 1200lines/25.4mm", NULL, NULL); octet_bit_field(log, pkt, 112, "Extension indicator", NULL, NULL); if (!(pkt[16] & DISBIT8)) return; if (len <= 17) { span_log(log, SPAN_LOG_FLOW, " Frame is short\n"); return; } octet_bit_field(log, pkt, 113, "Double sided printing capability (alternate mode)", NULL, NULL); octet_bit_field(log, pkt, 114, "Double sided printing capability (continuous mode)", NULL, NULL); if (frame_type == T30_DCS) octet_bit_field(log, pkt, 115, "Black and white mixed raster content profile (MRCbw)", NULL, NULL); else octet_reserved_bit(log, pkt, 115, 0); octet_bit_field(log, pkt, 116, "T.45 (run length colour encoded)", NULL, NULL); octet_field(log, pkt, 117, 118, "Shared memory", shared_data_memory_capacity_tags); octet_bit_field(log, pkt, 119, "T.44 colour space", NULL, NULL); octet_bit_field(log, pkt, 120, "Extension indicator", NULL, NULL); if (!(pkt[17] & DISBIT8)) return; if (len <= 18) { span_log(log, SPAN_LOG_FLOW, " Frame is short\n"); return; } octet_bit_field(log, pkt, 121, "Flow control capability for T.38 communication", NULL, NULL); octet_bit_field(log, pkt, 122, "K>4", NULL, NULL); octet_bit_field(log, pkt, 123, "Internet aware T.38 mode fax (not affected by data signal rate bits)", NULL, NULL); octet_field(log, pkt, 124, 126, "T.89 (Application profiles for ITU-T Rec T.88)", t89_profile_tags); octet_bit_field(log, pkt, 127, "sYCC-JPEG coding", NULL, NULL); octet_bit_field(log, pkt, 128, "Extension indicator", NULL, NULL); if (!(pkt[18] & DISBIT8)) return; span_log(log, SPAN_LOG_FLOW, " Extended beyond the current T.30 specification!\n"); } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/time_scale.c0000664000175000017500000002061111422612263013147 00000000000000/* * SpanDSP - a series of DSP components for telephony * * time_scale.c - Time scaling for linear speech data * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/time_scale.h" #include "spandsp/saturated.h" #include "spandsp/private/time_scale.h" /* Time scaling for speech, based on the Pointer Interval Controlled OverLap and Add (PICOLA) method, developed by Morita Naotaka. */ static __inline__ int amdf_pitch(int min_pitch, int max_pitch, int16_t amp[], int len) { int i; int j; int acc; int min_acc; int pitch; pitch = min_pitch; min_acc = INT_MAX; for (i = max_pitch; i <= min_pitch; i++) { acc = 0; for (j = 0; j < len; j++) acc += abs(amp[i + j] - amp[j]); if (acc < min_acc) { min_acc = acc; pitch = i; } } return pitch; } /*- End of function --------------------------------------------------------*/ static __inline__ void overlap_add(int16_t amp1[], int16_t amp2[], int len) { int i; float weight; float step; step = 1.0f/len; weight = 0.0f; for (i = 0; i < len; i++) { /* TODO: saturate */ amp2[i] = (int16_t) ((float) amp1[i]*(1.0f - weight) + (float) amp2[i]*weight); weight += step; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) time_scale_rate(time_scale_state_t *s, float playout_rate) { if (playout_rate <= 0.0f) return -1; /*endif*/ if (playout_rate >= 0.99f && playout_rate <= 1.01f) { /* Treat rate close to normal speed as exactly normal speed, and avoid divide by zero, and other numerical problems. */ playout_rate = 1.0f; } else if (playout_rate < 1.0f) { s->rcomp = playout_rate/(1.0f - playout_rate); } else { s->rcomp = 1.0f/(playout_rate - 1.0f); } /*endif*/ s->playout_rate = playout_rate; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(time_scale_state_t *) time_scale_init(time_scale_state_t *s, int sample_rate, float playout_rate) { int alloced; if (sample_rate > TIME_SCALE_MAX_SAMPLE_RATE) return NULL; alloced = FALSE; if (s == NULL) { if ((s = (time_scale_state_t *) malloc(sizeof (*s))) == NULL) return NULL; /*endif*/ alloced = TRUE; } /*endif*/ s->sample_rate = sample_rate; s->min_pitch = sample_rate/TIME_SCALE_MIN_PITCH; s->max_pitch = sample_rate/TIME_SCALE_MAX_PITCH; s->buf_len = 2*sample_rate/TIME_SCALE_MIN_PITCH; if (time_scale_rate(s, playout_rate)) { if (alloced) free(s); return NULL; } /*endif*/ s->rate_nudge = 0.0f; s->fill = 0; s->lcp = 0; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) time_scale_release(time_scale_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) time_scale_free(time_scale_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) time_scale(time_scale_state_t *s, int16_t out[], int16_t in[], int len) { double lcpf; int pitch; int out_len; int in_len; int k; out_len = 0; in_len = 0; /* Top up the buffer */ if (s->fill + len < s->buf_len) { /* Cannot continue without more samples */ memcpy(s->buf + s->fill, in, sizeof(int16_t)*len); s->fill += len; return out_len; } k = s->buf_len - s->fill; memcpy(s->buf + s->fill, in, sizeof(int16_t)*k); in_len += k; s->fill = s->buf_len; while (s->fill == s->buf_len) { while (s->lcp >= s->buf_len) { memcpy(out + out_len, s->buf, sizeof(int16_t)*s->buf_len); out_len += s->buf_len; if (len - in_len < s->buf_len) { /* Cannot continue without more samples */ memcpy(s->buf, in + in_len, sizeof(int16_t)*(len - in_len)); s->fill = len - in_len; s->lcp -= s->buf_len; return out_len; } memcpy(s->buf, in + in_len, sizeof(int16_t)*s->buf_len); in_len += s->buf_len; s->lcp -= s->buf_len; } if (s->lcp > 0) { memcpy(out + out_len, s->buf, sizeof(int16_t)*s->lcp); out_len += s->lcp; memcpy(s->buf, s->buf + s->lcp, sizeof(int16_t)*(s->buf_len - s->lcp)); if (len - in_len < s->lcp) { /* Cannot continue without more samples */ memcpy(s->buf + (s->buf_len - s->lcp), in + in_len, sizeof(int16_t)*(len - in_len)); s->fill = s->buf_len - s->lcp + len - in_len; s->lcp = 0; return out_len; } memcpy(s->buf + (s->buf_len - s->lcp), in + in_len, sizeof(int16_t)*s->lcp); in_len += s->lcp; s->lcp = 0; } if (s->playout_rate == 1.0f) { s->lcp = 0x7FFFFFFF; } else { pitch = amdf_pitch(s->min_pitch, s->max_pitch, s->buf, s->min_pitch); lcpf = (double) pitch*s->rcomp; /* Nudge around to compensate for fractional samples */ s->lcp = (int) lcpf; /* Note that s->lcp and lcpf are not the same, as lcpf has a fractional part, and s->lcp doesn't */ s->rate_nudge += s->lcp - lcpf; if (s->rate_nudge >= 0.5f) { s->lcp--; s->rate_nudge -= 1.0f; } else if (s->rate_nudge <= -0.5f) { s->lcp++; s->rate_nudge += 1.0f; } if (s->playout_rate < 1.0f) { /* Speed up - drop a chunk of data */ overlap_add(s->buf, s->buf + pitch, pitch); memcpy(&s->buf[pitch], &s->buf[2*pitch], sizeof(int16_t)*(s->buf_len - 2*pitch)); if (len - in_len < pitch) { /* Cannot continue without more samples */ memcpy(s->buf + s->buf_len - pitch, in + in_len, sizeof(int16_t)*(len - in_len)); s->fill += (len - in_len - pitch); return out_len; } memcpy(s->buf + s->buf_len - pitch, in + in_len, sizeof(int16_t)*pitch); in_len += pitch; } else { /* Slow down - insert a chunk of data */ memcpy(out + out_len, s->buf, sizeof(int16_t)*pitch); out_len += pitch; overlap_add(s->buf + pitch, s->buf, pitch); } } } return out_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) time_scale_max_output_len(time_scale_state_t *s, int input_len) { return (int) (input_len*s->playout_rate + s->min_pitch + 1); } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/timezone.c0000664000175000017500000006215212100560771012702 00000000000000/* * SpanDSP - a series of DSP components for telephony * * timezone.c - Timezone handling for time interpretation * * Written by Steve Underwood * * Copyright (C) 2010 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /* Timezone processing might not seem like a DSP activity, but getting the headers right on FAXes demands it. We need to handle multiple time zones within a process, for FAXes related to different parts of the globe, so the system timezone handling is not adequate. */ /* This timezone handling is derived from public domain software by Arthur David Olson which you may download from ftp://elsie.nci.nih.gov/pub at the time of writing. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #include "spandsp/telephony.h" #include "spandsp/timezone.h" #include "spandsp/private/timezone.h" #if !defined(FALSE) #define FALSE 0 #endif #if !defined(TRUE) #define TRUE (!FALSE) #endif #define SECS_PER_MIN 60 #define MINS_PER_HOUR 60 #define HOURS_PER_DAY 24 #define DAYS_PER_WEEK 7 #define DAYS_PER_NON_LEAP_YEAR 365 #define DAYS_PER_LEAP_YEAR 366 #define SECS_PER_HOUR (SECS_PER_MIN*MINS_PER_HOUR) #define SECS_PER_DAY ((long int) SECS_PER_HOUR*HOURS_PER_DAY) #define MONTHS_PER_YEAR 12 #define TM_YEAR_BASE 1900 #define EPOCH_YEAR 1970 #define EPOCH_WDAY TM_THURSDAY #define isleap(y) (((y)%4) == 0 && (((y)%100) != 0 || ((y)%400) == 0)) #define isleap_sum(a, b) isleap((a)%400 + (b)%400) /* Unlike 's isdigit, this also works if c < 0 | c > UCHAR_MAX. */ #define is_digit(c) ((unsigned int) (c) - '0' <= 9) #define TZ_DEF_RULE_STRING ",M4.1.0,M10.5.0" #define JULIAN_DAY 0 /* Jn - Julian day */ #define DAY_OF_YEAR 1 /* n - day of year */ #define MONTH_NTH_DAY_OF_WEEK 2 /* Mm.n.d - month, week, day of week */ static const char wildabbr[] = " "; static const char gmt[] = "GMT"; struct tz_rule_s { int r_type; /* Type of rule--see below */ int r_day; /* Day number of rule */ int r_week; /* Week number of rule */ int r_mon; /* Month number of rule */ long int r_time; /* Transition time of rule */ }; static const int mon_lengths[2][MONTHS_PER_YEAR] = { {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}, {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31} }; static const int year_lengths[2] = { DAYS_PER_NON_LEAP_YEAR, DAYS_PER_LEAP_YEAR }; static int add_with_overflow_detection(int *number, int delta) { /* This needs to be considered volatile, or clever optimisation destroys the effect of the the rollover detection logic */ volatile int last_number; last_number = *number; *number += delta; return (*number < last_number) != (delta < 0); } /*- End of function --------------------------------------------------------*/ static void set_tzname(tz_t *tz) { struct tz_state_s *sp; const struct tz_ttinfo_s *ttisp; int i; sp = &tz->state; tz->tzname[0] = wildabbr; tz->tzname[1] = wildabbr; for (i = 0; i < sp->typecnt; i++) { ttisp = &sp->ttis[i]; tz->tzname[ttisp->isdst] = &sp->chars[ttisp->abbrind]; } for (i = 0; i < sp->timecnt; i++) { ttisp = &sp->ttis[sp->types[i]]; tz->tzname[ttisp->isdst] = &sp->chars[ttisp->abbrind]; } } /*- End of function --------------------------------------------------------*/ /* Return the number of leap years through the end of the given year where, to make the math easy, the answer for year zero is defined as zero. */ static int leaps_thru_end_of(const int y) { return (y >= 0) ? (y/4 - y/100 + y/400) : -(leaps_thru_end_of(-(y + 1)) + 1); } /*- End of function --------------------------------------------------------*/ static struct tm *time_sub(const time_t * const timep, const long int offset, const struct tz_state_s * const sp, struct tm * const tmp) { const struct tz_lsinfo_s *lp; time_t tdays; const int *ip; int32_t corr; int32_t seconds; int32_t rem; int idays; int y; int hit; int i; int newy; time_t tdelta; int idelta; int leapdays; corr = 0; hit = 0; i = sp->leapcnt; while (--i >= 0) { lp = &sp->lsis[i]; if (*timep >= lp->trans) { if (*timep == lp->trans) { hit = ((i == 0 && lp->corr > 0) || lp->corr > sp->lsis[i - 1].corr); if (hit) { while (i > 0 && sp->lsis[i].trans == sp->lsis[i - 1].trans + 1 && sp->lsis[i].corr == sp->lsis[i - 1].corr + 1) { hit++; --i; } } } corr = lp->corr; break; } } y = EPOCH_YEAR; tdays = *timep/SECS_PER_DAY; rem = *timep - tdays*SECS_PER_DAY; while (tdays < 0 || tdays >= year_lengths[isleap(y)]) { tdelta = tdays / DAYS_PER_LEAP_YEAR; idelta = tdelta; if (tdelta - idelta >= 1 || idelta - tdelta >= 1) return NULL; if (idelta == 0) idelta = (tdays < 0) ? -1 : 1; newy = y; if (add_with_overflow_detection(&newy, idelta)) return NULL; leapdays = leaps_thru_end_of(newy - 1) - leaps_thru_end_of(y - 1); tdays -= ((time_t) newy - y)*DAYS_PER_NON_LEAP_YEAR; tdays -= leapdays; y = newy; } seconds = tdays*SECS_PER_DAY; tdays = seconds/SECS_PER_DAY; rem += seconds - tdays*SECS_PER_DAY; /* Given the range, we can now fearlessly cast... */ idays = tdays; rem += (offset - corr); while (rem < 0) { rem += SECS_PER_DAY; idays--; } while (rem >= SECS_PER_DAY) { rem -= SECS_PER_DAY; idays++; } while (idays < 0) { if (add_with_overflow_detection(&y, -1)) return NULL; idays += year_lengths[isleap(y)]; } while (idays >= year_lengths[isleap(y)]) { idays -= year_lengths[isleap(y)]; if (add_with_overflow_detection(&y, 1)) return NULL; } tmp->tm_year = y; if (add_with_overflow_detection(&tmp->tm_year, -TM_YEAR_BASE)) return NULL; tmp->tm_yday = idays; /* The "extra" mods below avoid overflow problems. */ tmp->tm_wday = EPOCH_WDAY + ((y - EPOCH_YEAR) % DAYS_PER_WEEK)*(DAYS_PER_NON_LEAP_YEAR % DAYS_PER_WEEK) + leaps_thru_end_of(y - 1) - leaps_thru_end_of(EPOCH_YEAR - 1) + idays; tmp->tm_wday %= DAYS_PER_WEEK; if (tmp->tm_wday < 0) tmp->tm_wday += DAYS_PER_WEEK; tmp->tm_hour = (int) (rem/SECS_PER_HOUR); rem %= SECS_PER_HOUR; tmp->tm_min = (int) (rem/SECS_PER_MIN); /* A positive leap second requires a special * representation. This uses "... ??:59:60" et seq. */ tmp->tm_sec = (int) (rem%SECS_PER_MIN) + hit; ip = mon_lengths[isleap(y)]; for (tmp->tm_mon = 0; idays >= ip[tmp->tm_mon]; (tmp->tm_mon)++) idays -= ip[tmp->tm_mon]; tmp->tm_mday = (int) (idays + 1); tmp->tm_isdst = 0; return tmp; } /*- End of function --------------------------------------------------------*/ /* Given a pointer into a time zone string, scan until a character that is not * a valid character in a zone name is found. Return a pointer to that * character. */ static const char *get_tzname(const char *strp) { char c; while ((c = *strp) != '\0' && !is_digit(c) && c != ',' && c != '-' && c != '+') strp++; return strp; } /*- End of function --------------------------------------------------------*/ /* Given a pointer into a time zone string, extract a number from that string. * Check that the number is within a specified range; if it is not, return * NULL. * Otherwise, return a pointer to the first character not part of the number. */ static const char *get_num(const char *strp, int * const nump, const int min, const int max) { char c; int num; if (strp == NULL || !is_digit(c = *strp)) return NULL; num = 0; do { num = num*10 + (c - '0'); if (num > max) return NULL; /* Illegal value */ c = *++strp; } while (is_digit(c)); if (num < min) return NULL; /* Illegal value */ *nump = num; return strp; } /*- End of function --------------------------------------------------------*/ /* Given a pointer into a time zone string, extract a number of seconds, * in hh[:mm[:ss]] form, from the string. * If any error occurs, return NULL. * Otherwise, return a pointer to the first character not part of the number * of seconds. */ static const char *get_secs(const char *strp, long int * const secsp) { int num; /* HOURS_PER_DAY*DAYS_PER_WEEK - 1 allows quasi-Posix rules like * "M10.4.6/26", which does not conform to Posix, * but which specifies the equivalent of * "02:00 on the first Sunday on or after 23 Oct". */ strp = get_num(strp, &num, 0, HOURS_PER_DAY*DAYS_PER_WEEK - 1); if (strp == NULL) return NULL; *secsp = num*(long int) SECS_PER_HOUR; if (*strp == ':') { strp = get_num(strp + 1, &num, 0, MINS_PER_HOUR - 1); if (strp == NULL) return NULL; *secsp += num*SECS_PER_MIN; if (*strp == ':') { /* SECS_PER_MIN allows for leap seconds. */ strp = get_num(strp + 1, &num, 0, SECS_PER_MIN); if (strp == NULL) return NULL; *secsp += num; } } return strp; } /*- End of function --------------------------------------------------------*/ /* Given a pointer into a time zone string, extract an offset, in * [+-]hh[:mm[:ss]] form, from the string. * If any error occurs, return NULL. * Otherwise, return a pointer to the first character not part of the time. */ static const char *get_offset(const char *strp, long int * const offsetp) { int neg = 0; if (*strp == '-') { neg = 1; strp++; } else if (*strp == '+') { strp++; } strp = get_secs(strp, offsetp); if (strp == NULL) return NULL; /* Illegal time */ if (neg) *offsetp = -*offsetp; return strp; } /*- End of function --------------------------------------------------------*/ /* Given a pointer into a time zone string, extract a rule in the form * date[/time]. See POSIX section 8 for the format of "date" and "time". * If a valid rule is not found, return NULL. * Otherwise, return a pointer to the first character not part of the rule. */ static const char *get_rule(const char *strp, struct tz_rule_s * const rulep) { if (*strp == 'J') { /* Julian day. */ rulep->r_type = JULIAN_DAY; strp = get_num(strp + 1, &rulep->r_day, 1, DAYS_PER_NON_LEAP_YEAR); } else if (*strp == 'M') { /* Month, week, day. */ rulep->r_type = MONTH_NTH_DAY_OF_WEEK; strp = get_num(strp + 1, &rulep->r_mon, 1, MONTHS_PER_YEAR); if (strp == NULL || *strp++ != '.') return NULL; strp = get_num(strp, &rulep->r_week, 1, 5); if (strp == NULL || *strp++ != '.') return NULL; strp = get_num(strp, &rulep->r_day, 0, DAYS_PER_WEEK - 1); } else if (is_digit(*strp)) { /* Day of the year. */ rulep->r_type = DAY_OF_YEAR; strp = get_num(strp, &rulep->r_day, 0, DAYS_PER_LEAP_YEAR - 1); } else { /* Invalid format */ return NULL; } if (strp == NULL) return NULL; if (*strp == '/') { /* Time specified. */ strp = get_secs(strp + 1, &rulep->r_time); } else { /* Default = 2:00:00 */ rulep->r_time = 2*SECS_PER_HOUR; } return strp; } /*- End of function --------------------------------------------------------*/ /* Given the Epoch-relative time of January 1, 00:00:00 UTC, in a year, the * year, a rule, and the offset from UTC at the time that rule takes effect, * calculate the Epoch-relative time that rule takes effect. */ static time_t trans_time(const time_t janfirst, const int year, const struct tz_rule_s * const rulep, const long int offset) { int leapyear; time_t value; int i; int d; int m1; int yy0; int yy1; int yy2; int dow; value = 0; leapyear = isleap(year); switch (rulep->r_type) { case JULIAN_DAY: /* Jn - Julian day, 1 == January 1, 60 == March 1 even in leap * years. * In non-leap years, or if the day number is 59 or less, just * add SECS_PER_DAY times the day number-1 to the time of * January 1, midnight, to get the day. */ value = janfirst + (rulep->r_day - 1)*SECS_PER_DAY; if (leapyear && rulep->r_day >= 60) value += SECS_PER_DAY; break; case DAY_OF_YEAR: /* n - day of year. * Just add SECS_PER_DAY times the day number to the time of * January 1, midnight, to get the day. */ value = janfirst + rulep->r_day * SECS_PER_DAY; break; case MONTH_NTH_DAY_OF_WEEK: /* Mm.n.d - nth "dth day" of month m. */ value = janfirst; for (i = 0; i < rulep->r_mon - 1; i++) value += mon_lengths[leapyear][i]*SECS_PER_DAY; /* Use Zeller's Congruence to get day-of-week of first day of month. */ m1 = (rulep->r_mon + 9)%12 + 1; yy0 = (rulep->r_mon <= 2) ? (year - 1) : year; yy1 = yy0/100; yy2 = yy0%100; dow = ((26*m1 - 2)/10 + 1 + yy2 + yy2/4 + yy1/4 - 2*yy1)%7; if (dow < 0) dow += DAYS_PER_WEEK; /* "dow" is the day-of-week of the first day of the month. Get * the day-of-month (zero-origin) of the first "dow" day of the * month. */ d = rulep->r_day - dow; if (d < 0) d += DAYS_PER_WEEK; for (i = 1; i < rulep->r_week; i++) { if (d + DAYS_PER_WEEK >= mon_lengths[leapyear][rulep->r_mon - 1]) break; d += DAYS_PER_WEEK; } /* "d" is the day-of-month (zero-origin) of the day we want. */ value += d*SECS_PER_DAY; break; } /* "value" is the Epoch-relative time of 00:00:00 UTC on the day in * question. To get the Epoch-relative time of the specified local * time on that day, add the transition time and the current offset * from UTC. */ return value + rulep->r_time + offset; } /*- End of function --------------------------------------------------------*/ /* Given a POSIX section 8-style TZ string, fill in the rule tables as appropriate. */ static int tzparse(const char *name, struct tz_state_s * const sp, const int lastditch) { const char *stdname; const char *dstname; size_t stdlen; size_t dstlen; long int stdoffset; long int dstoffset; long int theirstdoffset; long int theirdstoffset; long int theiroffset; unsigned char *typep; char *cp; int load_result; int isdst; int i; int j; int year; struct tz_rule_s start; struct tz_rule_s end; time_t *atp; time_t janfirst; time_t starttime; time_t endtime; dstname = NULL; stdname = name; if (lastditch) { stdlen = strlen(name); /* Length of standard zone name */ name += stdlen; if (stdlen >= sizeof(sp->chars)) stdlen = sizeof(sp->chars) - 1; stdoffset = 0; } else { name = get_tzname(name); stdlen = name - stdname; if (stdlen < 3) return -1; if (*name == '\0') return -1; name = get_offset(name, &stdoffset); if (name == NULL) return -1; } load_result = -1; if (load_result != 0) sp->leapcnt = 0; /* So, we're off a little */ if (*name != '\0') { dstname = name; name = get_tzname(name); dstlen = name - dstname; /* Length of DST zone name */ if (dstlen < 3) return -1; if (*name != '\0' && *name != ',' && *name != ';') { if ((name = get_offset(name, &dstoffset)) == NULL) return -1; } else { dstoffset = stdoffset - SECS_PER_HOUR; } if (*name == '\0' && load_result != 0) name = TZ_DEF_RULE_STRING; if (*name == ',' || *name == ';') { if ((name = get_rule(name + 1, &start)) == NULL) return -1; if (*name++ != ',') return -1; if ((name = get_rule(name, &end)) == NULL) return -1; if (*name != '\0') return -1; sp->typecnt = 2; /* Standard time and DST */ /* Two transitions per year, from EPOCH_YEAR to 2037. */ sp->timecnt = 2*(2037 - EPOCH_YEAR + 1); if (sp->timecnt > TZ_MAX_TIMES) return -1; sp->ttis[0].gmtoff = -dstoffset; sp->ttis[0].isdst = 1; sp->ttis[0].abbrind = stdlen + 1; sp->ttis[1].gmtoff = -stdoffset; sp->ttis[1].isdst = 0; sp->ttis[1].abbrind = 0; atp = sp->ats; typep = sp->types; janfirst = 0; for (year = EPOCH_YEAR; year <= 2037; year++) { starttime = trans_time(janfirst, year, &start, stdoffset); endtime = trans_time(janfirst, year, &end, dstoffset); if (starttime > endtime) { *atp++ = endtime; *typep++ = 1; /* DST ends */ *atp++ = starttime; *typep++ = 0; /* DST begins */ } else { *atp++ = starttime; *typep++ = 0; /* DST begins */ *atp++ = endtime; *typep++ = 1; /* DST ends */ } janfirst += year_lengths[isleap(year)]*SECS_PER_DAY; } } else { if (*name != '\0') return -1; /* Initial values of theirstdoffset and theirdstoffset. */ theirstdoffset = 0; for (i = 0; i < sp->timecnt; i++) { j = sp->types[i]; if (!sp->ttis[j].isdst) { theirstdoffset = -sp->ttis[j].gmtoff; break; } } theirdstoffset = 0; for (i = 0; i < sp->timecnt; i++) { j = sp->types[i]; if (sp->ttis[j].isdst) { theirdstoffset = -sp->ttis[j].gmtoff; break; } } /* Initially we're assumed to be in standard time. */ isdst = FALSE; theiroffset = theirstdoffset; /* Now juggle transition times and types tracking offsets as you do. */ for (i = 0; i < sp->timecnt; i++) { j = sp->types[i]; sp->types[i] = sp->ttis[j].isdst; if (sp->ttis[j].ttisgmt) { /* No adjustment to transition time */ } else { /* If summer time is in effect, and the * transition time was not specified as * standard time, add the summer time * offset to the transition time; * otherwise, add the standard time * offset to the transition time. */ /* Transitions from DST to DDST * will effectively disappear since * POSIX provides for only one DST * offset. */ if (isdst && !sp->ttis[j].ttisstd) sp->ats[i] += (dstoffset - theirdstoffset); else sp->ats[i] += (stdoffset - theirstdoffset); } theiroffset = -sp->ttis[j].gmtoff; if (sp->ttis[j].isdst) theirdstoffset = theiroffset; else theirstdoffset = theiroffset; } /* Finally, fill in ttis. ttisstd and ttisgmt need not be handled. */ sp->ttis[0].gmtoff = -stdoffset; sp->ttis[0].isdst = FALSE; sp->ttis[0].abbrind = 0; sp->ttis[1].gmtoff = -dstoffset; sp->ttis[1].isdst = TRUE; sp->ttis[1].abbrind = stdlen + 1; sp->typecnt = 2; } } else { dstlen = 0; sp->typecnt = 1; /* Only standard time */ sp->timecnt = 0; sp->ttis[0].gmtoff = -stdoffset; sp->ttis[0].isdst = 0; sp->ttis[0].abbrind = 0; } sp->charcnt = stdlen + 1; if (dstlen != 0) sp->charcnt += dstlen + 1; if ((size_t) sp->charcnt > sizeof(sp->chars)) return -1; cp = sp->chars; strncpy(cp, stdname, stdlen); cp += stdlen; *cp++ = '\0'; if (dstlen != 0) { strncpy(cp, dstname, dstlen); cp[dstlen] = '\0'; } return 0; } /*- End of function --------------------------------------------------------*/ static void tz_set(tz_t *tz, const char *tzstring) { const char *name = ""; struct tz_state_s *lclptr = &tz->state; if (tzstring) name = tzstring; /* See if we are already set OK */ if (tz->lcl_is_set > 0 && strcmp(tz->lcl_tzname, name) == 0) return; tz->lcl_is_set = strlen(name) < sizeof(tz->lcl_tzname); if (tz->lcl_is_set) strcpy(tz->lcl_tzname, name); if (name[0] == '\0') { /* User wants it fast rather than right, so, we're off a little. */ lclptr->leapcnt = 0; lclptr->timecnt = 0; lclptr->typecnt = 0; lclptr->ttis[0].isdst = 0; lclptr->ttis[0].gmtoff = 0; lclptr->ttis[0].abbrind = 0; strcpy(lclptr->chars, gmt); } else if (name[0] == ':' || tzparse(name, lclptr, FALSE) != 0) { tzparse(gmt, lclptr, TRUE); } set_tzname(tz); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) tz_localtime(tz_t *tz, struct tm *tmp, time_t t) { struct tz_state_s *sp; const struct tz_ttinfo_s *ttisp; int i; sp = &tz->state; if (sp->timecnt == 0 || t < sp->ats[0]) { i = 0; while (sp->ttis[i].isdst) { if (++i >= sp->typecnt) { i = 0; break; } } } else { for (i = 1; i < sp->timecnt; i++) { if (t < sp->ats[i]) break; } i = (int) sp->types[i - 1]; } ttisp = &sp->ttis[i]; time_sub(&t, ttisp->gmtoff, sp, tmp); tmp->tm_isdst = ttisp->isdst; tz->tzname[tmp->tm_isdst] = &sp->chars[ttisp->abbrind]; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) tz_tzname(tz_t *tz, int isdst) { return tz->tzname[(!isdst) ? 0 : 1]; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(tz_t *) tz_init(tz_t *tz, const char *tzstring) { if (tz == NULL) { if ((tz = (tz_t *) malloc(sizeof(*tz))) == NULL) return NULL; } memset(tz, 0, sizeof(*tz)); tz->tzname[0] = tz->tzname[1] = wildabbr; tz_set(tz, tzstring); return tz; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) tz_release(tz_t *tz) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) tz_free(tz_t *tz) { if (tz) free(tz); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/swept_tone.c0000664000175000017500000000713511422612262013236 00000000000000/* * SpanDSP - a series of DSP components for telephony * * swept_tone.c - Swept tone generation * * Written by Steve Underwood * * Copyright (C) 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/complex.h" #include "spandsp/vector_float.h" #include "spandsp/complex_vector_float.h" #include "spandsp/vector_int.h" #include "spandsp/complex_vector_int.h" #include "spandsp/dds.h" #include "spandsp/swept_tone.h" #include "spandsp/private/logging.h" #include "spandsp/private/swept_tone.h" SPAN_DECLARE(swept_tone_state_t *) swept_tone_init(swept_tone_state_t *s, float start, float end, float level, int duration, int repeating) { if (s == NULL) { if ((s = (swept_tone_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); s->current_phase_inc = s->starting_phase_inc = dds_phase_rate(start); s->phase_inc_step = dds_phase_rate((end - start)/(float) duration); s->scale = dds_scaling_dbm0(level); s->duration = duration; s->repeating = repeating; s->pos = 0; s->phase = 0; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) swept_tone(swept_tone_state_t *s, int16_t amp[], int max_len) { int i; int len; int chunk_len; for (len = 0; len < max_len; ) { chunk_len = max_len - len; if (chunk_len > s->duration - s->pos) chunk_len = s->duration - s->pos; for (i = len; i < len + chunk_len; i++) { amp[i] = (dds(&s->phase, s->current_phase_inc)*s->scale) >> 15; s->current_phase_inc += s->phase_inc_step; } len += chunk_len; s->pos += chunk_len; if (s->pos >= s->duration) { if (!s->repeating) break; s->pos = 0; s->current_phase_inc = s->starting_phase_inc; } } return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) swept_tone_current_frequency(swept_tone_state_t *s) { return dds_frequency(s->current_phase_inc); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) swept_tone_release(swept_tone_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) swept_tone_free(swept_tone_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/lpc10_decode.c0000664000175000017500000010641712101035022013260 00000000000000/* * SpanDSP - a series of DSP components for telephony * * lpc10_decode.c - LPC10 low bit rate speech codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * This code is based on the U.S. Department of Defense reference * implementation of the LPC-10 2400 bps Voice Coder. They do not * exert copyright claims on their code, and it may be freely used. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/dc_restore.h" #include "spandsp/lpc10.h" #include "spandsp/private/lpc10.h" #define LPC10_ORDER 10 #if !defined(min) #define min(a,b) ((a) <= (b) ? (a) : (b)) #endif #if !defined(max) #define max(a,b) ((a) >= (b) ? (a) : (b)) #endif /* Pseudo random number generator based on Knuth, Vol 2, p. 27. */ /* lpc10_random - int32_t variable, uniformly distributed over -32768 to 32767 */ static int32_t lpc10_random(lpc10_decode_state_t *s) { int32_t ret_val; /* The following is a 16 bit 2's complement addition, with overflow checking disabled */ s->y[s->k] += s->y[s->j]; ret_val = s->y[s->k]; if (--s->k < 0) s->k = 4; if (--s->j < 0) s->j = 4; return ret_val; } /*- End of function --------------------------------------------------------*/ static __inline__ int32_t pow_ii(int32_t x, int32_t n) { int32_t pow; uint32_t u; if (n <= 0) { if (n == 0 || x == 1) return 1; if (x != -1) return (x != 0) ? 1/x : 0; n = -n; } u = n; for (pow = 1; ; ) { if ((u & 1)) pow *= x; if ((u >>= 1) == 0) break; x *= x; } return pow; } /*- End of function --------------------------------------------------------*/ /* Synthesize one pitch epoch */ static void bsynz(lpc10_decode_state_t *s, float coef[], int32_t ip, int32_t *iv, float sout[], float rms, float ratio, float g2pass) { static const int32_t kexc[25] = { 8, -16, 26, -48, 86, -162, 294, -502, 718, -728, 184, 672, -610, -672, 184, 728, 718, 502, 294, 162, 86, 48, 26, 16, 8 }; int32_t i; int32_t j; int32_t k; int32_t px; float noise[166]; float pulse; float r1; float gain; float xssq; float sscale; float xy; float sum; float ssq; float lpi0; float hpi0; /* MAXPIT + MAXORD = 166 */ /* Calculate history scale factor XY and scale filter state */ /* Computing MIN */ r1 = s->rmso_bsynz/(rms + 1.0e-6f); xy = min(r1, 8.0f); s->rmso_bsynz = rms; for (i = 0; i < LPC10_ORDER; i++) s->exc2[i] = s->exc2[s->ipo + i]*xy; s->ipo = ip; if (*iv == 0) { /* Generate white noise for unvoiced */ for (i = 0; i < ip; i++) s->exc[LPC10_ORDER + i] = (float) (lpc10_random(s)/64); /* Impulse double excitation for plosives */ px = (lpc10_random(s) + 32768)*(ip - 1)/65536 + LPC10_ORDER + 1; r1 = ratio/4.0f; pulse = r1*342; if (pulse > 2.0e3f) pulse = 2.0e3f; s->exc[px - 1] += pulse; s->exc[px] -= pulse; } else { sscale = sqrtf((float) ip)/6.928f; for (i = 0; i < ip; i++) { s->exc[LPC10_ORDER + i] = 0.0f; if (i < 25) s->exc[LPC10_ORDER + i] = sscale*kexc[i]; lpi0 = s->exc[LPC10_ORDER + i]; s->exc[LPC10_ORDER + i] = s->exc[LPC10_ORDER + i]*0.125f + s->lpi[0]*0.75f + s->lpi[1]*0.125f; s->lpi[1] = s->lpi[0]; s->lpi[0] = lpi0; } for (i = 0; i < ip; i++) { noise[LPC10_ORDER + i] = lpc10_random(s)/64.0f; hpi0 = noise[LPC10_ORDER + i]; noise[LPC10_ORDER + i] = noise[LPC10_ORDER + i]*-0.125f + s->hpi[0]*0.25f + s->hpi[1]*-0.125f; s->hpi[1] = s->hpi[0]; s->hpi[0] = hpi0; } for (i = 0; i < ip; i++) s->exc[LPC10_ORDER + i] += noise[LPC10_ORDER + i]; } /* Synthesis filters: */ /* Modify the excitation with all-zero filter 1 + G*SUM */ xssq = 0.0f; for (i = 0; i < ip; i++) { k = LPC10_ORDER + i; sum = 0.0f; for (j = 0; j < LPC10_ORDER; j++) sum += coef[j]*s->exc[k - j - 1]; sum *= g2pass; s->exc2[k] = sum + s->exc[k]; } /* Synthesize using the all pole filter 1/(1 - SUM) */ for (i = 0; i < ip; i++) { k = LPC10_ORDER + i; sum = 0.0f; for (j = 0; j < LPC10_ORDER; j++) sum += coef[j]*s->exc2[k - j - 1]; s->exc2[k] = sum + s->exc2[k]; xssq += s->exc2[k]*s->exc2[k]; } /* Save filter history for next epoch */ for (i = 0; i < LPC10_ORDER; i++) { s->exc[i] = s->exc[ip + i]; s->exc2[i] = s->exc2[ip + i]; } /* Apply gain to match RMS */ ssq = rms*rms*ip; gain = sqrtf(ssq/xssq); for (i = 0; i < ip; i++) sout[i] = gain*s->exc2[LPC10_ORDER + i]; } /*- End of function --------------------------------------------------------*/ /* Synthesize a single pitch epoch */ static int pitsyn(lpc10_decode_state_t *s, int voice[], int32_t *pitch, float *rms, float *rc, int32_t ivuv[], int32_t ipiti[], float *rmsi, float *rci, int32_t *nout, float *ratio) { int32_t rci_dim1; int32_t rci_offset; int32_t i1; int32_t i; int32_t j; int32_t vflag; int32_t jused; int32_t lsamp; int32_t ip; int32_t nl; int32_t ivoice; int32_t istart; float r1; float alrn; float alro; float yarc[10]; float prop; float slope; float uvpit; float xxy; float msix; rci_dim1 = LPC10_ORDER; rci_offset = rci_dim1 + 1; rci -= rci_offset; if (*rms < 1.0f) *rms = 1.0f; if (s->rmso < 1.0f) s->rmso = 1.0f; uvpit = 0.0f; *ratio = *rms/(s->rmso + 8.0f); if (s->first_pitsyn) { lsamp = 0; ivoice = voice[1]; if (ivoice == 0) *pitch = LPC10_SAMPLES_PER_FRAME/4; *nout = LPC10_SAMPLES_PER_FRAME / *pitch; s->jsamp = LPC10_SAMPLES_PER_FRAME - *nout * *pitch; i1 = *nout; for (i = 0; i < i1; i++) { for (j = 0; j < LPC10_ORDER; j++) rci[j + (i + 1)*rci_dim1 + 1] = rc[j]; ivuv[i] = ivoice; ipiti[i] = *pitch; rmsi[i] = *rms; } s->first_pitsyn = FALSE; } else { vflag = 0; lsamp = LPC10_SAMPLES_PER_FRAME + s->jsamp; slope = (*pitch - s->ipito)/(float) lsamp; *nout = 0; jused = 0; istart = 1; if (voice[0] == s->ivoico && voice[1] == voice[0]) { if (voice[1] == 0) { /* SSUV - - 0 , 0 , 0 */ *pitch = LPC10_SAMPLES_PER_FRAME/4; s->ipito = *pitch; if (*ratio > 8.0f) s->rmso = *rms; } /* SSVC - - 1 , 1 , 1 */ slope = (*pitch - s->ipito)/(float) lsamp; ivoice = voice[1]; } else { if (s->ivoico != 1) { if (s->ivoico == voice[0]) { /* UV2VC2 - - 0 , 0 , 1 */ nl = lsamp - LPC10_SAMPLES_PER_FRAME/4; } else { /* UV2VC1 - - 0 , 1 , 1 */ nl = lsamp - LPC10_SAMPLES_PER_FRAME*3/4; } ipiti[0] = nl/2; ipiti[1] = nl - ipiti[0]; ivuv[0] = 0; ivuv[1] = 0; rmsi[0] = s->rmso; rmsi[1] = s->rmso; for (i = 0; i < LPC10_ORDER; i++) { rci[i + rci_dim1 + 1] = s->rco[i]; rci[i + (rci_dim1 << 1) + 1] = s->rco[i]; s->rco[i] = rc[i]; } slope = 0.0f; *nout = 2; s->ipito = *pitch; jused = nl; istart = nl + 1; ivoice = 1; } else { if (s->ivoico != voice[0]) { /* VC2UV1 - - 1 , 0 , 0 */ lsamp = LPC10_SAMPLES_PER_FRAME/4 + s->jsamp; } else { /* VC2UV2 - - 1 , 1 , 0 */ lsamp = LPC10_SAMPLES_PER_FRAME*3/4 + s->jsamp; } for (i = 0; i < LPC10_ORDER; i++) { yarc[i] = rc[i]; rc[i] = s->rco[i]; } ivoice = 1; slope = 0.0f; vflag = 1; } } /* Here is the value of most variables that are used below, depending on */ /* the values of IVOICO, VOICE(1), and VOICE(2). VOICE(1) and VOICE(2) */ /* are input arguments, and IVOICO is the value of VOICE(2) on the */ /* previous call (see notes for the IF (NOUT .NE. 0) statement near the */ /* end). Each of these three values is either 0 or 1. These three */ /* values below are given as 3-bit long strings, in the order IVOICO, */ /* VOICE(1), and VOICE(2). It appears that the code above assumes that */ /* the bit sequences 010 and 101 never occur, but I wonder whether a */ /* large enough number of bit errors in the channel could cause such a */ /* thing to happen, and if so, could that cause NOUT to ever go over 11? */ /* Note that all of the 180 values in the table are floatly LFRAME, but */ /* 180 has fewer characters, and it makes the table a little more */ /* concrete. If LFRAME is ever changed, keep this in mind. Similarly, */ /* 135's are 3*LFRAME/4, and 45's are LFRAME/4. If LFRAME is not a */ /* multiple of 4, then the 135 for NL-JSAMP is actually LFRAME-LFRAME/4, */ /* and the 45 for NL-JSAMP is actually LFRAME-3*LFRAME/4. */ /* Note that LSAMP-JSAMP is given as the variable. This was just for */ /* brevity, to avoid adding "+JSAMP" to all of the column entries. */ /* Similarly for NL-JSAMP. */ /* Variable | 000 001 011,010 111 110 100,101 */ /* ------------+-------------------------------------------------- */ /* ISTART | 1 NL+1 NL+1 1 1 1 */ /* LSAMP-JSAMP | 180 180 180 180 135 45 */ /* IPITO | 45 PITCH PITCH oldPITCH oldPITCH oldPITCH */ /* SLOPE | 0 0 0 seebelow 0 0 */ /* JUSED | 0 NL NL 0 0 0 */ /* PITCH | 45 PITCH PITCH PITCH PITCH PITCH */ /* NL-JSAMP | -- 135 45 -- -- -- */ /* VFLAG | 0 0 0 0 1 1 */ /* NOUT | 0 2 2 0 0 0 */ /* IVOICE | 0 1 1 1 1 1 */ /* while_loop | once once once once twice twice */ /* ISTART | -- -- -- -- JUSED+1 JUSED+1 */ /* LSAMP-JSAMP | -- -- -- -- 180 180 */ /* IPITO | -- -- -- -- oldPITCH oldPITCH */ /* SLOPE | -- -- -- -- 0 0 */ /* JUSED | -- -- -- -- ?? ?? */ /* PITCH | -- -- -- -- PITCH PITCH */ /* NL-JSAMP | -- -- -- -- -- -- */ /* VFLAG | -- -- -- -- 0 0 */ /* NOUT | -- -- -- -- ?? ?? */ /* IVOICE | -- -- -- -- 0 0 */ /* UVPIT is always 0.0 on the first pass through the DO WHILE (TRUE) loop below. */ /* The only possible non-0 value of SLOPE (in column 111) is (PITCH-IPITO)/FLOAT(LSAMP) */ /* Column 101 is identical to 100. Any good properties we can prove for 100 will also hold for 101. Similarly for 010 and 011. */ /* synths() calls this subroutine with PITCH restricted to the range 20 to 156. IPITO is similarly restricted to this range, after the first call. IP below is also restricted to this range, given the definitions of IPITO, SLOPE, UVPIT, and that I is in the range ISTART to LSAMP. */ for (;;) { for (i = istart; i <= lsamp; i++) { r1 = s->ipito + slope*i; ip = (int32_t) (r1 + 0.5f); if (uvpit != 0.0f) ip = (int32_t) uvpit; if (ip <= i - jused) { ++(*nout); ipiti[*nout - 1] = ip; *pitch = ip; ivuv[*nout - 1] = ivoice; jused += ip; prop = (jused - ip/2)/(float) lsamp; for (j = 0; j < LPC10_ORDER; j++) { alro = logf((s->rco[j] + 1)/(1 - s->rco[j])); alrn = logf((rc[j] + 1)/(1 - rc[j])); xxy = alro + prop*(alrn - alro); xxy = expf(xxy); rci[j + *nout*rci_dim1 + 1] = (xxy - 1.0f)/(xxy + 1.0f); } msix = logf(*rms) - logf(s->rmso); msix = prop*msix; msix = logf(s->rmso) + msix; rmsi[*nout - 1] = expf(msix); } } if (vflag != 1) break; vflag = 0; istart = jused + 1; lsamp = LPC10_SAMPLES_PER_FRAME + s->jsamp; slope = 0.0f; ivoice = 0; uvpit = (float) ((lsamp - istart)/2); if (uvpit > 90.0f) uvpit /= 2; s->rmso = *rms; for (i = 0; i < LPC10_ORDER; i++) { rc[i] = yarc[i]; s->rco[i] = yarc[i]; } } s->jsamp = lsamp - jused; } if (*nout != 0) { s->ivoico = voice[1]; s->ipito = *pitch; s->rmso = *rms; for (i = 0; i < LPC10_ORDER; i++) s->rco[i] = rc[i]; } return 0; } /*- End of function --------------------------------------------------------*/ static void deemp(lpc10_decode_state_t *s, float x[], int len) { int i; float r1; float dei0; for (i = 0; i < len; i++) { dei0 = x[i]; r1 = x[i] - s->dei[0]*1.9998f + s->dei[1]; x[i] = r1 + s->deo[0]*2.5f - s->deo[1]*2.0925f + s->deo[2]*0.585f; s->dei[1] = s->dei[0]; s->dei[0] = dei0; s->deo[2] = s->deo[1]; s->deo[1] = s->deo[0]; s->deo[0] = x[i]; } } /*- End of function --------------------------------------------------------*/ /* Convert reflection coefficients to predictor coefficients */ static float reflection_coeffs_to_predictor_coeffs(float rc[], float pc[], float gprime) { float temp[10]; float g2pass; int i; int j; g2pass = 1.0f; for (i = 0; i < LPC10_ORDER; i++) g2pass *= 1.0f - rc[i]*rc[i]; g2pass = gprime*sqrtf(g2pass); pc[0] = rc[0]; for (i = 1; i < LPC10_ORDER; i++) { for (j = 0; j < i; j++) temp[j] = pc[j] - rc[i]*pc[i - j - 1]; for (j = 0; j < i; j++) pc[j] = temp[j]; pc[i] = rc[i]; } return g2pass; } /*- End of function --------------------------------------------------------*/ static int synths(lpc10_decode_state_t *s, int voice[], int32_t *pitch, float *rms, float *rc, float speech[]) { int32_t i1; int32_t ivuv[16]; int32_t ipiti[16]; int32_t nout; int32_t i; int32_t j; float rmsi[16]; float ratio; float g2pass; float pc[10]; float rci[160]; i1 = min(*pitch, 156); *pitch = max(i1, 20); for (i = 0; i < LPC10_ORDER; i++) rc[i] = max(min(rc[i], 0.99f), -0.99f); pitsyn(s, voice, pitch, rms, rc, ivuv, ipiti, rmsi, rci, &nout, &ratio); if (nout > 0) { for (j = 0; j < nout; j++) { /* Add synthesized speech for pitch period J to the end of s->buf. */ g2pass = reflection_coeffs_to_predictor_coeffs(&rci[j*10], pc, 0.7f); bsynz(s, pc, ipiti[j], &ivuv[j], &s->buf[s->buflen], rmsi[j], ratio, g2pass); deemp(s, &s->buf[s->buflen], ipiti[j]); s->buflen += ipiti[j]; } /* Copy first MAXFRM samples from BUF to output array speech (scaling them), and then remove them from the beginning of s->buf. */ for (i = 0; i < LPC10_SAMPLES_PER_FRAME; i++) speech[i] = s->buf[i]/4096.0f; s->buflen -= LPC10_SAMPLES_PER_FRAME; for (i = 0; i < s->buflen; i++) s->buf[i] = s->buf[i + LPC10_SAMPLES_PER_FRAME]; } return 0; } /*- End of function --------------------------------------------------------*/ static void lpc10_unpack(lpc10_frame_t *t, const uint8_t ibits[]) { static const int bit[10] = { 2, 4, 8, 8, 8, 8, 16, 16, 16, 16 }; static const int iblist[53] = { 13, 12, 11, 1, 2, 13, 12, 11, 1, 2, 13, 10, 11, 2, 1, 10, 13, 12, 11, 10, 2, 13, 12, 11, 10, 2, 1, 12, 7, 6, 1, 10, 9, 8, 7, 4, 6, 9, 8, 7, 5, 1, 9, 8, 4, 6, 1, 5, 9, 8, 7, 5, 6 }; int32_t itab[13]; int x; int i; /* ibits is 54 bits of LPC data ordered as follows: */ /* R1-0, R2-0, R3-0, P-0, A-0, */ /* R1-1, R2-1, R3-1, P-1, A-1, */ /* R1-2, R4-0, R3-2, A-2, P-2, R4-1, */ /* R1-3, R2-2, R3-3, R4-2, A-3, */ /* R1-4, R2-3, R3-4, R4-3, A-4, */ /* P-3, R2-4, R7-0, R8-0, P-4, R4-4, */ /* R5-0, R6-0, R7-1,R10-0, R8-1, */ /* R5-1, R6-1, R7-2, R9-0, P-5, */ /* R5-2, R6-2,R10-1, R8-2, P-6, R9-1, */ /* R5-3, R6-3, R7-3, R9-2, R8-3, SYNC */ /* Reconstruct ITAB */ for (i = 0; i < 13; i++) itab[i] = 0; for (i = 0; i < 53; i++) { x = 52 - i; x = (ibits[x >> 3] >> (7 - (x & 7))) & 1; itab[iblist[52 - i] - 1] = (itab[iblist[52 - i] - 1] << 1) | x; } /* Sign extend the RC's */ for (i = 0; i < LPC10_ORDER; i++) { if ((itab[i + 3] & bit[i])) itab[i + 3] -= (bit[i] << 1); } /* Restore variables */ t->ipitch = itab[0]; t->irms = itab[1]; for (i = 0; i < LPC10_ORDER; i++) t->irc[i] = itab[LPC10_ORDER - 1 - i + 3]; } /*- End of function --------------------------------------------------------*/ /* Hamming 8, 4 decoder - can correct 1 out of seven bits and can detect up to two errors. */ /* This subroutine is entered with an eight bit word in INPUT. The 8th */ /* bit is parity and is stripped off. The remaining 7 bits address the */ /* hamming 8, 4 table and the output OUTPUT from the table gives the 4 */ /* bits of corrected data. If bit 4 is set, no error was detected. */ /* ERRCNT is the number of errors counted. */ static int32_t hamming_84_decode(int32_t input, int *errcnt) { static const uint8_t dactab[128] = { 16, 0, 0, 3, 0, 5, 14, 7, 0, 9, 14, 11, 14, 13, 30, 14, 0, 9, 2, 7, 4, 7, 7, 23, 9, 25, 10, 9, 12, 9, 14, 7, 0, 5, 2, 11, 5, 21, 6, 5, 8, 11, 11, 27, 12, 5, 14, 11, 2, 1, 18, 2, 12, 5, 2, 7, 12, 9, 2, 11, 28, 12, 12, 15, 0, 3, 3, 19, 4, 13, 6, 3, 8, 13, 10, 3, 13, 29, 14, 13, 4, 1, 10, 3, 20, 4, 4, 7, 10, 9, 26, 10, 4, 13, 10, 15, 8, 1, 6, 3, 6, 5, 22, 6, 24, 8, 8, 11, 8, 13, 6, 15, 1, 17 , 2, 1, 4, 1, 6, 15, 8, 1, 10, 15, 12, 15, 15, 31 }; int i; int parity; int32_t output; parity = input & 255; parity ^= parity >> 4; parity ^= parity >> 2; parity ^= parity >> 1; parity &= 1; i = dactab[input & 127]; output = i & 15; if ((i & 16)) { /* No errors detected in seven bits */ if (parity) (*errcnt)++; } else { /* One or two errors detected */ (*errcnt)++; if (parity == 0) { /* Two errors detected */ (*errcnt)++; output = -1; } } return output; } /*- End of function --------------------------------------------------------*/ static int32_t median(int32_t d1, int32_t d2, int32_t d3) { int32_t ret_val; ret_val = d2; if (d2 > d1 && d2 > d3) { ret_val = d1; if (d3 > d1) ret_val = d3; } else if (d2 < d1 && d2 < d3) { ret_val = d1; if (d3 < d1) ret_val = d3; } return ret_val; } /*- End of function --------------------------------------------------------*/ static void decode(lpc10_decode_state_t *s, lpc10_frame_t *t, int voice[], int32_t *pitch, float *rms, float rc[]) { static const int32_t ivtab[32] = { 24960, 24960, 24960, 24960, 25480, 25480, 25483, 25480, 16640, 1560, 1560, 1560, 16640, 1816, 1563, 1560, 24960, 24960, 24859, 24856, 26001, 25881, 25915, 25913, 1560, 1560, 7800, 3640, 1561, 1561, 3643, 3641 }; static const float corth[32] = { 32767.0f, 10.0f, 5.0f, 0.0f, 32767.0f, 8.0f, 4.0f, 0.0f, 32.0f, 6.4f, 3.2f, 0.0f, 32.0f, 6.4f, 3.2f, 0.0f, 32.0f, 11.2f, 6.4f, 0.0f, 32.0f, 11.2f, 6.4f, 0.0f, 16.0f, 5.6f, 3.2f, 0.0f, 16.0f, 5.6f, 3.2f, 0.0f }; static const int32_t detau[128] = { 0, 0, 0, 3, 0, 3, 3, 31, 0, 3, 3, 21, 3, 3, 29, 30, 0, 3, 3, 20, 3, 25, 27, 26, 3, 23, 58, 22, 3, 24, 28, 3, 0, 3, 3, 3, 3, 39, 33, 32, 3, 37, 35, 36, 3, 38, 34, 3, 3, 42, 46, 44, 50, 40, 48, 3, 54, 3, 56, 3, 52, 3, 3, 1, 0, 3, 3, 108, 3, 78, 100, 104, 3, 84, 92, 88, 156, 80, 96, 3, 3, 74, 70, 72, 66, 76, 68, 3, 62, 3, 60, 3, 64, 3, 3, 1, 3, 116, 132, 112, 148, 152, 3, 3, 140, 3, 136, 3, 144, 3, 3, 1, 124, 120, 128, 3, 3, 3, 3, 1, 3, 3, 3, 1, 3, 1, 1, 1 }; static const int32_t rmst[64] = { 1024, 936, 856, 784, 718, 656, 600, 550, 502, 460, 420, 384, 352, 328, 294, 270, 246, 226, 206, 188, 172, 158, 144, 132, 120, 110, 102, 92, 84, 78, 70, 64, 60, 54, 50, 46, 42, 38, 34, 32, 30, 26, 24, 22, 20, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }; static const int32_t detab7[32] = { 4, 11, 18, 25, 32, 39, 46, 53, 60, 66, 72, 77, 82, 87, 92, 96, 101, 104, 108, 111, 114, 115, 117, 119, 121, 122, 123, 124, 125, 126, 127, 127 }; static const float descl[8] = { 0.6953f, 0.625f, 0.5781f, 0.5469f, 0.5312f, 0.5391f, 0.4688f, 0.3828f }; static const int32_t deadd[8] = { 1152, -2816, -1536, -3584, -1280, -2432, 768, -1920 }; static const int32_t qb[8] = { 511, 511, 1023, 1023, 1023, 1023, 2047, 4095 }; static const int32_t nbit[10] = { 8, 8, 5, 5, 4, 4, 4, 4, 3, 2 }; static const int32_t zrc[10] = { 0, 0, 0, 0, 0, 3, 0, 2, 0, 0 }; static const int32_t bit[5] = { 2, 4, 8, 16, 32 }; int32_t ipit; int32_t iout; int32_t i; int32_t icorf; int32_t index; int32_t ivoic; int32_t ixcor; int32_t i1; int32_t i2; int32_t i4; int32_t ishift; int32_t lsb; int errcnt; /* If no error correction, do pitch and voicing then jump to decode */ i4 = detau[t->ipitch]; if (!s->error_correction) { voice[0] = 1; voice[1] = 1; if (t->ipitch <= 1) voice[0] = 0; if (t->ipitch == 0 || t->ipitch == 2) voice[1] = 0; if (i4 <= 4) i4 = s->iptold; *pitch = i4; if (voice[0] == 1 && voice[1] == 1) s->iptold = *pitch; if (voice[0] != voice[1]) *pitch = s->iptold; } else { /* Do error correction pitch and voicing */ if (i4 > 4) { s->dpit[0] = i4; ivoic = 2; s->iavgp = (s->iavgp*15 + i4 + 8)/16; } else { s->dpit[0] = s->iavgp; ivoic = i4; } s->drms[0] = t->irms; for (i = 0; i < LPC10_ORDER; i++) s->drc[i][0] = t->irc[i]; /* Determine index to IVTAB from V/UV decision */ /* If error rate is high then use alternate table */ index = (s->ivp2h << 4) + (s->iovoic << 2) + ivoic + 1; i1 = ivtab[index - 1]; ipit = i1 & 3; icorf = i1 >> 3; if (s->erate < 2048) icorf /= 64; /* Determine error rate: 4=high 1=low */ ixcor = 4; if (s->erate < 2048) ixcor = 3; if (s->erate < 1024) ixcor = 2; if (s->erate < 128) ixcor = 1; /* Voice/unvoice decision determined from bits 0 and 1 of IVTAB */ voice[0] = icorf/2 & 1; voice[1] = icorf & 1; /* Skip decoding on first frame because present data not yet available */ if (s->first) { s->first = FALSE; /* Assign PITCH a "default" value on the first call, since */ /* otherwise it would be left uninitialized. The two lines */ /* below were copied from above, since it seemed like a */ /* reasonable thing to do for the first call. */ if (i4 <= 4) i4 = s->iptold; *pitch = i4; } else { /* If bit 4 of ICORF is set then correct RMS and RC(1) - RC(4). */ /* Determine error rate and correct errors using a Hamming 8,4 code */ /* during transition of unvoiced frames. If IOUT is negative, */ /* more than 1 error occurred, use previous frame's parameters. */ if ((icorf & bit[3]) != 0) { errcnt = 0; lsb = s->drms[1] & 1; index = (s->drc[7][1] << 4) + s->drms[1]/2; iout = hamming_84_decode(index, &errcnt); s->drms[1] = s->drms[2]; if (iout >= 0) s->drms[1] = (iout << 1) + lsb; for (i = 1; i <= 4; i++) { if (i == 1) i1 = ((s->drc[8][1] & 7) << 1) + (s->drc[9][1] & 1); else i1 = s->drc[8 - i][1] & 15; i2 = s->drc[4 - i][1] & 31; lsb = i2 & 1; index = (i1 << 4) + (i2 >> 1); iout = hamming_84_decode(index, &errcnt); if (iout >= 0) { iout = (iout << 1) + lsb; if ((iout & 16) == 16) iout -= 32; } else { iout = s->drc[4 - i][2]; } s->drc[4 - i][1] = iout; } /* Determine error rate */ s->erate = (int32_t) (s->erate*0.96875f + errcnt*102.0f); } /* Get unsmoothed RMS, RC's, and PITCH */ t->irms = s->drms[1]; for (i = 0; i < LPC10_ORDER; i++) t->irc[i] = s->drc[i][1]; if (ipit == 1) s->dpit[1] = s->dpit[2]; if (ipit == 3) s->dpit[1] = s->dpit[0]; *pitch = s->dpit[1]; /* If bit 2 of ICORF is set then smooth RMS and RC's, */ if ((icorf & bit[1]) != 0) { if ((float) abs(s->drms[1] - s->drms[0]) >= corth[ixcor + 3] && (float) abs(s->drms[1] - s->drms[2]) >= corth[ixcor + 3]) { t->irms = median(s->drms[2], s->drms[1], s->drms[0]); } for (i = 0; i < 6; i++) { if ((float) abs(s->drc[i][1] - s->drc[i][0]) >= corth[ixcor + ((i + 3) << 2) - 5] && (float) abs(s->drc[i][1] - s->drc[i][2]) >= corth[ixcor + ((i + 3) << 2) - 5]) { t->irc[i] = median(s->drc[i][2], s->drc[i][1], s->drc[i][0]); } } } /* If bit 3 of ICORF is set then smooth pitch */ if ((icorf & bit[2]) != 0) { if ((float) abs(s->dpit[1] - s->dpit[0]) >= corth[ixcor - 1] && (float) abs(s->dpit[1] - s->dpit[2]) >= corth[ixcor - 1]) { *pitch = median(s->dpit[2], s->dpit[1], s->dpit[0]); } } /* If bit 5 of ICORF is set then RC(5) - RC(10) are loaded with values so that after quantization bias is removed in decode the values will be zero. */ } if ((icorf & bit[4]) != 0) { for (i = 4; i < LPC10_ORDER; i++) t->irc[i] = zrc[i]; } /* Housekeeping - one frame delay */ s->iovoic = ivoic; s->ivp2h = voice[1]; s->dpit[2] = s->dpit[1]; s->dpit[1] = s->dpit[0]; s->drms[2] = s->drms[1]; s->drms[1] = s->drms[0]; for (i = 0; i < LPC10_ORDER; i++) { s->drc[i][2] = s->drc[i][1]; s->drc[i][1] = s->drc[i][0]; } } /* Decode RMS */ t->irms = rmst[(31 - t->irms)*2]; /* Decode RC(1) and RC(2) from log-area-ratios */ /* Protect from illegal coded value (-16) caused by bit errors */ for (i = 0; i < 2; i++) { i2 = t->irc[i]; i1 = 0; if (i2 < 0) { i1 = 1; i2 = -i2; if (i2 > 15) i2 = 0; } i2 = detab7[i2*2]; if (i1 == 1) i2 = -i2; ishift = 15 - nbit[i]; t->irc[i] = i2*pow_ii(2, ishift); } /* Decode RC(3)-RC(10) to sign plus 14 bits */ for (i = 2; i < LPC10_ORDER; i++) { ishift = 15 - nbit[i]; i2 = t->irc[i]*pow_ii(2, ishift) + qb[i - 2]; t->irc[i] = (int32_t) (i2*descl[i - 2] + deadd[i - 2]); } /* Scale RMS and RC's to floats */ *rms = (float) t->irms; for (i = 0; i < LPC10_ORDER; i++) rc[i] = t->irc[i]/16384.0f; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(lpc10_decode_state_t *) lpc10_decode_init(lpc10_decode_state_t *s, int error_correction) { static const int16_t rand_init[] = { -21161, -8478, 30892, -10216, 16950 }; int i; int j; if (s == NULL) { if ((s = (lpc10_decode_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } s->error_correction = error_correction; /* State used by function decode */ s->iptold = 60; s->first = TRUE; s->ivp2h = 0; s->iovoic = 0; s->iavgp = 60; s->erate = 0; for (i = 0; i < 3; i++) { for (j = 0; j < 10; j++) s->drc[j][i] = 0; s->dpit[i] = 0; s->drms[i] = 0; } /* State used by function synths */ for (i = 0; i < 360; i++) s->buf[i] = 0.0f; s->buflen = LPC10_SAMPLES_PER_FRAME; /* State used by function pitsyn */ s->rmso = 1.0f; s->first_pitsyn = TRUE; /* State used by function bsynz */ s->ipo = 0; for (i = 0; i < 166; i++) { s->exc[i] = 0.0f; s->exc2[i] = 0.0f; } for (i = 0; i < 3; i++) { s->lpi[i] = 0.0f; s->hpi[i] = 0.0f; } s->rmso_bsynz = 0.0f; /* State used by function lpc10_random */ s->j = 1; s->k = 4; for (i = 0; i < 5; i++) s->y[i] = rand_init[i]; /* State used by function deemp */ for (i = 0; i < 2; i++) s->dei[i] = 0.0f; for (i = 0; i < 3; i++) s->deo[i] = 0.0f; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) lpc10_decode_release(lpc10_decode_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) lpc10_decode_free(lpc10_decode_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) lpc10_decode(lpc10_decode_state_t *s, int16_t amp[], const uint8_t code[], int len) { int voice[2]; int32_t pitch; float speech[LPC10_SAMPLES_PER_FRAME]; float rc[LPC10_ORDER]; lpc10_frame_t frame; float rms; int i; int j; int base; /* Decode 54 bits in 7 bytes to LPC10_SAMPLES_PER_FRAME speech samples. */ len /= 7; for (i = 0; i < len; i++) { lpc10_unpack(&frame, &code[i*7]); decode(s, &frame, voice, &pitch, &rms, rc); synths(s, voice, &pitch, &rms, rc, speech); base = i*LPC10_SAMPLES_PER_FRAME; for (j = 0; j < LPC10_SAMPLES_PER_FRAME; j++) amp[base + j] = (int16_t) lfastrintf(32768.0f*speech[j]); } return len*LPC10_SAMPLES_PER_FRAME; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/v22bis_tx.c0000664000175000017500000006660012343630121012670 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v22bis_tx.c - ITU V.22bis modem transmit part * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /* THIS IS A WORK IN PROGRESS - It is basically functional, but it is not feature complete, and doesn't reliably sync over the signal and noise level ranges it should! */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/logging.h" #include "spandsp/complex.h" #include "spandsp/vector_float.h" #include "spandsp/complex_vector_float.h" #include "spandsp/vector_int.h" #include "spandsp/complex_vector_int.h" #include "spandsp/async.h" #include "spandsp/dds.h" #include "spandsp/power_meter.h" #include "spandsp/v29rx.h" #include "spandsp/v22bis.h" #include "spandsp/private/logging.h" #include "spandsp/private/v22bis.h" #if defined(SPANDSP_USE_FIXED_POINTx) #include "v22bis_tx_fixed_rrc.h" #else #include "v22bis_tx_floating_rrc.h" #endif /* Quoting from the V.22bis spec. 6.3.1.1 Interworking at 2400 bit/s 6.3.1.1.1 Calling modem a) On connection to line the calling modem shall be conditioned to receive signals in the high channel at 1200 bit/s and transmit signals in the low channel at 1200 bit/s in accordance with section 2.5.2.2. It shall apply an ON condition to circuit 107 in accordance with Recommendation V.25. The modem shall initially remain silent. b) After 155 +-10 ms of unscrambled binary 1 has been detected, the modem shall remain silent for a further 456 +-10 ms then transmit an unscrambled repetitive double dibit pattern of 00 and 11 at 1200 bit/s for 100 +-3 ms. Following this signal the modem shall transmit scrambled binary 1 at 1200 bit/s. c) If the modem detects scrambled binary 1 in the high channel at 1200 bit/s for 270 +-40 ms, the handshake shall continue in accordance with section 6.3.1.2.1 c) and d). However, if unscrambled repetitive double dibit 00 and 11 at 1200 bit/s is detected in the high channel, then at the end of receipt of this signal the modem shall apply an ON condition to circuit 112. d) 600 +-10 ms after circuit 112 has been turned ON the modem shall begin transmitting scrambled binary 1 at 2400 bit/s, and 450 +-10 ms after circuit 112 has been turned ON the receiver may begin making 16-way decisions. e) Following transmission of scrambled binary 1 at 2400 bit/s for 200 +-10 ms, circuit 106 shall be conditioned to respond to circuit 105 and the modem shall be ready to transmit data at 2400 bit/s. f) When 32 consecutive bits of scrambled binary 1 at 2400 bit/s have been detected in the high channel the modem shall be ready to receive data at 2400 bit/s and shall apply an ON condition to circuit 109. 6.3.1.1.2 Answering modem a) On connection to line the answering modem shall be conditioned to transmit signals in the high channel at 1200 bit/s in accordance with section 2.5.2.2 and receive signals in the low channel at 1200 bit/s. Following transmission of the answer sequence in accordance with Recommendation V.25, the modem shall apply an ON condition to circuit 107 and then transmit unscrambled binary 1 at 1200 bit/s. b) If the modem detects scrambled binary 1 or 0 in the low channel at 1200 bit/s for 270 +-40 ms, the handshake shall continue in accordance with section 6.3.1.2.2 b) and c). However, if unscrambled repetitive double dibit 00 and 11 at 1200 bit/s is detected in the low channel, at the end of receipt of this signal the modem shall apply an ON condition to circuit 112 and then transmit an unscrambled repetitive double dibit pattern of 00 and 11 at 1200 bit/s for 100 +-3 ms. Following these signals the modem shall transmit scrambled binary 1 at 1200 bit/s. c) 600 +-10 ms after circuit 112 has been turned ON the modem shall begin transmitting scrambled binary 1 at 2400 bit/s, and 450 +-10 ms after circuit 112 has been turned ON the receiver may begin making 16-way decisions. d) Following transmission of scrambled binary 1 at 2400 bit/s for 200 +-10 ms, circuit 106 shall be conditioned to respond to circuit 105 and the modem shall be ready to transmit data at 2400 bit/s. e) When 32 consecutive bits of scrambled binary 1 at 2400 bit/s have been detected in the low channel the modem shall be ready to receive data at 2400 bit/s and shall apply an ON condition to circuit 109. 6.3.1.2 Interworking at 1200 bit/s The following handshake is identical to the Recommendation V.22 alternative A and B handshake. 6.3.1.2.1 Calling modem a) On connection to line the calling modem shall be conditioned to receive signals in the high channel at 1200 bit/s and transmit signals in the low channel at 1200 bit/s in accordance with section 2.5.2.2. It shall apply an ON condition to circuit 107 in accordance with Recommendation V.25. The modem shall initially remain silent. b) After 155 +-10 ms of unscrambled binary 1 has been detected, the modem shall remain silent for a further 456 +-10 ms then transmit scrambled binary 1 at 1200 bit/s (a preceding V.22 bis signal, as shown in Figure 7/V.22 bis, would not affect the operation of a V.22 answer modem). c) On detection of scrambled binary 1 in the high channel at 1200 bit/s for 270 +-40 ms the modem shall be ready to receive data at 1200 bit/s and shall apply an ON condition to circuit 109 and an OFF condition to circuit 112. d) 765 +-10 ms after circuit 109 has been turned ON, circuit 106 shall be conditioned to respond to circuit 105 and the modem shall be ready to transmit data at 1200 bit/s. 6.3.1.2.2 Answering modem a) On connection to line the answering modem shall be conditioned to transmit signals in the high channel at 1200 bit/s in accordance with section 2.5.2.2 and receive signals in the low channel at 1200 bit/s. Following transmission of the answer sequence in accordance with V.25 the modem shall apply an ON condition to circuit 107 and then transmit unscrambled binary 1 at 1200 bit/s. b) On detection of scrambled binary 1 or 0 in the low channel at 1200 bit/s for 270 +-40 ms the modem shall apply an OFF condition to circuit 112 and shall then transmit scrambled binary 1 at 1200 bit/s. c) After scrambled binary 1 has been transmitted at 1200 bit/s for 765 +-10 ms the modem shall be ready to transmit and receive data at 1200 bit/s, shall condition circuit 106 to respond to circuit 105 and shall apply an ON condition to circuit 109. Note - Manufacturers may wish to note that in certain countries, for national purposes, modems are in service which emit an answering tone of 2225 Hz instead of unscrambled binary 1. V.22bis to V.22bis ------------------ Calling party S1 scrambled 1's scrambled 1's data at 1200bps at 2400bps |---------------------------------------------------------|XXXXXXXX|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX|XXXXXXXXXXXXXX|XXXXXXXXXXXXX |<155+-10>|<456+-10>|<100+-3>| |<------600+-10------>|<---200+-10-->| ^ | ^<----450+-100---->|[16 way decisions begin] | | | | v | | |<------450+-100----->|[16 way decisions begin] | |<----------600+-10-------->| |<2150+-350>|<--3300+-700->|<75+-20>| |<100+-3>| |<---200+-10--> |-----------|XXXXXXXXXXXXXX|--------|XXXXXXXXXXXXXXXXXXXXXXXXXXXX|XXXXXXXX|XXXXXXXXXXXXXXXXXX|XXXXXXXXXXXXXX|XXXXXXXXXXXXX silence 2100Hz unscrambled 1's S1 scrambled 1's scrambled 1's data at 1200bps at 1200bps at 2400bps Answering party S1 = Unscrambled double dibit 00 and 11 at 1200bps When the 2400bps section starts, both sides should look for 32 bits of continuous ones, as a test of integrity. V.22 to V.22bis --------------- Calling party scrambled 1's data at 1200bps |---------------------------------------------------------|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX|XXXXXXXXXXXXX |<155+-10>|<456+-10>| |<270+-40>|<--------765+-10-------->| ^ | ^ | | | | | | | | | | v | |<2150+-350>|<--3300+-700->|<75+-20>| |<270+-40>|<---------765+-10-------->| |-----------|XXXXXXXXXXXXXX|--------|XXXXXXXXXXXXXXXXXXXXXXXXXXXXX|XXXXXXXXXXXXXXXXXXXXXXXXXX|XXXXXXXXXXXXX silence 2100Hz unscrambled 1's scrambled 1's data at 1200bps at 1200bps Answering party Both ends should accept unscrambled binary 1 or binary 0 as the preamble. V.22bis to V.22 --------------- Calling party S1 scrambled 1's data at 1200bps |---------------------------------------------------------|XXXXXXXX|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX|XXXXXXXXXXXXX |<155+-10>|<456+-10>|<100+-3>| |<-270+-40-><------765+-10------>| ^ | ^ | | | | v | | | | | |<2150+-350>|<--3300+-700->|<75+-20>| |<-270+-40->|<------765+-10----->| |-----------|XXXXXXXXXXXXXX|--------|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX|XXXXXXXXXXXXXXXXXXXX|XXXXXXXXXXXXX silence 2100Hz unscrambled 1's scrambled 1's data at 1200bps at 1200bps Answering party Both ends should accept unscrambled binary 1 or binary 0 as the preamble. */ #define ms_to_symbols(t) (((t)*600)/1000) static const int phase_steps[4] = { 1, 0, 2, 3 }; const complexf_t v22bis_constellation[16] = { { 1.0f, 1.0f}, { 3.0f, 1.0f}, /* 1200bps 00 */ { 1.0f, 3.0f}, { 3.0f, 3.0f}, {-1.0f, 1.0f}, {-1.0f, 3.0f}, /* 1200bps 01 */ {-3.0f, 1.0f}, {-3.0f, 3.0f}, {-1.0f, -1.0f}, {-3.0f, -1.0f}, /* 1200bps 10 */ {-1.0f, -3.0f}, {-3.0f, -3.0f}, { 1.0f, -1.0f}, { 1.0f, -3.0f}, /* 1200bps 11 */ { 3.0f, -1.0f}, { 3.0f, -3.0f} }; static int fake_get_bit(void *user_data) { return 1; } /*- End of function --------------------------------------------------------*/ static __inline__ int scramble(v22bis_state_t *s, int bit) { int out_bit; if (s->tx.scrambler_pattern_count >= 64) { bit ^= 1; s->tx.scrambler_pattern_count = 0; } out_bit = (bit ^ (s->tx.scramble_reg >> 13) ^ (s->tx.scramble_reg >> 16)) & 1; s->tx.scramble_reg = (s->tx.scramble_reg << 1) | out_bit; if (out_bit == 1) s->tx.scrambler_pattern_count++; else s->tx.scrambler_pattern_count = 0; return out_bit; } /*- End of function --------------------------------------------------------*/ static __inline__ int get_scrambled_bit(v22bis_state_t *s) { int bit; if ((bit = s->tx.current_get_bit(s->get_bit_user_data)) == SIG_STATUS_END_OF_DATA) { /* Fill out this symbol with ones, and prepare to send the rest of the shutdown sequence. */ s->tx.current_get_bit = fake_get_bit; s->tx.shutdown = 1; bit = 1; } return scramble(s, bit); } /*- End of function --------------------------------------------------------*/ static complexf_t training_get(v22bis_state_t *s) { complexf_t z; int bits; /* V.22bis training sequence */ switch (s->tx.training) { case V22BIS_TX_TRAINING_STAGE_INITIAL_TIMED_SILENCE: /* The answerer waits 75ms, then sends unscrambled ones */ if (++s->tx.training_count >= ms_to_symbols(75)) { /* Initial 75ms of silence is over */ span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting U11 1200\n"); s->tx.training_count = 0; s->tx.training = V22BIS_TX_TRAINING_STAGE_U11; } /* Fall through */ case V22BIS_TX_TRAINING_STAGE_INITIAL_SILENCE: /* Silence */ s->tx.constellation_state = 0; z = complex_setf(0.0f, 0.0f); break; case V22BIS_TX_TRAINING_STAGE_U11: /* Send continuous unscrambled ones at 1200bps (i.e. 270 degree phase steps). */ /* Only the answering modem sends unscrambled ones. It is the first thing exchanged between the modems. */ s->tx.constellation_state = (s->tx.constellation_state + phase_steps[3]) & 3; z = v22bis_constellation[(s->tx.constellation_state << 2) | 0x01]; break; case V22BIS_TX_TRAINING_STAGE_U0011: /* Continuous unscrambled double dibit 00 11 at 1200bps. This is termed the S1 segment in the V.22bis spec. It is only sent to request or accept 2400bps mode, and lasts 100+-3ms. After this timed burst, we unconditionally change to sending scrambled ones at 1200bps. */ s->tx.constellation_state = (s->tx.constellation_state + phase_steps[3*(s->tx.training_count & 1)]) & 3; z = v22bis_constellation[(s->tx.constellation_state << 2) | 0x01]; if (++s->tx.training_count >= ms_to_symbols(100)) { span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting S11 after U0011\n"); if (s->calling_party) { s->tx.training_count = 0; s->tx.training = V22BIS_TX_TRAINING_STAGE_S11; } else { s->tx.training_count = ms_to_symbols(756 - (600 - 100)); s->tx.training = V22BIS_TX_TRAINING_STAGE_TIMED_S11; } } break; case V22BIS_TX_TRAINING_STAGE_TIMED_S11: /* A timed period of scrambled ones at 1200bps. */ if (++s->tx.training_count >= ms_to_symbols(756)) { if (s->negotiated_bit_rate == 2400) { span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting S1111 (C)\n"); s->tx.training_count = 0; s->tx.training = V22BIS_TX_TRAINING_STAGE_S1111; } else { span_log(&s->logging, SPAN_LOG_FLOW, "+++ Tx normal operation (1200)\n"); s->tx.training_count = 0; s->tx.training = V22BIS_TX_TRAINING_STAGE_NORMAL_OPERATION; v22bis_report_status_change(s, SIG_STATUS_TRAINING_SUCCEEDED); s->tx.current_get_bit = s->get_bit; } } /* Fall through */ case V22BIS_TX_TRAINING_STAGE_S11: /* Scrambled ones at 1200bps. */ bits = scramble(s, 1); bits = (bits << 1) | scramble(s, 1); s->tx.constellation_state = (s->tx.constellation_state + phase_steps[bits]) & 3; z = v22bis_constellation[(s->tx.constellation_state << 2) | 0x01]; break; case V22BIS_TX_TRAINING_STAGE_S1111: /* Scrambled ones at 2400bps. We send a timed 200ms burst, and switch to normal operation at 2400bps */ bits = scramble(s, 1); bits = (bits << 1) | scramble(s, 1); s->tx.constellation_state = (s->tx.constellation_state + phase_steps[bits]) & 3; bits = scramble(s, 1); bits = (bits << 1) | scramble(s, 1); z = v22bis_constellation[(s->tx.constellation_state << 2) | bits]; if (++s->tx.training_count >= ms_to_symbols(200)) { /* We have completed training. Now handle some real work. */ span_log(&s->logging, SPAN_LOG_FLOW, "+++ Tx normal operation (2400)\n"); s->tx.training_count = 0; s->tx.training = V22BIS_TX_TRAINING_STAGE_NORMAL_OPERATION; v22bis_report_status_change(s, SIG_STATUS_TRAINING_SUCCEEDED); s->tx.current_get_bit = s->get_bit; } break; case V22BIS_TX_TRAINING_STAGE_PARKED: default: z = complex_setf(0.0f, 0.0f); break; } return z; } /*- End of function --------------------------------------------------------*/ static complexf_t getbaud(v22bis_state_t *s) { int bits; if (s->tx.training) { /* Send the training sequence */ return training_get(s); } /* There is no graceful shutdown procedure defined for V.22bis. Just send some ones, to ensure we get the real data bits through, even with bad ISI. */ if (s->tx.shutdown) { if (++s->tx.shutdown > 10) return complex_setf(0.0f, 0.0f); } /* The first two bits define the quadrant */ bits = get_scrambled_bit(s); bits = (bits << 1) | get_scrambled_bit(s); s->tx.constellation_state = (s->tx.constellation_state + phase_steps[bits]) & 3; if (s->negotiated_bit_rate == 1200) { bits = 0x01; } else { /* The other two bits define the position within the quadrant */ bits = get_scrambled_bit(s); bits = (bits << 1) | get_scrambled_bit(s); } return v22bis_constellation[(s->tx.constellation_state << 2) | bits]; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) v22bis_tx(v22bis_state_t *s, int16_t amp[], int len) { complexf_t x; complexf_t z; int i; int sample; float famp; if (s->tx.shutdown > 10) return 0; for (sample = 0; sample < len; sample++) { if ((s->tx.baud_phase += 3) >= 40) { s->tx.baud_phase -= 40; s->tx.rrc_filter[s->tx.rrc_filter_step] = s->tx.rrc_filter[s->tx.rrc_filter_step + V22BIS_TX_FILTER_STEPS] = getbaud(s); if (++s->tx.rrc_filter_step >= V22BIS_TX_FILTER_STEPS) s->tx.rrc_filter_step = 0; } /* Root raised cosine pulse shaping at baseband */ x = complex_setf(0.0f, 0.0f); for (i = 0; i < V22BIS_TX_FILTER_STEPS; i++) { x.re += tx_pulseshaper[39 - s->tx.baud_phase][i]*s->tx.rrc_filter[i + s->tx.rrc_filter_step].re; x.im += tx_pulseshaper[39 - s->tx.baud_phase][i]*s->tx.rrc_filter[i + s->tx.rrc_filter_step].im; } /* Now create and modulate the carrier */ z = dds_complexf(&s->tx.carrier_phase, s->tx.carrier_phase_rate); famp = (x.re*z.re - x.im*z.im)*s->tx.gain; if (s->tx.guard_phase_rate && (s->tx.rrc_filter[s->tx.rrc_filter_step].re != 0.0f || s->tx.rrc_filter[s->tx.rrc_filter_step].im != 0.0f)) { /* Add the guard tone */ famp += dds_modf(&s->tx.guard_phase, s->tx.guard_phase_rate, s->tx.guard_level, 0); } /* Don't bother saturating. We should never clip. */ amp[sample] = (int16_t) lfastrintf(famp); } return sample; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v22bis_tx_power(v22bis_state_t *s, float power) { float l; if (s->tx.guard_phase_rate == dds_phase_ratef(550.0f)) { l = 1.6f*powf(10.0f, (power - 1.0f - DBM0_MAX_POWER)/20.0f); s->tx.gain = l*32768.0f/(TX_PULSESHAPER_GAIN*3.0f); l = powf(10.0f, (power - 1.0f - 3.0f - DBM0_MAX_POWER)/20.0f); s->tx.guard_level = l*32768.0f; } else if(s->tx.guard_phase_rate == dds_phase_ratef(1800.0f)) { l = 1.6f*powf(10.0f, (power - 1.0f - 1.0f - DBM0_MAX_POWER)/20.0f); s->tx.gain = l*32768.0f/(TX_PULSESHAPER_GAIN*3.0f); l = powf(10.0f, (power - 1.0f - 6.0f - DBM0_MAX_POWER)/20.0f); s->tx.guard_level = l*32768.0f; } else { l = 1.6f*powf(10.0f, (power - DBM0_MAX_POWER)/20.0f); s->tx.gain = l*32768.0f/(TX_PULSESHAPER_GAIN*3.0f); s->tx.guard_level = 0; } } /*- End of function --------------------------------------------------------*/ static int v22bis_tx_restart(v22bis_state_t *s) { cvec_zerof(s->tx.rrc_filter, sizeof(s->tx.rrc_filter)/sizeof(s->tx.rrc_filter[0])); s->tx.rrc_filter_step = 0; s->tx.scramble_reg = 0; s->tx.scrambler_pattern_count = 0; if (s->calling_party) s->tx.training = V22BIS_TX_TRAINING_STAGE_INITIAL_SILENCE; else s->tx.training = V22BIS_TX_TRAINING_STAGE_INITIAL_TIMED_SILENCE; s->tx.training_count = 0; s->tx.carrier_phase = 0; s->tx.guard_phase = 0; s->tx.baud_phase = 0; s->tx.constellation_state = 0; s->tx.current_get_bit = fake_get_bit; s->tx.shutdown = 0; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v22bis_set_get_bit(v22bis_state_t *s, get_bit_func_t get_bit, void *user_data) { s->get_bit = get_bit; s->get_bit_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v22bis_set_put_bit(v22bis_state_t *s, put_bit_func_t put_bit, void *user_data) { s->put_bit = put_bit; s->put_bit_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v22bis_set_modem_status_handler(v22bis_state_t *s, modem_status_func_t handler, void *user_data) { s->status_handler = handler; s->status_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) v22bis_get_logging_state(v22bis_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v22bis_restart(v22bis_state_t *s, int bit_rate) { switch (bit_rate) { case 2400: case 1200: break; default: return -1; } s->bit_rate = bit_rate; s->negotiated_bit_rate = 1200; if (v22bis_tx_restart(s)) return -1; return v22bis_rx_restart(s); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v22bis_request_retrain(v22bis_state_t *s, int bit_rate) { /* TODO: support bit rate switching */ switch (bit_rate) { case 2400: case 1200: break; default: return -1; } /* TODO: support bit rate changes */ /* Retrain is only valid when we are normal operation at 2400bps */ if (s->rx.training != V22BIS_RX_TRAINING_STAGE_NORMAL_OPERATION || s->tx.training != V22BIS_TX_TRAINING_STAGE_NORMAL_OPERATION || s->negotiated_bit_rate != 2400) { return -1; } /* Send things back into the training process at the appropriate point. The far end should detect the S1 signal, and reciprocate. */ span_log(&s->logging, SPAN_LOG_FLOW, "+++ Initiating a retrain\n"); s->rx.pattern_repeats = 0; s->rx.training_count = 0; s->rx.training = V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200; s->tx.training_count = 0; s->tx.training = V22BIS_TX_TRAINING_STAGE_U0011; v22bis_equalizer_coefficient_reset(s); v22bis_report_status_change(s, SIG_STATUS_MODEM_RETRAIN_OCCURRED); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v22bis_remote_loopback(v22bis_state_t *s, int enable) { /* TODO: */ return -1; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v22bis_get_current_bit_rate(v22bis_state_t *s) { return s->negotiated_bit_rate; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(v22bis_state_t *) v22bis_init(v22bis_state_t *s, int bit_rate, int guard, int calling_party, get_bit_func_t get_bit, void *get_bit_user_data, put_bit_func_t put_bit, void *put_bit_user_data) { switch (bit_rate) { case 2400: case 1200: break; default: return NULL; } if (s == NULL) { if ((s = (v22bis_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "V.22bis"); s->bit_rate = bit_rate; s->calling_party = calling_party; s->get_bit = get_bit; s->get_bit_user_data = get_bit_user_data; s->put_bit = put_bit; s->put_bit_user_data = put_bit_user_data; if (s->calling_party) { s->tx.carrier_phase_rate = dds_phase_ratef(1200.0f); } else { s->tx.carrier_phase_rate = dds_phase_ratef(2400.0f); switch (guard) { case V22BIS_GUARD_TONE_550HZ: s->tx.guard_phase_rate = dds_phase_ratef(550.0f); break; case V22BIS_GUARD_TONE_1800HZ: s->tx.guard_phase_rate = dds_phase_ratef(1800.0f); break; default: s->tx.guard_phase_rate = 0; break; } } v22bis_tx_power(s, -14.0f); v22bis_restart(s, s->bit_rate); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v22bis_release(v22bis_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v22bis_free(v22bis_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/t38_core.c0000664000175000017500000012131112100770472012470 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t38_core.c - Encode and decode the ASN.1 of a T.38 IFP message * * Written by Steve Underwood * * Copyright (C) 2005, 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/bit_operations.h" #include "spandsp/t38_core.h" #include "spandsp/private/logging.h" #include "spandsp/private/t38_core.h" #define ACCEPTABLE_SEQ_NO_OFFSET 2000 /* The times for training, the optional TEP, and the HDLC preamble, for all the modem options, in ms. Note that the preamble for V.21 is 1s+-15%, and for the other modems is 200ms+100ms. */ static const struct { int tep; int training; int flags; } modem_startup_time[] = { { 0, 75000, 0}, /* T38_IND_NO_SIGNAL */ { 0, 0, 0}, /* T38_IND_CNG */ { 0, 3000000, 0}, /* T38_IND_CED */ { 0, 0, 1000000}, /* T38_IND_V21_PREAMBLE */ /* TODO: 850ms should be OK for this, but it causes trouble with some ATAs. Why? */ { 215000, 943000, 200000}, /* T38_IND_V27TER_2400_TRAINING */ { 215000, 708000, 200000}, /* T38_IND_V27TER_4800_TRAINING */ { 215000, 234000, 200000}, /* T38_IND_V29_7200_TRAINING */ { 215000, 234000, 200000}, /* T38_IND_V29_9600_TRAINING */ { 215000, 142000, 200000}, /* T38_IND_V17_7200_SHORT_TRAINING */ { 215000, 1393000, 200000}, /* T38_IND_V17_7200_LONG_TRAINING */ { 215000, 142000, 200000}, /* T38_IND_V17_9600_SHORT_TRAINING */ { 215000, 1393000, 200000}, /* T38_IND_V17_9600_LONG_TRAINING */ { 215000, 142000, 200000}, /* T38_IND_V17_12000_SHORT_TRAINING */ { 215000, 1393000, 200000}, /* T38_IND_V17_12000_LONG_TRAINING */ { 215000, 142000, 200000}, /* T38_IND_V17_14400_SHORT_TRAINING */ { 215000, 1393000, 200000}, /* T38_IND_V17_14400_LONG_TRAINING */ { 0, 0, 0}, /* T38_IND_V8_ANSAM */ { 0, 0, 0}, /* T38_IND_V8_SIGNAL */ { 0, 0, 200000}, /* T38_IND_V34_CNTL_CHANNEL_1200 */ { 0, 0, 200000}, /* T38_IND_V34_PRI_CHANNEL */ { 0, 0, 0}, /* T38_IND_V34_CC_RETRAIN */ { 215000, 0, 200000}, /* T38_IND_V33_12000_TRAINING */ { 215000, 0, 200000} /* T38_IND_V33_14400_TRAINING */ }; SPAN_DECLARE(const char *) t38_indicator_to_str(int indicator) { switch (indicator) { case T38_IND_NO_SIGNAL: return "no-signal"; case T38_IND_CNG: return "cng"; case T38_IND_CED: return "ced"; case T38_IND_V21_PREAMBLE: return "v21-preamble"; case T38_IND_V27TER_2400_TRAINING: return "v27-2400-training"; case T38_IND_V27TER_4800_TRAINING: return "v27-4800-training"; case T38_IND_V29_7200_TRAINING: return "v29-7200-training"; case T38_IND_V29_9600_TRAINING: return "v29-9600-training"; case T38_IND_V17_7200_SHORT_TRAINING: return "v17-7200-short-training"; case T38_IND_V17_7200_LONG_TRAINING: return "v17-7200-long-training"; case T38_IND_V17_9600_SHORT_TRAINING: return "v17-9600-short-training"; case T38_IND_V17_9600_LONG_TRAINING: return "v17-9600-long-training"; case T38_IND_V17_12000_SHORT_TRAINING: return "v17-12000-short-training"; case T38_IND_V17_12000_LONG_TRAINING: return "v17-12000-long-training"; case T38_IND_V17_14400_SHORT_TRAINING: return "v17-14400-short-training"; case T38_IND_V17_14400_LONG_TRAINING: return "v17-14400-long-training"; case T38_IND_V8_ANSAM: return "v8-ansam"; case T38_IND_V8_SIGNAL: return "v8-signal"; case T38_IND_V34_CNTL_CHANNEL_1200: return "v34-cntl-channel-1200"; case T38_IND_V34_PRI_CHANNEL: return "v34-pri-channel"; case T38_IND_V34_CC_RETRAIN: return "v34-CC-retrain"; case T38_IND_V33_12000_TRAINING: return "v33-12000-training"; case T38_IND_V33_14400_TRAINING: return "v33-14400-training"; } return "???"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t38_data_type_to_str(int data_type) { switch (data_type) { case T38_DATA_V21: return "v21"; case T38_DATA_V27TER_2400: return "v27-2400"; case T38_DATA_V27TER_4800: return "v27-4800"; case T38_DATA_V29_7200: return "v29-7200"; case T38_DATA_V29_9600: return "v29-9600"; case T38_DATA_V17_7200: return "v17-7200"; case T38_DATA_V17_9600: return "v17-9600"; case T38_DATA_V17_12000: return "v17-12000"; case T38_DATA_V17_14400: return "v17-14400"; case T38_DATA_V8: return "v8"; case T38_DATA_V34_PRI_RATE: return "v34-pri-rate"; case T38_DATA_V34_CC_1200: return "v34-CC-1200"; case T38_DATA_V34_PRI_CH: return "v34-pri-ch"; case T38_DATA_V33_12000: return "v33-12000"; case T38_DATA_V33_14400: return "v33-14400"; } return "???"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t38_field_type_to_str(int field_type) { switch (field_type) { case T38_FIELD_HDLC_DATA: return "hdlc-data"; case T38_FIELD_HDLC_SIG_END: return "hdlc-sig-end"; case T38_FIELD_HDLC_FCS_OK: return "hdlc-fcs-OK"; case T38_FIELD_HDLC_FCS_BAD: return "hdlc-fcs-BAD"; case T38_FIELD_HDLC_FCS_OK_SIG_END: return "hdlc-fcs-OK-sig-end"; case T38_FIELD_HDLC_FCS_BAD_SIG_END: return "hdlc-fcs-BAD-sig-end"; case T38_FIELD_T4_NON_ECM_DATA: return "t4-non-ecm-data"; case T38_FIELD_T4_NON_ECM_SIG_END: return "t4-non-ecm-sig-end"; case T38_FIELD_CM_MESSAGE: return "cm-message"; case T38_FIELD_JM_MESSAGE: return "jm-message"; case T38_FIELD_CI_MESSAGE: return "ci-message"; case T38_FIELD_V34RATE: return "v34rate"; } return "???"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t38_cm_profile_to_str(int profile) { switch (profile) { case '1': return "G3 FAX sending terminal"; case '2': return "G3 FAX receiving terminal"; case '3': return "V.34 HDX and G3 FAX sending terminal"; case '4': return "V.34 HDX and G3 FAX receiving terminal"; case '5': return "V.34 HDX-only FAX sending terminal"; case '6': return "V.34 HDX-only FAX receiving terminal"; } return "???"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t38_jm_to_str(const uint8_t *data, int len) { if (len < 2) return "???"; switch (data[0]) { case 'A': switch (data[1]) { case '0': return "ACK"; } break; case 'N': switch (data[1]) { case '0': return "NACK: No compatible mode available"; case '1': /* Response for profiles 1 and 2 */ return "NACK: No V.34 FAX, use G3 FAX"; case '2': /* Response for profiles 5 and 6 */ return "NACK: V.34 only FAX."; } break; } return "???"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t38_v34rate_to_bps(const uint8_t *data, int len) { int i; int rate; if (len < 3) return -1; for (i = 0, rate = 0; i < 3; i++) { if (data[i] < '0' || data[i] > '9') return -1; rate = rate*10 + data[i] - '0'; } return rate*100; } /*- End of function --------------------------------------------------------*/ static __inline__ int classify_seq_no_offset(int expected, int actual) { /* Classify the mismatch between expected and actual sequence numbers according to whether the actual is a little in the past (late), a little in the future (some packets have been lost), or a large jump that represents the sequence being lost (possibly when some RTP gets dumped to a UDPTL port). */ /* This assumes they are not equal */ if (expected > actual) { if (expected > actual + 0x10000 - ACCEPTABLE_SEQ_NO_OFFSET) { /* In the near future */ return 1; } if (expected < actual + ACCEPTABLE_SEQ_NO_OFFSET) { /* In the recent past */ return -1; } } else { if (expected + ACCEPTABLE_SEQ_NO_OFFSET > actual) { /* In the near future */ return 1; } if (expected + 0x10000 - ACCEPTABLE_SEQ_NO_OFFSET < actual) { /* In the recent past */ return -1; } } /* There has been a huge step in the sequence */ return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) t38_core_rx_ifp_stream(t38_core_state_t *s, const uint8_t *buf, int len, uint16_t log_seq_no) { int i; int t30_indicator; int t30_data; int prev_ptr; int ptr; int other_half; int numocts; int pkt_len; int ret; const uint8_t *msg; unsigned int count; unsigned int t30_field_type; uint8_t type; uint8_t data_field_present; uint8_t field_data_present; char tag[20]; if (span_log_test(&s->logging, SPAN_LOG_FLOW)) { sprintf(tag, "Rx %5d: IFP", log_seq_no); span_log_buf(&s->logging, SPAN_LOG_FLOW, tag, buf, len); } ptr = 0; pkt_len = len; switch (s->data_transport_protocol) { case T38_TRANSPORT_TCP: /* We don't know the actual packet length, so treat everythign we have as the packet */ ret = 0; break; case T38_TRANSPORT_TCP_TPKT: if (len >= 4) { /* Version */ if (buf[0] != 3) return -1; /* Reserved */ if (buf[1] != 0) return -1; /* Packet length - this includes the length of the header itself */ pkt_len = (buf[2] << 8) | buf[3]; if (len < pkt_len) return 0; ptr = 4; } ret = -1; break; default: /* We know the actual packet length, and its the exact length of what we were passed. */ ret = -1; break; } if ((ptr + 1) > pkt_len) return ret; data_field_present = buf[ptr] & 0x80; type = (buf[ptr] >> 6) & 1; switch (type) { case T38_TYPE_OF_MSG_T30_INDICATOR: /* Indicators should never have a data field */ if (data_field_present) { span_log(&s->logging, SPAN_LOG_PROTOCOL_WARNING, "Rx %5d: Data field with indicator\n", log_seq_no); return -1; } /* Any received indicator should mean we no longer have a valid concept of "last received data/field type". */ s->current_rx_data_type = -1; s->current_rx_field_type = -1; if ((buf[ptr] & 0x20)) { /* Extension */ if ((ptr + 2) > pkt_len) return ret; t30_indicator = T38_IND_V8_ANSAM + (((buf[ptr] << 2) & 0x3C) | ((buf[ptr + 1] >> 6) & 0x3)); if (t30_indicator > T38_IND_V33_14400_TRAINING) { span_log(&s->logging, SPAN_LOG_PROTOCOL_WARNING, "Rx %5d: Unknown indicator - %d\n", log_seq_no, t30_indicator); return -1; } ptr += 2; } else { t30_indicator = (buf[ptr] >> 1) & 0xF; ptr += 1; } span_log(&s->logging, SPAN_LOG_FLOW, "Rx %5d: indicator %s\n", log_seq_no, t38_indicator_to_str(t30_indicator)); s->rx_indicator_handler(s, s->rx_user_data, t30_indicator); /* This must come after the indicator handler, so the handler routine sees the existing state of the indicator. */ s->current_rx_indicator = t30_indicator; break; case T38_TYPE_OF_MSG_T30_DATA: if ((buf[ptr] & 0x20)) { /* Extension */ if ((ptr + 2) > pkt_len) return ret; t30_data = T38_DATA_V8 + (((buf[ptr] << 2) & 0x3C) | ((buf[ptr + 1] >> 6) & 0x3)); if (t30_data > T38_DATA_V33_14400) { span_log(&s->logging, SPAN_LOG_PROTOCOL_WARNING, "Rx %5d: Unknown data type - %d\n", log_seq_no, t30_data); return -1; } ptr += 2; } else { t30_data = (buf[ptr] >> 1) & 0xF; if (t30_data > T38_DATA_V17_14400) { span_log(&s->logging, SPAN_LOG_PROTOCOL_WARNING, "Rx %5d: Unknown data type - %d\n", log_seq_no, t30_data); return -1; } ptr += 1; } if (!data_field_present) { /* This is kinda weird, but I guess if the length checks out we accept it. */ span_log(&s->logging, SPAN_LOG_PROTOCOL_WARNING, "Rx %5d: Data type with no data field\n", log_seq_no); break; } if (ptr >= pkt_len) return ret; count = buf[ptr++]; //printf("Count is %d\n", count); /* Do a dummy run through the fields to check we have a complete and uncorrupted packet. */ prev_ptr = ptr; other_half = FALSE; t30_field_type = 0; for (i = 0; i < (int) count; i++) { if (ptr >= pkt_len) return ret; if (s->t38_version == 0) { /* The original version of T.38 with a typo in the ASN.1 spec. */ if (other_half) { /* The lack of a data field in the previous message means we are currently in the middle of an octet. */ field_data_present = (buf[ptr] >> 3) & 1; /* Decode field_type */ t30_field_type = buf[ptr] & 0x7; ptr++; other_half = FALSE; } else { field_data_present = (buf[ptr] >> 7) & 1; /* Decode field_type */ t30_field_type = (buf[ptr] >> 4) & 0x7; if (field_data_present) ptr++; else other_half = TRUE; } if (t30_field_type > T38_FIELD_T4_NON_ECM_SIG_END) { span_log(&s->logging, SPAN_LOG_PROTOCOL_WARNING, "Rx %5d: Unknown field type - %d\n", log_seq_no, t30_field_type); return -1; } } else { field_data_present = (buf[ptr] >> 7) & 1; /* Decode field_type */ if ((buf[ptr] & 0x40)) { if ((ptr + 2) > pkt_len) return ret; t30_field_type = T38_FIELD_CM_MESSAGE + (((buf[ptr] << 2) & 0x3C) | ((buf[ptr + 1] >> 6) & 0x3)); if (t30_field_type > T38_FIELD_V34RATE) { span_log(&s->logging, SPAN_LOG_PROTOCOL_WARNING, "Rx %5d: Unknown field type - %d\n", log_seq_no, t30_field_type); return -1; } ptr += 2; } else { t30_field_type = (buf[ptr++] >> 3) & 0x7; } } /* Decode field_data */ if (field_data_present) { if ((ptr + 2) > pkt_len) return ret; numocts = ((buf[ptr] << 8) | buf[ptr + 1]) + 1; msg = buf + ptr + 2; ptr += numocts + 2; } else { numocts = 0; msg = NULL; } if (ptr > pkt_len) return ret; } /* Check if we finished mid byte in a version 0 packet. */ if (other_half) ptr++; if (ptr > pkt_len) return ret; /* Things look alright in the data, so lets run through the fields again, actually processing them. There is no need to do all the error checking along the way on this pass. */ ptr = prev_ptr; other_half = FALSE; for (i = 0; i < (int) count; i++) { if (s->t38_version == 0) { /* The original version of T.38 with a typo in the ASN.1 spec. */ if (other_half) { /* The lack of a data field in the previous message means we are currently in the middle of an octet. */ field_data_present = (buf[ptr] >> 3) & 1; /* Decode field_type */ t30_field_type = buf[ptr] & 0x7; ptr++; other_half = FALSE; } else { field_data_present = (buf[ptr] >> 7) & 1; /* Decode field_type */ t30_field_type = (buf[ptr] >> 4) & 0x7; if (field_data_present) ptr++; else other_half = TRUE; } } else { field_data_present = (buf[ptr] >> 7) & 1; /* Decode field_type */ if ((buf[ptr] & 0x40)) { t30_field_type = T38_FIELD_CM_MESSAGE + (((buf[ptr] << 2) & 0x3C) | ((buf[ptr + 1] >> 6) & 0x3)); ptr += 2; } else { t30_field_type = (buf[ptr++] >> 3) & 0x7; } } /* Decode field_data */ if (field_data_present) { numocts = ((buf[ptr] << 8) | buf[ptr + 1]) + 1; msg = buf + ptr + 2; ptr += numocts + 2; } else { numocts = 0; msg = NULL; } span_log(&s->logging, SPAN_LOG_FLOW, "Rx %5d: (%d) data %s/%s + %d byte(s)\n", log_seq_no, i, t38_data_type_to_str(t30_data), t38_field_type_to_str(t30_field_type), numocts); s->rx_data_handler(s, s->rx_user_data, t30_data, t30_field_type, msg, numocts); s->current_rx_data_type = t30_data; s->current_rx_field_type = t30_field_type; } /* Check if we finished mid byte in a version 0 packet. */ if (other_half) ptr++; break; } if (ptr > pkt_len) return ret; return ptr; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) t38_core_rx_ifp_packet(t38_core_state_t *s, const uint8_t *buf, int len, uint16_t seq_no) { int log_seq_no; int ptr; log_seq_no = (s->check_sequence_numbers) ? seq_no : s->rx_expected_seq_no; if (s->check_sequence_numbers) { seq_no &= 0xFFFF; if (seq_no != s->rx_expected_seq_no) { /* An expected value of -1 indicates this is the first received packet, and will accept anything for that. We can't assume they will start from zero, even though they should. */ if (s->rx_expected_seq_no != -1) { /* We have a packet with a serial number that is not in sequence. The cause could be: - 1. a repeat copy of a recent packet. Many T.38 implementations can preduce quite a lot of these. - 2. a late packet, whose point in the sequence we have already passed. - 3. the result of a hop in the sequence numbers cause by something weird from the other end. Stream switching might cause this - 4. missing packets. In cases 1 and 2 we need to drop this packet. In case 2 it might make sense to try to do something with it in the terminal case. Currently we don't. For gateway operation it will be too late to do anything useful. */ if (((seq_no + 1) & 0xFFFF) == s->rx_expected_seq_no) { /* Assume this is truly a repeat packet, and don't bother checking its contents. */ span_log(&s->logging, SPAN_LOG_FLOW, "Rx %5d: Repeat packet number\n", log_seq_no); return 0; } /* Distinguish between a little bit out of sequence, and a huge hop. */ switch (classify_seq_no_offset(s->rx_expected_seq_no, seq_no)) { case -1: /* This packet is in the near past, so its late. */ span_log(&s->logging, SPAN_LOG_FLOW, "Rx %5d: Late packet - expected %d\n", log_seq_no, s->rx_expected_seq_no); return 0; case 1: /* This packet is in the near future, so some packets have been lost */ span_log(&s->logging, SPAN_LOG_FLOW, "Rx %5d: Missing from %d\n", log_seq_no, s->rx_expected_seq_no); s->rx_missing_handler(s, s->rx_user_data, s->rx_expected_seq_no, seq_no); s->missing_packets += (seq_no - s->rx_expected_seq_no); break; default: /* The sequence has jumped wildly */ span_log(&s->logging, SPAN_LOG_FLOW, "Rx %5d: Sequence restart\n", log_seq_no); s->rx_missing_handler(s, s->rx_user_data, -1, -1); s->missing_packets++; break; } } s->rx_expected_seq_no = seq_no; } } if (len < 1) { span_log(&s->logging, SPAN_LOG_PROTOCOL_WARNING, "Rx %5d: Bad packet length - %d\n", log_seq_no, len); return -1; } /* The sequence numbering is defined as rolling from 0xFFFF to 0x0000. Some implementations of T.38 roll from 0xFFFF to 0x0001. Isn't standardisation a wonderful thing? The T.38 document specifies only a small fraction of what it should, yet then they actually nail something properly, people ignore it. Developers in this industry truly deserves the **** **** **** **** **** **** documents they have to live with. Anyway, when the far end has a broken rollover behaviour we will get a hiccup at the rollover point. Don't worry too much. We will just treat the message in progress as one with some missing data. With any luck a retry will ride over the problem. Rollovers don't occur that often. It takes quite a few FAX pages to reach rollover. */ s->rx_expected_seq_no = (s->rx_expected_seq_no + 1) & 0xFFFF; ptr = t38_core_rx_ifp_stream(s, buf, len, seq_no); if (ptr != len) { if (ptr >= 0) span_log(&s->logging, SPAN_LOG_PROTOCOL_WARNING, "Rx %5d: Invalid length for packet - %d %d\n", log_seq_no, ptr, len); return -1; } return 0; } /*- End of function --------------------------------------------------------*/ static int t38_encode_indicator(t38_core_state_t *s, uint8_t buf[], int indicator) { int len; /* Build the IFP packet */ len = 0; if (s->data_transport_protocol == T38_TRANSPORT_TCP_TPKT) len = 4; /* Data field not present */ /* Indicator packet */ /* Type of indicator */ if (indicator <= T38_IND_V17_14400_LONG_TRAINING) { buf[len++] = (uint8_t) (indicator << 1); } else if (s->t38_version != 0 && indicator <= T38_IND_V33_14400_TRAINING) { buf[len++] = (uint8_t) (0x20 | (((indicator - T38_IND_V8_ANSAM) & 0xF) >> 2)); buf[len++] = (uint8_t) (((indicator - T38_IND_V8_ANSAM) << 6) & 0xFF); } else { len = -1; } if (s->data_transport_protocol == T38_TRANSPORT_TCP_TPKT) { /* Fill in the TPKT header (se RFC1006) */ /* Version */ buf[0] = 3; /* Reserved */ buf[1] = 0; /* Packet length - this includes the length of the header itself */ buf[2] = (len >> 8) & 0xFF; buf[3] = len & 0xFF; } return len; } /*- End of function --------------------------------------------------------*/ static int t38_encode_data(t38_core_state_t *s, uint8_t buf[], int data_type, const t38_data_field_t field[], int fields) { int len; int i; int enclen; int multiplier; int data_field_no; const t38_data_field_t *q; unsigned int encoded_len; unsigned int fragment_len; unsigned int value; uint8_t data_field_present; uint8_t field_data_present; char tag[20]; /* Build the IFP packet */ len = 0; if (s->data_transport_protocol == T38_TRANSPORT_TCP_TPKT) len = 4; /* There seems no valid reason why a packet would ever be generated without a data field present */ data_field_present = (fields > 0) ? 0x80 : 0x00; data_field_no = 0; /* Data field present */ /* Data packet */ /* Type of data */ if (data_type <= T38_DATA_V17_14400) { buf[len++] = (uint8_t) (data_field_present | 0x40 | (data_type << 1)); } else if (s->t38_version != 0 && data_type <= T38_DATA_V33_14400) { buf[len++] = (uint8_t) (data_field_present | 0x60 | (((data_type - T38_DATA_V8) & 0xF) >> 2)); buf[len++] = (uint8_t) (((data_type - T38_DATA_V8) << 6) & 0xFF); } else { return -1; } if (data_field_present) { encoded_len = 0; data_field_no = 0; do { value = fields - encoded_len; if (value < 0x80) { /* 1 octet case */ buf[len++] = (uint8_t) value; enclen = value; } else if (value < 0x4000) { /* 2 octet case */ buf[len++] = (uint8_t) (0x80 | ((value >> 8) & 0xFF)); buf[len++] = (uint8_t) (value & 0xFF); enclen = value; } else { /* Fragmentation case */ multiplier = (value/0x4000 < 4) ? value/0x4000 : 4; buf[len++] = (uint8_t) (0xC0 | multiplier); enclen = 0x4000*multiplier; } fragment_len = enclen; encoded_len += fragment_len; /* Encode the elements */ for (i = 0; i < (int) encoded_len; i++) { q = &field[data_field_no]; field_data_present = (uint8_t) (q->field_len > 0); /* Encode field_type */ if (s->t38_version == 0) { /* Original version of T.38 with a typo */ if (q->field_type > T38_FIELD_T4_NON_ECM_SIG_END) return -1; buf[len++] = (uint8_t) ((field_data_present << 7) | (q->field_type << 4)); } else { if (q->field_type <= T38_FIELD_T4_NON_ECM_SIG_END) { buf[len++] = (uint8_t) ((field_data_present << 7) | (q->field_type << 3)); } else if (q->field_type <= T38_FIELD_V34RATE) { buf[len++] = (uint8_t) ((field_data_present << 7) | 0x40 | ((q->field_type - T38_FIELD_CM_MESSAGE) >> 2)); buf[len++] = (uint8_t) (((q->field_type - T38_FIELD_CM_MESSAGE) << 6) & 0xC0); } else { return -1; } } /* Encode field_data */ if (field_data_present) { if (q->field_len < 1 || q->field_len > 65535) return -1; buf[len++] = (uint8_t) (((q->field_len - 1) >> 8) & 0xFF); buf[len++] = (uint8_t) ((q->field_len - 1) & 0xFF); memcpy(buf + len, q->field, q->field_len); len += q->field_len; } data_field_no++; } } while ((int) encoded_len != fields || fragment_len >= 16384); } for (data_field_no = 0; data_field_no < fields; data_field_no++) { span_log(&s->logging, SPAN_LOG_FLOW, "Tx %5d: (%d) data %s/%s + %d byte(s)\n", s->tx_seq_no, data_field_no, t38_data_type_to_str(data_type), t38_field_type_to_str(field[data_field_no].field_type), field[data_field_no].field_len); } if (s->data_transport_protocol == T38_TRANSPORT_TCP_TPKT) { /* Fill in the TPKT header (se RFC1006) */ /* Version */ buf[0] = 3; /* Reserved */ buf[1] = 0; /* Packet length - this includes the length of the header itself */ buf[2] = (len >> 8) & 0xFF; buf[3] = len & 0xFF; } if (span_log_test(&s->logging, SPAN_LOG_FLOW)) { sprintf(tag, "Tx %5d: IFP", s->tx_seq_no); span_log_buf(&s->logging, SPAN_LOG_FLOW, tag, buf, len); } return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t38_core_send_indicator(t38_core_state_t *s, int indicator) { uint8_t buf[100]; int len; int delay; int transmissions; delay = 0; /* Only send an indicator if it represents a change of state. */ /* If the 0x100 bit is set in indicator it will bypass this test, and force transmission */ if (s->current_tx_indicator != indicator) { /* Zero is a valid count, to suppress the transmission of indicators when the transport means they are not needed - e.g. TPKT/TCP. */ transmissions = (indicator & 0x100) ? 1 : s->category_control[T38_PACKET_CATEGORY_INDICATOR]; indicator &= 0xFF; if (s->category_control[T38_PACKET_CATEGORY_INDICATOR]) { if ((len = t38_encode_indicator(s, buf, indicator)) < 0) { span_log(&s->logging, SPAN_LOG_FLOW, "T.38 indicator len is %d\n", len); return len; } span_log(&s->logging, SPAN_LOG_FLOW, "Tx %5d: indicator %s\n", s->tx_seq_no, t38_indicator_to_str(indicator)); if (s->tx_packet_handler(s, s->tx_packet_user_data, buf, len, transmissions) < 0) { span_log(&s->logging, SPAN_LOG_PROTOCOL_WARNING, "Tx packet handler failure\n"); return -1; } s->tx_seq_no = (s->tx_seq_no + 1) & 0xFFFF; if (s->pace_transmission) { delay = modem_startup_time[indicator].training; if (s->allow_for_tep) delay += modem_startup_time[indicator].tep; } } s->current_tx_indicator = indicator; } return delay; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t38_core_send_flags_delay(t38_core_state_t *s, int indicator) { if (s->pace_transmission) return modem_startup_time[indicator].flags; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t38_core_send_training_delay(t38_core_state_t *s, int indicator) { if (s->pace_transmission) return modem_startup_time[indicator].training; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t38_core_send_data(t38_core_state_t *s, int data_type, int field_type, const uint8_t field[], int field_len, int category) { t38_data_field_t field0; uint8_t buf[1000]; int len; field0.field_type = field_type; field0.field = field; field0.field_len = field_len; if ((len = t38_encode_data(s, buf, data_type, &field0, 1)) < 0) { span_log(&s->logging, SPAN_LOG_FLOW, "T.38 data len is %d\n", len); return len; } if (s->tx_packet_handler(s, s->tx_packet_user_data, buf, len, s->category_control[category]) < 0) { span_log(&s->logging, SPAN_LOG_PROTOCOL_WARNING, "Tx packet handler failure\n"); return -1; } s->tx_seq_no = (s->tx_seq_no + 1) & 0xFFFF; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t38_core_send_data_multi_field(t38_core_state_t *s, int data_type, const t38_data_field_t field[], int fields, int category) { uint8_t buf[1000]; int len; if ((len = t38_encode_data(s, buf, data_type, field, fields)) < 0) { span_log(&s->logging, SPAN_LOG_FLOW, "T.38 data len is %d\n", len); return len; } if (s->tx_packet_handler(s, s->tx_packet_user_data, buf, len, s->category_control[category]) < 0) { span_log(&s->logging, SPAN_LOG_PROTOCOL_WARNING, "Tx packet handler failure\n"); return -1; } s->tx_seq_no = (s->tx_seq_no + 1) & 0xFFFF; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_set_data_rate_management_method(t38_core_state_t *s, int method) { s->data_rate_management_method = method; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_set_data_transport_protocol(t38_core_state_t *s, int data_transport_protocol) { s->data_transport_protocol = data_transport_protocol; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_set_fill_bit_removal(t38_core_state_t *s, int fill_bit_removal) { s->fill_bit_removal = fill_bit_removal; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_set_mmr_transcoding(t38_core_state_t *s, int mmr_transcoding) { s->mmr_transcoding = mmr_transcoding; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_set_jbig_transcoding(t38_core_state_t *s, int jbig_transcoding) { s->jbig_transcoding = jbig_transcoding; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_set_max_buffer_size(t38_core_state_t *s, int max_buffer_size) { s->max_buffer_size = max_buffer_size; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_set_max_datagram_size(t38_core_state_t *s, int max_datagram_size) { s->max_datagram_size = max_datagram_size; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_set_t38_version(t38_core_state_t *s, int t38_version) { s->t38_version = t38_version; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_set_sequence_number_handling(t38_core_state_t *s, int check) { s->check_sequence_numbers = check; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_set_pace_transmission(t38_core_state_t *s, int pace_transmission) { s->pace_transmission = pace_transmission; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_set_tep_handling(t38_core_state_t *s, int allow_for_tep) { s->allow_for_tep = allow_for_tep; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_set_redundancy_control(t38_core_state_t *s, int category, int setting) { s->category_control[category] = setting; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_set_fastest_image_data_rate(t38_core_state_t *s, int max_rate) { s->fastest_image_data_rate = max_rate; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t38_get_fastest_image_data_rate(t38_core_state_t *s) { return s->fastest_image_data_rate; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) t38_core_get_logging_state(t38_core_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t38_core_restart(t38_core_state_t *s) { /* Set the initial current receive states to something invalid, so the first data received is seen as a change of state. */ s->current_rx_indicator = -1; s->current_rx_data_type = -1; s->current_rx_field_type = -1; /* Set the initial current indicator state to something invalid, so the first attempt to send an indicator will work. */ s->current_tx_indicator = -1; /* We have no initial expectation of the received packet sequence number. They most often start at 0 or 1 for a UDPTL transport, but random starting numbers are possible. */ s->rx_expected_seq_no = -1; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(t38_core_state_t *) t38_core_init(t38_core_state_t *s, t38_rx_indicator_handler_t *rx_indicator_handler, t38_rx_data_handler_t *rx_data_handler, t38_rx_missing_handler_t *rx_missing_handler, void *rx_user_data, t38_tx_packet_handler_t *tx_packet_handler, void *tx_packet_user_data) { if (s == NULL) { if ((s = (t38_core_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "T.38"); /* Set some defaults for the parameters configurable from outside the T.38 domain - e.g. from SDP data. */ s->data_rate_management_method = T38_DATA_RATE_MANAGEMENT_TRANSFERRED_TCF; s->data_transport_protocol = T38_TRANSPORT_UDPTL; s->fill_bit_removal = FALSE; s->mmr_transcoding = FALSE; s->jbig_transcoding = FALSE; s->max_buffer_size = 400; s->max_datagram_size = 100; s->t38_version = 0; s->check_sequence_numbers = TRUE; s->pace_transmission = TRUE; /* Set some defaults */ s->category_control[T38_PACKET_CATEGORY_INDICATOR] = 1; s->category_control[T38_PACKET_CATEGORY_CONTROL_DATA] = 1; s->category_control[T38_PACKET_CATEGORY_CONTROL_DATA_END] = 1; s->category_control[T38_PACKET_CATEGORY_IMAGE_DATA] = 1; s->category_control[T38_PACKET_CATEGORY_IMAGE_DATA_END] = 1; s->rx_indicator_handler = rx_indicator_handler; s->rx_data_handler = rx_data_handler; s->rx_missing_handler = rx_missing_handler; s->rx_user_data = rx_user_data; s->tx_packet_handler = tx_packet_handler; s->tx_packet_user_data = tx_packet_user_data; t38_core_restart(s); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t38_core_release(t38_core_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t38_core_free(t38_core_state_t *s) { if (s) free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/Makefile.in0000664000175000017500000015101012343627456012756 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = src DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/config-h.in $(srcdir)/spandsp.h.in \ $(top_srcdir)/config/depcomp $(nobase_include_HEADERS) \ $(noinst_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_check_real_file.m4 \ $(top_srcdir)/m4/ax_fixed_point_machine.m4 \ $(top_srcdir)/m4/ax_misaligned_access_fails.m4 \ $(top_srcdir)/m4/ax_c99_features.m4 \ $(top_srcdir)/m4/ax_check_export_capability.m4 \ $(top_srcdir)/m4/ax_check_arm_neon.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = spandsp.h CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" \ "$(DESTDIR)$(includedir)" LTLIBRARIES = $(lib_LTLIBRARIES) libspandsp_la_LIBADD = am_libspandsp_la_OBJECTS = ademco_contactid.lo adsi.lo async.lo \ at_interpreter.lo awgn.lo bell_r2_mf.lo bert.lo \ bit_operations.lo bitstream.lo complex_filters.lo \ complex_vector_float.lo complex_vector_int.lo crc.lo \ dds_float.lo dds_int.lo dtmf.lo echo.lo fax.lo fax_modems.lo \ fsk.lo g711.lo g722.lo g726.lo gsm0610_decode.lo \ gsm0610_encode.lo gsm0610_long_term.lo gsm0610_lpc.lo \ gsm0610_preprocess.lo gsm0610_rpe.lo gsm0610_short_term.lo \ hdlc.lo ima_adpcm.lo image_translate.lo logging.lo \ lpc10_analyse.lo lpc10_decode.lo lpc10_encode.lo \ lpc10_placev.lo lpc10_voicing.lo math_fixed.lo modem_echo.lo \ modem_connect_tones.lo noise.lo oki_adpcm.lo playout.lo plc.lo \ power_meter.lo queue.lo schedule.lo sig_tone.lo silence_gen.lo \ super_tone_rx.lo super_tone_tx.lo swept_tone.lo t4_rx.lo \ t4_tx.lo t30.lo t30_api.lo t30_logging.lo t31.lo t35.lo \ t38_core.lo t38_gateway.lo t38_non_ecm_buffer.lo \ t38_terminal.lo testcpuid.lo time_scale.lo timezone.lo \ tone_detect.lo tone_generate.lo v17rx.lo v17tx.lo v18.lo \ v22bis_rx.lo v22bis_tx.lo v27ter_rx.lo v27ter_tx.lo v29rx.lo \ v29tx.lo v42.lo v42bis.lo v8.lo vector_float.lo vector_int.lo libspandsp_la_OBJECTS = $(am_libspandsp_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = libspandsp_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libspandsp_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libspandsp_la_SOURCES) DIST_SOURCES = $(libspandsp_la_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(nobase_include_HEADERS) $(nodist_include_HEADERS) \ $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ COMP_VENDOR_CFLAGS = @COMP_VENDOR_CFLAGS@ COMP_VENDOR_LDFLAGS = @COMP_VENDOR_LDFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_FAX2TIFF = @HAVE_FAX2TIFF@ HAVE_PBMTOG3 = @HAVE_PBMTOG3@ HAVE_SOX = @HAVE_SOX@ INSERT_INTTYPES_HEADER = @INSERT_INTTYPES_HEADER@ INSERT_MATH_HEADER = @INSERT_MATH_HEADER@ INSERT_STDBOOL_HEADER = @INSERT_STDBOOL_HEADER@ INSERT_STDINT_HEADER = @INSERT_STDINT_HEADER@ INSERT_TGMATH_HEADER = @INSERT_TGMATH_HEADER@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIMLIBS = @SIMLIBS@ SPANDSP_LT_AGE = @SPANDSP_LT_AGE@ SPANDSP_LT_CURRENT = @SPANDSP_LT_CURRENT@ SPANDSP_LT_REVISION = @SPANDSP_LT_REVISION@ SPANDSP_MISALIGNED_ACCESS_FAILS = @SPANDSP_MISALIGNED_ACCESS_FAILS@ SPANDSP_SUPPORT_T85 = @SPANDSP_SUPPORT_T85@ SPANDSP_SUPPORT_V34 = @SPANDSP_SUPPORT_V34@ SPANDSP_USE_EXPORT_CAPABILITY = @SPANDSP_USE_EXPORT_CAPABILITY@ SPANDSP_USE_FIXED_POINT = @SPANDSP_USE_FIXED_POINT@ STRIP = @STRIP@ TESTLIBS = @TESTLIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = $(COMP_VENDOR_CFLAGS) AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS) MAINTAINERCLEANFILES = Makefile.in DISTCLEANFILES = $(srcdir)/at_interpreter_dictionary.h \ $(srcdir)/math_fixed_tables.h \ $(srcdir)/v17_v32bis_rx_fixed_rrc.h \ $(srcdir)/v17_v32bis_rx_floating_rrc.h \ $(srcdir)/v17_v32bis_tx_fixed_rrc.h \ $(srcdir)/v17_v32bis_tx_floating_rrc.h \ $(srcdir)/v22bis_rx_1200_fixed_rrc.h \ $(srcdir)/v22bis_rx_2400_fixed_rrc.h \ $(srcdir)/v22bis_rx_1200_floating_rrc.h \ $(srcdir)/v22bis_rx_2400_floating_rrc.h \ $(srcdir)/v22bis_tx_fixed_rrc.h \ $(srcdir)/v22bis_tx_floating_rrc.h \ $(srcdir)/v27ter_rx_2400_fixed_rrc.h \ $(srcdir)/v27ter_rx_4800_fixed_rrc.h \ $(srcdir)/v27ter_rx_2400_floating_rrc.h \ $(srcdir)/v27ter_rx_4800_floating_rrc.h \ $(srcdir)/v27ter_tx_2400_fixed_rrc.h \ $(srcdir)/v27ter_tx_4800_fixed_rrc.h \ $(srcdir)/v27ter_tx_2400_floating_rrc.h \ $(srcdir)/v27ter_tx_4800_floating_rrc.h \ $(srcdir)/v29rx_fixed_rrc.h \ $(srcdir)/v29rx_floating_rrc.h \ $(srcdir)/v29tx_fixed_rrc.h \ $(srcdir)/v29tx_floating_rrc.h EXTRA_DIST = floating_fudge.h \ libspandsp.dsp \ libspandsp.2005.sln \ libspandsp.2008.sln \ libspandsp.2005.vcproj \ libspandsp.2008.vcproj \ libtiff.2005.vcproj \ libtiff.2008.vcproj \ filter_tools.c \ make_at_dictionary.c \ make_math_fixed_tables.c \ make_modem_filter.c \ msvc/config.h \ msvc/Download_TIFF.2005.vcproj \ msvc/Download_TIFF.2008.vcproj \ msvc/getopt.c \ msvc/gettimeofday.c \ msvc/inttypes.h \ msvc/make_at_dictionary.2005.vcproj \ msvc/make_at_dictionary.2008.vcproj \ msvc/make_modem_filter.2005.vcproj \ msvc/make_modem_filter.2008.vcproj \ msvc/msvcproj.head \ msvc/msvcproj.foot \ msvc/spandsp.h \ msvc/tgmath.h \ msvc/tiff/cleancount \ msvc/unistd.h \ msvc/util.vbs \ msvc/vc8proj.foot \ msvc/vc8proj.head \ msvc/vc9proj.foot \ msvc/vc9proj.head \ msvc/sys/time.h \ spandsp/private/README \ spandsp/version.h.in AM_CPPFLAGS = -I$(top_builddir) lib_LTLIBRARIES = libspandsp.la libspandsp_la_SOURCES = ademco_contactid.c \ adsi.c \ async.c \ at_interpreter.c \ awgn.c \ bell_r2_mf.c \ bert.c \ bit_operations.c \ bitstream.c \ complex_filters.c \ complex_vector_float.c \ complex_vector_int.c \ crc.c \ dds_float.c \ dds_int.c \ dtmf.c \ echo.c \ fax.c \ fax_modems.c \ fsk.c \ g711.c \ g722.c \ g726.c \ gsm0610_decode.c \ gsm0610_encode.c \ gsm0610_long_term.c \ gsm0610_lpc.c \ gsm0610_preprocess.c \ gsm0610_rpe.c \ gsm0610_short_term.c \ hdlc.c \ ima_adpcm.c \ image_translate.c \ logging.c \ lpc10_analyse.c \ lpc10_decode.c \ lpc10_encode.c \ lpc10_placev.c \ lpc10_voicing.c \ math_fixed.c \ modem_echo.c \ modem_connect_tones.c \ noise.c \ oki_adpcm.c \ playout.c \ plc.c \ power_meter.c \ queue.c \ schedule.c \ sig_tone.c \ silence_gen.c \ super_tone_rx.c \ super_tone_tx.c \ swept_tone.c \ t4_rx.c \ t4_tx.c \ t30.c \ t30_api.c \ t30_logging.c \ t31.c \ t35.c \ t38_core.c \ t38_gateway.c \ t38_non_ecm_buffer.c \ t38_terminal.c \ testcpuid.c \ time_scale.c \ timezone.c \ tone_detect.c \ tone_generate.c \ v17rx.c \ v17tx.c \ v18.c \ v22bis_rx.c \ v22bis_tx.c \ v27ter_rx.c \ v27ter_tx.c \ v29rx.c \ v29tx.c \ v42.c \ v42bis.c \ v8.c \ vector_float.c \ vector_int.c libspandsp_la_LDFLAGS = -version-info @SPANDSP_LT_CURRENT@:@SPANDSP_LT_REVISION@:@SPANDSP_LT_AGE@ $(COMP_VENDOR_LDFLAGS) nobase_include_HEADERS = spandsp/ademco_contactid.h \ spandsp/adsi.h \ spandsp/async.h \ spandsp/arctan2.h \ spandsp/at_interpreter.h \ spandsp/awgn.h \ spandsp/bell_r2_mf.h \ spandsp/bert.h \ spandsp/biquad.h \ spandsp/bit_operations.h \ spandsp/bitstream.h \ spandsp/crc.h \ spandsp/complex.h \ spandsp/complex_filters.h \ spandsp/complex_vector_float.h \ spandsp/complex_vector_int.h \ spandsp/dc_restore.h \ spandsp/dds.h \ spandsp/dtmf.h \ spandsp/echo.h \ spandsp/fast_convert.h \ spandsp/fax.h \ spandsp/fax_modems.h \ spandsp/fir.h \ spandsp/fsk.h \ spandsp/g168models.h \ spandsp/g711.h \ spandsp/g722.h \ spandsp/g726.h \ spandsp/gsm0610.h \ spandsp/hdlc.h \ spandsp/ima_adpcm.h \ spandsp/image_translate.h \ spandsp/logging.h \ spandsp/lpc10.h \ spandsp/math_fixed.h \ spandsp/modem_echo.h \ spandsp/modem_connect_tones.h \ spandsp/noise.h \ spandsp/oki_adpcm.h \ spandsp/playout.h \ spandsp/plc.h \ spandsp/power_meter.h \ spandsp/queue.h \ spandsp/saturated.h \ spandsp/schedule.h \ spandsp/stdbool.h \ spandsp/sig_tone.h \ spandsp/silence_gen.h \ spandsp/super_tone_rx.h \ spandsp/super_tone_tx.h \ spandsp/swept_tone.h \ spandsp/t30.h \ spandsp/t30_api.h \ spandsp/t30_fcf.h \ spandsp/t30_logging.h \ spandsp/t31.h \ spandsp/t35.h \ spandsp/t38_core.h \ spandsp/t38_gateway.h \ spandsp/t38_non_ecm_buffer.h \ spandsp/t38_terminal.h \ spandsp/t4_rx.h \ spandsp/t4_tx.h \ spandsp/t4_t6_decode.h \ spandsp/t4_t6_encode.h \ spandsp/telephony.h \ spandsp/time_scale.h \ spandsp/timezone.h \ spandsp/timing.h \ spandsp/tone_detect.h \ spandsp/tone_generate.h \ spandsp/v17rx.h \ spandsp/v17tx.h \ spandsp/v18.h \ spandsp/v22bis.h \ spandsp/v27ter_rx.h \ spandsp/v27ter_tx.h \ spandsp/v29rx.h \ spandsp/v29tx.h \ spandsp/v42.h \ spandsp/v42bis.h \ spandsp/v8.h \ spandsp/vector_float.h \ spandsp/vector_int.h \ spandsp/version.h \ spandsp/private/ademco_contactid.h \ spandsp/private/adsi.h \ spandsp/private/async.h \ spandsp/private/at_interpreter.h \ spandsp/private/awgn.h \ spandsp/private/bell_r2_mf.h \ spandsp/private/bert.h \ spandsp/private/bitstream.h \ spandsp/private/dtmf.h \ spandsp/private/echo.h \ spandsp/private/fax.h \ spandsp/private/fax_modems.h \ spandsp/private/fsk.h \ spandsp/private/g711.h \ spandsp/private/g722.h \ spandsp/private/g726.h \ spandsp/private/gsm0610.h \ spandsp/private/hdlc.h \ spandsp/private/ima_adpcm.h \ spandsp/private/image_translate.h \ spandsp/private/logging.h \ spandsp/private/lpc10.h \ spandsp/private/modem_connect_tones.h \ spandsp/private/modem_echo.h \ spandsp/private/noise.h \ spandsp/private/oki_adpcm.h \ spandsp/private/queue.h \ spandsp/private/schedule.h \ spandsp/private/sig_tone.h \ spandsp/private/silence_gen.h \ spandsp/private/super_tone_rx.h \ spandsp/private/super_tone_tx.h \ spandsp/private/swept_tone.h \ spandsp/private/t30.h \ spandsp/private/t30_dis_dtc_dcs_bits.h \ spandsp/private/t31.h \ spandsp/private/t38_core.h \ spandsp/private/t38_gateway.h \ spandsp/private/t38_non_ecm_buffer.h \ spandsp/private/t38_terminal.h \ spandsp/private/t4_rx.h \ spandsp/private/t4_tx.h \ spandsp/private/t4_t6_decode.h \ spandsp/private/t4_t6_encode.h \ spandsp/private/time_scale.h \ spandsp/private/timezone.h \ spandsp/private/tone_detect.h \ spandsp/private/tone_generate.h \ spandsp/private/v17rx.h \ spandsp/private/v17tx.h \ spandsp/private/v18.h \ spandsp/private/v22bis.h \ spandsp/private/v27ter_rx.h \ spandsp/private/v27ter_tx.h \ spandsp/private/v29rx.h \ spandsp/private/v29tx.h \ spandsp/private/v42.h \ spandsp/private/v42bis.h \ spandsp/private/v8.h \ spandsp/expose.h nodist_include_HEADERS = spandsp.h noinst_HEADERS = cielab_luts.h \ faxfont.h \ filter_tools.h \ gsm0610_local.h \ lpc10_encdecs.h \ mmx_sse_decs.h \ t30_local.h \ t4_t6_decode_states.h \ v17_v32bis_rx_constellation_maps.h \ v17_v32bis_tx_constellation_maps.h \ v29tx_constellation_maps.h V17_V32BIS_RX_INCL = v17_v32bis_rx_fixed_rrc.h \ v17_v32bis_rx_floating_rrc.h V17_V32BIS_TX_INCL = v17_v32bis_tx_fixed_rrc.h \ v17_v32bis_tx_floating_rrc.h V22BIS_RX_INCL = v22bis_rx_1200_fixed_rrc.h \ v22bis_rx_2400_fixed_rrc.h \ v22bis_rx_1200_floating_rrc.h \ v22bis_rx_2400_floating_rrc.h V22BIS_TX_INCL = v22bis_tx_fixed_rrc.h \ v22bis_tx_floating_rrc.h V27_RX_INCL = v27ter_rx_2400_fixed_rrc.h \ v27ter_rx_4800_fixed_rrc.h \ v27ter_rx_2400_floating_rrc.h \ v27ter_rx_4800_floating_rrc.h V27TER_TX_INCL = v27ter_tx_2400_fixed_rrc.h \ v27ter_tx_4800_fixed_rrc.h \ v27ter_tx_2400_floating_rrc.h \ v27ter_tx_4800_floating_rrc.h V29_RX_INCL = v29rx_fixed_rrc.h \ v29rx_floating_rrc.h V29_TX_INCL = v29tx_fixed_rrc.h \ v29tx_floating_rrc.h DSP = libspandsp.dsp VCPROJ8 = libspandsp.2005.vcproj VCPROJ9 = libspandsp.2008.vcproj WIN32SOURCES = $(libspandsp_la_SOURCES) .\\msvc\\gettimeofday.c WIN32HEADERS = $(nobase_include_HEADERS) spandsp.h DSPOUT = | awk '{printf("%s\r\n", $$0)}' >> $(DSP) VCPROJOUT8 = | awk '{printf("%s\r\n", $$0)}' >> $(VCPROJ8) VCPROJOUT9 = | awk '{printf("%s\r\n", $$0)}' >> $(VCPROJ9) all: config.h $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): config.h: stamp-h1 @if test ! -f $@; then rm -f stamp-h1; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi stamp-h1: $(top_srcdir)/config-h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/config.h $(top_srcdir)/config-h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 spandsp.h: $(top_builddir)/config.status $(srcdir)/spandsp.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ list2=; for p in $$list; do \ if test -f $$p; then \ list2="$$list2 $$p"; \ else :; fi; \ done; \ test -z "$$list2" || { \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ } uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ for p in $$list; do \ $(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ test -z "$$locs" || { \ echo rm -f $${locs}; \ rm -f $${locs}; \ } libspandsp.la: $(libspandsp_la_OBJECTS) $(libspandsp_la_DEPENDENCIES) $(EXTRA_libspandsp_la_DEPENDENCIES) $(AM_V_CCLD)$(libspandsp_la_LINK) -rpath $(libdir) $(libspandsp_la_OBJECTS) $(libspandsp_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ademco_contactid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adsi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/async.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/at_interpreter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/awgn.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bell_r2_mf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bit_operations.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitstream.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/complex_filters.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/complex_vector_float.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/complex_vector_int.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dds_float.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dds_int.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtmf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/echo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fax.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fax_modems.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsk.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g711.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g722.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g726.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm0610_decode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm0610_encode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm0610_long_term.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm0610_lpc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm0610_preprocess.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm0610_rpe.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm0610_short_term.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hdlc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ima_adpcm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_translate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logging.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lpc10_analyse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lpc10_decode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lpc10_encode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lpc10_placev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lpc10_voicing.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/math_fixed.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modem_connect_tones.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modem_echo.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/noise.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oki_adpcm.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/playout.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/power_meter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queue.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/schedule.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sig_tone.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/silence_gen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/super_tone_rx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/super_tone_tx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swept_tone.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t30.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t30_api.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t30_logging.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t31.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t35.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t38_core.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t38_gateway.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t38_non_ecm_buffer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t38_terminal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t4_rx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t4_tx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testcpuid.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_scale.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timezone.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tone_detect.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tone_generate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v17rx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v17tx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v18.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v22bis_rx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v22bis_tx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v27ter_rx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v27ter_tx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v29rx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v29tx.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v42.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v42bis.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v8.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector_float.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector_int.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nobase_includeHEADERS: $(nobase_include_HEADERS) @$(NORMAL_INSTALL) @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)/$$dir"; }; \ echo " $(INSTALL_HEADER) $$xfiles '$(DESTDIR)$(includedir)/$$dir'"; \ $(INSTALL_HEADER) $$xfiles "$(DESTDIR)$(includedir)/$$dir" || exit $$?; }; \ done uninstall-nobase_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nobase_include_HEADERS)'; test -n "$(includedir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) install-nodist_includeHEADERS: $(nodist_include_HEADERS) @$(NORMAL_INSTALL) @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \ $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ done uninstall-nodist_includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(nodist_include_HEADERS)'; test -n "$(includedir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$(top_distdir)" distdir="$(distdir)" \ dist-hook check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(includedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-nobase_includeHEADERS \ install-nodist_includeHEADERS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-libLTLIBRARIES install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-libLTLIBRARIES uninstall-nobase_includeHEADERS \ uninstall-nodist_includeHEADERS .MAKE: all install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \ ctags-am dist-hook distclean distclean-compile \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am \ install-libLTLIBRARIES install-man \ install-nobase_includeHEADERS install-nodist_includeHEADERS \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-libLTLIBRARIES uninstall-nobase_includeHEADERS \ uninstall-nodist_includeHEADERS make_at_dictionary$(EXEEXT): $(top_srcdir)/src/make_at_dictionary.c $(CC_FOR_BUILD) -o make_at_dictionary$(EXEEXT) $(top_srcdir)/src/make_at_dictionary.c -DHAVE_CONFIG_H -I$(top_builddir)/src make_math_fixed_tables$(EXEEXT): $(top_srcdir)/src/make_math_fixed_tables.c $(CC_FOR_BUILD) -o make_math_fixed_tables$(EXEEXT) $(top_srcdir)/src/make_math_fixed_tables.c -DHAVE_CONFIG_H -I$(top_builddir)/src -lm make_modem_filter$(EXEEXT): $(top_srcdir)/src/make_modem_filter.c $(top_srcdir)/src/filter_tools.c $(CC_FOR_BUILD) -o make_modem_filter$(EXEEXT) $(top_srcdir)/src/make_modem_filter.c $(top_srcdir)/src/filter_tools.c -DHAVE_CONFIG_H -I$(top_builddir)/src -lm # We need to run make_at_dictionary, so it generates the # at_interpreter_dictionary.h file at_interpreter.$(OBJEXT): at_interpreter_dictionary.h at_interpreter.lo: at_interpreter_dictionary.h at_interpreter_dictionary.h: make_at_dictionary$(EXEEXT) ./make_at_dictionary$(EXEEXT) >at_interpreter_dictionary.h math_fixed.$(OBJEXT): math_fixed_tables.h math_fixed.lo: math_fixed_tables.h math_fixed_tables.h: make_math_fixed_tables$(EXEEXT) ./make_math_fixed_tables$(EXEEXT) >math_fixed_tables.h t4_rx.$(OBJEXT): spandsp/version.h t4_rx.lo: spandsp/version.h v17rx.$(OBJEXT): ${V17_V32BIS_RX_INCL} v17rx.lo: ${V17_V32BIS_RX_INCL} v17_v32bis_rx_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.17 -i -r >v17_v32bis_rx_fixed_rrc.h v17_v32bis_rx_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.17 -r >v17_v32bis_rx_floating_rrc.h v17tx.$(OBJEXT): ${V17_V32BIS_TX_INCL} v17tx.lo: ${V17_V32BIS_TX_INCL} v17_v32bis_tx_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.17 -i -t >v17_v32bis_tx_fixed_rrc.h v17_v32bis_tx_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.17 -t >v17_v32bis_tx_floating_rrc.h v22bis_rx.$(OBJEXT): ${V22BIS_RX_INCL} v22bis_rx.lo: ${V22BIS_RX_INCL} v22bis_rx_1200_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.22bis1200 -i -r >v22bis_rx_1200_fixed_rrc.h v22bis_rx_2400_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.22bis2400 -i -r >v22bis_rx_2400_fixed_rrc.h v22bis_rx_1200_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.22bis1200 -r >v22bis_rx_1200_floating_rrc.h v22bis_rx_2400_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.22bis2400 -r >v22bis_rx_2400_floating_rrc.h v22bis_tx.$(OBJEXT): ${V22BIS_TX_INCL} v22bis_tx.lo: ${V22BIS_TX_INCL} v22bis_tx_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.22bis -i -t >v22bis_tx_fixed_rrc.h v22bis_tx_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.22bis -t >v22bis_tx_floating_rrc.h v27ter_rx.$(OBJEXT): ${V27_RX_INCL} v27ter_rx.lo: ${V27_RX_INCL} v27ter_rx_2400_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.27ter2400 -i -r >v27ter_rx_2400_fixed_rrc.h v27ter_rx_4800_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.27ter4800 -i -r >v27ter_rx_4800_fixed_rrc.h v27ter_rx_2400_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.27ter2400 -r >v27ter_rx_2400_floating_rrc.h v27ter_rx_4800_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.27ter4800 -r >v27ter_rx_4800_floating_rrc.h v27ter_tx_.$(OBJEXT): ${V27TER_TX_INCL} v27ter_tx.lo: ${V27TER_TX_INCL} v27ter_tx_2400_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.27ter2400 -i -t >v27ter_tx_2400_fixed_rrc.h v27ter_tx_4800_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.27ter4800 -i -t >v27ter_tx_4800_fixed_rrc.h v27ter_tx_2400_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.27ter2400 -t >v27ter_tx_2400_floating_rrc.h v27ter_tx_4800_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.27ter4800 -t >v27ter_tx_4800_floating_rrc.h v29rx.$(OBJEXT): ${V29_RX_INCL} v29rx.lo: ${V29_RX_INCL} v29rx_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.29 -i -r >v29rx_fixed_rrc.h v29rx_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.29 -r >v29rx_floating_rrc.h v29tx.$(OBJEXT): ${V29_TX_INCL} v29tx.lo: ${V29_TX_INCL} v29tx_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.29 -i -t >v29tx_fixed_rrc.h v29tx_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.29 -t >v29tx_floating_rrc.h $(DSP): msvc/msvcproj.head msvc/msvcproj.foot Makefile.am echo "creating $(DSP)" @(cp $(srcdir)/msvc/msvcproj.head $(DSP); \ echo "# Begin Group \"Source Files\"" $(DSPOUT); \ for file in $(WIN32SOURCES); do \ echo "# Begin Source File" $(DSPOUT); \ echo "" $(DSPOUT); \ echo "SOURCE=.\\"$$file $(DSPOUT); \ echo "# End Source File" $(DSPOUT); \ done; \ echo "# End Group" $(DSPOUT); \ echo "# Begin Group \"Header Files\"" $(DSPOUT); \ for file in $(WIN32HEADERS); do \ echo "# Begin Source File" $(DSPOUT); \ echo "" $(DSPOUT); \ echo "SOURCE=.\\"$$file $(DSPOUT); \ echo "# End Source File" $(DSPOUT); \ done; \ echo "# End Group" $(DSPOUT); \ cat $(srcdir)/msvc/msvcproj.foot $(DSPOUT) ) $(VCPROJ8): msvc/vc8proj.head msvc/vc8proj.foot Makefile.am echo "creating $(VCPROJ8)" @(cp $(srcdir)/msvc/vc8proj.head $(VCPROJ8); \ for file in $(WIN32SOURCES); do \ echo "" $(VCPROJOUT8); \ done; \ echo "" $(VCPROJOUT8); \ for file in $(WIN32HEADERS); do \ echo "" $(VCPROJOUT8); \ done; \ cat $(srcdir)/msvc/vc8proj.foot $(VCPROJOUT8) ) $(VCPROJ9): msvc/vc9proj.head msvc/vc9proj.foot Makefile.am echo "creating $(VCPROJ9)" @(cp $(srcdir)/msvc/vc9proj.head $(VCPROJ9); \ for file in $(WIN32SOURCES); do \ echo "" $(VCPROJOUT9); \ done; \ echo "" $(VCPROJOUT9); \ for file in $(WIN32HEADERS); do \ echo "" $(VCPROJOUT9); \ done; \ cat $(srcdir)/msvc/vc9proj.foot $(VCPROJOUT9) ) $(srcdir)/msvc/spandsp.h: spandsp.h.in echo "creating $(srcdir)/msvc/spandsp.h" @sed -e "s/#define _SPANDSP_H_/#define _SPANDSP_H_\n\n#define __inline__ __inline\n#pragma warning(disable:4200)/" \ -e "s/\@SPANDSP_USE_FIXED_POINT\@/#undef SPANDSP_USE_FIXED_POINT/" \ -e "s/\@SPANDSP_MISALIGNED_ACCESS_FAILS\@/#undef SPANDSP_MISALIGNED_ACCESS_FAILS/" \ -e "s/\@SPANDSP_USE_EXPORT_CAPABILITY\@/#define SPANDSP_USE_EXPORT_CAPABILITY 1/" \ -e "s/\@INSERT_INTTYPES_HEADER\@/#include /" \ -e "s/\@INSERT_MATH_HEADER\@/#include /" $(srcdir)/spandsp.h.in > $(srcdir)/msvc/spandsp.h dist-hook: spandsp/version.h spandsp/version.h: mkdir -p $(@D) NOWDATE=`date --utc +"%Y%m%d"` ; \ NOWTIME=`date --utc +"%H%M%S"` ; \ sed 's/$$SPANDSP_RELEASE_DATE/'$$NOWDATE'/;s/$$SPANDSP_RELEASE_TIME/'$$NOWTIME'/' \ <$(srcdir)/spandsp/version.h.in >$@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: spandsp-0.0.6/src/g726.c0000664000175000017500000010227311422612261011532 00000000000000/* * SpanDSP - a series of DSP components for telephony * * g726.c - The ITU G.726 codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Based on G.721/G.723 code which is: * * This source code is a product of Sun Microsystems, Inc. and is provided * for unrestricted use. Users may copy or modify this source code without * charge. * * SUN SOURCE CODE IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING * THE WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. * * Sun source code is provided with no support and without any obligation on * the part of Sun Microsystems, Inc. to assist in its use, correction, * modification or enhancement. * * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY THIS SOFTWARE * OR ANY PART THEREOF. * * In no event will Sun Microsystems, Inc. be liable for any lost revenue * or profits or other special, indirect and consequential damages, even if * Sun has been advised of the possibility of such damages. * * Sun Microsystems, Inc. * 2550 Garcia Avenue * Mountain View, California 94043 */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/dc_restore.h" #include "spandsp/bitstream.h" #include "spandsp/bit_operations.h" #include "spandsp/g711.h" #include "spandsp/g726.h" #include "spandsp/private/bitstream.h" #include "spandsp/private/g726.h" /* * Maps G.726_16 code word to reconstructed scale factor normalized log * magnitude values. */ static const int g726_16_dqlntab[4] = { 116, 365, 365, 116 }; /* Maps G.726_16 code word to log of scale factor multiplier. */ static const int g726_16_witab[4] = { -704, 14048, 14048, -704 }; /* * Maps G.726_16 code words to a set of values whose long and short * term averages are computed and then compared to give an indication * how stationary (steady state) the signal is. */ static const int g726_16_fitab[4] = { 0x000, 0xE00, 0xE00, 0x000 }; static const int qtab_726_16[1] = { 261 }; /* * Maps G.726_24 code word to reconstructed scale factor normalized log * magnitude values. */ static const int g726_24_dqlntab[8] = { -2048, 135, 273, 373, 373, 273, 135, -2048 }; /* Maps G.726_24 code word to log of scale factor multiplier. */ static const int g726_24_witab[8] = { -128, 960, 4384, 18624, 18624, 4384, 960, -128 }; /* * Maps G.726_24 code words to a set of values whose long and short * term averages are computed and then compared to give an indication * how stationary (steady state) the signal is. */ static const int g726_24_fitab[8] = { 0x000, 0x200, 0x400, 0xE00, 0xE00, 0x400, 0x200, 0x000 }; static const int qtab_726_24[3] = { 8, 218, 331 }; /* * Maps G.726_32 code word to reconstructed scale factor normalized log * magnitude values. */ static const int g726_32_dqlntab[16] = { -2048, 4, 135, 213, 273, 323, 373, 425, 425, 373, 323, 273, 213, 135, 4, -2048 }; /* Maps G.726_32 code word to log of scale factor multiplier. */ static const int g726_32_witab[16] = { -384, 576, 1312, 2048, 3584, 6336, 11360, 35904, 35904, 11360, 6336, 3584, 2048, 1312, 576, -384 }; /* * Maps G.726_32 code words to a set of values whose long and short * term averages are computed and then compared to give an indication * how stationary (steady state) the signal is. */ static const int g726_32_fitab[16] = { 0x000, 0x000, 0x000, 0x200, 0x200, 0x200, 0x600, 0xE00, 0xE00, 0x600, 0x200, 0x200, 0x200, 0x000, 0x000, 0x000 }; static const int qtab_726_32[7] = { -124, 80, 178, 246, 300, 349, 400 }; /* * Maps G.726_40 code word to ructeconstructed scale factor normalized log * magnitude values. */ static const int g726_40_dqlntab[32] = { -2048, -66, 28, 104, 169, 224, 274, 318, 358, 395, 429, 459, 488, 514, 539, 566, 566, 539, 514, 488, 459, 429, 395, 358, 318, 274, 224, 169, 104, 28, -66, -2048 }; /* Maps G.726_40 code word to log of scale factor multiplier. */ static const int g726_40_witab[32] = { 448, 448, 768, 1248, 1280, 1312, 1856, 3200, 4512, 5728, 7008, 8960, 11456, 14080, 16928, 22272, 22272, 16928, 14080, 11456, 8960, 7008, 5728, 4512, 3200, 1856, 1312, 1280, 1248, 768, 448, 448 }; /* * Maps G.726_40 code words to a set of values whose long and short * term averages are computed and then compared to give an indication * how stationary (steady state) the signal is. */ static const int g726_40_fitab[32] = { 0x000, 0x000, 0x000, 0x000, 0x000, 0x200, 0x200, 0x200, 0x200, 0x200, 0x400, 0x600, 0x800, 0xA00, 0xC00, 0xC00, 0xC00, 0xC00, 0xA00, 0x800, 0x600, 0x400, 0x200, 0x200, 0x200, 0x200, 0x200, 0x000, 0x000, 0x000, 0x000, 0x000 }; static const int qtab_726_40[15] = { -122, -16, 68, 139, 198, 250, 298, 339, 378, 413, 445, 475, 502, 528, 553 }; /* * returns the integer product of the 14-bit integer "an" and * "floating point" representation (4-bit exponent, 6-bit mantessa) "srn". */ static int16_t fmult(int16_t an, int16_t srn) { int16_t anmag; int16_t anexp; int16_t anmant; int16_t wanexp; int16_t wanmant; int16_t retval; anmag = (an > 0) ? an : ((-an) & 0x1FFF); anexp = (int16_t) (top_bit(anmag) - 5); anmant = (anmag == 0) ? 32 : (anexp >= 0) ? (anmag >> anexp) : (anmag << -anexp); wanexp = anexp + ((srn >> 6) & 0xF) - 13; wanmant = (anmant*(srn & 0x3F) + 0x30) >> 4; retval = (wanexp >= 0) ? ((wanmant << wanexp) & 0x7FFF) : (wanmant >> -wanexp); return (((an ^ srn) < 0) ? -retval : retval); } /*- End of function --------------------------------------------------------*/ /* * Compute the estimated signal from the 6-zero predictor. */ static __inline__ int16_t predictor_zero(g726_state_t *s) { int i; int sezi; sezi = fmult(s->b[0] >> 2, s->dq[0]); /* ACCUM */ for (i = 1; i < 6; i++) sezi += fmult(s->b[i] >> 2, s->dq[i]); return (int16_t) sezi; } /*- End of function --------------------------------------------------------*/ /* * Computes the estimated signal from the 2-pole predictor. */ static __inline__ int16_t predictor_pole(g726_state_t *s) { return (fmult(s->a[1] >> 2, s->sr[1]) + fmult(s->a[0] >> 2, s->sr[0])); } /*- End of function --------------------------------------------------------*/ /* * Computes the quantization step size of the adaptive quantizer. */ static int step_size(g726_state_t *s) { int y; int dif; int al; if (s->ap >= 256) return s->yu; y = s->yl >> 6; dif = s->yu - y; al = s->ap >> 2; if (dif > 0) y += (dif*al) >> 6; else if (dif < 0) y += (dif*al + 0x3F) >> 6; return y; } /*- End of function --------------------------------------------------------*/ /* * Given a raw sample, 'd', of the difference signal and a * quantization step size scale factor, 'y', this routine returns the * ADPCM codeword to which that sample gets quantized. The step * size scale factor division operation is done in the log base 2 domain * as a subtraction. */ static int16_t quantize(int d, /* Raw difference signal sample */ int y, /* Step size multiplier */ const int table[], /* quantization table */ int quantizer_states) /* table size of int16_t integers */ { int16_t dqm; /* Magnitude of 'd' */ int16_t exp; /* Integer part of base 2 log of 'd' */ int16_t mant; /* Fractional part of base 2 log */ int16_t dl; /* Log of magnitude of 'd' */ int16_t dln; /* Step size scale factor normalized log */ int i; int size; /* * LOG * * Compute base 2 log of 'd', and store in 'dl'. */ dqm = (int16_t) abs(d); exp = (int16_t) (top_bit(dqm >> 1) + 1); /* Fractional portion. */ mant = ((dqm << 7) >> exp) & 0x7F; dl = (exp << 7) + mant; /* * SUBTB * * "Divide" by step size multiplier. */ dln = dl - (int16_t) (y >> 2); /* * QUAN * * Search for codword i for 'dln'. */ size = (quantizer_states - 1) >> 1; for (i = 0; i < size; i++) { if (dln < table[i]) break; } if (d < 0) { /* Take 1's complement of i */ return (int16_t) ((size << 1) + 1 - i); } if (i == 0 && (quantizer_states & 1)) { /* Zero is only valid if there are an even number of states, so take the 1's complement if the code is zero. */ return (int16_t) quantizer_states; } return (int16_t) i; } /*- End of function --------------------------------------------------------*/ /* * Returns reconstructed difference signal 'dq' obtained from * codeword 'i' and quantization step size scale factor 'y'. * Multiplication is performed in log base 2 domain as addition. */ static int16_t reconstruct(int sign, /* 0 for non-negative value */ int dqln, /* G.72x codeword */ int y) /* Step size multiplier */ { int16_t dql; /* Log of 'dq' magnitude */ int16_t dex; /* Integer part of log */ int16_t dqt; int16_t dq; /* Reconstructed difference signal sample */ dql = (int16_t) (dqln + (y >> 2)); /* ADDA */ if (dql < 0) return ((sign) ? -0x8000 : 0); /* ANTILOG */ dex = (dql >> 7) & 15; dqt = 128 + (dql & 127); dq = (dqt << 7) >> (14 - dex); return ((sign) ? (dq - 0x8000) : dq); } /*- End of function --------------------------------------------------------*/ /* * updates the state variables for each output code */ static void update(g726_state_t *s, int y, /* quantizer step size */ int wi, /* scale factor multiplier */ int fi, /* for long/short term energies */ int dq, /* quantized prediction difference */ int sr, /* reconstructed signal */ int dqsez) /* difference from 2-pole predictor */ { int16_t mag; int16_t exp; int16_t a2p; /* LIMC */ int16_t a1ul; /* UPA1 */ int16_t pks1; /* UPA2 */ int16_t fa1; int16_t ylint; int16_t dqthr; int16_t ylfrac; int16_t thr; int16_t pk0; int i; int tr; a2p = 0; /* Needed in updating predictor poles */ pk0 = (dqsez < 0) ? 1 : 0; /* prediction difference magnitude */ mag = (int16_t) (dq & 0x7FFF); /* TRANS */ ylint = (int16_t) (s->yl >> 15); /* exponent part of yl */ ylfrac = (int16_t) ((s->yl >> 10) & 0x1F); /* fractional part of yl */ /* Limit threshold to 31 << 10 */ thr = (ylint > 9) ? (31 << 10) : ((32 + ylfrac) << ylint); dqthr = (thr + (thr >> 1)) >> 1; /* dqthr = 0.75 * thr */ if (!s->td) /* signal supposed voice */ tr = FALSE; else if (mag <= dqthr) /* supposed data, but small mag */ tr = FALSE; /* treated as voice */ else /* signal is data (modem) */ tr = TRUE; /* * Quantizer scale factor adaptation. */ /* FUNCTW & FILTD & DELAY */ /* update non-steady state step size multiplier */ s->yu = (int16_t) (y + ((wi - y) >> 5)); /* LIMB */ if (s->yu < 544) s->yu = 544; else if (s->yu > 5120) s->yu = 5120; /* FILTE & DELAY */ /* update steady state step size multiplier */ s->yl += s->yu + ((-s->yl) >> 6); /* * Adaptive predictor coefficients. */ if (tr) { /* Reset the a's and b's for a modem signal */ s->a[0] = 0; s->a[1] = 0; s->b[0] = 0; s->b[1] = 0; s->b[2] = 0; s->b[3] = 0; s->b[4] = 0; s->b[5] = 0; } else { /* Update the a's and b's */ /* UPA2 */ pks1 = pk0 ^ s->pk[0]; /* Update predictor pole a[1] */ a2p = s->a[1] - (s->a[1] >> 7); if (dqsez != 0) { fa1 = (pks1) ? s->a[0] : -s->a[0]; /* a2p = function of fa1 */ if (fa1 < -8191) a2p -= 0x100; else if (fa1 > 8191) a2p += 0xFF; else a2p += fa1 >> 5; if (pk0 ^ s->pk[1]) { /* LIMC */ if (a2p <= -12160) a2p = -12288; else if (a2p >= 12416) a2p = 12288; else a2p -= 0x80; } else if (a2p <= -12416) a2p = -12288; else if (a2p >= 12160) a2p = 12288; else a2p += 0x80; } /* TRIGB & DELAY */ s->a[1] = a2p; /* UPA1 */ /* Update predictor pole a[0] */ s->a[0] -= s->a[0] >> 8; if (dqsez != 0) { if (pks1 == 0) s->a[0] += 192; else s->a[0] -= 192; } /* LIMD */ a1ul = 15360 - a2p; if (s->a[0] < -a1ul) s->a[0] = -a1ul; else if (s->a[0] > a1ul) s->a[0] = a1ul; /* UPB : update predictor zeros b[6] */ for (i = 0; i < 6; i++) { /* Distinguish 40Kbps mode from the others */ s->b[i] -= s->b[i] >> ((s->bits_per_sample == 5) ? 9 : 8); if (dq & 0x7FFF) { /* XOR */ if ((dq ^ s->dq[i]) >= 0) s->b[i] += 128; else s->b[i] -= 128; } } } for (i = 5; i > 0; i--) s->dq[i] = s->dq[i - 1]; /* FLOAT A : convert dq[0] to 4-bit exp, 6-bit mantissa f.p. */ if (mag == 0) { s->dq[0] = (dq >= 0) ? 0x20 : 0xFC20; } else { exp = (int16_t) (top_bit(mag) + 1); s->dq[0] = (dq >= 0) ? ((exp << 6) + ((mag << 6) >> exp)) : ((exp << 6) + ((mag << 6) >> exp) - 0x400); } s->sr[1] = s->sr[0]; /* FLOAT B : convert sr to 4-bit exp., 6-bit mantissa f.p. */ if (sr == 0) { s->sr[0] = 0x20; } else if (sr > 0) { exp = (int16_t) (top_bit(sr) + 1); s->sr[0] = (int16_t) ((exp << 6) + ((sr << 6) >> exp)); } else if (sr > -32768) { mag = (int16_t) -sr; exp = (int16_t) (top_bit(mag) + 1); s->sr[0] = (exp << 6) + ((mag << 6) >> exp) - 0x400; } else { s->sr[0] = (uint16_t) 0xFC20; } /* DELAY A */ s->pk[1] = s->pk[0]; s->pk[0] = pk0; /* TONE */ if (tr) /* this sample has been treated as data */ s->td = FALSE; /* next one will be treated as voice */ else if (a2p < -11776) /* small sample-to-sample correlation */ s->td = TRUE; /* signal may be data */ else /* signal is voice */ s->td = FALSE; /* Adaptation speed control. */ /* FILTA */ s->dms += ((int16_t) fi - s->dms) >> 5; /* FILTB */ s->dml += (((int16_t) (fi << 2) - s->dml) >> 7); if (tr) s->ap = 256; else if (y < 1536) /* SUBTC */ s->ap += (0x200 - s->ap) >> 4; else if (s->td) s->ap += (0x200 - s->ap) >> 4; else if (abs((s->dms << 2) - s->dml) >= (s->dml >> 3)) s->ap += (0x200 - s->ap) >> 4; else s->ap += (-s->ap) >> 4; } /*- End of function --------------------------------------------------------*/ static int16_t tandem_adjust_alaw(int16_t sr, /* decoder output linear PCM sample */ int se, /* predictor estimate sample */ int y, /* quantizer step size */ int i, /* decoder input code */ int sign, const int qtab[], int quantizer_states) { uint8_t sp; /* A-law compressed 8-bit code */ int16_t dx; /* prediction error */ int id; /* quantized prediction error */ int sd; /* adjusted A-law decoded sample value */ if (sr <= -32768) sr = -1; sp = linear_to_alaw((sr >> 1) << 3); /* 16-bit prediction error */ dx = (int16_t) ((alaw_to_linear(sp) >> 2) - se); id = quantize(dx, y, qtab, quantizer_states); if (id == i) { /* No adjustment of sp required */ return (int16_t) sp; } /* sp adjustment needed */ /* ADPCM codes : 8, 9, ... F, 0, 1, ... , 6, 7 */ /* 2's complement to biased unsigned */ if ((id ^ sign) > (i ^ sign)) { /* sp adjusted to next lower value */ if (sp & 0x80) sd = (sp == 0xD5) ? 0x55 : (((sp ^ 0x55) - 1) ^ 0x55); else sd = (sp == 0x2A) ? 0x2A : (((sp ^ 0x55) + 1) ^ 0x55); } else { /* sp adjusted to next higher value */ if (sp & 0x80) sd = (sp == 0xAA) ? 0xAA : (((sp ^ 0x55) + 1) ^ 0x55); else sd = (sp == 0x55) ? 0xD5 : (((sp ^ 0x55) - 1) ^ 0x55); } return (int16_t) sd; } /*- End of function --------------------------------------------------------*/ static int16_t tandem_adjust_ulaw(int16_t sr, /* decoder output linear PCM sample */ int se, /* predictor estimate sample */ int y, /* quantizer step size */ int i, /* decoder input code */ int sign, const int qtab[], int quantizer_states) { uint8_t sp; /* u-law compressed 8-bit code */ int16_t dx; /* prediction error */ int id; /* quantized prediction error */ int sd; /* adjusted u-law decoded sample value */ if (sr <= -32768) sr = 0; sp = linear_to_ulaw(sr << 2); /* 16-bit prediction error */ dx = (int16_t) ((ulaw_to_linear(sp) >> 2) - se); id = quantize(dx, y, qtab, quantizer_states); if (id == i) { /* No adjustment of sp required. */ return (int16_t) sp; } /* ADPCM codes : 8, 9, ... F, 0, 1, ... , 6, 7 */ /* 2's complement to biased unsigned */ if ((id ^ sign) > (i ^ sign)) { /* sp adjusted to next lower value */ if (sp & 0x80) sd = (sp == 0xFF) ? 0x7E : (sp + 1); else sd = (sp == 0x00) ? 0x00 : (sp - 1); } else { /* sp adjusted to next higher value */ if (sp & 0x80) sd = (sp == 0x80) ? 0x80 : (sp - 1); else sd = (sp == 0x7F) ? 0xFE : (sp + 1); } return (int16_t) sd; } /*- End of function --------------------------------------------------------*/ /* * Encodes a linear PCM, A-law or u-law input sample and returns its 3-bit code. */ static uint8_t g726_16_encoder(g726_state_t *s, int16_t amp) { int y; int16_t sei; int16_t sezi; int16_t se; int16_t d; int16_t sr; int16_t dqsez; int16_t dq; int16_t i; sezi = predictor_zero(s); sei = sezi + predictor_pole(s); se = sei >> 1; d = amp - se; /* Quantize prediction difference */ y = step_size(s); i = quantize(d, y, qtab_726_16, 4); dq = reconstruct(i & 2, g726_16_dqlntab[i], y); /* Reconstruct the signal */ sr = (dq < 0) ? (se - (dq & 0x3FFF)) : (se + dq); /* Pole prediction difference */ dqsez = sr + (sezi >> 1) - se; update(s, y, g726_16_witab[i], g726_16_fitab[i], dq, sr, dqsez); return (uint8_t) i; } /*- End of function --------------------------------------------------------*/ /* * Decodes a 2-bit CCITT G.726_16 ADPCM code and returns * the resulting 16-bit linear PCM, A-law or u-law sample value. */ static int16_t g726_16_decoder(g726_state_t *s, uint8_t code) { int16_t sezi; int16_t sei; int16_t se; int16_t sr; int16_t dq; int16_t dqsez; int y; /* Mask to get proper bits */ code &= 0x03; sezi = predictor_zero(s); sei = sezi + predictor_pole(s); y = step_size(s); dq = reconstruct(code & 2, g726_16_dqlntab[code], y); /* Reconstruct the signal */ se = sei >> 1; sr = (dq < 0) ? (se - (dq & 0x3FFF)) : (se + dq); /* Pole prediction difference */ dqsez = sr + (sezi >> 1) - se; update(s, y, g726_16_witab[code], g726_16_fitab[code], dq, sr, dqsez); switch (s->ext_coding) { case G726_ENCODING_ALAW: return tandem_adjust_alaw(sr, se, y, code, 2, qtab_726_16, 4); case G726_ENCODING_ULAW: return tandem_adjust_ulaw(sr, se, y, code, 2, qtab_726_16, 4); } return (sr << 2); } /*- End of function --------------------------------------------------------*/ /* * Encodes a linear PCM, A-law or u-law input sample and returns its 3-bit code. */ static uint8_t g726_24_encoder(g726_state_t *s, int16_t amp) { int16_t sei; int16_t sezi; int16_t se; int16_t d; int16_t sr; int16_t dqsez; int16_t dq; int16_t i; int y; sezi = predictor_zero(s); sei = sezi + predictor_pole(s); se = sei >> 1; d = amp - se; /* Quantize prediction difference */ y = step_size(s); i = quantize(d, y, qtab_726_24, 7); dq = reconstruct(i & 4, g726_24_dqlntab[i], y); /* Reconstruct the signal */ sr = (dq < 0) ? (se - (dq & 0x3FFF)) : (se + dq); /* Pole prediction difference */ dqsez = sr + (sezi >> 1) - se; update(s, y, g726_24_witab[i], g726_24_fitab[i], dq, sr, dqsez); return (uint8_t) i; } /*- End of function --------------------------------------------------------*/ /* * Decodes a 3-bit CCITT G.726_24 ADPCM code and returns * the resulting 16-bit linear PCM, A-law or u-law sample value. */ static int16_t g726_24_decoder(g726_state_t *s, uint8_t code) { int16_t sezi; int16_t sei; int16_t se; int16_t sr; int16_t dq; int16_t dqsez; int y; /* Mask to get proper bits */ code &= 0x07; sezi = predictor_zero(s); sei = sezi + predictor_pole(s); y = step_size(s); dq = reconstruct(code & 4, g726_24_dqlntab[code], y); /* Reconstruct the signal */ se = sei >> 1; sr = (dq < 0) ? (se - (dq & 0x3FFF)) : (se + dq); /* Pole prediction difference */ dqsez = sr + (sezi >> 1) - se; update(s, y, g726_24_witab[code], g726_24_fitab[code], dq, sr, dqsez); switch (s->ext_coding) { case G726_ENCODING_ALAW: return tandem_adjust_alaw(sr, se, y, code, 4, qtab_726_24, 7); case G726_ENCODING_ULAW: return tandem_adjust_ulaw(sr, se, y, code, 4, qtab_726_24, 7); } return (sr << 2); } /*- End of function --------------------------------------------------------*/ /* * Encodes a linear input sample and returns its 4-bit code. */ static uint8_t g726_32_encoder(g726_state_t *s, int16_t amp) { int16_t sei; int16_t sezi; int16_t se; int16_t d; int16_t sr; int16_t dqsez; int16_t dq; int16_t i; int y; sezi = predictor_zero(s); sei = sezi + predictor_pole(s); se = sei >> 1; d = amp - se; /* Quantize the prediction difference */ y = step_size(s); i = quantize(d, y, qtab_726_32, 15); dq = reconstruct(i & 8, g726_32_dqlntab[i], y); /* Reconstruct the signal */ sr = (dq < 0) ? (se - (dq & 0x3FFF)) : (se + dq); /* Pole prediction difference */ dqsez = sr + (sezi >> 1) - se; update(s, y, g726_32_witab[i], g726_32_fitab[i], dq, sr, dqsez); return (uint8_t) i; } /*- End of function --------------------------------------------------------*/ /* * Decodes a 4-bit CCITT G.726_32 ADPCM code and returns * the resulting 16-bit linear PCM, A-law or u-law sample value. */ static int16_t g726_32_decoder(g726_state_t *s, uint8_t code) { int16_t sezi; int16_t sei; int16_t se; int16_t sr; int16_t dq; int16_t dqsez; int y; /* Mask to get proper bits */ code &= 0x0F; sezi = predictor_zero(s); sei = sezi + predictor_pole(s); y = step_size(s); dq = reconstruct(code & 8, g726_32_dqlntab[code], y); /* Reconstruct the signal */ se = sei >> 1; sr = (dq < 0) ? (se - (dq & 0x3FFF)) : (se + dq); /* Pole prediction difference */ dqsez = sr + (sezi >> 1) - se; update(s, y, g726_32_witab[code], g726_32_fitab[code], dq, sr, dqsez); switch (s->ext_coding) { case G726_ENCODING_ALAW: return tandem_adjust_alaw(sr, se, y, code, 8, qtab_726_32, 15); case G726_ENCODING_ULAW: return tandem_adjust_ulaw(sr, se, y, code, 8, qtab_726_32, 15); } return (sr << 2); } /*- End of function --------------------------------------------------------*/ /* * Encodes a 16-bit linear PCM, A-law or u-law input sample and retuens * the resulting 5-bit CCITT G.726 40Kbps code. */ static uint8_t g726_40_encoder(g726_state_t *s, int16_t amp) { int16_t sei; int16_t sezi; int16_t se; int16_t d; int16_t sr; int16_t dqsez; int16_t dq; int16_t i; int y; sezi = predictor_zero(s); sei = sezi + predictor_pole(s); se = sei >> 1; d = amp - se; /* Quantize prediction difference */ y = step_size(s); i = quantize(d, y, qtab_726_40, 31); dq = reconstruct(i & 0x10, g726_40_dqlntab[i], y); /* Reconstruct the signal */ sr = (dq < 0) ? (se - (dq & 0x7FFF)) : (se + dq); /* Pole prediction difference */ dqsez = sr + (sezi >> 1) - se; update(s, y, g726_40_witab[i], g726_40_fitab[i], dq, sr, dqsez); return (uint8_t) i; } /*- End of function --------------------------------------------------------*/ /* * Decodes a 5-bit CCITT G.726 40Kbps code and returns * the resulting 16-bit linear PCM, A-law or u-law sample value. */ static int16_t g726_40_decoder(g726_state_t *s, uint8_t code) { int16_t sezi; int16_t sei; int16_t se; int16_t sr; int16_t dq; int16_t dqsez; int y; /* Mask to get proper bits */ code &= 0x1F; sezi = predictor_zero(s); sei = sezi + predictor_pole(s); y = step_size(s); dq = reconstruct(code & 0x10, g726_40_dqlntab[code], y); /* Reconstruct the signal */ se = sei >> 1; sr = (dq < 0) ? (se - (dq & 0x7FFF)) : (se + dq); /* Pole prediction difference */ dqsez = sr + (sezi >> 1) - se; update(s, y, g726_40_witab[code], g726_40_fitab[code], dq, sr, dqsez); switch (s->ext_coding) { case G726_ENCODING_ALAW: return tandem_adjust_alaw(sr, se, y, code, 0x10, qtab_726_40, 31); case G726_ENCODING_ULAW: return tandem_adjust_ulaw(sr, se, y, code, 0x10, qtab_726_40, 31); } return (sr << 2); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(g726_state_t *) g726_init(g726_state_t *s, int bit_rate, int ext_coding, int packing) { int i; if (bit_rate != 16000 && bit_rate != 24000 && bit_rate != 32000 && bit_rate != 40000) return NULL; if (s == NULL) { if ((s = (g726_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } s->yl = 34816; s->yu = 544; s->dms = 0; s->dml = 0; s->ap = 0; s->rate = bit_rate; s->ext_coding = ext_coding; s->packing = packing; for (i = 0; i < 2; i++) { s->a[i] = 0; s->pk[i] = 0; s->sr[i] = 32; } for (i = 0; i < 6; i++) { s->b[i] = 0; s->dq[i] = 32; } s->td = FALSE; switch (bit_rate) { case 16000: s->enc_func = g726_16_encoder; s->dec_func = g726_16_decoder; s->bits_per_sample = 2; break; case 24000: s->enc_func = g726_24_encoder; s->dec_func = g726_24_decoder; s->bits_per_sample = 3; break; case 32000: default: s->enc_func = g726_32_encoder; s->dec_func = g726_32_decoder; s->bits_per_sample = 4; break; case 40000: s->enc_func = g726_40_encoder; s->dec_func = g726_40_decoder; s->bits_per_sample = 5; break; } bitstream_init(&s->bs, (s->packing != G726_PACKING_LEFT)); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g726_release(g726_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g726_free(g726_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g726_decode(g726_state_t *s, int16_t amp[], const uint8_t g726_data[], int g726_bytes) { int i; int samples; uint8_t code; int sl; for (samples = i = 0; ; ) { if (s->packing != G726_PACKING_NONE) { /* Unpack the code bits */ if (s->packing != G726_PACKING_LEFT) { if (s->bs.residue < s->bits_per_sample) { if (i >= g726_bytes) break; s->bs.bitstream |= (g726_data[i++] << s->bs.residue); s->bs.residue += 8; } code = (uint8_t) (s->bs.bitstream & ((1 << s->bits_per_sample) - 1)); s->bs.bitstream >>= s->bits_per_sample; } else { if (s->bs.residue < s->bits_per_sample) { if (i >= g726_bytes) break; s->bs.bitstream = (s->bs.bitstream << 8) | g726_data[i++]; s->bs.residue += 8; } code = (uint8_t) ((s->bs.bitstream >> (s->bs.residue - s->bits_per_sample)) & ((1 << s->bits_per_sample) - 1)); } s->bs.residue -= s->bits_per_sample; } else { if (i >= g726_bytes) break; code = g726_data[i++]; } sl = s->dec_func(s, code); if (s->ext_coding != G726_ENCODING_LINEAR) ((uint8_t *) amp)[samples++] = (uint8_t) sl; else amp[samples++] = (int16_t) sl; } return samples; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g726_encode(g726_state_t *s, uint8_t g726_data[], const int16_t amp[], int len) { int i; int g726_bytes; int16_t sl; uint8_t code; for (g726_bytes = i = 0; i < len; i++) { /* Linearize the input sample to 14-bit PCM */ switch (s->ext_coding) { case G726_ENCODING_ALAW: sl = alaw_to_linear(((const uint8_t *) amp)[i]) >> 2; break; case G726_ENCODING_ULAW: sl = ulaw_to_linear(((const uint8_t *) amp)[i]) >> 2; break; default: sl = amp[i] >> 2; break; } code = s->enc_func(s, sl); if (s->packing != G726_PACKING_NONE) { /* Pack the code bits */ if (s->packing != G726_PACKING_LEFT) { s->bs.bitstream |= (code << s->bs.residue); s->bs.residue += s->bits_per_sample; if (s->bs.residue >= 8) { g726_data[g726_bytes++] = (uint8_t) (s->bs.bitstream & 0xFF); s->bs.bitstream >>= 8; s->bs.residue -= 8; } } else { s->bs.bitstream = (s->bs.bitstream << s->bits_per_sample) | code; s->bs.residue += s->bits_per_sample; if (s->bs.residue >= 8) { g726_data[g726_bytes++] = (uint8_t) ((s->bs.bitstream >> (s->bs.residue - 8)) & 0xFF); s->bs.residue -= 8; } } } else { g726_data[g726_bytes++] = (uint8_t) code; } } return g726_bytes; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/bell_r2_mf.c0000664000175000017500000006405012343630436013057 00000000000000/* * SpanDSP - a series of DSP components for telephony * * bell_r2_mf.c - Bell MF and MFC/R2 tone generation and detection. * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/fast_convert.h" #include "spandsp/queue.h" #include "spandsp/dc_restore.h" #include "spandsp/complex.h" #include "spandsp/dds.h" #include "spandsp/tone_detect.h" #include "spandsp/tone_generate.h" #include "spandsp/super_tone_rx.h" #include "spandsp/dtmf.h" #include "spandsp/bell_r2_mf.h" #include "spandsp/private/logging.h" #include "spandsp/private/queue.h" #include "spandsp/private/tone_generate.h" #include "spandsp/private/bell_r2_mf.h" #if !defined(M_PI) /* C99 systems may not define M_PI */ #define M_PI 3.14159265358979323846264338327 #endif /*! MF tone descriptor. */ typedef struct { int f1; /* First freq */ int f2; /* Second freq */ int8_t level1; /* Level of the first freq (dB) */ int8_t level2; /* Level of the second freq (dB) */ uint8_t on_time; /* Tone on time (ms) */ uint8_t off_time; /* Minimum post tone silence (ms) */ } mf_digit_tones_t; int bell_mf_gen_inited = FALSE; tone_gen_descriptor_t bell_mf_digit_tones[15]; int r2_mf_gen_inited = FALSE; tone_gen_descriptor_t r2_mf_fwd_digit_tones[15]; tone_gen_descriptor_t r2_mf_back_digit_tones[15]; #if 0 tone_gen_descriptor_t socotel_mf_digit_tones[18]; #endif /* Bell R1 tone generation specs. * Power: -7dBm +- 1dB * Frequency: within +-1.5% * Mismatch between the start time of a pair of tones: <=6ms. * Mismatch between the end time of a pair of tones: <=6ms. * Tone duration: 68+-7ms, except KP which is 100+-7ms. * Inter-tone gap: 68+-7ms. */ static const mf_digit_tones_t bell_mf_tones[] = { { 700, 900, -7, -7, 68, 68}, { 700, 1100, -7, -7, 68, 68}, { 900, 1100, -7, -7, 68, 68}, { 700, 1300, -7, -7, 68, 68}, { 900, 1300, -7, -7, 68, 68}, {1100, 1300, -7, -7, 68, 68}, { 700, 1500, -7, -7, 68, 68}, { 900, 1500, -7, -7, 68, 68}, {1100, 1500, -7, -7, 68, 68}, {1300, 1500, -7, -7, 68, 68}, { 700, 1700, -7, -7, 68, 68}, /* ST''' - use 'C' */ { 900, 1700, -7, -7, 68, 68}, /* ST' - use 'A' */ {1100, 1700, -7, -7, 100, 68}, /* KP - use '*' */ {1300, 1700, -7, -7, 68, 68}, /* ST'' - use 'B' */ {1500, 1700, -7, -7, 68, 68}, /* ST - use '#' */ {0, 0, 0, 0, 0, 0} }; /* The order of the digits here must match the list above */ static const char bell_mf_tone_codes[] = "1234567890CA*B#"; /* R2 tone generation specs. * Power: -11.5dBm +- 1dB * Frequency: within +-4Hz * Mismatch between the start time of a pair of tones: <=1ms. * Mismatch between the end time of a pair of tones: <=1ms. */ static const mf_digit_tones_t r2_mf_fwd_tones[] = { {1380, 1500, -11, -11, 1, 0}, {1380, 1620, -11, -11, 1, 0}, {1500, 1620, -11, -11, 1, 0}, {1380, 1740, -11, -11, 1, 0}, {1500, 1740, -11, -11, 1, 0}, {1620, 1740, -11, -11, 1, 0}, {1380, 1860, -11, -11, 1, 0}, {1500, 1860, -11, -11, 1, 0}, {1620, 1860, -11, -11, 1, 0}, {1740, 1860, -11, -11, 1, 0}, {1380, 1980, -11, -11, 1, 0}, {1500, 1980, -11, -11, 1, 0}, {1620, 1980, -11, -11, 1, 0}, {1740, 1980, -11, -11, 1, 0}, {1860, 1980, -11, -11, 1, 0}, {0, 0, 0, 0, 0, 0} }; static const mf_digit_tones_t r2_mf_back_tones[] = { {1140, 1020, -11, -11, 1, 0}, {1140, 900, -11, -11, 1, 0}, {1020, 900, -11, -11, 1, 0}, {1140, 780, -11, -11, 1, 0}, {1020, 780, -11, -11, 1, 0}, { 900, 780, -11, -11, 1, 0}, {1140, 660, -11, -11, 1, 0}, {1020, 660, -11, -11, 1, 0}, { 900, 660, -11, -11, 1, 0}, { 780, 660, -11, -11, 1, 0}, {1140, 540, -11, -11, 1, 0}, {1020, 540, -11, -11, 1, 0}, { 900, 540, -11, -11, 1, 0}, { 780, 540, -11, -11, 1, 0}, { 660, 540, -11, -11, 1, 0}, {0, 0, 0, 0, 0, 0} }; /* The order of the digits here must match the lists above */ static const char r2_mf_tone_codes[] = "1234567890BCDEF"; #if 0 static const mf_digit_tones_t socotel_tones[] = { { 700, 900, -11, -11, 1, 0}, { 700, 1100, -11, -11, 1, 0}, { 900, 1100, -11, -11, 1, 0}, { 700, 1300, -11, -11, 1, 0}, { 900, 1300, -11, -11, 1, 0}, {1100, 1300, -11, -11, 1, 0}, { 700, 1500, -11, -11, 1, 0}, { 900, 1500, -11, -11, 1, 0}, {1100, 1500, -11, -11, 1, 0}, {1300, 1500, -11, -11, 1, 0}, {1500, 1700, -11, -11, 1, 0}, { 700, 1700, -11, -11, 1, 0}, { 900, 1700, -11, -11, 1, 0}, {1300, 1700, -11, -11, 1, 0}, {1100, 1700, -11, -11, 1, 0}, {1700, 0, -11, -11, 1, 0}, /* Use 'F' */ {1900, 0, -11, -11, 1, 0}, /* Use 'G' */ {0, 0, 0, 0, 0, 0} }; /* The order of the digits here must match the list above */ static char socotel_mf_tone_codes[] = "1234567890ABCDEFG"; #endif #if defined(SPANDSP_USE_FIXED_POINT) #define BELL_MF_THRESHOLD 204089 /* -30.5dBm0 */ #define BELL_MF_TWIST 3.981f /* 6dB */ #define BELL_MF_RELATIVE_PEAK 12.589f /* 11dB */ #define BELL_MF_SAMPLES_PER_BLOCK 120 #define R2_MF_THRESHOLD 62974 /* -36.5dBm0 */ #define R2_MF_TWIST 5.012f /* 7dB */ #define R2_MF_RELATIVE_PEAK 12.589f /* 11dB */ #define R2_MF_SAMPLES_PER_BLOCK 133 #else #define BELL_MF_THRESHOLD 3343803100.0f /* -30.5dBm0 [((120.0*32768.0/1.4142)*10^((-30.5 - DBM0_MAX_SINE_POWER)/20.0))^2 => 3343803100.0] */ #define BELL_MF_TWIST 3.981f /* 6dB [10^(6/10) => 3.981] */ #define BELL_MF_RELATIVE_PEAK 12.589f /* 11dB */ #define BELL_MF_SAMPLES_PER_BLOCK 120 #define R2_MF_THRESHOLD 1031766650.0f /* -36.5dBm0 [((133.0*32768.0/1.4142)*10^((-36.5 - DBM0_MAX_SINE_POWER)/20.0))^2 => 1031766650.0] */ #define R2_MF_TWIST 5.012f /* 7dB */ #define R2_MF_RELATIVE_PEAK 12.589f /* 11dB */ #define R2_MF_SAMPLES_PER_BLOCK 133 #endif static goertzel_descriptor_t bell_mf_detect_desc[6]; static goertzel_descriptor_t mf_fwd_detect_desc[6]; static goertzel_descriptor_t mf_back_detect_desc[6]; static const int bell_mf_frequencies[] = { 700, 900, 1100, 1300, 1500, 1700 }; /* Use the follow characters for the Bell MF special signals: KP - use '*' ST - use '#' ST' - use 'A' ST'' - use 'B' ST''' - use 'C' */ static const char bell_mf_positions[] = "1247C-358A--69*---0B----#"; static const int r2_mf_fwd_frequencies[] = { 1380, 1500, 1620, 1740, 1860, 1980 }; static const int r2_mf_back_frequencies[] = { 1140, 1020, 900, 780, 660, 540 }; /* Use codes '1' to 'F' for the R2 signals 1 to 15, except for signal 'A'. Use '0' for this, so the codes match the digits 0-9. */ static const char r2_mf_positions[] = "1247B-358C--69D---0E----F"; static void bell_mf_gen_init(void) { int i; const mf_digit_tones_t *tones; if (bell_mf_gen_inited) return; i = 0; tones = bell_mf_tones; while (tones->on_time) { /* Note: The duration of KP is longer than the other signals. */ tone_gen_descriptor_init(&bell_mf_digit_tones[i++], tones->f1, tones->level1, tones->f2, tones->level2, tones->on_time, tones->off_time, 0, 0, FALSE); tones++; } bell_mf_gen_inited = TRUE; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) bell_mf_tx(bell_mf_tx_state_t *s, int16_t amp[], int max_samples) { int len; const char *cp; int digit; len = 0; if (s->tones.current_section >= 0) { /* Deal with the fragment left over from last time */ len = tone_gen(&s->tones, amp, max_samples); } while (len < max_samples && (digit = queue_read_byte(&s->queue.queue)) >= 0) { /* Step to the next digit */ if ((cp = strchr(bell_mf_tone_codes, digit)) == NULL) continue; tone_gen_init(&s->tones, &bell_mf_digit_tones[cp - bell_mf_tone_codes]); len += tone_gen(&s->tones, amp + len, max_samples - len); } return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) bell_mf_tx_put(bell_mf_tx_state_t *s, const char *digits, int len) { size_t space; /* This returns the number of characters that would not fit in the buffer. The buffer will only be loaded if the whole string of digits will fit, in which case zero is returned. */ if (len < 0) { if ((len = strlen(digits)) == 0) return 0; } if ((space = queue_free_space(&s->queue.queue)) < (size_t) len) return len - (int) space; if (queue_write(&s->queue.queue, (const uint8_t *) digits, len) >= 0) return 0; return -1; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(bell_mf_tx_state_t *) bell_mf_tx_init(bell_mf_tx_state_t *s) { if (s == NULL) { if ((s = (bell_mf_tx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); if (!bell_mf_gen_inited) bell_mf_gen_init(); tone_gen_init(&s->tones, &bell_mf_digit_tones[0]); s->current_sample = 0; queue_init(&s->queue.queue, MAX_BELL_MF_DIGITS, QUEUE_READ_ATOMIC | QUEUE_WRITE_ATOMIC); s->tones.current_section = -1; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) bell_mf_tx_release(bell_mf_tx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) bell_mf_tx_free(bell_mf_tx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) r2_mf_tx(r2_mf_tx_state_t *s, int16_t amp[], int samples) { int len; if (s->digit == 0) { len = samples; memset(amp, 0, len*sizeof(int16_t)); } else { len = tone_gen(&s->tone, amp, samples); } return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) r2_mf_tx_put(r2_mf_tx_state_t *s, char digit) { char *cp; if (digit && (cp = strchr(r2_mf_tone_codes, digit))) { if (s->fwd) tone_gen_init(&s->tone, &r2_mf_fwd_digit_tones[cp - r2_mf_tone_codes]); else tone_gen_init(&s->tone, &r2_mf_back_digit_tones[cp - r2_mf_tone_codes]); s->digit = digit; } else { s->digit = 0; } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(r2_mf_tx_state_t *) r2_mf_tx_init(r2_mf_tx_state_t *s, int fwd) { int i; const mf_digit_tones_t *tones; if (s == NULL) { if ((s = (r2_mf_tx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); if (!r2_mf_gen_inited) { i = 0; tones = r2_mf_fwd_tones; while (tones->on_time) { tone_gen_descriptor_init(&r2_mf_fwd_digit_tones[i++], tones->f1, tones->level1, tones->f2, tones->level2, tones->on_time, tones->off_time, 0, 0, (tones->off_time == 0)); tones++; } i = 0; tones = r2_mf_back_tones; while (tones->on_time) { tone_gen_descriptor_init(&r2_mf_back_digit_tones[i++], tones->f1, tones->level1, tones->f2, tones->level2, tones->on_time, tones->off_time, 0, 0, (tones->off_time == 0)); tones++; } r2_mf_gen_inited = TRUE; } s->fwd = fwd; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) r2_mf_tx_release(r2_mf_tx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) r2_mf_tx_free(r2_mf_tx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) bell_mf_rx(bell_mf_rx_state_t *s, const int16_t amp[], int samples) { #if defined(SPANDSP_USE_FIXED_POINT) int32_t energy[6]; int16_t xamp; #else float energy[6]; float xamp; #endif int i; int j; int sample; int best; int second_best; int limit; uint8_t hit; hit = 0; for (sample = 0; sample < samples; sample = limit) { if ((samples - sample) >= (BELL_MF_SAMPLES_PER_BLOCK - s->current_sample)) limit = sample + (BELL_MF_SAMPLES_PER_BLOCK - s->current_sample); else limit = samples; for (j = sample; j < limit; j++) { xamp = goertzel_preadjust_amp(amp[j]); goertzel_samplex(&s->out[0], xamp); goertzel_samplex(&s->out[1], xamp); goertzel_samplex(&s->out[2], xamp); goertzel_samplex(&s->out[3], xamp); goertzel_samplex(&s->out[4], xamp); goertzel_samplex(&s->out[5], xamp); } s->current_sample += (limit - sample); if (s->current_sample < BELL_MF_SAMPLES_PER_BLOCK) continue; /* We are at the end of an MF detection block */ /* Find the two highest energies. The spec says to look for two tones and two tones only. Taking this literally -ie only two tones pass the minimum threshold - doesn't work well. The sinc function mess, due to rectangular windowing ensure that! Find the two highest energies and ensure they are considerably stronger than any of the others. */ energy[0] = goertzel_result(&s->out[0]); energy[1] = goertzel_result(&s->out[1]); if (energy[0] > energy[1]) { best = 0; second_best = 1; } else { best = 1; second_best = 0; } for (i = 2; i < 6; i++) { energy[i] = goertzel_result(&s->out[i]); if (energy[i] >= energy[best]) { second_best = best; best = i; } else if (energy[i] >= energy[second_best]) { second_best = i; } } /* Basic signal level and twist tests */ hit = 0; if (energy[best] >= BELL_MF_THRESHOLD && energy[second_best] >= BELL_MF_THRESHOLD && energy[best] < energy[second_best]*BELL_MF_TWIST && energy[best]*BELL_MF_TWIST > energy[second_best]) { /* Relative peak test */ hit = 'X'; for (i = 0; i < 6; i++) { if (i != best && i != second_best) { if (energy[i]*BELL_MF_RELATIVE_PEAK >= energy[second_best]) { /* The best two are not clearly the best */ hit = 0; break; } } } } if (hit) { /* Get the values into ascending order */ if (second_best < best) { i = best; best = second_best; second_best = i; } best = best*5 + second_best - 1; hit = bell_mf_positions[best]; /* Look for two successive similar results */ /* The logic in the next test is: For KP we need 4 successive identical clean detects, with two blocks of something different preceeding it. For anything else we need two successive identical clean detects, with two blocks of something different preceeding it. */ if (hit == s->hits[4] && hit == s->hits[3] && ((hit != '*' && hit != s->hits[2] && hit != s->hits[1]) || (hit == '*' && hit == s->hits[2] && hit != s->hits[1] && hit != s->hits[0]))) { if (s->current_digits < MAX_BELL_MF_DIGITS) { s->digits[s->current_digits++] = (char) hit; s->digits[s->current_digits] = '\0'; if (s->digits_callback) { s->digits_callback(s->digits_callback_data, s->digits, s->current_digits); s->current_digits = 0; } } else { s->lost_digits++; } } } s->hits[0] = s->hits[1]; s->hits[1] = s->hits[2]; s->hits[2] = s->hits[3]; s->hits[3] = s->hits[4]; s->hits[4] = hit; s->current_sample = 0; } if (s->current_digits && s->digits_callback) { s->digits_callback(s->digits_callback_data, s->digits, s->current_digits); s->digits[0] = '\0'; s->current_digits = 0; } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(size_t) bell_mf_rx_get(bell_mf_rx_state_t *s, char *buf, int max) { if (max > s->current_digits) max = s->current_digits; if (max > 0) { memcpy(buf, s->digits, max); memmove(s->digits, s->digits + max, s->current_digits - max); s->current_digits -= max; } buf[max] = '\0'; return max; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(bell_mf_rx_state_t *) bell_mf_rx_init(bell_mf_rx_state_t *s, digits_rx_callback_t callback, void *user_data) { int i; static int initialised = FALSE; if (s == NULL) { if ((s = (bell_mf_rx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); if (!initialised) { for (i = 0; i < 6; i++) make_goertzel_descriptor(&bell_mf_detect_desc[i], (float) bell_mf_frequencies[i], BELL_MF_SAMPLES_PER_BLOCK); initialised = TRUE; } s->digits_callback = callback; s->digits_callback_data = user_data; s->hits[0] = s->hits[1] = s->hits[2] = s->hits[3] = s->hits[4] = 0; for (i = 0; i < 6; i++) goertzel_init(&s->out[i], &bell_mf_detect_desc[i]); s->current_sample = 0; s->lost_digits = 0; s->current_digits = 0; s->digits[0] = '\0'; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) bell_mf_rx_release(bell_mf_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) bell_mf_rx_free(bell_mf_rx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) r2_mf_rx(r2_mf_rx_state_t *s, const int16_t amp[], int samples) { #if defined(SPANDSP_USE_FIXED_POINT) int32_t energy[6]; int16_t xamp; #else float energy[6]; float xamp; #endif int i; int j; int sample; int best; int second_best; int hit; int hit_digit; int limit; hit = 0; hit_digit = 0; for (sample = 0; sample < samples; sample = limit) { if ((samples - sample) >= (R2_MF_SAMPLES_PER_BLOCK - s->current_sample)) limit = sample + (R2_MF_SAMPLES_PER_BLOCK - s->current_sample); else limit = samples; for (j = sample; j < limit; j++) { xamp = goertzel_preadjust_amp(amp[j]); goertzel_samplex(&s->out[0], xamp); goertzel_samplex(&s->out[1], xamp); goertzel_samplex(&s->out[2], xamp); goertzel_samplex(&s->out[3], xamp); goertzel_samplex(&s->out[4], xamp); goertzel_samplex(&s->out[5], xamp); } s->current_sample += (limit - sample); if (s->current_sample < R2_MF_SAMPLES_PER_BLOCK) continue; /* We are at the end of an MF detection block */ /* Find the two highest energies */ energy[0] = goertzel_result(&s->out[0]); energy[1] = goertzel_result(&s->out[1]); if (energy[0] > energy[1]) { best = 0; second_best = 1; } else { best = 1; second_best = 0; } for (i = 2; i < 6; i++) { energy[i] = goertzel_result(&s->out[i]); if (energy[i] >= energy[best]) { second_best = best; best = i; } else if (energy[i] >= energy[second_best]) { second_best = i; } } /* Basic signal level and twist tests */ hit = FALSE; if (energy[best] >= R2_MF_THRESHOLD && energy[second_best] >= R2_MF_THRESHOLD && energy[best] < energy[second_best]*R2_MF_TWIST && energy[best]*R2_MF_TWIST > energy[second_best]) { /* Relative peak test */ hit = TRUE; for (i = 0; i < 6; i++) { if (i != best && i != second_best) { if (energy[i]*R2_MF_RELATIVE_PEAK >= energy[second_best]) { /* The best two are not clearly the best */ hit = FALSE; break; } } } } if (hit) { /* Get the values into ascending order */ if (second_best < best) { i = best; best = second_best; second_best = i; } best = best*5 + second_best - 1; hit_digit = r2_mf_positions[best]; } else { hit_digit = 0; } if (s->current_digit != hit_digit && s->callback) { i = (hit_digit) ? -10 : -99; s->callback(s->callback_data, hit_digit, i, 0); } s->current_digit = hit_digit; s->current_sample = 0; } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) r2_mf_rx_get(r2_mf_rx_state_t *s) { return s->current_digit; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(r2_mf_rx_state_t *) r2_mf_rx_init(r2_mf_rx_state_t *s, int fwd, tone_report_func_t callback, void *user_data) { int i; static int initialised = FALSE; if (s == NULL) { if ((s = (r2_mf_rx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); s->fwd = fwd; if (!initialised) { for (i = 0; i < 6; i++) { make_goertzel_descriptor(&mf_fwd_detect_desc[i], (float) r2_mf_fwd_frequencies[i], R2_MF_SAMPLES_PER_BLOCK); make_goertzel_descriptor(&mf_back_detect_desc[i], (float) r2_mf_back_frequencies[i], R2_MF_SAMPLES_PER_BLOCK); } initialised = TRUE; } if (fwd) { for (i = 0; i < 6; i++) goertzel_init(&s->out[i], &mf_fwd_detect_desc[i]); } else { for (i = 0; i < 6; i++) goertzel_init(&s->out[i], &mf_back_detect_desc[i]); } s->callback = callback; s->callback_data = user_data; s->current_digit = 0; s->current_sample = 0; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) r2_mf_rx_release(r2_mf_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) r2_mf_rx_free(r2_mf_rx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/v27ter_tx.c0000664000175000017500000004044112343630060012707 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v27ter_tx.c - ITU V.27ter modem transmit part * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/logging.h" #include "spandsp/complex.h" #include "spandsp/vector_float.h" #include "spandsp/complex_vector_float.h" #include "spandsp/vector_int.h" #include "spandsp/complex_vector_int.h" #include "spandsp/async.h" #include "spandsp/dds.h" #include "spandsp/power_meter.h" #include "spandsp/v27ter_tx.h" #include "spandsp/private/logging.h" #include "spandsp/private/v27ter_tx.h" #if defined(SPANDSP_USE_FIXED_POINT) #include "v27ter_tx_4800_fixed_rrc.h" #include "v27ter_tx_2400_fixed_rrc.h" #else #include "v27ter_tx_4800_floating_rrc.h" #include "v27ter_tx_2400_floating_rrc.h" #endif /*! The nominal frequency of the carrier, in Hertz */ #define CARRIER_NOMINAL_FREQ 1800.0f /* Segments of the training sequence */ /* V.27ter defines a long and a short sequence. FAX doesn't use the short sequence, so it is not implemented here. */ /*! The start of training segment 1, in symbols */ #define V27TER_TRAINING_SEG_1 0 /*! The start of training segment 2, in symbols */ #define V27TER_TRAINING_SEG_2 (V27TER_TRAINING_SEG_1 + 320) /*! The start of training segment 3, in symbols */ #define V27TER_TRAINING_SEG_3 (V27TER_TRAINING_SEG_2 + 32) /*! The start of training segment 4, in symbols */ #define V27TER_TRAINING_SEG_4 (V27TER_TRAINING_SEG_3 + 50) /*! The start of training segment 5, in symbols */ #define V27TER_TRAINING_SEG_5 (V27TER_TRAINING_SEG_4 + 1074) /*! The end of the training, in symbols */ #define V27TER_TRAINING_END (V27TER_TRAINING_SEG_5 + 8) /*! The end of the shutdown sequence, in symbols */ #define V27TER_TRAINING_SHUTDOWN_END (V27TER_TRAINING_END + 32) static int fake_get_bit(void *user_data) { return 1; } /*- End of function --------------------------------------------------------*/ static __inline__ int scramble(v27ter_tx_state_t *s, int in_bit) { int out_bit; /* This scrambler is really quite messy to implement. There seems to be no efficient shortcut */ out_bit = (in_bit ^ (s->scramble_reg >> 5) ^ (s->scramble_reg >> 6)) & 1; if (s->scrambler_pattern_count >= 33) { out_bit ^= 1; s->scrambler_pattern_count = 0; } else { if ((((s->scramble_reg >> 7) ^ out_bit) & ((s->scramble_reg >> 8) ^ out_bit) & ((s->scramble_reg >> 11) ^ out_bit) & 1)) s->scrambler_pattern_count = 0; else s->scrambler_pattern_count++; } s->scramble_reg = (s->scramble_reg << 1) | out_bit; return out_bit; } /*- End of function --------------------------------------------------------*/ static __inline__ int get_scrambled_bit(v27ter_tx_state_t *s) { int bit; if ((bit = s->current_get_bit(s->get_bit_user_data)) == SIG_STATUS_END_OF_DATA) { /* End of real data. Switch to the fake get_bit routine, until we have shut down completely. */ if (s->status_handler) s->status_handler(s->status_user_data, SIG_STATUS_END_OF_DATA); s->current_get_bit = fake_get_bit; s->in_training = TRUE; bit = 1; } return scramble(s, bit); } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINT) static complexi16_t getbaud(v27ter_tx_state_t *s) #else static complexf_t getbaud(v27ter_tx_state_t *s) #endif { static const int phase_steps_4800[8] = { 1, 0, 2, 3, 6, 7, 5, 4 }; static const int phase_steps_2400[4] = { 0, 2, 6, 4 }; #if defined(SPANDSP_USE_FIXED_POINT) static const complexi16_t constellation[8] = { { 1414, 0000}, /* 0deg */ { 1000, 1000}, /* 45deg */ { 0000, 1414}, /* 90deg */ {-1000, 1000}, /* 135deg */ {-1414, 0000}, /* 180deg */ {-1000, -1000}, /* 225deg */ { 0000, -1414}, /* 270deg */ { 1000, -1000} /* 315deg */ }; static const complexi16_t zero = {0, 0}; #else static const complexf_t constellation[8] = { { 1.414f, 0.0f}, /* 0deg */ { 1.0f, 1.0f}, /* 45deg */ { 0.0f, 1.414f}, /* 90deg */ {-1.0f, 1.0f}, /* 135deg */ {-1.414f, 0.0f}, /* 180deg */ {-1.0f, -1.0f}, /* 225deg */ { 0.0f, -1.414f}, /* 270deg */ { 1.0f, -1.0f} /* 315deg */ }; static const complexf_t zero = {0.0f, 0.0f}; #endif int bits; if (s->in_training) { /* Send the training sequence */ if (++s->training_step <= V27TER_TRAINING_SEG_5) { if (s->training_step <= V27TER_TRAINING_SEG_4) { if (s->training_step <= V27TER_TRAINING_SEG_2) { /* Segment 1: Unmodulated carrier (talker echo protection) */ return constellation[0]; } if (s->training_step <= V27TER_TRAINING_SEG_3) { /* Segment 2: Silence */ return zero; } /* Segment 3: Regular reversals... */ s->constellation_state = (s->constellation_state + 4) & 7; return constellation[s->constellation_state]; } /* Segment 4: Scrambled reversals... */ /* Apply the 1 + x^-6 + x^-7 scrambler. We want every third bit from the scrambler. */ bits = get_scrambled_bit(s) << 2; get_scrambled_bit(s); get_scrambled_bit(s); s->constellation_state = (s->constellation_state + bits) & 7; return constellation[s->constellation_state]; } /* We should be in the block of test ones, or shutdown ones, if we get here. */ /* There is no graceful shutdown procedure defined for V.27ter. Just send some ones, to ensure we get the real data bits through, even with bad ISI. */ if (s->training_step == V27TER_TRAINING_END + 1) { /* End of the last segment - segment 5: All ones */ /* Switch from the fake get_bit routine, to the user supplied real one, and we are up and running. */ s->current_get_bit = s->get_bit; s->in_training = FALSE; } if (s->training_step == V27TER_TRAINING_SHUTDOWN_END) { if (s->status_handler) s->status_handler(s->status_user_data, SIG_STATUS_SHUTDOWN_COMPLETE); } } /* 4800bps uses 8 phases. 2400bps uses 4 phases. */ if (s->bit_rate == 4800) { bits = get_scrambled_bit(s); bits = (bits << 1) | get_scrambled_bit(s); bits = (bits << 1) | get_scrambled_bit(s); bits = phase_steps_4800[bits]; } else { bits = get_scrambled_bit(s); bits = (bits << 1) | get_scrambled_bit(s); bits = phase_steps_2400[bits]; } s->constellation_state = (s->constellation_state + bits) & 7; return constellation[s->constellation_state]; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) v27ter_tx(v27ter_tx_state_t *s, int16_t amp[], int len) { #if defined(SPANDSP_USE_FIXED_POINT) complexi_t x; complexi_t z; #else complexf_t x; complexf_t z; #endif int i; int sample; if (s->training_step >= V27TER_TRAINING_SHUTDOWN_END) { /* Once we have sent the shutdown symbols, we stop sending completely. */ return 0; } /* The symbol rates for the two bit rates are different. This makes it difficult to merge both generation procedures into a single efficient loop. We do not bother trying. We use two independent loops, filter coefficients, etc. */ if (s->bit_rate == 4800) { for (sample = 0; sample < len; sample++) { if (++s->baud_phase >= 5) { s->baud_phase -= 5; s->rrc_filter[s->rrc_filter_step] = s->rrc_filter[s->rrc_filter_step + V27TER_TX_FILTER_STEPS] = getbaud(s); if (++s->rrc_filter_step >= V27TER_TX_FILTER_STEPS) s->rrc_filter_step = 0; } /* Root raised cosine pulse shaping at baseband */ #if defined(SPANDSP_USE_FIXED_POINT) x = complex_seti(0, 0); for (i = 0; i < V27TER_TX_FILTER_STEPS; i++) { x.re += (int32_t) tx_pulseshaper_4800[TX_PULSESHAPER_4800_COEFF_SETS - 1 - s->baud_phase][i]*(int32_t) s->rrc_filter[i + s->rrc_filter_step].re; x.im += (int32_t) tx_pulseshaper_4800[TX_PULSESHAPER_4800_COEFF_SETS - 1 - s->baud_phase][i]*(int32_t) s->rrc_filter[i + s->rrc_filter_step].im; } /* Now create and modulate the carrier */ x.re >>= 14; x.im >>= 14; z = dds_complexi(&s->carrier_phase, s->carrier_phase_rate); /* Don't bother saturating. We should never clip. */ i = (x.re*z.re - x.im*z.im) >> 15; amp[sample] = (int16_t) ((i*s->gain_4800) >> 15); #else x = complex_setf(0.0f, 0.0f); for (i = 0; i < V27TER_TX_FILTER_STEPS; i++) { x.re += tx_pulseshaper_4800[TX_PULSESHAPER_4800_COEFF_SETS - 1 - s->baud_phase][i]*s->rrc_filter[i + s->rrc_filter_step].re; x.im += tx_pulseshaper_4800[TX_PULSESHAPER_4800_COEFF_SETS - 1 - s->baud_phase][i]*s->rrc_filter[i + s->rrc_filter_step].im; } /* Now create and modulate the carrier */ z = dds_complexf(&s->carrier_phase, s->carrier_phase_rate); /* Don't bother saturating. We should never clip. */ amp[sample] = (int16_t) lfastrintf((x.re*z.re - x.im*z.im)*s->gain_4800); #endif } } else { for (sample = 0; sample < len; sample++) { if ((s->baud_phase += 3) >= 20) { s->baud_phase -= 20; s->rrc_filter[s->rrc_filter_step] = s->rrc_filter[s->rrc_filter_step + V27TER_TX_FILTER_STEPS] = getbaud(s); if (++s->rrc_filter_step >= V27TER_TX_FILTER_STEPS) s->rrc_filter_step = 0; } /* Root raised cosine pulse shaping at baseband */ #if defined(SPANDSP_USE_FIXED_POINT) x = complex_seti(0, 0); for (i = 0; i < V27TER_TX_FILTER_STEPS; i++) { x.re += (int32_t) tx_pulseshaper_2400[TX_PULSESHAPER_2400_COEFF_SETS - 1 - s->baud_phase][i]*(int32_t) s->rrc_filter[i + s->rrc_filter_step].re; x.im += (int32_t) tx_pulseshaper_2400[TX_PULSESHAPER_2400_COEFF_SETS - 1 - s->baud_phase][i]*(int32_t) s->rrc_filter[i + s->rrc_filter_step].im; } /* Now create and modulate the carrier */ x.re >>= 14; x.im >>= 14; z = dds_complexi(&s->carrier_phase, s->carrier_phase_rate); /* Don't bother saturating. We should never clip. */ i = (x.re*z.re - x.im*z.im) >> 15; amp[sample] = (int16_t) ((i*s->gain_2400) >> 15); #else x = complex_setf(0.0f, 0.0f); for (i = 0; i < V27TER_TX_FILTER_STEPS; i++) { x.re += tx_pulseshaper_2400[TX_PULSESHAPER_2400_COEFF_SETS - 1 - s->baud_phase][i]*s->rrc_filter[i + s->rrc_filter_step].re; x.im += tx_pulseshaper_2400[TX_PULSESHAPER_2400_COEFF_SETS - 1 - s->baud_phase][i]*s->rrc_filter[i + s->rrc_filter_step].im; } /* Now create and modulate the carrier */ z = dds_complexf(&s->carrier_phase, s->carrier_phase_rate); /* Don't bother saturating. We should never clip. */ amp[sample] = (int16_t) lfastrintf((x.re*z.re - x.im*z.im)*s->gain_2400); #endif } } return sample; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v27ter_tx_power(v27ter_tx_state_t *s, float power) { float l; l = powf(10.0f, (power - DBM0_MAX_POWER)/20.0f)*32768.0f; #if defined(SPANDSP_USE_FIXED_POINT) s->gain_2400 = 16.0f*1.024f*(32767.0f/28828.51f)*l/TX_PULSESHAPER_2400_GAIN; s->gain_4800 = 16.0f*1.024f*(32767.0f/28828.46f)*l/TX_PULSESHAPER_4800_GAIN; #else s->gain_2400 = l/TX_PULSESHAPER_2400_GAIN; s->gain_4800 = l/TX_PULSESHAPER_4800_GAIN; #endif } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v27ter_tx_set_get_bit(v27ter_tx_state_t *s, get_bit_func_t get_bit, void *user_data) { if (s->get_bit == s->current_get_bit) s->current_get_bit = get_bit; s->get_bit = get_bit; s->get_bit_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v27ter_tx_set_modem_status_handler(v27ter_tx_state_t *s, modem_status_func_t handler, void *user_data) { s->status_handler = handler; s->status_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) v27ter_tx_get_logging_state(v27ter_tx_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v27ter_tx_restart(v27ter_tx_state_t *s, int bit_rate, int tep) { if (bit_rate != 4800 && bit_rate != 2400) return -1; s->bit_rate = bit_rate; #if defined(SPANDSP_USE_FIXED_POINT) cvec_zeroi16(s->rrc_filter, sizeof(s->rrc_filter)/sizeof(s->rrc_filter[0])); #else cvec_zerof(s->rrc_filter, sizeof(s->rrc_filter)/sizeof(s->rrc_filter[0])); #endif s->rrc_filter_step = 0; s->scramble_reg = 0x3C; s->scrambler_pattern_count = 0; s->in_training = TRUE; s->training_step = (tep) ? V27TER_TRAINING_SEG_1 : V27TER_TRAINING_SEG_2; s->carrier_phase = 0; s->baud_phase = 0; s->constellation_state = 0; s->current_get_bit = fake_get_bit; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(v27ter_tx_state_t *) v27ter_tx_init(v27ter_tx_state_t *s, int bit_rate, int tep, get_bit_func_t get_bit, void *user_data) { switch (bit_rate) { case 4800: case 2400: break; default: return NULL; } if (s == NULL) { if ((s = (v27ter_tx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "V.27ter TX"); s->get_bit = get_bit; s->get_bit_user_data = user_data; s->carrier_phase_rate = dds_phase_ratef(CARRIER_NOMINAL_FREQ); v27ter_tx_power(s, -14.0f); v27ter_tx_restart(s, bit_rate, tep); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v27ter_tx_release(v27ter_tx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v27ter_tx_free(v27ter_tx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/bert.c0000664000175000017500000003545011422612261012003 00000000000000/* * SpanDSP - a series of DSP components for telephony * * bert.c - Bit error rate tests. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/async.h" #include "spandsp/bert.h" #include "spandsp/private/logging.h" #include "spandsp/private/bert.h" #define MEASUREMENT_STEP 100 static const char *qbf = "VoyeZ Le BricK GeanT QuE J'ExaminE PreS Du WharF 123 456 7890 + - * : = $ % ( )" "ThE QuicK BrowN FoX JumpS OveR ThE LazY DoG 123 456 7890 + - * : = $ % ( )"; SPAN_DECLARE(const char *) bert_event_to_str(int event) { switch (event) { case BERT_REPORT_SYNCED: return "synced"; case BERT_REPORT_UNSYNCED: return "unsync'ed"; case BERT_REPORT_REGULAR: return "regular"; case BERT_REPORT_GT_10_2: return "error rate > 1 in 10^2"; case BERT_REPORT_LT_10_2: return "error rate < 1 in 10^2"; case BERT_REPORT_LT_10_3: return "error rate < 1 in 10^3"; case BERT_REPORT_LT_10_4: return "error rate < 1 in 10^4"; case BERT_REPORT_LT_10_5: return "error rate < 1 in 10^5"; case BERT_REPORT_LT_10_6: return "error rate < 1 in 10^6"; case BERT_REPORT_LT_10_7: return "error rate < 1 in 10^7"; } return "???"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) bert_get_bit(bert_state_t *s) { int bit; if (s->limit && s->tx.bits >= s->limit) return SIG_STATUS_END_OF_DATA; bit = 0; switch (s->pattern_class) { case 0: bit = s->tx.reg & 1; s->tx.reg = (s->tx.reg >> 1) | ((s->tx.reg & 1) << s->shift2); break; case 1: bit = s->tx.reg & 1; s->tx.reg = (s->tx.reg >> 1) | (((s->tx.reg ^ (s->tx.reg >> s->shift)) & 1) << s->shift2); if (s->max_zeros) { /* This generator suppresses runs >s->max_zeros */ if (bit) { if (++s->tx.zeros > s->max_zeros) { s->tx.zeros = 0; bit ^= 1; } } else { s->tx.zeros = 0; } } bit ^= s->invert; break; case 2: if (s->tx.step_bit == 0) { s->tx.step_bit = 7; s->tx.reg = qbf[s->tx.step++]; if (s->tx.reg == 0) { s->tx.reg = 'V'; s->tx.step = 1; } } bit = s->tx.reg & 1; s->tx.reg >>= 1; s->tx.step_bit--; break; } s->tx.bits++; return bit; } /*- End of function --------------------------------------------------------*/ static void assess_error_rate(bert_state_t *s) { int i; int j; int sum; int test; /* We assess the error rate in decadic steps. For each decade we assess the error over 10 times the number of bits, to smooth the result. This means we assess the 1 in 100 rate based on 1000 bits (i.e. we look for >=10 errors in 1000 bits). We make an assessment every 100 bits, using a sliding window over the last 1000 bits. We assess the 1 in 1000 rate over 10000 bits in a similar way, and so on for the lower error rates. */ test = TRUE; for (i = 2; i <= 7; i++) { if (++s->decade_ptr[i] < 10) break; /* This decade has reached 10 snapshots, so we need to touch the next decade */ s->decade_ptr[i] = 0; /* Sum the last 10 snapshots from this decade, to see if we overflow into the next decade */ for (sum = 0, j = 0; j < 10; j++) sum += s->decade_bad[i][j]; if (test && sum > 10) { /* We overflow into the next decade */ test = FALSE; if (s->error_rate != i && s->reporter) s->reporter(s->user_data, BERT_REPORT_GT_10_2 + i - 2, &s->results); s->error_rate = i; } s->decade_bad[i][0] = 0; if (i < 7) s->decade_bad[i + 1][s->decade_ptr[i + 1]] = sum; } if (i > 7) { if (s->decade_ptr[i] >= 10) s->decade_ptr[i] = 0; if (test) { if (s->error_rate != i && s->reporter) s->reporter(s->user_data, BERT_REPORT_GT_10_2 + i - 2, &s->results); s->error_rate = i; } } else { s->decade_bad[i][s->decade_ptr[i]] = 0; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) bert_put_bit(bert_state_t *s, int bit) { if (bit < 0) { /* Special conditions */ printf("Status is %s (%d)\n", signal_status_to_str(bit), bit); return; } bit = (bit & 1) ^ s->invert; s->rx.bits++; switch (s->pattern_class) { case 0: if (s->rx.resync) { s->rx.reg = (s->rx.reg >> 1) | (bit << s->shift2); s->rx.ref_reg = (s->rx.ref_reg >> 1) | ((s->rx.ref_reg & 1) << s->shift2); if (s->rx.reg == s->rx.ref_reg) { if (++s->rx.resync > s->resync_time) { s->rx.resync = 0; if (s->reporter) s->reporter(s->user_data, BERT_REPORT_SYNCED, &s->results); } } else { s->rx.resync = 2; s->rx.ref_reg = s->rx.master_reg; } } else { s->results.total_bits++; if ((bit ^ s->rx.ref_reg) & 1) s->results.bad_bits++; s->rx.ref_reg = (s->rx.ref_reg >> 1) | ((s->rx.ref_reg & 1) << s->shift2); } break; case 1: if (s->rx.resync) { /* If we get a reasonable period for which we correctly predict the next bit, we must be in sync. */ /* Don't worry about max. zeros tests when resyncing. It might just extend the resync time a little. Trying to include the test might affect robustness. */ if (bit == (int) ((s->rx.reg >> s->shift) & 1)) { if (++s->rx.resync > s->resync_time) { s->rx.resync = 0; if (s->reporter) s->reporter(s->user_data, BERT_REPORT_SYNCED, &s->results); } } else { s->rx.resync = 2; s->rx.reg ^= s->mask; } } else { s->results.total_bits++; if (s->max_zeros) { /* This generator suppresses runs >s->max_zeros */ if ((s->rx.reg & s->mask)) { if (++s->rx.zeros > s->max_zeros) { s->rx.zeros = 0; bit ^= 1; } } else { s->rx.zeros = 0; } } if (bit != (int) ((s->rx.reg >> s->shift) & 1)) { s->results.bad_bits++; s->rx.resync_bad_bits++; s->decade_bad[2][s->decade_ptr[2]]++; } if (--s->rx.measurement_step <= 0) { /* Every hundred bits we need to do the error rate measurement */ s->rx.measurement_step = MEASUREMENT_STEP; assess_error_rate(s); } if (--s->rx.resync_cnt <= 0) { /* Check if there were enough bad bits during this period to justify a resync. */ if (s->rx.resync_bad_bits >= (s->rx.resync_len*s->rx.resync_percent)/100) { s->rx.resync = 1; s->results.resyncs++; if (s->reporter) s->reporter(s->user_data, BERT_REPORT_UNSYNCED, &s->results); } s->rx.resync_cnt = s->rx.resync_len; s->rx.resync_bad_bits = 0; } } s->rx.reg = (s->rx.reg >> 1) | (((s->rx.reg ^ (s->rx.reg >> s->shift)) & 1) << s->shift2); break; case 2: s->rx.reg = (s->rx.reg >> 1) | (bit << 6); /* TODO: There is no mechanism for synching yet. This only works if things start in sync. */ if (++s->rx.step_bit == 7) { s->rx.step_bit = 0; if ((int) s->rx.reg != qbf[s->rx.step]) { /* We need to work out the number of actual bad bits here. We need to look at the error rate, and see it a resync is needed. etc. */ s->results.bad_bits++; } if (qbf[++s->rx.step] == '\0') s->rx.step = 0; } s->results.total_bits++; break; } if (s->report_frequency > 0) { if (--s->rx.report_countdown <= 0) { if (s->reporter) s->reporter(s->user_data, BERT_REPORT_REGULAR, &s->results); s->rx.report_countdown = s->report_frequency; } } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) bert_result(bert_state_t *s, bert_results_t *results) { results->total_bits = s->results.total_bits; results->bad_bits = s->results.bad_bits; results->resyncs = s->results.resyncs; return sizeof(*results); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) bert_set_report(bert_state_t *s, int freq, bert_report_func_t reporter, void *user_data) { s->report_frequency = freq; s->reporter = reporter; s->user_data = user_data; s->rx.report_countdown = s->report_frequency; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(bert_state_t *) bert_init(bert_state_t *s, int limit, int pattern, int resync_len, int resync_percent) { int i; int j; if (s == NULL) { if ((s = (bert_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); s->pattern = pattern; s->limit = limit; s->reporter = NULL; s->user_data = NULL; s->report_frequency = 0; s->resync_time = 72; s->invert = 0; switch (s->pattern) { case BERT_PATTERN_ZEROS: s->tx.reg = 0; s->shift2 = 31; s->pattern_class = 0; break; case BERT_PATTERN_ONES: s->tx.reg = ~((uint32_t) 0); s->shift2 = 31; s->pattern_class = 0; break; case BERT_PATTERN_7_TO_1: s->tx.reg = 0xFEFEFEFE; s->shift2 = 31; s->pattern_class = 0; break; case BERT_PATTERN_3_TO_1: s->tx.reg = 0xEEEEEEEE; s->shift2 = 31; s->pattern_class = 0; break; case BERT_PATTERN_1_TO_1: s->tx.reg = 0xAAAAAAAA; s->shift2 = 31; s->pattern_class = 0; break; case BERT_PATTERN_1_TO_3: s->tx.reg = 0x11111111; s->shift2 = 31; s->pattern_class = 0; break; case BERT_PATTERN_1_TO_7: s->tx.reg = 0x01010101; s->shift2 = 31; s->pattern_class = 0; break; case BERT_PATTERN_QBF: s->tx.reg = 0; s->pattern_class = 2; break; case BERT_PATTERN_ITU_O151_23: s->pattern_class = 1; s->tx.reg = 0x7FFFFF; s->mask = 0x20; s->shift = 5; s->shift2 = 22; s->invert = 1; s->resync_time = 56; s->max_zeros = 0; break; case BERT_PATTERN_ITU_O151_20: s->pattern_class = 1; s->tx.reg = 0xFFFFF; s->mask = 0x8; s->shift = 3; s->shift2 = 19; s->invert = 1; s->resync_time = 50; s->max_zeros = 14; break; case BERT_PATTERN_ITU_O151_15: s->pattern_class = 1; s->tx.reg = 0x7FFF; s->mask = 0x2; s->shift = 1; s->shift2 = 14; s->invert = 1; s->resync_time = 40; s->max_zeros = 0; break; case BERT_PATTERN_ITU_O152_11: s->pattern_class = 1; s->tx.reg = 0x7FF; s->mask = 0x4; s->shift = 2; s->shift2 = 10; s->invert = 0; s->resync_time = 32; s->max_zeros = 0; break; case BERT_PATTERN_ITU_O153_9: s->pattern_class = 1; s->tx.reg = 0x1FF; s->mask = 0x10; s->shift = 4; s->shift2 = 8; s->invert = 0; s->resync_time = 28; s->max_zeros = 0; break; } s->tx.bits = 0; s->tx.step = 0; s->tx.step_bit = 0; s->tx.zeros = 0; s->rx.reg = s->tx.reg; s->rx.ref_reg = s->rx.reg; s->rx.master_reg = s->rx.ref_reg; s->rx.bits = 0; s->rx.step = 0; s->rx.step_bit = 0; s->rx.resync = 1; s->rx.resync_cnt = resync_len; s->rx.resync_bad_bits = 0; s->rx.resync_len = resync_len; s->rx.resync_percent = resync_percent; s->results.total_bits = 0; s->results.bad_bits = 0; s->results.resyncs = 0; s->rx.report_countdown = 0; for (i = 0; i < 8; i++) { for (j = 0; j < 10; j++) s->decade_bad[i][j] = 0; s->decade_ptr[i] = 0; } s->error_rate = 8; s->rx.measurement_step = MEASUREMENT_STEP; span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "BERT"); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) bert_release(bert_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) bert_free(bert_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/t35.c0000664000175000017500000010066412100765640011466 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t35.c - ITU T.35 FAX non-standard facility processing. * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * The NSF data tables are adapted from the NSF handling in HylaFAX, which * carries the following copyright notice: * * Created by Dmitry Bely, April 2000 * Copyright (c) 1994-1996 Sam Leffler * Copyright (c) 1994-1996 Silicon Graphics, Inc. * HylaFAX is a trademark of Silicon Graphics * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. * * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include "spandsp/telephony.h" #include "spandsp/bit_operations.h" #include "spandsp/t35.h" /*! NSF pattern for FAX machine identification */ typedef struct { /*! The number of bytes of the NSF byte string to match */ int model_id_size; /*! The NSF byte string to expect */ const char *model_id; /*! The model name of the FAX terminal */ const char *model_name; } model_data_t; /*! NSF pattern for identifying the manufacturer of a FAX machine */ typedef struct { /*! The vendor ID byte string */ const char *vendor_id; /*! The length of the vendor ID byte string */ int vendor_id_len; /*! The vendor's name */ const char *vendor_name; /*! TRUE if the station ID for this vendor is reversed */ int inverse_station_id_order; /*! A pointer to a list of known models from this vendor */ const model_data_t *known_models; } nsf_data_t; /*! T.35 country codes */ typedef struct { /*! The country's name */ const char *name; /*! A pointer to a list of known vendors from this country */ const nsf_data_t *vendors; } country_code_t; static const model_data_t Canon[] = { {5, "\x80\x00\x80\x48\x00", "Faxphone B640"}, {5, "\x80\x00\x80\x49\x10", "Fax B100"}, {5, "\x80\x00\x8A\x49\x10", "Laser Class 9000 Series"}, {5, "\x80\x00\x8A\x48\x00", "Laser Class 2060"}, {0, NULL, NULL} }; static const model_data_t Brother[] = { {9, "\x55\x55\x00\x88\x90\x80\x5F\x00\x15\x51", "Intellifax 770"}, {9, "\x55\x55\x00\x80\xB0\x80\x00\x00\x59\xD4", "Personal fax 190"}, {9, "\x55\x55\x00\x8C\x90\x80\xF0\x02\x20", "MFC-8600"}, {0, NULL, NULL} }; static const model_data_t Panasonic0E[] = { {10, "\x00\x00\x00\x96\x0F\x01\x02\x00\x10\x05\x02\x95\xC8\x08\x01\x49\x02\x41\x53\x54\x47", "KX-F90"}, {10, "\x00\x00\x00\x96\x0F\x01\x03\x00\x10\x05\x02\x95\xC8\x08\x01\x49\x02\x03", "KX-F230 or KX-FT21 or ..."}, {10, "\x00\x00\x00\x16\x0F\x01\x03\x00\x10\x05\x02\x95\xC8\x08", "KX-F780"}, {10, "\x00\x00\x00\x16\x0F\x01\x03\x00\x10\x00\x02\x95\x80\x08\x75\xB5", "KX-M260"}, {10, "\x00\x00\x00\x16\x0F\x01\x02\x00\x10\x05\x02\x85\xC8\x08\xAD", "KX-F2050BS"}, {0, NULL, NULL} }; static const model_data_t Panasonic79[] = { {10, "\x00\x00\x00\x02\x0F\x09\x12\x00\x10\x05\x02\x95\xC8\x88\x80\x80\x01", "UF-S10"}, {10, "\x00\x00\x00\x16\x7F\x09\x13\x00\x10\x05\x16\x8D\xC0\xD0\xF8\x80\x01", "/Siemens Fax 940"}, {10, "\x00\x00\x00\x16\x0F\x09\x13\x00\x10\x05\x06\x8D\xC0\x50\xCB", "Panafax UF-321"}, {0, NULL, NULL} }; static const model_data_t Ricoh[] = { {10, "\x00\x00\x00\x12\x10\x0D\x02\x00\x50\x00\x2A\xB8\x2C", "/Nashuatec P394"}, {0, NULL, NULL} }; static const model_data_t Samsung16[] = { {4, "\x00\x00\xA4\x01", "M545 6800"}, {0, NULL, NULL} }; static const model_data_t Samsung5A[] = { {4, "\x00\x00\xC0\x00", "SF-5100"}, {0, NULL, NULL} }; static const model_data_t Samsung8C[] = { {4, "\x00\x00\x01\x00", "SF-2010"}, {0, NULL, NULL} }; static const model_data_t SamsungA2[] = { {4, "\x00\x00\x80\x00", "FX-4000"}, {0, NULL, NULL} }; static const model_data_t Sanyo[] = { {10, "\x00\x00\x10\xB1\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x41\x26\xFF\xFF\x00\x00\x85\xA1", "SFX-107"}, {10, "\x00\x00\x00\xB1\x12\xF2\x62\xB4\x82\x0A\xF2\x2A\x12\xD2\xA2\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\x04\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x41\x4E\xFF\xFF\x00\x00", "MFP-510"}, {0, NULL, NULL} }; static const model_data_t HP[] = { {5, "\x20\x00\x45\x00\x0C\x04\x70\xCD\x4F\x00\x7F\x49", "LaserJet 3150"}, {5, "\x40\x80\x84\x01\xF0\x6A", "OfficeJet"}, {5, "\xC0\x00\x00\x00\x00", "OfficeJet 500"}, {5, "\xC0\x00\x00\x00\x00\x8B", "Fax-920"}, {0, NULL, NULL} }; static const model_data_t Sharp[] = { {32, "\x00\xCE\xB8\x80\x80\x11\x85\x0D\xDD\x00\x00\xDD\xDD\x00\x00\xDD\xDD\x00\x00\x00\x00\x00\x00\x00\x00\xED\x22\xB0\x00\x00\x90\x00", "Sharp F0-10"}, {33, "\x00\xCE\xB8\x80\x80\x11\x85\x0D\xDD\x00\x00\xDD\xDD\x00\x00\xDD\xDD\x00\x00\x00\x00\x00\x00\x00\x00\xED\x22\xB0\x00\x00\x90\x00\x8C", "Sharp UX-460"}, {33, "\x00\x4E\xB8\x80\x80\x11\x84\x0D\xDD\x00\x00\xDD\xDD\x00\x00\xDD\xDD\x00\x00\x00\x00\x00\x00\x00\x00\xED\x22\xB0\x00\x00\x90\x00\xAD", "Sharp UX-177"}, {33, "\x00\xCE\xB8\x00\x84\x0D\xDD\x00\x00\xDD\xDD\x00\x00\xDD\xDD\xDD\xDD\xDD\x02\x05\x28\x02\x22\x43\x29\xED\x23\x90\x00\x00\x90\x01\x00", "Sharp FO-4810"}, {0, NULL, NULL} }; static const model_data_t Xerox[] = { {10, "\x00\x08\x2D\x43\x57\x50\x61\x75\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x01\x1A\x02\x02\x10\x01\x82\x01\x30\x34", "635 Workcenter"}, {0, NULL, NULL} }; static const model_data_t XeroxDA[] = { {4, "\x00\x00\xC0\x00", "Workcentre Pro 580"}, {0, NULL, NULL} }; static const model_data_t Lexmark[] = { {4, "\x00\x80\xA0\x00", "X4270"}, {0, NULL, NULL} }; static const model_data_t JetFax[] = { {6, "\x01\x00\x45\x00\x0D\x7F", "M910e"}, {0, NULL, NULL} }; static const model_data_t PitneyBowes[] = { {6, "\x79\x91\xB1\xB8\x7A\xD8", "9550"}, {0, NULL, NULL} }; static const model_data_t Dialogic[] = { {8, "\x56\x8B\x06\x55\x00\x15\x00\x00", "VFX/40ESC"}, {0, NULL, NULL} }; static const model_data_t Muratec45[] = { {10, "\xF4\x91\xFF\xFF\xFF\x42\x2A\xBC\x01\x57", "M4700"}, {0, NULL, NULL} }; /* Muratec uses unregistered Japan code "00 00 48" */ static const model_data_t Muratec48[] = { {3, "\x53\x53\x61", "M620"}, {0, NULL, NULL} }; /* * Country code first byte, then manufacturer is last two bytes. See T.35. * Apparently Germany issued some manufacturer codes before the two-byte * standard was accepted, and so some few German manufacturers are * identified by a single manufacturer byte. * * T.30 5.3.6.2.7 (2003) states that the NSF FIF is transmitted * in MSB2LSB order. Revisions of T.30 prior to 2003 did not * contain explicit specification as to the transmit bit order. * (Although it did otherwise state that all HDLC frame data should * be in MSB order except as noted.) Because CSI, TSI, and other * prologue frames were in LSB order by way of an exception to the * general rule (T.30 5.3.6.2.4-11) many manufacturers assumed that * NSF should also be in LSB order. Consequently there will be * some country-code "masquerading" as a terminal may use the * proper country-code, but with an inverted bit order. * * Thus, country code x61 (Korea) turns into x86 (Papua New Guinea), * code xB5 (USA) turns into xAD (Tunisia), code x26 (China) turns * into x64 (Lebanon), code x04 (Germany) turns into x20 (Canada), * and code x3D (France) turns into xBC (Vietnam). * * For the most part it should be safe to identify a manufacturer * both with the MSB and LSB ordered bits, as the "masqueraded" country * is likely to not be actively assigning T.38 manufacturer codes. * However, some manufacturers (e.g. Microsoft) may use MSB for the * country code and LSB for the rest of the NSF, and so basically this * table must be verified and corrected against actual real-world * results. */ static const nsf_data_t vendor_00[] = { /* Japan */ {"\x00\x00", 2, "Unknown - indeterminate", TRUE, NULL}, {"\x00\x01", 2, "Anritsu", FALSE, NULL}, {"\x00\x02", 2, "Nippon Telephone", FALSE, NULL}, {"\x00\x05", 2, "Mitsuba Electric", FALSE, NULL}, {"\x00\x06", 2, "Master Net", FALSE, NULL}, {"\x00\x09", 2, "Xerox/Toshiba", TRUE, Xerox}, {"\x00\x0A", 2, "Kokusai", FALSE, NULL}, {"\x00\x0D", 2, "Logic System International", FALSE, NULL}, {"\x00\x0E", 2, "Panasonic", FALSE, Panasonic0E}, {"\x00\x11", 2, "Canon", FALSE, Canon}, {"\x00\x15", 2, "Toyotsushen Machinery", FALSE, NULL}, {"\x00\x16", 2, "System House Mind", FALSE, NULL}, {"\x00\x19", 2, "Xerox", TRUE, NULL}, {"\x00\x1D", 2, "Hitachi Software", FALSE, NULL}, {"\x00\x21", 2, "OKI Electric/Lanier", TRUE, NULL}, {"\x00\x25", 2, "Ricoh", TRUE, Ricoh}, {"\x00\x26", 2, "Konica", FALSE, NULL}, {"\x00\x29", 2, "Japan Wireless", FALSE, NULL}, {"\x00\x2D", 2, "Sony", FALSE, NULL}, {"\x00\x31", 2, "Sharp/Olivetti", FALSE, Sharp}, {"\x00\x35", 2, "Kogyu", FALSE, NULL}, {"\x00\x36", 2, "Japan Telecom", FALSE, NULL}, {"\x00\x3D", 2, "IBM Japan", FALSE, NULL}, {"\x00\x39", 2, "Panasonic", FALSE, NULL}, {"\x00\x41", 2, "Swasaki Communication", FALSE, NULL}, {"\x00\x45", 2, "Muratec", FALSE, Muratec45}, {"\x00\x46", 2, "Pheonix", FALSE, NULL}, {"\x00\x48", 2, "Muratec", FALSE, Muratec48}, /* Not registered */ {"\x00\x49", 2, "Japan Electric", FALSE, NULL}, {"\x00\x4D", 2, "Okura Electric", FALSE, NULL}, {"\x00\x51", 2, "Sanyo", FALSE, Sanyo}, {"\x00\x55", 2, "Unknown - Japan 55", FALSE, NULL}, {"\x00\x56", 2, "Brother", FALSE, Brother}, {"\x00\x59", 2, "Fujitsu", FALSE, NULL}, {"\x00\x5D", 2, "Kuoni", FALSE, NULL}, {"\x00\x61", 2, "Casio", FALSE, NULL}, {"\x00\x65", 2, "Tateishi Electric", FALSE, NULL}, {"\x00\x66", 2, "Utax/Mita", TRUE, NULL}, {"\x00\x69", 2, "Hitachi Production", FALSE, NULL}, {"\x00\x6D", 2, "Hitachi Telecom", FALSE, NULL}, {"\x00\x71", 2, "Tamura Electric Works", FALSE, NULL}, {"\x00\x75", 2, "Tokyo Electric Corp.", FALSE, NULL}, {"\x00\x76", 2, "Advance", FALSE, NULL}, {"\x00\x79", 2, "Panasonic", FALSE, Panasonic79}, {"\x00\x7D", 2, "Seiko", FALSE, NULL}, {"\x08\x00", 2, "Daiko", FALSE, NULL}, {"\x10\x00", 2, "Funai Electric", FALSE, NULL}, {"\x20\x00", 2, "Eagle System", FALSE, NULL}, {"\x30\x00", 2, "Nippon Business Systems", FALSE, NULL}, {"\x40\x00", 2, "Comtron", FALSE, NULL}, {"\x48\x00", 2, "Cosmo Consulting", FALSE, NULL}, {"\x50\x00", 2, "Orion Electric", FALSE, NULL}, {"\x60\x00", 2, "Nagano Nippon", FALSE, NULL}, {"\x70\x00", 2, "Kyocera", FALSE, NULL}, {"\x80\x00", 2, "Kanda Networks", FALSE, NULL}, {"\x88\x00", 2, "Soft Front", FALSE, NULL}, {"\x90\x00", 2, "Arctic", FALSE, NULL}, {"\xA0\x00", 2, "Nakushima", FALSE, NULL}, {"\xB0\x00", 2, "Minolta", FALSE, NULL}, {"\xC0\x00", 2, "Tohoku Pioneer", FALSE, NULL}, {"\xD0\x00", 2, "USC", FALSE, NULL}, {"\xE0\x00", 2, "Hiboshi", FALSE, NULL}, {"\xF0\x00", 2, "Sumitomo Electric", FALSE, NULL}, {NULL, 0, NULL, FALSE, NULL} }; static const nsf_data_t vendor_20[] = { /* Germany */ {"\x09", 1, "ITK Institut für Telekommunikation GmbH & Co KG", FALSE, NULL}, {"\x11", 1, "Dr. Neuhaus Mikroelektronik", FALSE, NULL}, {"\x21", 1, "ITO Communication", FALSE, NULL}, {"\x31", 1, "mbp Kommunikationssysteme GmbH", FALSE, NULL}, {"\x41", 1, "Siemens", FALSE, NULL}, {"\x42", 1, "Deutsche Telekom AG", FALSE, NULL}, {"\x51", 1, "mps Software", FALSE, NULL}, {"\x61", 1, "Hauni Elektronik", FALSE, NULL}, {"\x71", 1, "Digitronic computersysteme gmbh", FALSE, NULL}, {"\x81\x00", 2, "Innovaphone GmbH", FALSE, NULL}, {"\x81\x40", 2, "TEDAS Gesellschaft für Telekommunikations-, Daten- und Audiosysteme mbH", FALSE, NULL}, {"\x81\x80", 2, "AVM Audiovisuelles Marketing und Computersysteme GmbH", FALSE, NULL}, {"\x81\xC0", 2, "EICON Technology Research GmbH", FALSE, NULL}, {"\xB1", 1, "Schneider Rundfunkwerke AG", FALSE, NULL}, {"\xC2", 1, "Deutsche Telekom AG", FALSE, NULL}, {"\xD1", 1, "Ferrari electronik GmbH", FALSE, NULL}, {"\xF1", 1, "DeTeWe - Deutsche Telephonwerke AG & Co", FALSE, NULL}, {"\xFF", 1, "Germany Regional Code", FALSE, NULL}, {NULL, 0, NULL, FALSE, NULL} }; static const nsf_data_t vendor_64[] = { /* China (not Lebanon) */ {"\x00\x00", 2, "Unknown - China 00 00", FALSE, NULL}, {"\x01\x00", 2, "Unknown - China 01 00", FALSE, NULL}, {"\x01\x01", 2, "Unknown - China 01 01", FALSE, NULL}, {"\x01\x02", 2, "Unknown - China 01 02", FALSE, NULL}, {NULL, 0, NULL, FALSE, NULL} }; static const nsf_data_t vendor_61[] = { /* Korea */ {"\x00\x7A", 2, "Xerox", FALSE, NULL}, {NULL, 0, NULL, FALSE, NULL} }; static const nsf_data_t vendor_86[] = { /* Korea (not Papua New Guinea) */ {"\x00\x02", 2, "Unknown - Korea 02", FALSE, NULL}, {"\x00\x06", 2, "Unknown - Korea 06", FALSE, NULL}, {"\x00\x08", 2, "Unknown - Korea 08", FALSE, NULL}, {"\x00\x0A", 2, "Unknown - Korea 0A", FALSE, NULL}, {"\x00\x0E", 2, "Unknown - Korea 0E", FALSE, NULL}, {"\x00\x10", 2, "Samsung", FALSE, NULL}, {"\x00\x11", 2, "Unknown - Korea 11", FALSE, NULL}, {"\x00\x16", 2, "Samsung", FALSE, Samsung16}, {"\x00\x1A", 2, "Unknown - Korea 1A", FALSE, NULL}, {"\x00\x40", 2, "Unknown - Korea 40", FALSE, NULL}, {"\x00\x48", 2, "Unknown - Korea 48", FALSE, NULL}, {"\x00\x52", 2, "Unknown - Korea 52", FALSE, NULL}, {"\x00\x5A", 2, "Samsung", FALSE, Samsung5A}, {"\x00\x5E", 2, "Unknown - Korea 5E", FALSE, NULL}, {"\x00\x66", 2, "Unknown - Korea 66", FALSE, NULL}, {"\x00\x6E", 2, "Unknown - Korea 6E", FALSE, NULL}, {"\x00\x82", 2, "Unknown - Korea 82", FALSE, NULL}, {"\x00\x88", 2, "Unknown - Korea 88", FALSE, NULL}, {"\x00\x8A", 2, "Unknown - Korea 8A", FALSE, NULL}, {"\x00\x8C", 2, "Samsung", FALSE, Samsung8C}, {"\x00\x92", 2, "Unknown - Korea 92", FALSE, NULL}, {"\x00\x98", 2, "Samsung", FALSE, NULL}, {"\x00\xA2", 2, "Samsung", FALSE, SamsungA2}, {"\x00\xA4", 2, "Unknown - Korea A4", FALSE, NULL}, {"\x00\xC2", 2, "Samsung", FALSE, NULL}, {"\x00\xC9", 2, "Unknown - Korea C9", FALSE, NULL}, {"\x00\xCC", 2, "Unknown - Korea CC", FALSE, NULL}, {"\x00\xD2", 2, "Unknown - Korea D2", FALSE, NULL}, {"\x00\xDA", 2, "Xerox", FALSE, XeroxDA}, {"\x00\xE2", 2, "Unknown - Korea E2", FALSE, NULL}, {"\x00\xEC", 2, "Unknown - Korea EC", FALSE, NULL}, {"\x00\xEE", 2, "Unknown - Korea EE", FALSE, NULL}, {NULL, 0, NULL, FALSE, NULL} }; static const nsf_data_t vendor_bc[] = { /* France */ {"\x53\x01", 2, "Minolta", FALSE, NULL}, {NULL, 0, NULL, FALSE, NULL} }; static const nsf_data_t vendor_ad[] = { /* United States (not Tunisia) */ {"\x00\x00", 2, "Pitney Bowes", FALSE, PitneyBowes}, {"\x00\x0C", 2, "Dialogic", FALSE, NULL}, {"\x00\x15", 2, "Lexmark", FALSE, Lexmark}, {"\x00\x16", 2, "JetFax", FALSE, JetFax}, {"\x00\x24", 2, "Octel", FALSE, NULL}, {"\x00\x36", 2, "HP", FALSE, HP}, {"\x00\x42", 2, "FaxTalk", FALSE, NULL}, {"\x00\x44", 2, NULL, TRUE, NULL}, {"\x00\x46", 2, "BrookTrout", FALSE, NULL}, {"\x00\x51", 2, "Telogy Networks", FALSE, NULL}, {"\x00\x55", 2, "HylaFAX", FALSE, NULL}, {"\x00\x5C", 2, "IBM", FALSE, NULL}, {"\x00\x98", 2, "Unknown - USA 98", TRUE, NULL}, {NULL, 0, NULL, FALSE, NULL} }; static const nsf_data_t vendor_b4[] = { /* United Kingdom */ {"\x00\xB0", 2, "DCE", FALSE, NULL}, {"\x00\xB1", 2, "Hasler", FALSE, NULL}, {"\x00\xB2", 2, "Interquad", FALSE, NULL}, {"\x00\xB3", 2, "Comwave", FALSE, NULL}, {"\x00\xB4", 2, "Iconographic", FALSE, NULL}, {"\x00\xB5", 2, "Wordcraft", FALSE, NULL}, {"\x00\xB6", 2, "Acorn", FALSE, NULL}, {NULL, 0, NULL, FALSE, NULL} }; static const nsf_data_t vendor_b5[] = { /* United States */ {"\x00\x01", 2, "Picturetel", FALSE, NULL}, {"\x00\x20", 2, "Conexant", FALSE, NULL}, {"\x00\x22", 2, "Comsat", FALSE, NULL}, {"\x00\x24", 2, "Octel", FALSE, NULL}, {"\x00\x26", 2, "ROLM", FALSE, NULL}, {"\x00\x28", 2, "SOFNET", FALSE, NULL}, {"\x00\x29", 2, "TIA TR-29 Committee", FALSE, NULL}, {"\x00\x2A", 2, "STF Tech", FALSE, NULL}, {"\x00\x2C", 2, "HKB", FALSE, NULL}, {"\x00\x2E", 2, "Delrina", FALSE, NULL}, {"\x00\x30", 2, "Dialogic", FALSE, NULL}, {"\x00\x32", 2, "Applied Synergy", FALSE, NULL}, {"\x00\x34", 2, "Syncro Development", FALSE, NULL}, {"\x00\x36", 2, "Genoa", FALSE, NULL}, {"\x00\x38", 2, "Texas Instruments", FALSE, NULL}, {"\x00\x3A", 2, "IBM", FALSE, NULL}, {"\x00\x3C", 2, "ViaSat", FALSE, NULL}, {"\x00\x3E", 2, "Ericsson", FALSE, NULL}, {"\x00\x42", 2, "Bogosian", FALSE, NULL}, {"\x00\x44", 2, "Adobe", FALSE, NULL}, {"\x00\x46", 2, "Fremont Communications", FALSE, NULL}, {"\x00\x48", 2, "Hayes", FALSE, NULL}, {"\x00\x4A", 2, "Lucent", FALSE, NULL}, {"\x00\x4C", 2, "Data Race", FALSE, NULL}, {"\x00\x4E", 2, "TRW", FALSE, NULL}, {"\x00\x52", 2, "Audiofax", FALSE, NULL}, {"\x00\x54", 2, "Computer Automation", FALSE, NULL}, {"\x00\x56", 2, "Serca", FALSE, NULL}, {"\x00\x58", 2, "Octocom", FALSE, NULL}, {"\x00\x5C", 2, "Power Solutions", FALSE, NULL}, {"\x00\x5A", 2, "Digital Sound", FALSE, NULL}, {"\x00\x5E", 2, "Pacific Data", FALSE, NULL}, {"\x00\x60", 2, "Commetrex", FALSE, NULL}, {"\x00\x62", 2, "BrookTrout", FALSE, NULL}, {"\x00\x64", 2, "Gammalink", FALSE, NULL}, {"\x00\x66", 2, "Castelle", FALSE, NULL}, {"\x00\x68", 2, "Hybrid Fax", FALSE, NULL}, {"\x00\x6A", 2, "Omnifax", FALSE, NULL}, {"\x00\x6C", 2, "HP", FALSE, NULL}, {"\x00\x6E", 2, "Microsoft", FALSE, NULL}, {"\x00\x72", 2, "Speaking Devices", FALSE, NULL}, {"\x00\x74", 2, "Compaq", FALSE, NULL}, {"\x00\x76", 2, "Microsoft", FALSE, NULL}, /* uses LSB for country but MSB for manufacturer */ {"\x00\x78", 2, "Cylink", FALSE, NULL}, {"\x00\x7A", 2, "Pitney Bowes", FALSE, NULL}, {"\x00\x7C", 2, "Digiboard", FALSE, NULL}, {"\x00\x7E", 2, "Codex", FALSE, NULL}, {"\x00\x82", 2, "Wang Labs", FALSE, NULL}, {"\x00\x84", 2, "Netexpress Communications", FALSE, NULL}, {"\x00\x86", 2, "Cable-Sat", FALSE, NULL}, {"\x00\x88", 2, "MFPA", FALSE, NULL}, {"\x00\x8A", 2, "Telogy Networks", FALSE, NULL}, {"\x00\x8E", 2, "Telecom Multimedia Systems", FALSE, NULL}, {"\x00\x8C", 2, "AT&T", FALSE, NULL}, {"\x00\x92", 2, "Nuera", FALSE, NULL}, {"\x00\x94", 2, "K56flex", FALSE, NULL}, {"\x00\x96", 2, "MiBridge", FALSE, NULL}, {"\x00\x98", 2, "Xerox", FALSE, NULL}, {"\x00\x9A", 2, "Fujitsu", FALSE, NULL}, {"\x00\x9B", 2, "Fujitsu", FALSE, NULL}, {"\x00\x9C", 2, "Natural Microsystems", FALSE, NULL}, {"\x00\x9E", 2, "CopyTele", FALSE, NULL}, {"\x00\xA2", 2, "Murata", FALSE, NULL}, {"\x00\xA4", 2, "Lanier", FALSE, NULL}, {"\x00\xA6", 2, "Qualcomm", FALSE, NULL}, {"\x00\xAA", 2, "HylaFAX", FALSE, NULL}, {NULL, 0, NULL, FALSE, NULL} }; static const country_code_t t35_country_codes[255] = { {"Japan", vendor_00}, /* 0x00 */ {"Albania", NULL}, {"Algeria", NULL}, {"American Samoa", NULL}, {"Germany", NULL}, {"Anguilla", NULL}, {"Antigua and Barbuda", NULL}, {"Argentina", NULL}, {"Ascension (see S. Helena)", NULL}, {"Australia", NULL}, {"Austria", NULL}, {"Bahamas", NULL}, {"Bahrain", NULL}, {"Bangladesh", NULL}, {"Barbados", NULL}, {"Belgium", NULL}, {"Belize", NULL}, /* 0x10 */ {"Benin (Republic of)", NULL}, {"Bermudas", NULL}, {"Bhutan (Kingdom of)", NULL}, {"Bolivia", NULL}, {"Botswana", NULL}, {"Brazil", NULL}, {"British Antarctic Territory", NULL}, {"British Indian Ocean Territory", NULL}, {"British Virgin Islands", NULL}, {"Brunei Darussalam", NULL}, {"Bulgaria", NULL}, {"Myanmar (Union of)", NULL}, {"Burundi", NULL}, {"Byelorussia", NULL}, {"Cameroon", NULL}, {"Canada", vendor_20}, /* 0x20 */ {"Cape Verde", NULL}, {"Cayman Islands", NULL}, {"Central African Republic", NULL}, {"Chad", NULL}, {"Chile", NULL}, {"China", NULL}, {"Colombia", NULL}, {"Comoros", NULL}, {"Congo", NULL}, {"Cook Islands", NULL}, {"Costa Rica", NULL}, {"Cuba", NULL}, {"Cyprus", NULL}, {"Czech and Slovak Federal Republic", NULL}, /* 0x30 */ {"Cambodia", NULL}, {"Democratic People's Republic of Korea", NULL}, {"Denmark", NULL}, {"Djibouti", NULL}, {"Dominican Republic", NULL}, {"Dominica", NULL}, {"Ecuador", NULL}, {"Egypt", NULL}, {"El Salvador", NULL}, {"Equatorial Guinea", NULL}, {"Ethiopia", NULL}, {"Falkland Islands", NULL}, {"Fiji", NULL}, {"Finland", NULL}, {"France", NULL}, {"French Polynesia", NULL}, {"French Southern and Antarctic Lands", NULL}, {"Gabon", NULL}, /* 0x40 */ {"Gambia", NULL}, {"Germany (Federal Republic of)", NULL}, {"Angola", NULL}, {"Ghana", NULL}, {"Gibraltar", NULL}, {"Greece", NULL}, {"Grenada", NULL}, {"Guam", NULL}, {"Guatemala", NULL}, {"Guernsey", NULL}, {"Guinea", NULL}, {"Guinea-Bissau", NULL}, {"Guayana", NULL}, {"Haiti", NULL}, {"Honduras", NULL}, {"Hong Kong", NULL}, /* 0x50 */ {"Hungary (Republic of)", NULL}, {"Iceland", NULL}, {"India", NULL}, {"Indonesia", NULL}, {"Iran (Islamic Republic of)", NULL}, {"Iraq", NULL}, {"Ireland", NULL}, {"Israel", NULL}, {"Italy", NULL}, {"Cote d'Ivoire", NULL}, {"Jamaica", NULL}, {"Afghanistan", NULL}, {"Jersey", NULL}, {"Jordan", NULL}, {"Kenya", NULL}, {"Kiribati", NULL}, /* 0x60 */ {"Korea (Republic of)", vendor_61}, {"Kuwait", NULL}, {"Lao (People's Democratic Republic)", NULL}, {"Lebanon", vendor_64}, {"Lesotho", NULL}, {"Liberia", NULL}, {"Libya", NULL}, {"Liechtenstein", NULL}, {"Luxembourg", NULL}, {"Macau", NULL}, {"Madagascar", NULL}, {"Malaysia", NULL}, {"Malawi", NULL}, {"Maldives", NULL}, {"Mali", NULL}, {"Malta", NULL}, /* 0x70 */ {"Mauritania", NULL}, {"Mauritius", NULL}, {"Mexico", NULL}, {"Monaco", NULL}, {"Mongolia", NULL}, {"Montserrat", NULL}, {"Morocco", NULL}, {"Mozambique", NULL}, {"Nauru", NULL}, {"Nepal", NULL}, {"Netherlands", NULL}, {"Netherlands Antilles", NULL}, {"New Caledonia", NULL}, {"New Zealand", NULL}, {"Nicaragua", NULL}, {"Niger", NULL}, /* 0x80 */ {"Nigeria", NULL}, {"Norway", NULL}, {"Oman", NULL}, {"Pakistan", NULL}, {"Panama", NULL}, {"Papua New Guinea", vendor_86}, {"Paraguay", NULL}, {"Peru", NULL}, {"Philippines", NULL}, {"Poland (Republic of)", NULL}, {"Portugal", NULL}, {"Puerto Rico", NULL}, {"Qatar", NULL}, {"Romania", NULL}, {"Rwanda", NULL}, {"Saint Kitts and Nevis", NULL}, /* 0x90 */ {"Saint Croix", NULL}, {"Saint Helena and Ascension", NULL}, {"Saint Lucia", NULL}, {"San Marino", NULL}, {"Saint Thomas", NULL}, {"Sao Tome and Principe", NULL}, {"Saint Vincent and the Grenadines", NULL}, {"Saudi Arabia", NULL}, {"Senegal", NULL}, {"Seychelles", NULL}, {"Sierra Leone", NULL}, {"Singapore", NULL}, {"Solomon Islands", NULL}, {"Somalia", NULL}, {"South Africa", NULL}, {"Spain", NULL}, /* 0xA0 */ {"Sri Lanka", NULL}, {"Sudan", NULL}, {"Suriname", NULL}, {"Swaziland", NULL}, {"Sweden", NULL}, {"Switzerland", NULL}, {"Syria", NULL}, {"Tanzania", NULL}, {"Thailand", NULL}, {"Togo", NULL}, {"Tonga", NULL}, {"Trinidad and Tobago", NULL}, {"Tunisia", vendor_ad}, {"Turkey", NULL}, {"Turks and Caicos Islands", NULL}, {"Tuvalu", NULL}, /* 0xB0 */ {"Uganda", NULL}, {"Ukraine", NULL}, {"United Arab Emirates", NULL}, {"United Kingdom", vendor_b4}, {"United States", vendor_b5}, {"Burkina Faso", NULL}, {"Uruguay", NULL}, {"U.S.S.R.", NULL}, {"Vanuatu", NULL}, {"Vatican City State", NULL}, {"Venezuela", NULL}, {"Viet Nam", NULL}, {"Wallis and Futuna", NULL}, {"Western Samoa", NULL}, {"Yemen (Republic of)", NULL}, {"Yemen (Republic of)", NULL}, /* 0xC0 */ {"Yugoslavia", NULL}, {"Zaire", NULL}, {"Zambia", NULL}, {"Zimbabwe", NULL}, {"Slovakia", NULL}, {"Slovenia", NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, /* 0xD0 */ {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, /* 0xE0 */ {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, /* 0xF0 */ {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {NULL, NULL}, {"Lithuania", NULL}, {"Latvia", NULL}, {"Estonia", NULL}, {"US Virgin Islands", NULL}, {NULL, NULL}, {NULL, NULL}, {"(Universal)", NULL}, {"Taiwan", NULL} }; SPAN_DECLARE(int) t35_real_country_code(int country_code, int country_code_extension) { if (country_code < 0 || country_code > 0xFF) return -1; if (country_code == 0xFF) { /* The extension code gives us the country. */ /* Right now there are no extension codes defined by the ITU */ return -1; } /* We need to apply realism over accuracy, though it blocks out some countries. It is very rare to find a machine from any country but the following: Japan 0x00 (no confusion) Germany 0x04 (0x20) (Canada/Germany confusion) China 0x26 (0x64) (China/Lebanon confusion) Korea 0x61 (0x86) (Korea/Papua New Guinea confusion) UK 0xB4 (0x2D) (UK/Cyprus confusion) USA 0xB5 (0xAD) (USA/Tunisia confusion) France 0x3D (0xBC) (France/Vietnam confusion) If we force the most likely of the two possible countries (forward or bit reversed), the only mixup with any realistic probability is the Canada/Germany confusion. We will just live with this, and force the more likely countries. */ switch (country_code) { case 0x20: /* Force Germany */ case 0x2D: /* Force UK */ case 0x64: /* Force China */ case 0x86: /* Force Korea */ case 0xAD: /* Force USA */ case 0xBC: /* Force France */ country_code = bit_reverse8(country_code); break; } /* Try the country code at face value, then bit reversed */ if (t35_country_codes[country_code].name) return country_code; /* If the country code is missing, its most likely the country code is reversed. */ country_code = bit_reverse8(country_code); if (t35_country_codes[country_code].name) return country_code; return -1; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t35_real_country_code_to_str(int country_code, int country_code_extension) { int real_code; if ((real_code = t35_real_country_code(country_code, country_code_extension)) >= 0) return t35_country_codes[real_code].name; return NULL; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t35_country_code_to_str(int country_code, int country_code_extension) { if (country_code < 0 || country_code > 0xFF) return NULL; if (country_code == 0xFF) { /* The extension code gives us the country. */ /* Right now there are no extension codes defined by the ITU */ return NULL; } return t35_country_codes[country_code].name; } /*- End of function --------------------------------------------------------*/ static const nsf_data_t *find_vendor(const uint8_t *msg, int len) { const nsf_data_t *vendors; const nsf_data_t *p; int real_country_code; if (msg[0] < 0 || msg[0] > 0xFF) return NULL; if (msg[0] == 0xFF) { /* The extension code gives us the country. */ /* Right now there are no extension codes defined by the ITU */ return NULL; } if ((real_country_code = t35_real_country_code(msg[0], msg[1])) < 0) return NULL; if ((vendors = t35_country_codes[msg[0]].vendors) == NULL) return NULL; for (p = vendors; p->vendor_id; p++) { if (len >= p->vendor_id_len && memcmp(p->vendor_id, &msg[1], p->vendor_id_len) == 0) { return p; } } return NULL; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t35_vendor_to_str(const uint8_t *msg, int len) { const nsf_data_t *p; if ((p = find_vendor(msg, len)) == NULL) return NULL; return p->vendor_name; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t35_decode(const uint8_t *msg, int len, const char **country, const char **vendor, const char **model) { const nsf_data_t *p; const model_data_t *pp; if (country) *country = t35_real_country_code_to_str(msg[0], msg[1]); if (vendor) *vendor = NULL; if (model) *model = NULL; if ((p = find_vendor(msg, len)) == NULL) return FALSE; if (vendor) *vendor = p->vendor_name; if (model && p->known_models) { for (pp = p->known_models; pp->model_id; pp++) { if (len == 1 + p->vendor_id_len + pp->model_id_size && memcmp(&msg[1 + p->vendor_id_len], pp->model_id, pp->model_id_size) == 0) { *model = pp->model_name; break; } } } return TRUE; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/gsm0610_preprocess.c0000664000175000017500000001030712100747737014416 00000000000000/* * SpanDSP - a series of DSP components for telephony * * gsm0610_preprocess.c - GSM 06.10 full rate speech codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * This code is based on the widely used GSM 06.10 code available from * http://kbs.cs.tu-berlin.de/~jutta/toast.html */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/bitstream.h" #include "spandsp/saturated.h" #include "spandsp/gsm0610.h" #include "gsm0610_local.h" /* 4.2.0 .. 4.2.3 PREPROCESSING SECTION After A-law to linear conversion (or directly from the A to D converter) the following scaling is assumed for input to the RPE-LTP algorithm: in: 0.1.....................12 S.v.v.v.v.v.v.v.v.v.v.v.v.*.*.* Where S is the sign bit, v a valid bit, and * a "don't care" bit. The original signal is called sop[..] out: 0.1................... 12 S.S.v.v.v.v.v.v.v.v.v.v.v.v.0.0 */ void gsm0610_preprocess(gsm0610_state_t *s, const int16_t amp[GSM0610_FRAME_LEN], int16_t so[GSM0610_FRAME_LEN]) { int16_t z1; int16_t mp; int16_t s1; int16_t msp; int16_t SO; int32_t L_z2; int32_t L_s2; int32_t L_temp; #if !defined(__GNUC__) int16_t lsp; #endif int k; z1 = s->z1; L_z2 = s->L_z2; mp = s->mp; for (k = 0; k < GSM0610_FRAME_LEN; k++) { /* 4.2.1 Downscaling of the input signal */ SO = (amp[k] >> 1) & ~3; /* This is supposed to have been downscaled by previous routine. */ assert(SO >= -0x4000); assert(SO <= 0x3FFC); /* 4.2.2 Offset compensation */ /* This part implements a high-pass filter and requires extended arithmetic precision for the recursive part of this filter. The input of this procedure is the array so[0...159] and the output the array sof[0...159]. */ /* Compute the non-recursive part */ s1 = SO - z1; z1 = SO; assert(s1 != INT16_MIN); /* Compute the recursive part */ L_s2 = s1; L_s2 <<= 15; /* Perform a 31 by 16 bits multiplication */ #if defined(__GNUC__) L_z2 = ((int64_t) L_z2*32735 + 0x4000) >> 15; /* Alternate (ANSI) version of below line does slightly different rounding: * L_temp = L_z2 >> 9; * L_temp += L_temp >> 5; * L_temp = (++L_temp) >> 1; * L_z2 = L_z2 - L_temp; */ L_z2 = saturated_add32(L_z2, L_s2); #else /* This does L_z2 = L_z2 * 0x7FD5/0x8000 + L_s2 */ msp = (int16_t) (L_z2 >> 15); lsp = (int16_t) (L_z2 - ((int32_t) msp << 15)); L_s2 += gsm_mult_r(lsp, 32735); L_temp = (int32_t) msp*32735; L_z2 = saturated_add32(L_temp, L_s2); #endif /* Compute sof[k] with rounding */ L_temp = saturated_add32(L_z2, 16384); /* 4.2.3 Preemphasis */ msp = gsm_mult_r(mp, -28180); mp = (int16_t) (L_temp >> 15); so[k] = saturated_add16(mp, msp); } /*endfor*/ s->z1 = z1; s->L_z2 = L_z2; s->mp = mp; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/v29tx.c0000664000175000017500000003217312343627707012060 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v29tx.c - ITU V.29 modem transmit part * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/logging.h" #include "spandsp/complex.h" #include "spandsp/vector_float.h" #include "spandsp/complex_vector_float.h" #include "spandsp/vector_int.h" #include "spandsp/complex_vector_int.h" #include "spandsp/async.h" #include "spandsp/dds.h" #include "spandsp/power_meter.h" #include "spandsp/v29tx.h" #include "spandsp/private/logging.h" #include "spandsp/private/v29tx.h" #include "v29tx_constellation_maps.h" #if defined(SPANDSP_USE_FIXED_POINT) #include "v29tx_fixed_rrc.h" #else #include "v29tx_floating_rrc.h" #endif /*! The nominal frequency of the carrier, in Hertz */ #define CARRIER_NOMINAL_FREQ 1700.0f /* Segments of the training sequence */ /*! The start of the optional TEP, that may preceed the actual training, in symbols */ #define V29_TRAINING_SEG_TEP 0 /*! The start of training segment 1, in symbols */ #define V29_TRAINING_SEG_1 (V29_TRAINING_SEG_TEP + 480) /*! The start of training segment 2, in symbols */ #define V29_TRAINING_SEG_2 (V29_TRAINING_SEG_1 + 48) /*! The start of training segment 3, in symbols */ #define V29_TRAINING_SEG_3 (V29_TRAINING_SEG_2 + 128) /*! The start of training segment 4, in symbols */ #define V29_TRAINING_SEG_4 (V29_TRAINING_SEG_3 + 384) /*! The end of the training, in symbols */ #define V29_TRAINING_END (V29_TRAINING_SEG_4 + 48) /*! The end of the shutdown sequence, in symbols */ #define V29_TRAINING_SHUTDOWN_END (V29_TRAINING_END + 32) static int fake_get_bit(void *user_data) { return 1; } /*- End of function --------------------------------------------------------*/ static __inline__ int get_scrambled_bit(v29_tx_state_t *s) { int bit; int out_bit; if ((bit = s->current_get_bit(s->get_bit_user_data)) == SIG_STATUS_END_OF_DATA) { /* End of real data. Switch to the fake get_bit routine, until we have shut down completely. */ if (s->status_handler) s->status_handler(s->status_user_data, SIG_STATUS_END_OF_DATA); s->current_get_bit = fake_get_bit; s->in_training = TRUE; bit = 1; } out_bit = (bit ^ (s->scramble_reg >> (18 - 1)) ^ (s->scramble_reg >> (23 - 1))) & 1; s->scramble_reg = (s->scramble_reg << 1) | out_bit; return out_bit; } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINT) static __inline__ complexi16_t getbaud(v29_tx_state_t *s) #else static __inline__ complexf_t getbaud(v29_tx_state_t *s) #endif { static const int phase_steps_9600[8] = { 1, 0, 2, 3, 6, 7, 5, 4 }; static const int phase_steps_4800[4] = { 0, 2, 6, 4 }; #if defined(SPANDSP_USE_FIXED_POINT) static const complexi16_t zero = {0, 0}; #else static const complexf_t zero = {0.0f, 0.0f}; #endif int bits; int amp; int bit; if (s->in_training) { /* Send the training sequence */ if (++s->training_step <= V29_TRAINING_SEG_4) { if (s->training_step <= V29_TRAINING_SEG_3) { if (s->training_step <= V29_TRAINING_SEG_1) { /* Optional segment: Unmodulated carrier (talker echo protection) */ return v29_9600_constellation[0]; } if (s->training_step <= V29_TRAINING_SEG_2) { /* Segment 1: silence */ return zero; } /* Segment 2: ABAB... */ return v29_abab_constellation[(s->training_step & 1) + s->training_offset]; } /* Segment 3: CDCD... */ /* Apply the 1 + x^-6 + x^-7 training scrambler */ bit = s->training_scramble_reg & 1; s->training_scramble_reg >>= 1; s->training_scramble_reg |= (((bit ^ s->training_scramble_reg) & 1) << 6); return v29_cdcd_constellation[bit + s->training_offset]; } /* We should be in the block of test ones, or shutdown ones, if we get here. */ /* There is no graceful shutdown procedure defined for V.29. Just send some ones, to ensure we get the real data bits through, even with bad ISI. */ if (s->training_step == V29_TRAINING_END + 1) { /* Switch from the fake get_bit routine, to the user supplied real one, and we are up and running. */ s->current_get_bit = s->get_bit; s->in_training = FALSE; } if (s->training_step == V29_TRAINING_SHUTDOWN_END) { if (s->status_handler) s->status_handler(s->status_user_data, SIG_STATUS_SHUTDOWN_COMPLETE); } } /* 9600bps uses the full constellation. 7200bps uses only the first half of the full constellation. 4800bps uses the smaller constellation. */ amp = 0; /* We only use an amplitude bit at 9600bps */ if (s->bit_rate == 9600 && get_scrambled_bit(s)) amp = 8; /*endif*/ bits = get_scrambled_bit(s); bits = (bits << 1) | get_scrambled_bit(s); if (s->bit_rate == 4800) { bits = phase_steps_4800[bits]; } else { bits = (bits << 1) | get_scrambled_bit(s); bits = phase_steps_9600[bits]; } s->constellation_state = (s->constellation_state + bits) & 7; return v29_9600_constellation[amp | s->constellation_state]; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) v29_tx(v29_tx_state_t *s, int16_t amp[], int len) { #if defined(SPANDSP_USE_FIXED_POINT) complexi_t x; complexi_t z; #else complexf_t x; complexf_t z; #endif int i; int sample; if (s->training_step >= V29_TRAINING_SHUTDOWN_END) { /* Once we have sent the shutdown symbols, we stop sending completely. */ return 0; } for (sample = 0; sample < len; sample++) { if ((s->baud_phase += 3) >= 10) { s->baud_phase -= 10; s->rrc_filter[s->rrc_filter_step] = s->rrc_filter[s->rrc_filter_step + V29_TX_FILTER_STEPS] = getbaud(s); if (++s->rrc_filter_step >= V29_TX_FILTER_STEPS) s->rrc_filter_step = 0; } /* Root raised cosine pulse shaping at baseband */ #if defined(SPANDSP_USE_FIXED_POINT) x = complex_seti(0, 0); for (i = 0; i < V29_TX_FILTER_STEPS; i++) { x.re += (int32_t) tx_pulseshaper[TX_PULSESHAPER_COEFF_SETS - 1 - s->baud_phase][i]*(int32_t) s->rrc_filter[i + s->rrc_filter_step].re; x.im += (int32_t) tx_pulseshaper[TX_PULSESHAPER_COEFF_SETS - 1 - s->baud_phase][i]*(int32_t) s->rrc_filter[i + s->rrc_filter_step].im; } /* Now create and modulate the carrier */ x.re >>= 4; x.im >>= 4; z = dds_complexi(&s->carrier_phase, s->carrier_phase_rate); /* Don't bother saturating. We should never clip. */ i = (x.re*z.re - x.im*z.im) >> 15; amp[sample] = (int16_t) ((i*s->gain) >> 15); #else x = complex_setf(0.0f, 0.0f); for (i = 0; i < V29_TX_FILTER_STEPS; i++) { x.re += tx_pulseshaper[TX_PULSESHAPER_COEFF_SETS - 1 - s->baud_phase][i]*s->rrc_filter[i + s->rrc_filter_step].re; x.im += tx_pulseshaper[TX_PULSESHAPER_COEFF_SETS - 1 - s->baud_phase][i]*s->rrc_filter[i + s->rrc_filter_step].im; } /* Now create and modulate the carrier */ z = dds_complexf(&s->carrier_phase, s->carrier_phase_rate); /* Don't bother saturating. We should never clip. */ amp[sample] = (int16_t) lfastrintf((x.re*z.re - x.im*z.im)*s->gain); #endif } return sample; } /*- End of function --------------------------------------------------------*/ static void set_working_gain(v29_tx_state_t *s) { #if defined(SPANDSP_USE_FIXED_POINT) switch (s->bit_rate) { case 9600: s->gain = 0.387f*s->base_gain*16.0f*32767.0f/30672.52f; break; case 7200: s->gain = 0.605f*s->base_gain*16.0f*32767.0f/30672.52f; break; case 4800: s->gain = 0.470f*s->base_gain*16.0f*32767.0f/30672.52f; break; default: break; } #else switch (s->bit_rate) { case 9600: s->gain = 0.387f*s->base_gain; break; case 7200: s->gain = 0.605f*s->base_gain; break; case 4800: s->gain = 0.470f*s->base_gain; break; default: break; } #endif } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v29_tx_power(v29_tx_state_t *s, float power) { /* The constellation does not maintain constant average power as we change bit rates. We need to scale the gain we get here by a bit rate specific scaling factor each time we restart the modem. */ s->base_gain = powf(10.0f, (power - DBM0_MAX_POWER)/20.0f)*32768.0f/TX_PULSESHAPER_GAIN; set_working_gain(s); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v29_tx_set_get_bit(v29_tx_state_t *s, get_bit_func_t get_bit, void *user_data) { if (s->get_bit == s->current_get_bit) s->current_get_bit = get_bit; s->get_bit = get_bit; s->get_bit_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v29_tx_set_modem_status_handler(v29_tx_state_t *s, modem_status_func_t handler, void *user_data) { s->status_handler = handler; s->status_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) v29_tx_get_logging_state(v29_tx_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v29_tx_restart(v29_tx_state_t *s, int bit_rate, int tep) { span_log(&s->logging, SPAN_LOG_FLOW, "Restarting V.29\n"); s->bit_rate = bit_rate; set_working_gain(s); switch (s->bit_rate) { case 9600: s->training_offset = 0; break; case 7200: s->training_offset = 2; break; case 4800: s->training_offset = 4; break; default: return -1; } #if defined(SPANDSP_USE_FIXED_POINT) cvec_zeroi16(s->rrc_filter, sizeof(s->rrc_filter)/sizeof(s->rrc_filter[0])); #else cvec_zerof(s->rrc_filter, sizeof(s->rrc_filter)/sizeof(s->rrc_filter[0])); #endif s->rrc_filter_step = 0; s->scramble_reg = 0; s->training_scramble_reg = 0x2A; s->in_training = TRUE; s->training_step = (tep) ? V29_TRAINING_SEG_TEP : V29_TRAINING_SEG_1; s->carrier_phase = 0; s->baud_phase = 0; s->constellation_state = 0; s->current_get_bit = fake_get_bit; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(v29_tx_state_t *) v29_tx_init(v29_tx_state_t *s, int bit_rate, int tep, get_bit_func_t get_bit, void *user_data) { switch (bit_rate) { case 9600: case 7200: case 4800: break; default: return NULL; } if (s == NULL) { if ((s = (v29_tx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "V.29 TX"); s->get_bit = get_bit; s->get_bit_user_data = user_data; s->carrier_phase_rate = DDS_PHASE_RATE(CARRIER_NOMINAL_FREQ); v29_tx_power(s, -14.0f); v29_tx_restart(s, bit_rate, tep); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v29_tx_release(v29_tx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v29_tx_free(v29_tx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/ademco_contactid.c0000664000175000017500000013712212101002711014312 00000000000000/* * SpanDSP - a series of DSP components for telephony * * ademco_contactid.c - Ademco ContactID alarm protocol * * Written by Steve Underwood * * Copyright (C) 2012 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include #include #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/logging.h" #include "spandsp/queue.h" #include "spandsp/complex.h" #include "spandsp/dds.h" #include "spandsp/power_meter.h" #include "spandsp/async.h" #include "spandsp/vector_float.h" #include "spandsp/complex_vector_float.h" #include "spandsp/vector_int.h" #include "spandsp/complex_vector_int.h" #include "spandsp/tone_detect.h" #include "spandsp/tone_generate.h" #include "spandsp/super_tone_rx.h" #include "spandsp/dtmf.h" #include "spandsp/ademco_contactid.h" #include "spandsp/private/logging.h" #include "spandsp/private/queue.h" #include "spandsp/private/tone_detect.h" #include "spandsp/private/tone_generate.h" #include "spandsp/private/dtmf.h" #include "spandsp/private/ademco_contactid.h" /* Ademco ContactID Protocol Answer Wait 0.5s to 2s for the line to settle Send 1400Hz for 100ms Send silence for 100ms Send 2300Hz for 100ms Receiver now waits (both timing and frequency errors specified as 3%, but sender side should accept these tones with 5% frequency error.) Sender waits 250-300ms after end of 2300Hz tone Send ACCT MT QXYZ GG CCC ACCT = 4 digit account code (0-9, B-F) MT = 2 digit message type (18 preferred, 98 optional) Q = 1 digit event qualifier. 1 = New event or opening. 3 = New restore or closing. 6 = Previous condition still present XYZ = 3 digit event code (0-9, B-F) GG = 2 digit group or partition number (0-9, B-F). 00=no specific group CCC = 3 digit zone number (event reports) or user number (open/close reports). 000=no specific zone or user information S = 1 digit hex checksum (sum all message digits + S) mod 15 == 0 DTMF tones are 50-60ms on 50-60ms off 0 10 (counted as 10 in checksum calculations) 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 B (*) 11 C (#) 12 D (A) 13 E (B) 14 F (C) 15 DTMF D is not used Wait 1.25s for a kiss-off tone Detect at least 400ms of kissoff to be valid, then wait for end of tone Wait 250-300ms before sending the next DTMF message If kissoff doesn't start within 1.25s of the end of the DTMF, repeat the DTMF message Receiver sends 750-1000ms of 1400Hz as the kissoff tone Sender shall make 4 attempts before giving up. One successful kissoff resets the attempt counter */ struct ademco_code_s { int code; const char *name; int data_type; }; static const struct ademco_code_s ademco_codes[] = { {0x100, "Medical", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x101, "Personal emergency", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x102, "Fail to report in", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x110, "Fire", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x111, "Smoke", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x112, "Combustion", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x113, "Water flow", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x114, "Heat", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x115, "Pull station", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x116, "Duct", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x117, "Flame", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x118, "Near alarm", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x120, "Panic", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x121, "Duress", ADEMCO_CONTACTID_DATA_IS_USER}, {0x122, "Silent", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x123, "Audible", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x124, "Duress - Access granted", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x125, "Duress - Egress granted", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x130, "Burglary", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x131, "Perimeter", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x132, "Interior", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x133, "24 hour (safe)", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x134, "Entry/Exit", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x135, "Day/Night", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x136, "Outdoor", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x137, "Tamper", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x138, "Near alarm", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x139, "Intrusion verifier", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x140, "General alarm", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x141, "Polling loop open", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x142, "Polling loop short", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x143, "Expansion module failure", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x144, "Sensor tamper", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x145, "Expansion module tamper", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x146, "Silent burglary", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x147, "Sensor supervision failure", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x150, "24 hour non-burglary", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x151, "Gas detected", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x152, "Refrigeration", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x153, "Loss of heat", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x154, "Water leakage", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x155, "Foil break", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x156, "Day trouble", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x157, "Low bottled gas level", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x158, "High temp", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x159, "Low temp", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x161, "Loss of air flow", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x162, "Carbon monoxide detected", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x163, "Tank level", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x200, "Fire supervisory", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x201, "Low water pressure", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x202, "Low CO2", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x203, "Gate valve sensor", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x204, "Low water level", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x205, "Pump activated", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x206, "Pump failure", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x300, "System trouble", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x301, "AC loss", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x302, "Low system battery", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x303, "RAM checksum bad", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x304, "ROM checksum bad", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x305, "System reset", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x306, "Panel programming changed", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x307, "Self-test failure", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x308, "System shutdown", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x309, "Battery test failure", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x310, "Ground fault", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x311, "Battery missing/dead", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x312, "Power supply overcurrent", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x313, "Engineer reset", ADEMCO_CONTACTID_DATA_IS_USER}, {0x320, "Sounder/relay", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x321, "Bell 1", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x322, "Bell 2", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x323, "Alarm relay", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x324, "Trouble relay", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x325, "Reversing relay", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x326, "Notification appliance ckt. #3", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x327, "Notification appliance ckt. #4", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x330, "System peripheral trouble", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x331, "Polling loop open", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x332, "Polling loop short", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x333, "Expansion module failure", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x334, "Repeater failure", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x335, "Local printer out of paper", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x336, "Local printer failure", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x337, "Exp. module DC loss", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x338, "Exp. module low battery", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x339, "Exp. module reset", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x341, "Exp. module tamper", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x342, "Exp. module AC loss", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x343, "Exp. module self-test fail", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x344, "RF receiver jam detect", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x350, "Communication trouble", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x351, "Telco 1 fault", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x352, "Telco 2 fault", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x353, "Long range radio transmitter fault", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x354, "Failure to communicate event", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x355, "Loss of radio supervision", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x356, "Loss of central polling", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x357, "Long range radio VSWR problem", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x370, "Protection loop", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x371, "Protection loop open", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x372, "Protection loop short", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x373, "Fire trouble", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x374, "Exit error alarm (zone)", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x375, "Panic zone trouble", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x376, "Hold-up zone trouble", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x377, "Swinger trouble", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x378, "Cross-zone trouble", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x380, "Sensor trouble", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x381, "Loss of supervision - RF", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x382, "Loss of supervision - RPM", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x383, "Sensor tamper", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x384, "RF low battery", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x385, "Smoke detector high sensitivity", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x386, "Smoke detector low sensitivity", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x387, "Intrusion detector high sensitivity", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x388, "Intrusion detector low sensitivity", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x389, "Sensor self-test failure", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x391, "Sensor Watch trouble", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x392, "Drift compensation error", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x393, "Maintenance alert", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x400, "Open/Close", ADEMCO_CONTACTID_DATA_IS_USER}, {0x401, "O/C by user", ADEMCO_CONTACTID_DATA_IS_USER}, {0x402, "Group O/C", ADEMCO_CONTACTID_DATA_IS_USER}, {0x403, "Automatic O/C", ADEMCO_CONTACTID_DATA_IS_USER}, {0x404, "Late to O/C", ADEMCO_CONTACTID_DATA_IS_USER}, {0x405, "Deferred O/C", ADEMCO_CONTACTID_DATA_IS_USER}, {0x406, "Cancel", ADEMCO_CONTACTID_DATA_IS_USER}, {0x407, "Remote arm/disarm", ADEMCO_CONTACTID_DATA_IS_USER}, {0x408, "Quick arm", ADEMCO_CONTACTID_DATA_IS_USER}, {0x409, "Keyswitch O/C", ADEMCO_CONTACTID_DATA_IS_USER}, {0x441, "Armed STAY", ADEMCO_CONTACTID_DATA_IS_USER}, {0x442, "Keyswitch Armed STAY", ADEMCO_CONTACTID_DATA_IS_USER}, {0x450, "Exception O/C", ADEMCO_CONTACTID_DATA_IS_USER}, {0x451, "Early O/C", ADEMCO_CONTACTID_DATA_IS_USER}, {0x452, "Late O/C", ADEMCO_CONTACTID_DATA_IS_USER}, {0x453, "Failed to open", ADEMCO_CONTACTID_DATA_IS_USER}, {0x454, "Failed to close", ADEMCO_CONTACTID_DATA_IS_USER}, {0x455, "Auto-arm failed", ADEMCO_CONTACTID_DATA_IS_USER}, {0x456, "Partial arm", ADEMCO_CONTACTID_DATA_IS_USER}, {0x457, "Exit error (user)", ADEMCO_CONTACTID_DATA_IS_USER}, {0x458, "User on Premises", ADEMCO_CONTACTID_DATA_IS_USER}, {0x459, "Recent close", ADEMCO_CONTACTID_DATA_IS_USER}, {0x461, "Wrong code entry", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x462, "Legal code entry", ADEMCO_CONTACTID_DATA_IS_USER}, {0x463, "Re-arm after alarm", ADEMCO_CONTACTID_DATA_IS_USER}, {0x464, "Auto-arm time extended", ADEMCO_CONTACTID_DATA_IS_USER}, {0x465, "Panic alarm reset", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x466, "Service on/off premises", ADEMCO_CONTACTID_DATA_IS_USER}, {0x411, "Callback request made", ADEMCO_CONTACTID_DATA_IS_USER}, {0x412, "Successful download/access", ADEMCO_CONTACTID_DATA_IS_USER}, {0x413, "Unsuccessful access", ADEMCO_CONTACTID_DATA_IS_USER}, {0x414, "System shutdown command received", ADEMCO_CONTACTID_DATA_IS_USER}, {0x415, "Dialer shutdown command received", ADEMCO_CONTACTID_DATA_IS_USER}, {0x416, "Successful Upload", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x421, "Access denied", ADEMCO_CONTACTID_DATA_IS_USER}, {0x422, "Access report by user", ADEMCO_CONTACTID_DATA_IS_USER}, {0x423, "Forced Access", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x424, "Egress Denied", ADEMCO_CONTACTID_DATA_IS_USER}, {0x425, "Egress Granted", ADEMCO_CONTACTID_DATA_IS_USER}, {0x426, "Access Door propped open", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x427, "Access point door status monitor trouble", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x428, "Access point request to exit trouble", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x429, "Access program mode entry", ADEMCO_CONTACTID_DATA_IS_USER}, {0x430, "Access program mode exit", ADEMCO_CONTACTID_DATA_IS_USER}, {0x431, "Access threat level change", ADEMCO_CONTACTID_DATA_IS_USER}, {0x432, "Access relay/trigger fail", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x433, "Access RTE shunt", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x434, "Access DSM shunt", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x501, "Access reader disable", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x520, "Sounder/Relay disable", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x521, "Bell 1 disable", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x522, "Bell 2 disable", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x523, "Alarm relay disable", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x524, "Trouble relay disable", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x525, "Reversing relay disable", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x526, "Notification appliance ckt. #3 disable", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x527, "Notification appliance ckt. #4 disable", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x531, "Module added", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x532, "Module removed", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x551, "Dialer disabled", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x552, "Radio transmitter disabled", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x553, "Remote upload/download disabled", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x570, "Zone/Sensor bypass", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x571, "Fire bypass", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x572, "24 hour zone bypass", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x573, "Burg. bypass", ADEMCO_CONTACTID_DATA_IS_USER}, {0x574, "Group bypass", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x575, "Swinger bypass", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x576, "Access zone shunt", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x577, "Access point bypass", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x601, "Manual trigger test report", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x602, "Periodic test report", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x603, "Periodic RF transmission", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x604, "Fire test", ADEMCO_CONTACTID_DATA_IS_USER}, {0x605, "Status report to follow", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x606, "Listen-in to follow", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x607, "Walk test mode", ADEMCO_CONTACTID_DATA_IS_USER}, {0x608, "Periodic test - system trouble present", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x609, "Video transmitter active", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x611, "Point tested OK", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x612, "Point not tested", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x613, "Intrusion zone walk tested", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x614, "Fire zone walk tested", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x615, "Panic zone walk tested", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x616, "Service request", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x621, "Event log reset", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x622, "Event log 50% full", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x623, "Event log 90% full", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x624, "Event log overflow", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x625, "Time/Date reset", ADEMCO_CONTACTID_DATA_IS_USER}, {0x626, "Time/Date inaccurate", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x627, "Program mode entry", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x628, "Program mode exit", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x629, "32 hour event log marker", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x630, "Schedule change", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x631, "Exception schedule change", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x632, "Access schedule change", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x641, "Senior watch trouble", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x642, "Latch-key supervision", ADEMCO_CONTACTID_DATA_IS_USER}, {0x651, "Reserved for Ademco use", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x652, "Reserved for Ademco use", ADEMCO_CONTACTID_DATA_IS_USER}, {0x653, "Reserved for Ademco use", ADEMCO_CONTACTID_DATA_IS_USER}, {0x654, "System inactivity", ADEMCO_CONTACTID_DATA_IS_ZONE}, {0x900, "Download abort", ADEMCO_CONTACTID_DATA_IS_USER}, {0x901, "Download start/end", ADEMCO_CONTACTID_DATA_IS_USER}, {0x902, "Download interrupted", ADEMCO_CONTACTID_DATA_IS_USER}, {0x910, "Auto-close with bypass", ADEMCO_CONTACTID_DATA_IS_USER}, {0x911, "Bypass closing", ADEMCO_CONTACTID_DATA_IS_USER}, {0x999, "32 hour no read of event log", ADEMCO_CONTACTID_DATA_IS_USER}, {-1, "???"} }; #if defined(SPANDSP_USE_FIXED_POINT) #define GOERTZEL_SAMPLES_PER_BLOCK 55 /* We need to detect over a +-5% range */ #define DETECTION_THRESHOLD 16439 /* -42dBm0 [((GOERTZEL_SAMPLES_PER_BLOCK*GOERTZEL_SAMPLES_PER_BLOCK*32768.0/(1.4142*128.0))*10^((-42 - DBM0_MAX_SINE_POWER)/20.0))^2] */ #define TONE_TWIST 4 /* 6dB */ #define TONE_TO_TOTAL_ENERGY 64 /* -3dB */ #else #define GOERTZEL_SAMPLES_PER_BLOCK 55 /* We need to detect over a +-5% range */ #define DETECTION_THRESHOLD 2104205.6f /* -42dBm0 [((GOERTZEL_SAMPLES_PER_BLOCK*GOERTZEL_SAMPLES_PER_BLOCK*32768.0/1.4142)*10^((-42 - DBM0_MAX_SINE_POWER)/20.0))^2] */ #define TONE_TWIST 3.981f /* 6dB */ #define TONE_TO_TOTAL_ENERGY 1.995f /* 3dB */ #endif static goertzel_descriptor_t tone_1400_desc; static goertzel_descriptor_t tone_2300_desc; SPAN_DECLARE(int) encode_msg(char buf[], const ademco_contactid_report_t *report) { char *s; int sum; int x; static const char remap[] = {'D', '*', '#', 'A', 'B', 'C'}; sprintf(buf, "%04X%02X%1X%03X%02X%03X", report->acct, report->mt, report->q, report->xyz, report->gg, report->ccc); for (sum = 0, s = buf; *s; s++) { if (*s == 'A') return -1; if (*s > '9') { x = *s - ('A' - 10); /* Remap the Ademco B-F digits to normal DTMF *#ABC digits */ *s = remap[x - 10]; } else { x = *s - '0'; if (x == 0) x = 10; } sum += x; } sum = ((sum + 15)/15)*15 - sum; if (sum == 0) sum = 'C'; else if (sum <= 9) sum += '0'; else sum = remap[sum - 10]; *s++ = sum; *s = '\0'; return s - buf; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) decode_msg(ademco_contactid_report_t *report, const char buf[]) { const char *s; char *t; int sum; int x; char buf2[20]; /* We need to remap normal DTMF (0-0, *, #, A-D) to Ademco's psuedo-hex (0-0, B-F, nothing for A) and calculate the checksum */ for (sum = 0, s = buf, t = buf2; *s; s++, t++) { x = *s; switch (x) { case '*': x = 'B'; break; case '#': x = 'C'; break; case 'A': x = 'D'; break; case 'B': x = 'E'; break; case 'C': x = 'F'; break; case 'D': /* This should not happen in the Ademco protocol */ x = 'A'; break; default: x = *s; break; } *t = x; if (x > '9') { x -= ('B' - 11); } else { if (x == '0') x = 10; else x -= '0'; } sum += x; } *t = '\0'; if (sum%15 != 0) return -1; if (sscanf(buf2, "%04x%02x%1x%03x%02x%03x", &report->acct, &report->mt, &report->q, &report->xyz, &report->gg, &report->ccc) != 6) return -1; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) ademco_contactid_msg_qualifier_to_str(int q) { switch (q) { case ADEMCO_CONTACTID_QUALIFIER_NEW_EVENT: return "New event"; case ADEMCO_CONTACTID_QUALIFIER_NEW_RESTORE: return "New restore"; case ADEMCO_CONTACTID_QUALIFIER_STATUS_REPORT: return "Status report"; } return "???"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) ademco_contactid_event_to_str(int xyz) { int entry; for (entry = 0; ademco_codes[entry].code >= 0; entry++) { if (xyz == ademco_codes[entry].code) return ademco_codes[entry].name; } return "???"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) ademco_contactid_receiver_log_msg(ademco_contactid_receiver_state_t *s, const ademco_contactid_report_t *report) { const char *t; span_log(&s->logging, SPAN_LOG_FLOW, "Ademco Contact ID message:\n"); span_log(&s->logging, SPAN_LOG_FLOW, " Account %X\n", report->acct); switch (report->mt) { case ADEMCO_CONTACTID_MESSAGE_TYPE_18: case ADEMCO_CONTACTID_MESSAGE_TYPE_98: t = "Contact ID"; break; default: t = "???"; break; } span_log(&s->logging, SPAN_LOG_FLOW, " Message type %s (%X)\n", t, report->mt); t = ademco_contactid_msg_qualifier_to_str(report->q); span_log(&s->logging, SPAN_LOG_FLOW, " Qualifier %s (%X)\n", t, report->q); t = ademco_contactid_event_to_str(report->xyz); span_log(&s->logging, SPAN_LOG_FLOW, " Event %s (%X)\n", t, report->xyz); span_log(&s->logging, SPAN_LOG_FLOW, " Group/partition %X\n", report->gg); span_log(&s->logging, SPAN_LOG_FLOW, " User/Zone information %X\n", report->ccc); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) ademco_contactid_receiver_tx(ademco_contactid_receiver_state_t *s, int16_t amp[], int max_samples) { int i; int samples; switch (s->step) { case 0: samples = (s->remaining_samples > max_samples) ? max_samples : s->remaining_samples; vec_zeroi16(amp, samples); s->remaining_samples -= samples; if (s->remaining_samples > 0) return samples; span_log(&s->logging, SPAN_LOG_FLOW, "Initial silence finished\n"); s->step++; s->tone_phase_rate = dds_phase_rate(1400.0); s->tone_level = dds_scaling_dbm0(-11); s->tone_phase = 0; s->remaining_samples = ms_to_samples(100); return samples; case 1: samples = (s->remaining_samples > max_samples) ? max_samples : s->remaining_samples; for (i = 0; i < samples; i++) amp[i] = dds_mod(&s->tone_phase, s->tone_phase_rate, s->tone_level, 0); s->remaining_samples -= samples; if (s->remaining_samples > 0) return samples; span_log(&s->logging, SPAN_LOG_FLOW, "1400Hz tone finished\n"); s->step++; s->remaining_samples = ms_to_samples(100); return samples; case 2: samples = (s->remaining_samples > max_samples) ? max_samples : s->remaining_samples; vec_zeroi16(amp, samples); s->remaining_samples -= samples; if (s->remaining_samples > 0) return samples; span_log(&s->logging, SPAN_LOG_FLOW, "Second silence finished\n"); s->step++; s->tone_phase_rate = dds_phase_rate(2300.0); s->tone_level = dds_scaling_dbm0(-11); s->tone_phase = 0; s->remaining_samples = ms_to_samples(100); return samples; case 3: samples = (s->remaining_samples > max_samples) ? max_samples : s->remaining_samples; for (i = 0; i < samples; i++) amp[i] = dds_mod(&s->tone_phase, s->tone_phase_rate, s->tone_level, 0); s->remaining_samples -= samples; if (s->remaining_samples > 0) return samples; span_log(&s->logging, SPAN_LOG_FLOW, "2300Hz tone finished\n"); s->step++; s->remaining_samples = ms_to_samples(100); return samples; case 4: /* Idle here, waiting for a response */ return 0; case 5: samples = (s->remaining_samples > max_samples) ? max_samples : s->remaining_samples; vec_zeroi16(amp, samples); s->remaining_samples -= samples; if (s->remaining_samples > 0) return samples; span_log(&s->logging, SPAN_LOG_FLOW, "Sending kissoff\n"); s->step++; s->tone_phase_rate = dds_phase_rate(1400.0); s->tone_level = dds_scaling_dbm0(-11); s->tone_phase = 0; s->remaining_samples = ms_to_samples(850); return samples; case 6: samples = (s->remaining_samples > max_samples) ? max_samples : s->remaining_samples; for (i = 0; i < samples; i++) amp[i] = dds_mod(&s->tone_phase, s->tone_phase_rate, s->tone_level, 0); s->remaining_samples -= samples; if (s->remaining_samples > 0) return samples; span_log(&s->logging, SPAN_LOG_FLOW, "1400Hz tone finished\n"); s->step = 4; s->remaining_samples = ms_to_samples(100); return samples; } return max_samples; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) ademco_contactid_receiver_rx(ademco_contactid_receiver_state_t *s, const int16_t amp[], int samples) { return dtmf_rx(&s->dtmf, amp, samples); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) ademco_contactid_receiver_fillin(ademco_contactid_receiver_state_t *s, int samples) { return dtmf_rx_fillin(&s->dtmf, samples); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) ademco_contactid_receiver_get_logging_state(ademco_contactid_receiver_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ static void dtmf_digit_delivery(void *user_data, const char *digits, int len) { ademco_contactid_receiver_state_t *s; ademco_contactid_report_t report; s = (ademco_contactid_receiver_state_t *) user_data; memcpy(&s->rx_digits[s->rx_digits_len], digits, len); s->rx_digits_len += len; if (s->rx_digits_len == 16) { s->rx_digits[16] = '\0'; if (decode_msg(&report, s->rx_digits) == 0) { ademco_contactid_receiver_log_msg(s, &report); if (s->callback) s->callback(s->callback_user_data, &report); s->step++; } s->rx_digits_len = 0; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) ademco_contactid_receiver_set_realtime_callback(ademco_contactid_receiver_state_t *s, ademco_contactid_report_func_t callback, void *user_data) { s->callback = callback; s->callback_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(ademco_contactid_receiver_state_t *) ademco_contactid_receiver_init(ademco_contactid_receiver_state_t *s, ademco_contactid_report_func_t callback, void *user_data) { if (s == NULL) { if ((s = (ademco_contactid_receiver_state_t *) malloc(sizeof (*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "Ademco"); dtmf_rx_init(&s->dtmf, dtmf_digit_delivery, (void *) s); s->rx_digits_len = 0; s->callback = callback; s->callback_user_data = user_data; s->step = 0; s->remaining_samples = ms_to_samples(500); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) ademco_contactid_receiver_release(ademco_contactid_receiver_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) ademco_contactid_receiver_free(ademco_contactid_receiver_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) ademco_contactid_sender_tx(ademco_contactid_sender_state_t *s, int16_t amp[], int max_samples) { int sample; int samples; for (sample = 0; sample < max_samples; sample += samples) { switch (s->step) { case 0: if (!s->clear_to_send) return 0; s->clear_to_send = FALSE; s->step++; s->remaining_samples = ms_to_samples(250); /* Fall through */ case 1: samples = (s->remaining_samples > (max_samples - sample)) ? (max_samples - sample) : s->remaining_samples; vec_zeroi16(&[sample], samples); s->remaining_samples -= samples; if (s->remaining_samples > 0) return samples; span_log(&s->logging, SPAN_LOG_FLOW, "Pre-send silence finished\n"); s->step++; break; case 2: samples = dtmf_tx(&s->dtmf, &[sample], max_samples - sample); if (samples == 0) { s->clear_to_send = FALSE; s->step = 0; return sample; } break; default: return sample; } } return sample; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) ademco_contactid_sender_rx(ademco_contactid_sender_state_t *s, const int16_t amp[], int samples) { #if defined(SPANDSP_USE_FIXED_POINT) int32_t energy_1400; int32_t energy_2300; int16_t xamp; #else float energy_1400; float energy_2300; float xamp; #endif int sample; int limit; int hit; int j; for (sample = 0; sample < samples; sample = limit) { if ((samples - sample) >= (GOERTZEL_SAMPLES_PER_BLOCK - s->current_sample)) limit = sample + (GOERTZEL_SAMPLES_PER_BLOCK - s->current_sample); else limit = samples; for (j = sample; j < limit; j++) { xamp = amp[j]; xamp = goertzel_preadjust_amp(xamp); #if defined(SPANDSP_USE_FIXED_POINT) s->energy += ((int32_t) xamp*xamp); #else s->energy += xamp*xamp; #endif goertzel_samplex(&s->tone_1400, xamp); goertzel_samplex(&s->tone_2300, xamp); } s->current_sample += (limit - sample); if (s->current_sample < GOERTZEL_SAMPLES_PER_BLOCK) continue; energy_1400 = goertzel_result(&s->tone_1400); energy_2300 = goertzel_result(&s->tone_2300); hit = 0; if (energy_1400 > DETECTION_THRESHOLD || energy_2300 > DETECTION_THRESHOLD) { if (energy_1400 > energy_2300) { if (energy_1400 > TONE_TO_TOTAL_ENERGY*s->energy) hit = 1; } else { if (energy_2300 > TONE_TO_TOTAL_ENERGY*s->energy) hit = 2; } } if (hit != s->in_tone && hit == s->last_hit) { /* We have two successive indications that something has changed to a specific new state. */ switch (s->tone_state) { case 0: if (hit == 1) { span_log(&s->logging, SPAN_LOG_FLOW, "Receiving initial 1400Hz\n"); s->in_tone = hit; s->tone_state = 1; s->duration = 0; } break; case 1: /* We are looking for a burst of 1400Hz which is 100ms +- 5% long */ if (hit == 0) { if (s->duration < ms_to_samples(70) || s->duration > ms_to_samples(130)) { span_log(&s->logging, SPAN_LOG_FLOW, "Bad initial 1400Hz tone duration\n"); s->tone_state = 0; } else { span_log(&s->logging, SPAN_LOG_FLOW, "Received 1400Hz tone\n"); s->tone_state = 2; } s->in_tone = hit; s->duration = 0; } break; case 2: /* We are looking for 100ms +-5% of silence after the 1400Hz tone */ if (s->duration < ms_to_samples(70) || s->duration > ms_to_samples(130)) { span_log(&s->logging, SPAN_LOG_FLOW, "Bad silence length\n"); s->tone_state = 0; s->in_tone = hit; } else if (hit == 2) { span_log(&s->logging, SPAN_LOG_FLOW, "Received silence\n"); s->tone_state = 3; s->in_tone = hit; } else { s->tone_state = 0; s->in_tone = 0; } s->duration = 0; break; case 3: /* We are looking for a burst of 2300Hz which is 100ms +- 5% long */ if (hit == 0) { if (s->duration < ms_to_samples(70) || s->duration > ms_to_samples(130)) { span_log(&s->logging, SPAN_LOG_FLOW, "Bad initial 2300Hz tone duration\n"); s->tone_state = 0; } else { span_log(&s->logging, SPAN_LOG_FLOW, "Received 2300Hz\n"); if (s->callback) s->callback(s->callback_user_data, -1, 0, 0); s->tone_state = 4; /* Release the transmit side, and it will time the 250ms post tone delay */ s->clear_to_send = TRUE; s->tries = 0; if (s->tx_digits_len) s->timer = ms_to_samples(3000); } s->in_tone = hit; s->duration = 0; } break; case 4: if (hit == 1) { span_log(&s->logging, SPAN_LOG_FLOW, "Receiving kissoff\n"); s->tone_state = 5; s->in_tone = hit; s->duration = 0; } break; case 5: if (hit == 0) { s->busy = FALSE; if (s->duration < ms_to_samples(400) || s->duration > ms_to_samples(1500)) { span_log(&s->logging, SPAN_LOG_FLOW, "Bad kissoff duration %d\n", s->duration); if (++s->tries < 4) { dtmf_tx_put(&s->dtmf, s->tx_digits, s->tx_digits_len); s->timer = ms_to_samples(3000); s->tone_state = 4; } else { s->timer = 0; if (s->callback) s->callback(s->callback_user_data, FALSE, 0, 0); } } else { span_log(&s->logging, SPAN_LOG_FLOW, "Received good kissoff\n"); s->clear_to_send = TRUE; s->tx_digits_len = 0; if (s->callback) s->callback(s->callback_user_data, TRUE, 0, 0); s->tone_state = 4; s->clear_to_send = TRUE; s->tries = 0; if (s->tx_digits_len) s->timer = ms_to_samples(3000); } s->in_tone = hit; s->duration = 0; } break; } } s->last_hit = hit; s->duration += GOERTZEL_SAMPLES_PER_BLOCK; if (s->timer > 0) { s->timer -= GOERTZEL_SAMPLES_PER_BLOCK; if (s->timer <= 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Timer expired\n"); if (s->tone_state == 4 && s->tx_digits_len) { if (++s->tries < 4) { dtmf_tx_put(&s->dtmf, s->tx_digits, s->tx_digits_len); s->timer = ms_to_samples(3000); } else { s->timer = 0; if (s->callback) s->callback(s->callback_user_data, FALSE, 0, 0); } } } } s->energy = 0; s->current_sample = 0; } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) ademco_contactid_sender_fillin(ademco_contactid_sender_state_t *s, int samples) { /* Restart any Goertzel and energy gathering operation we might be in the middle of. */ goertzel_reset(&s->tone_1400); goertzel_reset(&s->tone_2300); #if defined(SPANDSP_USE_FIXED_POINT) s->energy = 0; #else s->energy = 0.0f; #endif s->current_sample = 0; /* Don't update the hit detection. Pretend it never happened. */ /* TODO: Surely we can be cleverer than this. */ return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) ademco_contactid_sender_put(ademco_contactid_sender_state_t *s, const ademco_contactid_report_t *report) { if (s->busy) return -1; if ((s->tx_digits_len = encode_msg(s->tx_digits, report)) < 0) return -1; s->busy = TRUE; return dtmf_tx_put(&s->dtmf, s->tx_digits, s->tx_digits_len); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) ademco_contactid_sender_get_logging_state(ademco_contactid_sender_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) ademco_contactid_sender_set_realtime_callback(ademco_contactid_sender_state_t *s, tone_report_func_t callback, void *user_data) { s->callback = callback; s->callback_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(ademco_contactid_sender_state_t *) ademco_contactid_sender_init(ademco_contactid_sender_state_t *s, tone_report_func_t callback, void *user_data) { static int initialised = FALSE; if (s == NULL) { if ((s = (ademco_contactid_sender_state_t *) malloc(sizeof (*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "Ademco"); if (!initialised) { make_goertzel_descriptor(&tone_1400_desc, 1400.0f, GOERTZEL_SAMPLES_PER_BLOCK); make_goertzel_descriptor(&tone_2300_desc, 2300.0f, GOERTZEL_SAMPLES_PER_BLOCK); } goertzel_init(&s->tone_1400, &tone_1400_desc); goertzel_init(&s->tone_2300, &tone_2300_desc); s->current_sample = 0; s->callback = callback; s->callback_user_data = user_data; s->step = 0; s->remaining_samples = ms_to_samples(100); dtmf_tx_init(&s->dtmf); /* The specified timing is 50-60ms on, 50-60ms off */ dtmf_tx_set_timing(&s->dtmf, 55, 55); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) ademco_contactid_sender_release(ademco_contactid_sender_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) ademco_contactid_sender_free(ademco_contactid_sender_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/plc.c0000664000175000017500000002027612100557773011637 00000000000000/* * SpanDSP - a series of DSP components for telephony * * plc.c * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/saturated.h" #include "spandsp/plc.h" /* We do a straight line fade to zero volume in 50ms when we are filling in for missing data. */ #define ATTENUATION_INCREMENT 0.0025f /* Attenuation per sample */ static void save_history(plc_state_t *s, int16_t *buf, int len) { if (len >= PLC_HISTORY_LEN) { /* Just keep the last part of the new data, starting at the beginning of the buffer */ memcpy(s->history, buf + len - PLC_HISTORY_LEN, sizeof(int16_t)*PLC_HISTORY_LEN); s->buf_ptr = 0; return; } if (s->buf_ptr + len > PLC_HISTORY_LEN) { /* Wraps around - must break into two sections */ memcpy(s->history + s->buf_ptr, buf, sizeof(int16_t)*(PLC_HISTORY_LEN - s->buf_ptr)); len -= (PLC_HISTORY_LEN - s->buf_ptr); memcpy(s->history, buf + (PLC_HISTORY_LEN - s->buf_ptr), sizeof(int16_t)*len); s->buf_ptr = len; return; } /* Can use just one section */ memcpy(s->history + s->buf_ptr, buf, sizeof(int16_t)*len); s->buf_ptr += len; } /*- End of function --------------------------------------------------------*/ static __inline__ void normalise_history(plc_state_t *s) { int16_t tmp[PLC_HISTORY_LEN]; if (s->buf_ptr == 0) return; memcpy(tmp, s->history, sizeof(int16_t)*s->buf_ptr); memcpy(s->history, s->history + s->buf_ptr, sizeof(int16_t)*(PLC_HISTORY_LEN - s->buf_ptr)); memcpy(s->history + PLC_HISTORY_LEN - s->buf_ptr, tmp, sizeof(int16_t)*s->buf_ptr); s->buf_ptr = 0; } /*- End of function --------------------------------------------------------*/ static __inline__ int amdf_pitch(int min_pitch, int max_pitch, int16_t amp[], int len) { int i; int j; int acc; int min_acc; int pitch; pitch = min_pitch; min_acc = INT_MAX; for (i = max_pitch; i <= min_pitch; i++) { acc = 0; for (j = 0; j < len; j++) acc += abs(amp[i + j] - amp[j]); if (acc < min_acc) { min_acc = acc; pitch = i; } } return pitch; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) plc_rx(plc_state_t *s, int16_t amp[], int len) { int i; int pitch_overlap; float old_step; float new_step; float old_weight; float new_weight; float gain; if (s->missing_samples) { /* Although we have a real signal, we need to smooth it to fit well with the synthetic signal we used for the previous block */ /* The start of the real data is overlapped with the next 1/4 cycle of the synthetic data. */ pitch_overlap = s->pitch >> 2; if (pitch_overlap > len) pitch_overlap = len; gain = 1.0f - s->missing_samples*ATTENUATION_INCREMENT; if (gain < 0.0f) gain = 0.0f; new_step = 1.0f/pitch_overlap; old_step = new_step*gain; new_weight = new_step; old_weight = (1.0f - new_step)*gain; for (i = 0; i < pitch_overlap; i++) { amp[i] = fsaturate(old_weight*s->pitchbuf[s->pitch_offset] + new_weight*amp[i]); if (++s->pitch_offset >= s->pitch) s->pitch_offset = 0; new_weight += new_step; old_weight -= old_step; if (old_weight < 0.0f) old_weight = 0.0f; } s->missing_samples = 0; } save_history(s, amp, len); return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) plc_fillin(plc_state_t *s, int16_t amp[], int len) { int i; int pitch_overlap; float old_step; float new_step; float old_weight; float new_weight; float gain; int orig_len; orig_len = len; if (s->missing_samples == 0) { /* As the gap in real speech starts we need to assess the last known pitch, and prepare the synthetic data we will use for fill-in */ normalise_history(s); s->pitch = amdf_pitch(PLC_PITCH_MIN, PLC_PITCH_MAX, s->history + PLC_HISTORY_LEN - CORRELATION_SPAN - PLC_PITCH_MIN, CORRELATION_SPAN); /* We overlap a 1/4 wavelength */ pitch_overlap = s->pitch >> 2; /* Cook up a single cycle of pitch, using a single of the real signal with 1/4 cycle OLA'ed to make the ends join up nicely */ /* The first 3/4 of the cycle is a simple copy */ for (i = 0; i < s->pitch - pitch_overlap; i++) s->pitchbuf[i] = s->history[PLC_HISTORY_LEN - s->pitch + i]; /* The last 1/4 of the cycle is overlapped with the end of the previous cycle */ new_step = 1.0f/pitch_overlap; new_weight = new_step; for ( ; i < s->pitch; i++) { s->pitchbuf[i] = s->history[PLC_HISTORY_LEN - s->pitch + i]*(1.0f - new_weight) + s->history[PLC_HISTORY_LEN - 2*s->pitch + i]*new_weight; new_weight += new_step; } /* We should now be ready to fill in the gap with repeated, decaying cycles of what is in pitchbuf */ gain = 1.0f; /* We need to OLA the first 1/4 wavelength of the synthetic data, to smooth it into the previous real data. To avoid the need to introduce a delay in the stream, reverse the last 1/4 wavelength, and OLA with that. */ new_step = 1.0f/pitch_overlap; old_step = new_step; new_weight = new_step; old_weight = 1.0f - new_step; for (i = 0; i < pitch_overlap; i++) { amp[i] = fsaturate(old_weight*s->history[PLC_HISTORY_LEN - 1 - i] + new_weight*s->pitchbuf[i]); new_weight += new_step; old_weight -= old_step; if (old_weight < 0.0f) old_weight = 0.0f; } s->pitch_offset = i; } else { gain = 1.0f - s->missing_samples*ATTENUATION_INCREMENT; i = 0; } for ( ; gain > 0.0f && i < len; i++) { amp[i] = (int16_t) (s->pitchbuf[s->pitch_offset]*gain); gain -= ATTENUATION_INCREMENT; if (++s->pitch_offset >= s->pitch) s->pitch_offset = 0; } for ( ; i < len; i++) amp[i] = 0; s->missing_samples += orig_len; save_history(s, amp, len); return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(plc_state_t *) plc_init(plc_state_t *s) { if (s == NULL) { if ((s = (plc_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) plc_release(plc_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) plc_free(plc_state_t *s) { if (s) free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/sig_tone.c0000664000175000017500000005412212343630356012663 00000000000000/* * SpanDSP - a series of DSP components for telephony * * sig_tone.c - Signalling tone processing for the 2280Hz, 2400Hz, 2600Hz * and similar signalling tones used in older protocols. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/dc_restore.h" #include "spandsp/saturated.h" #include "spandsp/vector_int.h" #include "spandsp/complex.h" #include "spandsp/power_meter.h" #include "spandsp/dds.h" #include "spandsp/super_tone_rx.h" #include "spandsp/sig_tone.h" #include "spandsp/private/sig_tone.h" /*! PI */ #define PI 3.14159265358979323 enum { NOTCH_COEFF_SET_2280HZ = 0, NOTCH_COEFF_SET_2400HZ, NOTCH_COEFF_SET_2600HZ }; /* The coefficients for the data notch filters. These filters are also the guard filters for tone detection. */ static const sig_tone_notch_coeffs_t notch_coeffs[3] = { { /* 2280 Hz */ #if defined(SPANDSP_USE_FIXED_POINT) { 3600, 14397, 32767}, { 0, -9425, -28954}, { 0, 14196, 32767}, { 0, -17393, -28954}, 12, #else {0.878906f, 0.439362f, 1.0f}, {0.0f, -0.287627f, -0.883605f}, {0.0f, 0.433228f, 1.0f}, {0.0f, -0.530792f, -0.883605f}, #endif }, { /* 2400Hz */ #if defined(SPANDSP_USE_FIXED_POINT) { 3530, 20055, 32767}, { 0, -14950, -28341}, { 0, 20349, 32767}, { 0, -22633, -28341}, 12, #else {0.862000f, 0.612055f, 1.0f}, {0.0f, -0.456264f, -0.864899f}, {0.0f, 0.621021f, 1.0f}, {0.0f, -0.690738f, -0.864899f}, #endif }, { /* 2600Hz */ #if defined(SPANDSP_USE_FIXED_POINT) { 3530, 29569, 32767}, { 0, -24010, -28341}, { 0, 29844, 32767}, { 0, -31208, -28341}, 12, #else {0.862000f, 0.902374f, 1.0f}, {0.0f, -0.732727f, -0.864899f}, {0.0f, 0.910766f, 1.0f}, {0.0f, -0.952393f, -0.864899f}, #endif } }; static const sig_tone_flat_coeffs_t flat_coeffs[1] = { { #if defined(SPANDSP_USE_FIXED_POINT) { 12900, -16384, -16384}, { 0, -8578, -11796}, 15, #else {0.393676f, -0.5f, -0.5f}, {0.0f, -0.261778f, -0.359985f}, #endif } }; static const sig_tone_descriptor_t sig_tones[3] = { { /* 2280Hz (e.g. AC15, and many other European protocols) */ {2280, 0}, {{-10, -20}, {0, 0}}, /* -10+-1 dBm0 and -20+-1 dBm0 */ ms_to_samples(400), /* High to low timout - 300ms to 550ms */ ms_to_samples(225), /* Sharp to flat timeout */ ms_to_samples(225), /* Notch insertion timeout */ ms_to_samples(3), /* Tone on persistence check */ ms_to_samples(8), /* Tone off persistence check */ 1, { ¬ch_coeffs[NOTCH_COEFF_SET_2280HZ], NULL, }, &flat_coeffs[NOTCH_COEFF_SET_2280HZ], 13.0f, -30.0f, -30.0f }, { /* 2600Hz (e.g. many US protocols) */ {2600, 0}, {{-8, -8}, {0, 0}}, ms_to_samples(0), ms_to_samples(0), ms_to_samples(225), ms_to_samples(3), ms_to_samples(8), 1, { ¬ch_coeffs[NOTCH_COEFF_SET_2600HZ], NULL, }, NULL, 15.6f, -30.0f, -30.0f }, { /* 2400Hz/2600Hz (e.g. SS5 and SS5bis) */ {2400, 2600}, {{-8, -8}, {-8, -8}}, ms_to_samples(0), ms_to_samples(0), ms_to_samples(225), ms_to_samples(3), ms_to_samples(8), 2, { ¬ch_coeffs[NOTCH_COEFF_SET_2400HZ], ¬ch_coeffs[NOTCH_COEFF_SET_2600HZ] }, NULL, 15.6f, -30.0f, -30.0f } }; static const int tone_present_bits[3] = { SIG_TONE_1_PRESENT, SIG_TONE_2_PRESENT, SIG_TONE_1_PRESENT | SIG_TONE_2_PRESENT }; static const int tone_change_bits[3] = { SIG_TONE_1_CHANGE, SIG_TONE_2_CHANGE, SIG_TONE_1_CHANGE | SIG_TONE_2_CHANGE }; static const int coeff_sets[3] = { 0, 1, 0 }; SPAN_DECLARE(int) sig_tone_tx(sig_tone_tx_state_t *s, int16_t amp[], int len) { int i; int j; int k; int n; int16_t tone; int need_update; int high_low; for (i = 0; i < len; i += n) { if (s->current_tx_timeout) { if (s->current_tx_timeout <= len - i) { n = s->current_tx_timeout; need_update = TRUE; } else { n = len - i; need_update = FALSE; } s->current_tx_timeout -= n; } else { n = len - i; need_update = FALSE; } if (!(s->current_tx_tone & SIG_TONE_TX_PASSTHROUGH)) vec_zeroi16(&[i], n); /*endif*/ if ((s->current_tx_tone & (SIG_TONE_1_PRESENT | SIG_TONE_2_PRESENT))) { /* Are we in the early phase (high tone energy level), or the sustaining phase (low tone energy level) of tone generation? */ /* This doesn't try to get the high/low timing precise, as there is no value in doing so. It works block by block, and the blocks are normally quite short. */ if (s->high_low_timer > 0) { if (n > s->high_low_timer) n = s->high_low_timer; s->high_low_timer -= n; high_low = 0; } else { high_low = 1; } /*endif*/ for (k = 0; k < s->desc->tones; k++) { if ((s->current_tx_tone & tone_present_bits[k]) && s->phase_rate[k]) { for (j = i; j < i + n; j++) { tone = dds_mod(&s->phase_acc[k], s->phase_rate[k], s->tone_scaling[k][high_low], 0); amp[j] = saturated_add16(amp[j], tone); } /*endfor*/ } /*endif*/ } } /*endif*/ if (need_update && s->sig_update) s->sig_update(s->user_data, SIG_TONE_TX_UPDATE_REQUEST, 0, 0); /*endif*/ } /*endfor*/ return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) sig_tone_tx_set_mode(sig_tone_tx_state_t *s, int mode, int duration) { int old_tones; int new_tones; old_tones = s->current_tx_tone & (SIG_TONE_1_PRESENT | SIG_TONE_2_PRESENT); new_tones = mode & (SIG_TONE_1_PRESENT | SIG_TONE_2_PRESENT); if (new_tones && old_tones != new_tones) s->high_low_timer = s->desc->high_low_timeout; /*endif*/ /* If a tone is being turned on, let's start the phase from zero */ if ((mode & SIG_TONE_1_PRESENT) && !(s->current_tx_tone & SIG_TONE_1_PRESENT)) s->phase_acc[0] = 0; if ((mode & SIG_TONE_2_PRESENT) && !(s->current_tx_tone & SIG_TONE_2_PRESENT)) s->phase_acc[1] = 0; s->current_tx_tone = mode; s->current_tx_timeout = duration; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(sig_tone_tx_state_t *) sig_tone_tx_init(sig_tone_tx_state_t *s, int tone_type, tone_report_func_t sig_update, void *user_data) { int i; if (sig_update == NULL || tone_type < 1 || tone_type > 3) return NULL; /*endif*/ if (s == NULL) { if ((s = (sig_tone_tx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); s->sig_update = sig_update; s->user_data = user_data; s->desc = &sig_tones[tone_type - 1]; for (i = 0; i < 2; i++) { if (s->desc->tone_freq[i]) s->phase_rate[i] = dds_phase_rate((float) s->desc->tone_freq[i]); else s->phase_rate[i] = 0; s->tone_scaling[i][0] = dds_scaling_dbm0((float) s->desc->tone_amp[i][0]); s->tone_scaling[i][1] = dds_scaling_dbm0((float) s->desc->tone_amp[i][1]); } return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) sig_tone_tx_release(sig_tone_tx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) sig_tone_tx_free(sig_tone_tx_state_t *s) { if (s) free(s); return 0; } /*- End of function --------------------------------------------------------*/ int nnn = 0; SPAN_DECLARE(int) sig_tone_rx(sig_tone_rx_state_t *s, int16_t amp[], int len) { #if defined(SPANDSP_USE_FIXED_POINT) int16_t x; int32_t v; int16_t notched_signal[3]; int16_t bandpass_signal; int16_t signal; #else float x; float v; float notched_signal[3]; float bandpass_signal; float signal; #endif int i; int j; int k; int l; int m; int32_t notch_power[3]; int32_t flat_power; int immediate; l = s->desc->tones; if (l == 2) l = 3; notch_power[1] = notch_power[2] = INT32_MAX; for (i = 0; i < len; i++) { if (s->signalling_state_duration < INT_MAX) s->signalling_state_duration++; /*endif*/ signal = amp[i]; for (j = 0; j < l; j++) { k = coeff_sets[j]; /* The notch filter is two cascaded biquads. */ #if defined(SPANDSP_USE_FIXED_POINT) v = ((int32_t) signal*s->desc->notch[k]->a1[0]) + ((int32_t) s->tone[j].notch_z1[0]*s->desc->notch[k]->b1[1]) + ((int32_t) s->tone[j].notch_z1[1]*s->desc->notch[k]->b1[2]); x = v >> 15; v += ((int32_t) s->tone[j].notch_z1[0]*s->desc->notch[k]->a1[1]) + ((int32_t) s->tone[j].notch_z1[1]*s->desc->notch[k]->a1[2]); s->tone[j].notch_z1[1] = s->tone[j].notch_z1[0]; s->tone[j].notch_z1[0] = x; v += ((int32_t) s->tone[j].notch_z2[0]*s->desc->notch[k]->b2[1]) + ((int32_t) s->tone[j].notch_z2[1]*s->desc->notch[k]->b2[2]); x = v >> 15; v += ((int32_t) s->tone[j].notch_z2[0]*s->desc->notch[k]->a2[1]) + ((int32_t) s->tone[j].notch_z2[1]*s->desc->notch[k]->a2[2]); s->tone[j].notch_z2[1] = s->tone[j].notch_z2[0]; s->tone[j].notch_z2[0] = x; notched_signal[j] = v >> s->desc->notch[k]->postscale; #else v = signal*s->desc->notch[k]->a1[0] + s->tone[j].notch_z1[0]*s->desc->notch[k]->b1[1] + s->tone[j].notch_z1[1]*s->desc->notch[k]->b1[2]; x = v; v += s->tone[j].notch_z1[0]*s->desc->notch[k]->a1[1] + s->tone[j].notch_z1[1]*s->desc->notch[k]->a1[2]; s->tone[j].notch_z1[1] = s->tone[j].notch_z1[0]; s->tone[j].notch_z1[0] = x; v += s->tone[j].notch_z2[0]*s->desc->notch[k]->b2[1] + s->tone[j].notch_z2[1]*s->desc->notch[k]->b2[2]; x = v; v += s->tone[j].notch_z2[0]*s->desc->notch[k]->a2[1] + s->tone[j].notch_z2[1]*s->desc->notch[k]->a2[2]; s->tone[j].notch_z2[1] = s->tone[j].notch_z2[0]; s->tone[j].notch_z2[0] = x; notched_signal[j] = v; #endif /* Modulus and leaky integrate the notched data. The result of this isn't used in low tone detect mode, but we must keep the power measurement rolling along. */ notch_power[j] = power_meter_update(&s->tone[j].power, notched_signal[j]); if (j == 1) signal = notched_signal[j]; } if ((s->signalling_state & (SIG_TONE_1_PRESENT | SIG_TONE_2_PRESENT))) { if (s->flat_mode_timeout && --s->flat_mode_timeout == 0) s->flat_mode = TRUE; /*endif*/ } else { s->flat_mode_timeout = s->desc->sharp_flat_timeout; s->flat_mode = FALSE; } /*endif*/ immediate = -1; if (s->flat_mode) { //printf("Flat mode %d %d\n", s->flat_mode_timeout, s->desc->sharp_flat_timeout); /* Flat mode */ bandpass_signal = amp[i]; if (s->desc->flat) { /* The bandpass filter is a single bi-quad stage */ #if defined(SPANDSP_USE_FIXED_POINT) v = ((int32_t) amp[i]*s->desc->flat->a[0]) + ((int32_t) s->flat_z[0]*s->desc->flat->b[1]) + ((int32_t) s->flat_z[1]*s->desc->flat->b[2]); x = v >> 15; v += ((int32_t) s->flat_z[0]*s->desc->flat->a[1]) + ((int32_t) s->flat_z[1]*s->desc->flat->a[2]); s->flat_z[1] = s->flat_z[0]; s->flat_z[0] = x; bandpass_signal = v >> s->desc->flat->postscale; #else v = amp[i]*s->desc->flat->a[0] + s->flat_z[0]*s->desc->flat->b[1] + s->flat_z[1]*s->desc->flat->b[2]; x = v; v += s->flat_z[0]*s->desc->flat->a[1] + s->flat_z[1]*s->desc->flat->a[2]; s->flat_z[1] = s->flat_z[0]; s->flat_z[0] = x; bandpass_signal = v; #endif } flat_power = power_meter_update(&s->flat_power, bandpass_signal); /* For the flat receiver we use a simple power threshold! */ if ((s->signalling_state & (SIG_TONE_1_PRESENT | SIG_TONE_2_PRESENT))) { if (flat_power < s->flat_detection_threshold) { s->signalling_state &= ~tone_present_bits[0]; s->signalling_state |= tone_change_bits[0]; } /*endif*/ } else { if (flat_power > s->flat_detection_threshold) s->signalling_state |= (tone_present_bits[0] | tone_change_bits[0]); /*endif*/ } /*endif*/ /* Notch insertion logic */ /* tone_present and tone_on are equivalent in flat mode */ if ((s->signalling_state & (SIG_TONE_1_PRESENT | SIG_TONE_2_PRESENT))) { s->notch_insertion_timeout = s->desc->notch_lag_time; } else { if (s->notch_insertion_timeout) s->notch_insertion_timeout--; /*endif*/ } /*endif*/ } else { /* Sharp mode */ flat_power = power_meter_update(&s->flat_power, amp[i]); /* Persistence checking and notch insertion logic */ if (flat_power >= s->sharp_detection_threshold) { /* Which is the better of the single tone responses? */ m = (notch_power[0] < notch_power[1]) ? 0 : 1; /* Single tone has precedence. If the better one fails to detect, try for a dual tone signal. */ if ((notch_power[m] >> 6)*s->detection_ratio < (flat_power >> 6)) immediate = m; else if ((notch_power[2] >> 6)*s->detection_ratio < (flat_power >> 7)) immediate = 2; } //printf("Immediate = %d %d %d\n", immediate, s->signalling_state, s->tone_persistence_timeout); if ((s->signalling_state & (SIG_TONE_1_PRESENT | SIG_TONE_2_PRESENT))) { if (immediate != s->current_notch_filter) { /* No tone is detected this sample */ if (--s->tone_persistence_timeout == 0) { /* Tone off is confirmed */ s->tone_persistence_timeout = s->desc->tone_on_check_time; s->signalling_state |= ((s->signalling_state & (SIG_TONE_1_PRESENT | SIG_TONE_2_PRESENT)) << 1); s->signalling_state &= ~(SIG_TONE_1_PRESENT | SIG_TONE_2_PRESENT); } /*endif*/ } else { s->tone_persistence_timeout = s->desc->tone_off_check_time; } /*endif*/ } else { if (s->notch_insertion_timeout) s->notch_insertion_timeout--; /*endif*/ if (immediate >= 0 && immediate == s->last_sample_tone_present) { /* Consistent tone detected this sample */ if (--s->tone_persistence_timeout == 0) { /* Tone on is confirmed */ s->tone_persistence_timeout = s->desc->tone_off_check_time; s->notch_insertion_timeout = s->desc->notch_lag_time; s->signalling_state |= (tone_present_bits[immediate] | tone_change_bits[immediate]); s->current_notch_filter = immediate; } /*endif*/ } else { s->tone_persistence_timeout = s->desc->tone_on_check_time; } /*endif*/ } /*endif*/ //printf("XXX %d %d %d %d %d %d\n", nnn++, notch_power[0], notch_power[1], notch_power[2], flat_power, immediate*10000000); } /*endif*/ if ((s->signalling_state & (SIG_TONE_1_CHANGE | SIG_TONE_2_CHANGE))) { if (s->sig_update) s->sig_update(s->user_data, s->signalling_state, 0, s->signalling_state_duration); /*endif*/ s->signalling_state &= ~(SIG_TONE_1_CHANGE | SIG_TONE_2_CHANGE); s->signalling_state_duration = 0; } /*endif*/ if ((s->current_rx_tone & SIG_TONE_RX_PASSTHROUGH)) { if ((s->current_rx_tone & SIG_TONE_RX_FILTER_TONE) || s->notch_insertion_timeout) #if defined(SPANDSP_USE_FIXED_POINT) amp[i] = saturate16(notched_signal[s->current_notch_filter]); #else amp[i] = fsaturatef(notched_signal[s->current_notch_filter]); #endif /*endif*/ } else { /* Simply mute the media path */ amp[i] = 0; } /*endif*/ s->last_sample_tone_present = immediate; } /*endfor*/ return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) sig_tone_rx_set_mode(sig_tone_rx_state_t *s, int mode, int duration) { s->current_rx_tone = mode; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(sig_tone_rx_state_t *) sig_tone_rx_init(sig_tone_rx_state_t *s, int tone_type, tone_report_func_t sig_update, void *user_data) { int i; #if !defined(SPANDSP_USE_FIXED_POINT) int j; #endif if (sig_update == NULL || tone_type < 1 || tone_type > 3) return NULL; /*endif*/ if (s == NULL) { if ((s = (sig_tone_rx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); #if !defined(SPANDSP_USE_FIXED_POINT) for (j = 0; j < 3; j++) { for (i = 0; i < 2; i++) { s->tone[j].notch_z1[i] = 0.0f; s->tone[j].notch_z2[i] = 0.0f; } } for (i = 0; i < 2; i++) s->flat_z[i] = 0.0f; #endif s->last_sample_tone_present = -1; s->sig_update = sig_update; s->user_data = user_data; s->desc = &sig_tones[tone_type - 1]; for (i = 0; i < 3; i++) power_meter_init(&s->tone[i].power, 5); power_meter_init(&s->flat_power, 5); s->flat_detection_threshold = power_meter_level_dbm0(s->desc->flat_detection_threshold); s->sharp_detection_threshold = power_meter_level_dbm0(s->desc->sharp_detection_threshold); s->detection_ratio = powf(10.0f, s->desc->detection_ratio/10.0f) + 1.0f; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) sig_tone_rx_release(sig_tone_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) sig_tone_rx_free(sig_tone_rx_state_t *s) { if (s) free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/faxfont.h0000664000175000017500000020060111422612261012511 00000000000000/* * SpanDSP - a series of DSP components for telephony * * faxfont.h - a simple fixed pitch font for FAX headers * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_FAXFONT_H_) #define _FAXFONT_H_ static const uint32_t header_font[256][16] = { { /* 0 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, }, { /* 1 */ 0x0, 0x0, 0x3FFC, 0xC003, 0xCC33, 0xC003, 0xC003, 0xCFF3, 0xC3C3, 0xC003, 0xC003, 0x3FFC, 0x0, 0x0, 0x0, 0x0, }, { /* 2 */ 0x0, 0x0, 0x3FFC, 0xFFFF, 0xF3CF, 0xFFFF, 0xFFFF, 0xF00F, 0xFC3F, 0xFFFF, 0xFFFF, 0x3FFC, 0x0, 0x0, 0x0, 0x0, }, { /* 3 */ 0x0, 0x0, 0x0, 0x0, 0x1E78, 0x7FFE, 0x7FFE, 0x7FFE, 0x7FFE, 0x1FF8, 0x7E0, 0x180, 0x0, 0x0, 0x0, 0x0, }, { /* 4 */ 0x0, 0x0, 0x0, 0x0, 0x180, 0x7E0, 0x1FF8, 0x7FFE, 0x1FF8, 0x7E0, 0x180, 0x0, 0x0, 0x0, 0x0, 0x0, }, { /* 5 */ 0x0, 0x0, 0x0, 0x3C0, 0xFF0, 0xFF0, 0x7C3E, 0x7C3E, 0x7C3E, 0x63C6, 0x3C0, 0xFF0, 0x0, 0x0, 0x0, 0x0, }, { /* 6 */ 0x0, 0x0, 0x0, 0x180, 0x7E0, 0x1FF8, 0x7FFE, 0x7FFE, 0x1FF8, 0x180, 0x180, 0x7E0, 0x0, 0x0, 0x0, 0x0, }, { /* 7 */ 0x0, 0x0, 0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 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, }, { /* 46 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3C0, 0x3C0, 0x0, 0x0, 0x0, 0x0, }, { /* 47 */ 0x0, 0x0, 0x0, 0x0, 0x6, 0x1E, 0x78, 0x1E0, 0x780, 0x1E00, 0x7800, 0x6000, 0x0, 0x0, 0x0, 0x0, }, { /* 48 */ 0x0, 0x0, 0x1FF8, 0x781E, 0x781E, 0x787E, 0x799E, 0x799E, 0x7E1E, 0x781E, 0x781E, 0x1FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 49 */ 0x0, 0x0, 0x3C0, 0xFC0, 0x3FC0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3FFC, 0x0, 0x0, 0x0, 0x0, }, { /* 50 */ 0x0, 0x0, 0x1FF8, 0x781E, 0x1E, 0x78, 0x1E0, 0x780, 0x1E00, 0x7800, 0x781E, 0x7FFE, 0x0, 0x0, 0x0, 0x0, }, { /* 51 */ 0x0, 0x0, 0x1FF8, 0x781E, 0x1E, 0x1E, 0x7F8, 0x1E, 0x1E, 0x1E, 0x781E, 0x1FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 52 */ 0x0, 0x0, 0x78, 0x1F8, 0x7F8, 0x1E78, 0x7878, 0x7FFE, 0x78, 0x78, 0x78, 0x1FE, 0x0, 0x0, 0x0, 0x0, }, { /* 53 */ 0x0, 0x0, 0x7FFE, 0x7800, 0x7800, 0x7800, 0x7FF8, 0x7E, 0x1E, 0x1E, 0x781E, 0x1FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 54 */ 0x0, 0x0, 0x7E0, 0x1E00, 0x7800, 0x7800, 0x7FF8, 0x781E, 0x781E, 0x781E, 0x781E, 0x1FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 55 */ 0x0, 0x0, 0x7FFE, 0x781E, 0x1E, 0x1E, 0x78, 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E, 0x781E, 0x781E, 0x781E, 0x781E, 0x0, 0x0, 0x0, 0x0, }, { /* 66 */ 0x0, 0x0, 0x7FF8, 0x1E1E, 0x1E1E, 0x1E1E, 0x1FF8, 0x1E1E, 0x1E1E, 0x1E1E, 0x1E1E, 0x7FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 67 */ 0x0, 0x0, 0x7F8, 0x1E1E, 0x7806, 0x7800, 0x7800, 0x7800, 0x7800, 0x7806, 0x1E1E, 0x7F8, 0x0, 0x0, 0x0, 0x0, }, { /* 68 */ 0x0, 0x0, 0x7FE0, 0x1E78, 0x1E1E, 0x1E1E, 0x1E1E, 0x1E1E, 0x1E1E, 0x1E1E, 0x1E78, 0x7FE0, 0x0, 0x0, 0x0, 0x0, }, { /* 69 */ 0x0, 0x0, 0x7FFE, 0x1E1E, 0x1E06, 0x1E60, 0x1FE0, 0x1E60, 0x1E00, 0x1E06, 0x1E1E, 0x7FFE, 0x0, 0x0, 0x0, 0x0, }, { /* 70 */ 0x0, 0x0, 0x7FFE, 0x1E1E, 0x1E06, 0x1E60, 0x1FE0, 0x1E60, 0x1E00, 0x1E00, 0x1E00, 0x7F80, 0x0, 0x0, 0x0, 0x0, }, { /* 71 */ 0x0, 0x0, 0x7F8, 0x1E1E, 0x7806, 0x7800, 0x7800, 0x79FE, 0x781E, 0x781E, 0x1E1E, 0x7E6, 0x0, 0x0, 0x0, 0x0, }, { /* 72 */ 0x0, 0x0, 0x781E, 0x781E, 0x781E, 0x781E, 0x7FFE, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x0, 0x0, 0x0, 0x0, }, { /* 73 */ 0x0, 0x0, 0x7F8, 0x1E0, 0x1E0, 0x1E0, 0x1E0, 0x1E0, 0x1E0, 0x1E0, 0x1E0, 0x7F8, 0x0, 0x0, 0x0, 0x0, }, { /* 74 */ 0x0, 0x0, 0x1FE, 0x78, 0x78, 0x78, 0x78, 0x78, 0x7878, 0x7878, 0x7878, 0x1FE0, 0x0, 0x0, 0x0, 0x0, }, { /* 75 */ 0x0, 0x0, 0x7E1E, 0x1E1E, 0x1E78, 0x1E78, 0x1FE0, 0x1FE0, 0x1E78, 0x1E1E, 0x1E1E, 0x7E1E, 0x0, 0x0, 0x0, 0x0, }, { /* 76 */ 0x0, 0x0, 0x7F80, 0x1E00, 0x1E00, 0x1E00, 0x1E00, 0x1E00, 0x1E00, 0x1E06, 0x1E1E, 0x7FFE, 0x0, 0x0, 0x0, 0x0, }, { /* 77 */ 0x0, 0x0, 0x781E, 0x7E7E, 0x7FFE, 0x7FFE, 0x799E, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x0, 0x0, 0x0, 0x0, }, { /* 78 */ 0x0, 0x0, 0x781E, 0x7E1E, 0x7F9E, 0x7FFE, 0x79FE, 0x787E, 0x781E, 0x781E, 0x781E, 0x781E, 0x0, 0x0, 0x0, 0x0, }, { /* 79 */ 0x0, 0x0, 0x7E0, 0x1E78, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x1E78, 0x7E0, 0x0, 0x0, 0x0, 0x0, }, { /* 80 */ 0x0, 0x0, 0x7FF8, 0x1E1E, 0x1E1E, 0x1E1E, 0x1FF8, 0x1E00, 0x1E00, 0x1E00, 0x1E00, 0x7F80, 0x0, 0x0, 0x0, 0x0, }, { /* 81 */ 0x0, 0x0, 0x1FF8, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x799E, 0x79FE, 0x1FF8, 0x78, 0x7E, 0x0, 0x0, }, { /* 82 */ 0x0, 0x0, 0x7FF8, 0x1E1E, 0x1E1E, 0x1E1E, 0x1FF8, 0x1E78, 0x1E1E, 0x1E1E, 0x1E1E, 0x7E1E, 0x0, 0x0, 0x0, 0x0, }, { /* 83 */ 0x0, 0x0, 0x1FF8, 0x781E, 0x781E, 0x1E00, 0x7E0, 0x78, 0x1E, 0x781E, 0x781E, 0x1FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 84 */ 0x0, 0x0, 0x1FFE, 0x1FFE, 0x19E6, 0x1E0, 0x1E0, 0x1E0, 0x1E0, 0x1E0, 0x1E0, 0x7F8, 0x0, 0x0, 0x0, 0x0, }, { /* 85 */ 0x0, 0x0, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x1FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 86 */ 0x0, 0x0, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x1E78, 0x7E0, 0x180, 0x0, 0x0, 0x0, 0x0, }, { /* 87 */ 0x0, 0x0, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x799E, 0x799E, 0x7FFE, 0x1E78, 0x1E78, 0x0, 0x0, 0x0, 0x0, }, { /* 88 */ 0x0, 0x0, 0x781E, 0x781E, 0x1E78, 0x1E78, 0x7E0, 0x7E0, 0x1E78, 0x1E78, 0x781E, 0x781E, 0x0, 0x0, 0x0, 0x0, }, { /* 89 */ 0x0, 0x0, 0x3C3C, 0x3C3C, 0x3C3C, 0x3C3C, 0xFF0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0xFF0, 0x0, 0x0, 0x0, 0x0, }, { /* 90 */ 0x0, 0x0, 0x7FFE, 0x781E, 0x601E, 0x78, 0x1E0, 0x780, 0x1E00, 0x7806, 0x781E, 0x7FFE, 0x0, 0x0, 0x0, 0x0, }, { /* 91 */ 0x0, 0x0, 0xFF0, 0xF00, 0xF00, 0xF00, 0xF00, 0xF00, 0xF00, 0xF00, 0xF00, 0xFF0, 0x0, 0x0, 0x0, 0x0, }, { /* 92 */ 0x0, 0x0, 0x0, 0x6000, 0x7800, 0x7E00, 0x1F80, 0x7E0, 0x1F8, 0x7E, 0x1E, 0x6, 0x0, 0x0, 0x0, 0x0, }, { /* 93 */ 0x0, 0x0, 0xFF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF0, 0x0, 0x0, 0x0, 0x0, }, { /* 94 */ 0x180, 0x7E0, 0x1E78, 0x781E, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, }, { /* 95 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xFFFF, 0x0, 0x0, }, { /* 96 */ 0xF00, 0xF00, 0x3C0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, }, { /* 97 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x1FE0, 0x78, 0x1FF8, 0x7878, 0x7878, 0x7878, 0x1F9E, 0x0, 0x0, 0x0, 0x0, }, { /* 98 */ 0x0, 0x0, 0x7E00, 0x1E00, 0x1E00, 0x1FE0, 0x1E78, 0x1E1E, 0x1E1E, 0x1E1E, 0x1E1E, 0x79F8, 0x0, 0x0, 0x0, 0x0, }, { /* 99 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x1FF8, 0x781E, 0x7800, 0x7800, 0x7800, 0x781E, 0x1FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 100 */ 0x0, 0x0, 0x1F8, 0x78, 0x78, 0x7F8, 0x1E78, 0x7878, 0x7878, 0x7878, 0x7878, 0x1F9E, 0x0, 0x0, 0x0, 0x0, }, { /* 101 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x1FF8, 0x781E, 0x7FFE, 0x7800, 0x7800, 0x781E, 0x1FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 102 */ 0x0, 0x0, 0x7E0, 0x1E78, 0x1E18, 0x1E00, 0x7F80, 0x1E00, 0x1E00, 0x1E00, 0x1E00, 0x7F80, 0x0, 0x0, 0x0, 0x0, }, { /* 103 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x1F9E, 0x7878, 0x7878, 0x7878, 0x7878, 0x7878, 0x1FF8, 0x78, 0x7878, 0x1FE0, 0x0,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E, 0x7878, 0x7878, 0x7878, 0x7878, 0x7878, 0x1FF8, 0x78, 0x78, 0x1FE, 0x0, }, { /* 114 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x79F8, 0x1F9E, 0x1E06, 0x1E00, 0x1E00, 0x1E00, 0x7F80, 0x0, 0x0, 0x0, 0x0, }, { /* 115 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x1FF8, 0x781E, 0x1E00, 0x7E0, 0x78, 0x781E, 0x1FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 116 */ 0x0, 0x0, 0x180, 0x780, 0x780, 0x7FF8, 0x780, 0x780, 0x780, 0x780, 0x79E, 0x1F8, 0x0, 0x0, 0x0, 0x0, }, { /* 117 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x7878, 0x7878, 0x7878, 0x7878, 0x7878, 0x7878, 0x1F9E, 0x0, 0x0, 0x0, 0x0, }, { /* 118 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x1E1E, 0x1E1E, 0x1E1E, 0x1E1E, 0x1E1E, 0x7F8, 0x1E0, 0x0, 0x0, 0x0, 0x0, }, { /* 119 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x781E, 0x781E, 0x781E, 0x799E, 0x799E, 0x7FFE, 0x1E78, 0x0, 0x0, 0x0, 0x0, }, { /* 120 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x781E, 0x1E78, 0x7E0, 0x7E0, 0x7E0, 0x1E78, 0x781E, 0x0, 0x0, 0x0, 0x0, }, { /* 121 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x1FFE, 0x1E, 0x78, 0x7FE0, 0x0, }, { /* 122 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x7FFE, 0x7878, 0x1E0, 0x780, 0x1E00, 0x781E, 0x7FFE, 0x0, 0x0, 0x0, 0x0, }, { /* 123 */ 0x0, 0x0, 0xFC, 0x3C0, 0x3C0, 0x3C0, 0xF00, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0xFC, 0x0, 0x0, 0x0, 0x0, }, { /* 124 */ 0x0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x0, 0x0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x0, }, { /* 125 */ 0x0, 0x0, 0x3F00, 0x3C0, 0x3C0, 0x3C0, 0xF0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3F00, 0x0, 0x0, 0x0, 0x0, }, { /* 126 */ 0x0, 0x0, 0x1F9E, 0x79F8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, }, { /* 127 */ 0x0, 0x0, 0x0, 0x0, 0x180, 0x7E0, 0x1E78, 0x781E, 0x781E, 0x781E, 0x7FFE, 0x0, 0x0, 0x0, 0x0, 0x0, }, { /* 128 */ 0x0, 0x0, 0x7F8, 0x1E1E, 0x7806, 0x7800, 0x7800, 0x7800, 0x7806, 0x1E1E, 0x7F8, 0x78, 0x1E, 0x1FF8, 0x0, 0x0, }, { /* 129 */ 0x0, 0x0, 0x7878, 0x7878, 0x0, 0x7878, 0x7878, 0x7878, 0x7878, 0x7878, 0x7878, 0x1F9E, 0x0, 0x0, 0x0, 0x0, }, { /* 130 */ 0x0, 0x78, 0x1E0, 0x780, 0x0, 0x1FF8, 0x781E, 0x7FFE, 0x7800, 0x7800, 0x781E, 0x1FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 131 */ 0x0, 0x180, 0x7E0, 0x1E78, 0x0, 0x1FE0, 0x78, 0x1FF8, 0x7878, 0x7878, 0x7878, 0x1F9E, 0x0, 0x0, 0x0, 0x0, }, { /* 132 */ 0x0, 0x0, 0x7878, 0x7878, 0x0, 0x1FE0, 0x78, 0x1FF8, 0x7878, 0x7878, 0x7878, 0x1F9E, 0x0, 0x0, 0x0, 0x0, }, { /* 133 */ 0x0, 0x1E00, 0x780, 0x1E0, 0x0, 0x1FE0, 0x78, 0x1FF8, 0x7878, 0x7878, 0x7878, 0x1F9E, 0x0, 0x0, 0x0, 0x0, }, { /* 134 */ 0x0, 0x7E0, 0x1E78, 0x7E0, 0x0, 0x1FE0, 0x78, 0x1FF8, 0x7878, 0x7878, 0x7878, 0x1F9E, 0x0, 0x0, 0x0, 0x0, }, { /* 135 */ 0x0, 0x0, 0x0, 0x0, 0xFF0, 0x3C3C, 0x3C00, 0x3C00, 0x3C3C, 0xFF0, 0xF0, 0x3C, 0xFF0, 0x0, 0x0, 0x0, }, { /* 136 */ 0x0, 0x180, 0x7E0, 0x1E78, 0x0, 0x1FF8, 0x781E, 0x7FFE, 0x7800, 0x7800, 0x781E, 0x1FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 137 */ 0x0, 0x0, 0x781E, 0x781E, 0x0, 0x1FF8, 0x781E, 0x7FFE, 0x7800, 0x7800, 0x781E, 0x1FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 138 */ 0x0, 0x1E00, 0x780, 0x1E0, 0x0, 0x1FF8, 0x781E, 0x7FFE, 0x7800, 0x7800, 0x781E, 0x1FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 139 */ 0x0, 0x0, 0x3C3C, 0x3C3C, 0x0, 0xFC0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0xFF0, 0x0, 0x0, 0x0, 0x0, }, { /* 140 */ 0x0, 0x3C0, 0xFF0, 0x3C3C, 0x0, 0xFC0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0xFF0, 0x0, 0x0, 0x0, 0x0, }, { /* 141 */ 0x0, 0x3C00, 0xF00, 0x3C0, 0x0, 0xFC0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0xFF0, 0x0, 0x0, 0x0, 0x0, }, { /* 142 */ 0x0, 0x781E, 0x781E, 0x180, 0x7E0, 0x1E78, 0x781E, 0x781E, 0x7FFE, 0x781E, 0x781E, 0x781E, 0x0, 0x0, 0x0, 0x0, }, { /* 143 */ 0x7E0, 0x1E78, 0x7E0, 0x0, 0x7E0, 0x1E78, 0x781E, 0x781E, 0x7FFE, 0x781E, 0x781E, 0x781E, 0x0, 0x0, 0x0, 0x0, }, { /* 144 */ 0x1E0, 0x780, 0x1E00, 0x0, 0x7FFE, 0x1E1E, 0x1E00, 0x1FF8, 0x1E00, 0x1E00, 0x1E1E, 0x7FFE, 0x0, 0x0, 0x0, 0x0, }, { /* 145 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x7878, 0x1F9E, 0x79E, 0x1FFE, 0x79E0, 0x79E0, 0x1E7E, 0x0, 0x0, 0x0, 0x0, }, { /* 146 */ 0x0, 0x0, 0x7FE, 0x1E78, 0x7878, 0x7878, 0x7FFE, 0x7878, 0x7878, 0x7878, 0x7878, 0x787E, 0x0, 0x0, 0x0, 0x0, }, { /* 147 */ 0x0, 0x180, 0x7E0, 0x1E78, 0x0, 0x1FF8, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x1FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 148 */ 0x0, 0x0, 0x781E, 0x781E, 0x0, 0x1FF8, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x1FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 149 */ 0x0, 0x1E00, 0x780, 0x1E0, 0x0, 0x1FF8, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x1FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 150 */ 0x0, 0x780, 0x1FE0, 0x7878, 0x0, 0x7878, 0x7878, 0x7878, 0x7878, 0x7878, 0x7878, 0x1F9E, 0x0, 0x0, 0x0, 0x0, }, { /* 151 */ 0x0, 0x1E00, 0x780, 0x1E0, 0x0, 0x7878, 0x7878, 0x7878, 0x7878, 0x7878, 0x7878, 0x1F9E, 0x0, 0x0, 0x0, 0x0, }, { /* 152 */ 0x0, 0x0, 0x781E, 0x781E, 0x0, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x1FFE, 0x1E, 0x78, 0x1FE0, 0x0, }, { /* 153 */ 0x0, 0x781E, 0x781E, 0x0, 0x7E0, 0x1E78, 0x781E, 0x781E, 0x781E, 0x781E, 0x1E78, 0x7E0, 0x0, 0x0, 0x0, 0x0, }, { /* 154 */ 0x0, 0x781E, 0x781E, 0x0, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x1FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 155 */ 0x0, 0x3C0, 0x3C0, 0xFF0, 0x3C3C, 0x3C00, 0x3C00, 0x3C00, 0x3C3C, 0xFF0, 0x3C0, 0x3C0, 0x0, 0x0, 0x0, 0x0, }, { /* 156 */ 0x0, 0x7E0, 0x1E78, 0x1E18, 0x1E00, 0x7F80, 0x1E00, 0x1E00, 0x1E00, 0x1E00, 0x7E1E, 0x7FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 157 */ 0x0, 0x0, 0x3C3C, 0x3C3C, 0xFF0, 0x3C0, 0x3FFC, 0x3C0, 0x3FFC, 0x3C0, 0x3C0, 0x3C0, 0x0, 0x0, 0x0, 0x0, }, { /* 158 */ 0x0, 0x7FE0, 0x7878, 0x7878, 0x7FE0, 0x7818, 0x7878, 0x79FE, 0x7878, 0x7878, 0x7878, 0x781E, 0x0, 0x0, 0x0, 0x0, }, { /* 159 */ 0x0, 0xFC, 0x3CF, 0x3C0, 0x3C0, 0x3C0, 0x3FFC, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0xF3C0, 0x3F00, 0x0, 0x0, }, { /* 160 */ 0x0, 0x1E0, 0x780, 0x1E00, 0x0, 0x1FE0, 0x78, 0x1FF8, 0x7878, 0x7878, 0x7878, 0x1F9E, 0x0, 0x0, 0x0, 0x0, }, { /* 161 */ 0x0, 0xF0, 0x3C0, 0xF00, 0x0, 0xFC0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0xFF0, 0x0, 0x0, 0x0, 0x0, }, { /* 162 */ 0x0, 0x1E0, 0x780, 0x1E00, 0x0, 0x1FF8, 0x781E, 0x781E, 0x781E, 0x781E, 0x781E, 0x1FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 163 */ 0x0, 0x1E0, 0x780, 0x1E00, 0x0, 0x7878, 0x7878, 0x7878, 0x7878, 0x7878, 0x7878, 0x1F9E, 0x0, 0x0, 0x0, 0x0, }, { /* 164 */ 0x0, 0x0, 0x1F9E, 0x79F8, 0x0, 0x79F8, 0x1E1E, 0x1E1E, 0x1E1E, 0x1E1E, 0x1E1E, 0x1E1E, 0x0, 0x0, 0x0, 0x0, }, { /* 165 */ 0x1F9E, 0x79F8, 0x0, 0x781E, 0x7E1E, 0x7F9E, 0x7FFE, 0x79FE, 0x787E, 0x781E, 0x781E, 0x781E, 0x0, 0x0, 0x0, 0x0, }, { /* 166 */ 0x0, 0xFF0, 0x3CF0, 0x3CF0, 0xFFC, 0x0, 0x3FFC, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, }, { /* 167 */ 0x0, 0x7E0, 0x1E78, 0x1E78, 0x7E0, 0x0, 0x1FF8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, }, { /* 168 */ 0x0, 0x0, 0x780, 0x780, 0x0, 0x780, 0x780, 0x1E00, 0x7800, 0x781E, 0x781E, 0x1FF8, 0x0, 0x0, 0x0, 0x0, }, { /* 169 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xFFFC, 0xF000, 0xF000, 0xF000, 0xF000, 0x0, 0x0, 0x0, 0x0, 0x0, }, { /* 170 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xFFFC, 0x3C, 0x3C, 0x3C, 0x3C, 0x0, 0x0, 0x0, 0x0, 0x0, }, { /* 171 */ 0x0, 0x7000, 0x7000, 0x700C, 0x703C, 0x70F0, 0x3C0, 0xF00, 0x3C00, 0xF0FC, 0xC30E, 0x3C, 0xF0, 0x3FE, 0x0, 0x0, }, { /* 172 */ 0x0, 0x7000, 0x7000, 0x700C, 0x703C, 0x70F0, 0x3C0, 0xF00, 0x3C3C, 0xF0FC, 0xC38C, 0x7FE, 0x3C, 0xFE, 0x0, 0x0, }, { /* 173 */ 0x0, 0x0, 0x3C0, 0x3C0, 0x0, 0x3C0, 0x3C0, 0x3C0, 0x7E0, 0x7E0, 0x7E0, 0x3C0, 0x0, 0x0, 0x0, 0x0, }, { /* 174 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0xE0E, 0x3C3C, 0x7070, 0x3C3C, 0xE0E, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, }, { /* 175 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x7070, 0x3C3C, 0xE0E, 0x3C3C, 0x7070, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, }, { /* 176 */ 0x303, 0x3030, 0x303, 0x3030, 0x303, 0x3030, 0x303, 0x3030, 0x303, 0x3030, 0x303, 0x3030, 0x303, 0x3030, 0x303, 0x3030, }, { /* 177 */ 0xAAAA, 0x5555, 0xAAAA, 0x5555, 0xAAAA, 0x5555, 0xAAAA, 0x5555, 0xAAAA, 0x5555, 0xAAAA, 0x5555, 0xAAAA, 0x5555, 0xAAAA, 0x5555, }, { /* 178 */ 0xF3F3, 0x3F3F, 0xF3F3, 0x3F3F, 0xF3F3, 0x3F3F, 0xF3F3, 0x3F3F, 0xF3F3, 0x3F3F, 0xF3F3, 0x3F3F, 0xF3F3, 0x3F3F, 0xF3F3, 0x3F3F, }, { /* 179 */ 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, }, { /* 180 */ 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0x3C0, 0xFFC0, 0x3C0, 0x3C0, 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 0x0, 0x0, 0x7FFE, 0x781E, 0x781E, 0x7800, 0x7800, 0x7800, 0x7800, 0x7800, 0x7800, 0x7800, 0x0, 0x0, 0x0, 0x0, }, { /* 227 */ 0x0, 0x0, 0x0, 0x0, 0x7FFE, 0x7FFE, 0x1E78, 0x1E78, 0x1E78, 0x1E78, 0x1E78, 0x1E78, 0x0, 0x0, 0x0, 0x0, }, { /* 228 */ 0x0, 0x0, 0x0, 0x7FFE, 0x781E, 0x1E00, 0x780, 0x1E0, 0x780, 0x1E00, 0x781E, 0x7FFE, 0x0, 0x0, 0x0, 0x0, }, { /* 229 */ 0x0, 0x0, 0x0, 0x0, 0x0, 0x1FFE, 0x79E0, 0x79E0, 0x79E0, 0x79E0, 0x79E0, 0x1F80, 0x0, 0x0, 0x0, 0x0, }, { /* 230 */ 0x0, 0x0, 0x0, 0x0, 0x1E1E, 0x1E1E, 0x1E1E, 0x1E1E, 0x1E1E, 0x1FF8, 0x1E00, 0x1E00, 0x7800, 0x0, 0x0, 0x0, }, { /* 231 */ 0x0, 0x0, 0x0, 0x0, 0x1F9E, 0x79F8, 0x1E0, 0x1E0, 0x1E0, 0x1E0, 0x1E0, 0x1E0, 0x0, 0x0, 0x0, 0x0, }, { /* 232 */ 0x0, 0x0, 0x0, 0x3FFC, 0x3C0, 0xFF0, 0x3C3C, 0x3C3C, 0x3C3C, 0xFF0, 0x3C0, 0x3FFC, 0x0, 0x0, 0x0, 0x0, }, { /* 233 */ 0x0, 0x0, 0x0, 0x7E0, 0x1E78, 0x781E, 0x781E, 0x7FFE, 0x781E, 0x781E, 0x1E78, 0x7E0, 0x0, 0x0, 0x0, 0x0, }, { /* 234 */ 0x0, 0x0, 0x7E0, 0x1E78, 0x781E, 0x781E, 0x781E, 0x1E78, 0x1E78, 0x1E78, 0x1E78, 0x7E7E, 0x0, 0x0, 0x0, 0x0, }, { /* 235 */ 0x0, 0x0, 0x3FC, 0xF00, 0x3C0, 0xF0, 0xFFC, 0x3C3C, 0x3C3C,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, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, }, }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/t38_gateway.c0000664000175000017500000027772412357123064013230 00000000000000//#define LOG_FAX_AUDIO /* * SpanDSP - a series of DSP components for telephony * * t38_gateway.c - A T.38 gateway, less the packet exchange part * * Written by Steve Underwood * * Copyright (C) 2005, 2006, 2007, 2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #if defined(LOG_FAX_AUDIO) #include #endif #include #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/queue.h" #include "spandsp/dc_restore.h" #include "spandsp/bit_operations.h" #include "spandsp/power_meter.h" #include "spandsp/complex.h" #include "spandsp/tone_detect.h" #include "spandsp/tone_generate.h" #include "spandsp/async.h" #include "spandsp/crc.h" #include "spandsp/hdlc.h" #include "spandsp/silence_gen.h" #include "spandsp/fsk.h" #include "spandsp/v29tx.h" #include "spandsp/v29rx.h" #include "spandsp/v27ter_tx.h" #include "spandsp/v27ter_rx.h" #include "spandsp/v17tx.h" #include "spandsp/v17rx.h" #include "spandsp/super_tone_rx.h" #include "spandsp/modem_connect_tones.h" #include "spandsp/timezone.h" #include "spandsp/t4_rx.h" #include "spandsp/t4_tx.h" #if defined(SPANDSP_SUPPORT_T85) #include "spandsp/t81_t82_arith_coding.h" #include "spandsp/t85.h" #endif #include "spandsp/t4_t6_decode.h" #include "spandsp/t4_t6_encode.h" #include "spandsp/t30_fcf.h" #include "spandsp/t35.h" #include "spandsp/t30.h" #include "spandsp/t30_logging.h" #include "spandsp/fax_modems.h" #include "spandsp/t38_core.h" #include "spandsp/t38_non_ecm_buffer.h" #include "spandsp/t38_gateway.h" #include "spandsp/private/logging.h" #include "spandsp/private/silence_gen.h" #include "spandsp/private/fsk.h" #include "spandsp/private/v17tx.h" #include "spandsp/private/v17rx.h" #include "spandsp/private/v27ter_tx.h" #include "spandsp/private/v27ter_rx.h" #include "spandsp/private/v29tx.h" #include "spandsp/private/v29rx.h" #include "spandsp/private/modem_connect_tones.h" #include "spandsp/private/hdlc.h" #include "spandsp/private/fax_modems.h" #include "spandsp/private/timezone.h" #if defined(SPANDSP_SUPPORT_T85) #include "spandsp/private/t81_t82_arith_coding.h" #include "spandsp/private/t85.h" #endif #include "spandsp/private/t4_t6_decode.h" #include "spandsp/private/t4_t6_encode.h" #include "spandsp/private/t4_rx.h" #include "spandsp/private/t4_tx.h" #include "spandsp/private/t30.h" #include "spandsp/private/t38_core.h" #include "spandsp/private/t38_non_ecm_buffer.h" #include "spandsp/private/t38_gateway.h" /* This is the target time per transmission chunk. The actual packet timing will sync to the data octets. */ /*! The default number of milliseconds per transmitted IFP when sending bulk T.38 data */ #define DEFAULT_MS_PER_TX_CHUNK 30 /*! The number of bytes which must be in the audio to T.38 HDLC buffer before we start outputting them as IFP messages. */ #define HDLC_START_BUFFER_LEVEL 8 /*! The number of transmissions of indicator IFP packets */ #define INDICATOR_TX_COUNT 3 /*! The number of transmissions of data IFP packets */ #define DATA_TX_COUNT 1 /*! The number of transmissions of terminating data IFP packets */ #define DATA_END_TX_COUNT 3 enum { DISBIT1 = 0x01, DISBIT2 = 0x02, DISBIT3 = 0x04, DISBIT4 = 0x08, DISBIT5 = 0x10, DISBIT6 = 0x20, DISBIT7 = 0x40, DISBIT8 = 0x80 }; enum { HDLC_FLAG_FINISHED = 0x01, HDLC_FLAG_CORRUPT_CRC = 0x02, HDLC_FLAG_PROCEED_WITH_OUTPUT = 0x04, HDLC_FLAG_MISSING_DATA = 0x08 }; enum { FLAG_INDICATOR = 0x100, FLAG_DATA = 0x200 }; enum { TIMED_MODE_STARTUP = 0, TIMED_MODE_IDLE, TIMED_MODE_TCF_PREDICTABLE_MODEM_START_FAST_MODEM_ANNOUNCED, TIMED_MODE_TCF_PREDICTABLE_MODEM_START_FAST_MODEM_SEEN, TIMED_MODE_TCF_PREDICTABLE_MODEM_START_PAST_V21_MODEM, TIMED_MODE_TCF_PREDICTABLE_MODEM_START_BEGIN, }; /*! The maximum number of bytes to be zapped, in order to corrupt NSF, NSS and NSC messages, so the receiver does not recognise them. */ #define MAX_NSX_SUPPRESSION 10 /*! The number of consecutive flags to declare HDLC framing is OK. */ #define HDLC_FRAMING_OK_THRESHOLD 5 static uint8_t nsx_overwrite[2][MAX_NSX_SUPPRESSION] = { {0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0xFF, 0, 0, 0, 0, 0, 0, 0, 0, 0}, }; static int restart_rx_modem(t38_gateway_state_t *s); static int process_rx_indicator(t38_core_state_t *t, void *user_data, int indicator); static void hdlc_underflow_handler(void *user_data); static void to_t38_buffer_init(t38_gateway_to_t38_state_t *s); static void t38_hdlc_rx_put_bit(hdlc_rx_state_t *t, int new_bit); static void non_ecm_put_bit(void *user_data, int bit); static void non_ecm_remove_fill_and_put_bit(void *user_data, int bit); static void non_ecm_push_residue(t38_gateway_state_t *s); static void tone_detected(void *user_data, int tone, int level, int delay); static void set_rx_handler(t38_gateway_state_t *s, span_rx_handler_t *handler, span_rx_fillin_handler_t *fillin_handler, void *user_data) { if (s->audio.modems.rx_handler != span_dummy_rx) { s->audio.modems.rx_handler = handler; s->audio.modems.rx_fillin_handler = fillin_handler; } /*endif*/ s->audio.base_rx_handler = handler; s->audio.base_rx_fillin_handler = fillin_handler; s->audio.modems.rx_user_data = user_data; } /*- End of function --------------------------------------------------------*/ static void set_tx_handler(t38_gateway_state_t *s, span_tx_handler_t *handler, void *user_data) { s->audio.modems.tx_handler = handler; s->audio.modems.tx_user_data = user_data; } /*- End of function --------------------------------------------------------*/ static void set_next_tx_handler(t38_gateway_state_t *s, span_tx_handler_t *handler, void *user_data) { s->audio.modems.next_tx_handler = handler; s->audio.modems.next_tx_user_data = user_data; } /*- End of function --------------------------------------------------------*/ static void set_rx_active(t38_gateway_state_t *s, int active) { s->audio.modems.rx_handler = (active) ? s->audio.base_rx_handler : span_dummy_rx; s->audio.modems.rx_fillin_handler = (active) ? s->audio.base_rx_fillin_handler : span_dummy_rx_fillin; } /*- End of function --------------------------------------------------------*/ static int v17_v21_rx_fillin(void *user_data, int len) { t38_gateway_state_t *t; fax_modems_state_t *s; t = (t38_gateway_state_t *) user_data; s = &t->audio.modems; v17_rx_fillin(&s->fast_modems.v17_rx, len); fsk_rx_fillin(&s->v21_rx, len); return 0; } /*- End of function --------------------------------------------------------*/ static int v17_v21_rx(void *user_data, const int16_t amp[], int len) { t38_gateway_state_t *t; fax_modems_state_t *s; t = (t38_gateway_state_t *) user_data; s = &t->audio.modems; v17_rx(&s->fast_modems.v17_rx, amp, len); if (s->rx_trained) { /* The fast modem has trained, so we no longer need to run the slow one in parallel. */ span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.17 + V.21 to V.17 (%.2fdBm0)\n", v17_rx_signal_power(&s->fast_modems.v17_rx)); set_rx_handler(t, (span_rx_handler_t *) &v17_rx, (span_rx_fillin_handler_t *) &v17_rx_fillin, &s->fast_modems.v17_rx); } else { fsk_rx(&s->v21_rx, amp, len); if (s->rx_signal_present) { span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.17 + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx)); set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &s->v21_rx); } /*endif*/ } /*endif*/ return 0; } /*- End of function --------------------------------------------------------*/ static int v27ter_v21_rx_fillin(void *user_data, int len) { t38_gateway_state_t *t; fax_modems_state_t *s; t = (t38_gateway_state_t *) user_data; s = &t->audio.modems; v27ter_rx_fillin(&s->fast_modems.v27ter_rx, len); fsk_rx_fillin(&s->v21_rx, len); return 0; } /*- End of function --------------------------------------------------------*/ static int v27ter_v21_rx(void *user_data, const int16_t amp[], int len) { t38_gateway_state_t *t; fax_modems_state_t *s; t = (t38_gateway_state_t *) user_data; s = &t->audio.modems; v27ter_rx(&s->fast_modems.v27ter_rx, amp, len); if (s->rx_trained) { /* The fast modem has trained, so we no longer need to run the slow one in parallel. */ span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.27ter + V.21 to V.27ter (%.2fdBm0)\n", v27ter_rx_signal_power(&s->fast_modems.v27ter_rx)); set_rx_handler(t, (span_rx_handler_t *) &v27ter_rx, (span_rx_fillin_handler_t *) &v27ter_v21_rx_fillin, &s->fast_modems.v27ter_rx); } else { fsk_rx(&s->v21_rx, amp, len); if (s->rx_signal_present) { span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.27ter + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx)); set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &s->v21_rx); } /*endif*/ } /*endif*/ return 0; } /*- End of function --------------------------------------------------------*/ static int v29_v21_rx_fillin(void *user_data, int len) { t38_gateway_state_t *t; fax_modems_state_t *s; t = (t38_gateway_state_t *) user_data; s = &t->audio.modems; v29_rx_fillin(&s->fast_modems.v29_rx, len); fsk_rx_fillin(&s->v21_rx, len); return 0; } /*- End of function --------------------------------------------------------*/ static int v29_v21_rx(void *user_data, const int16_t amp[], int len) { t38_gateway_state_t *t; fax_modems_state_t *s; t = (t38_gateway_state_t *) user_data; s = &t->audio.modems; v29_rx(&s->fast_modems.v29_rx, amp, len); if (s->rx_trained) { /* The fast modem has trained, so we no longer need to run the slow one in parallel. */ span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.29 + V.21 to V.29 (%.2fdBm0)\n", v29_rx_signal_power(&s->fast_modems.v29_rx)); set_rx_handler(t, (span_rx_handler_t *) &v29_rx, (span_rx_fillin_handler_t *) &v29_rx_fillin, &s->fast_modems.v29_rx); } else { fsk_rx(&s->v21_rx, amp, len); if (s->rx_signal_present) { span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.29 + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx)); set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &s->v21_rx); } /*endif*/ } /*endif*/ return 0; } /*- End of function --------------------------------------------------------*/ static void tone_detected(void *user_data, int tone, int level, int delay) { t38_gateway_state_t *s; s = (t38_gateway_state_t *) user_data; span_log(&s->logging, SPAN_LOG_FLOW, "%s detected (%ddBm0)\n", modem_connect_tone_to_str(tone), level); } /*- End of function --------------------------------------------------------*/ static void hdlc_underflow_handler(void *user_data) { t38_gateway_state_t *s; t38_gateway_hdlc_state_t *t; s = (t38_gateway_state_t *) user_data; t = &s->core.hdlc_to_modem; span_log(&s->logging, SPAN_LOG_FLOW, "HDLC underflow at %d\n", t->out); /* If the current HDLC buffer is not at the HDLC_FLAG_PROCEED_WITH_OUTPUT stage, this underflow must be an end of preamble condition. */ if ((t->buf[t->out].flags & HDLC_FLAG_PROCEED_WITH_OUTPUT)) { t->buf[t->out].len = 0; t->buf[t->out].flags = 0; t->buf[t->out].contents = 0; if (++t->out >= T38_TX_HDLC_BUFS) t->out = 0; span_log(&s->logging, SPAN_LOG_FLOW, "HDLC next is 0x%X\n", t->buf[t->out].contents); if ((t->buf[t->out].contents & FLAG_INDICATOR)) { /* The next thing in the queue is an indicator, so we need to stop this modem. */ span_log(&s->logging, SPAN_LOG_FLOW, "HDLC shutdown\n"); hdlc_tx_frame(&s->audio.modems.hdlc_tx, NULL, 0); } else if ((t->buf[t->out].contents & FLAG_DATA)) { /* Check if we should start sending the next frame */ if ((t->buf[t->out].flags & HDLC_FLAG_PROCEED_WITH_OUTPUT)) { /* This frame is ready to go, and uses the same modem we are running now. So, send whatever we have. This might or might not be an entire frame. */ span_log(&s->logging, SPAN_LOG_FLOW, "HDLC start next frame\n"); hdlc_tx_frame(&s->audio.modems.hdlc_tx, t->buf[t->out].buf, t->buf[t->out].len); if ((t->buf[t->out].flags & HDLC_FLAG_CORRUPT_CRC)) hdlc_tx_corrupt_frame(&s->audio.modems.hdlc_tx); /*endif*/ } /*endif*/ } /*endif*/ } /*endif*/ } /*- End of function --------------------------------------------------------*/ static int set_next_tx_type(t38_gateway_state_t *s) { get_bit_func_t get_bit_func; void *get_bit_user_data; int indicator; int short_train; fax_modems_state_t *t; t38_gateway_hdlc_state_t *u; t = &s->audio.modems; t38_non_ecm_buffer_report_output_status(&s->core.non_ecm_to_modem, &s->logging); if (t->next_tx_handler) { /* There is a handler queued, so that is the next one. */ set_tx_handler(s, t->next_tx_handler, t->next_tx_user_data); set_next_tx_handler(s, NULL, NULL); if (t->tx_handler == (span_tx_handler_t *) &silence_gen || t->tx_handler == (span_tx_handler_t *) &tone_gen) { set_rx_active(s, TRUE); } else { set_rx_active(s, FALSE); } /*endif*/ return TRUE; } /*endif*/ u = &s->core.hdlc_to_modem; if (u->in == u->out) return FALSE; /*endif*/ if ((u->buf[u->out].contents & FLAG_INDICATOR) == 0) return FALSE; /*endif*/ indicator = (u->buf[u->out].contents & 0xFF); u->buf[u->out].len = 0; u->buf[u->out].flags = 0; u->buf[u->out].contents = 0; if (++u->out >= T38_TX_HDLC_BUFS) u->out = 0; /*endif*/ span_log(&s->logging, SPAN_LOG_FLOW, "Changing to %s\n", t38_indicator_to_str(indicator)); if (s->core.image_data_mode && s->core.ecm_mode) { span_log(&s->logging, SPAN_LOG_FLOW, "HDLC mode\n"); hdlc_tx_init(&t->hdlc_tx, FALSE, 2, TRUE, hdlc_underflow_handler, s); get_bit_func = (get_bit_func_t) hdlc_tx_get_bit; get_bit_user_data = (void *) &t->hdlc_tx; } else { span_log(&s->logging, SPAN_LOG_FLOW, "Non-ECM mode\n"); get_bit_func = t38_non_ecm_buffer_get_bit; get_bit_user_data = (void *) &s->core.non_ecm_to_modem; } /*endif*/ switch (indicator) { case T38_IND_NO_SIGNAL: t->tx_bit_rate = 0; /* Impose 75ms minimum on transmitted silence */ //silence_gen_set(&t->silence_gen, ms_to_samples(75)); set_tx_handler(s, (span_tx_handler_t *) &silence_gen, &t->silence_gen); set_next_tx_handler(s, (span_tx_handler_t *) NULL, NULL); set_rx_active(s, TRUE); break; case T38_IND_CNG: t->tx_bit_rate = 0; modem_connect_tones_tx_init(&t->connect_tx, MODEM_CONNECT_TONES_FAX_CNG); set_tx_handler(s, (span_tx_handler_t *) &modem_connect_tones_tx, &t->connect_tx); silence_gen_set(&t->silence_gen, 0); set_next_tx_handler(s, (span_tx_handler_t *) &silence_gen, &t->silence_gen); set_rx_active(s, TRUE); break; case T38_IND_CED: t->tx_bit_rate = 0; modem_connect_tones_tx_init(&t->connect_tx, MODEM_CONNECT_TONES_FAX_CED); set_tx_handler(s, (span_tx_handler_t *) &modem_connect_tones_tx, &t->connect_tx); set_next_tx_handler(s, (span_tx_handler_t *) NULL, NULL); set_rx_active(s, TRUE); break; case T38_IND_V21_PREAMBLE: t->tx_bit_rate = 300; hdlc_tx_init(&t->hdlc_tx, FALSE, 2, TRUE, hdlc_underflow_handler, s); hdlc_tx_flags(&t->hdlc_tx, 32); silence_gen_alter(&t->silence_gen, ms_to_samples(75)); u->buf[u->in].len = 0; fsk_tx_init(&t->v21_tx, &preset_fsk_specs[FSK_V21CH2], (get_bit_func_t) hdlc_tx_get_bit, &t->hdlc_tx); set_tx_handler(s, (span_tx_handler_t *) &silence_gen, &t->silence_gen); set_next_tx_handler(s, (span_tx_handler_t *) &fsk_tx, &t->v21_tx); set_rx_active(s, TRUE); break; case T38_IND_V27TER_2400_TRAINING: case T38_IND_V27TER_4800_TRAINING: switch (indicator) { case T38_IND_V27TER_2400_TRAINING: t->tx_bit_rate = 2400; break; case T38_IND_V27TER_4800_TRAINING: t->tx_bit_rate = 4800; break; } /*endswitch*/ silence_gen_alter(&t->silence_gen, ms_to_samples(75)); v27ter_tx_restart(&t->fast_modems.v27ter_tx, t->tx_bit_rate, t->use_tep); v27ter_tx_set_get_bit(&t->fast_modems.v27ter_tx, get_bit_func, get_bit_user_data); set_tx_handler(s, (span_tx_handler_t *) &silence_gen, &t->silence_gen); set_next_tx_handler(s, (span_tx_handler_t *) &v27ter_tx, &t->fast_modems.v27ter_tx); set_rx_active(s, TRUE); break; case T38_IND_V29_7200_TRAINING: case T38_IND_V29_9600_TRAINING: switch (indicator) { case T38_IND_V29_7200_TRAINING: t->tx_bit_rate = 7200; break; case T38_IND_V29_9600_TRAINING: t->tx_bit_rate = 9600; break; } /*endswitch*/ silence_gen_alter(&t->silence_gen, ms_to_samples(75)); v29_tx_restart(&t->fast_modems.v29_tx, t->tx_bit_rate, t->use_tep); v29_tx_set_get_bit(&t->fast_modems.v29_tx, get_bit_func, get_bit_user_data); set_tx_handler(s, (span_tx_handler_t *) &silence_gen, &t->silence_gen); set_next_tx_handler(s, (span_tx_handler_t *) &v29_tx, &t->fast_modems.v29_tx); set_rx_active(s, TRUE); break; case T38_IND_V17_7200_SHORT_TRAINING: case T38_IND_V17_7200_LONG_TRAINING: case T38_IND_V17_9600_SHORT_TRAINING: case T38_IND_V17_9600_LONG_TRAINING: case T38_IND_V17_12000_SHORT_TRAINING: case T38_IND_V17_12000_LONG_TRAINING: case T38_IND_V17_14400_SHORT_TRAINING: case T38_IND_V17_14400_LONG_TRAINING: short_train = FALSE; switch (indicator) { case T38_IND_V17_7200_SHORT_TRAINING: short_train = TRUE; t->tx_bit_rate = 7200; break; case T38_IND_V17_7200_LONG_TRAINING: t->tx_bit_rate = 7200; break; case T38_IND_V17_9600_SHORT_TRAINING: short_train = TRUE; t->tx_bit_rate = 9600; break; case T38_IND_V17_9600_LONG_TRAINING: t->tx_bit_rate = 9600; break; case T38_IND_V17_12000_SHORT_TRAINING: short_train = TRUE; t->tx_bit_rate = 12000; break; case T38_IND_V17_12000_LONG_TRAINING: t->tx_bit_rate = 12000; break; case T38_IND_V17_14400_SHORT_TRAINING: short_train = TRUE; t->tx_bit_rate = 14400; break; case T38_IND_V17_14400_LONG_TRAINING: t->tx_bit_rate = 14400; break; } /*endswitch*/ silence_gen_alter(&t->silence_gen, ms_to_samples(75)); v17_tx_restart(&t->fast_modems.v17_tx, t->tx_bit_rate, t->use_tep, short_train); v17_tx_set_get_bit(&t->fast_modems.v17_tx, get_bit_func, get_bit_user_data); set_tx_handler(s, (span_tx_handler_t *) &silence_gen, &t->silence_gen); set_next_tx_handler(s, (span_tx_handler_t *) &v17_tx, &t->fast_modems.v17_tx); set_rx_active(s, TRUE); break; case T38_IND_V8_ANSAM: t->tx_bit_rate = 300; break; case T38_IND_V8_SIGNAL: t->tx_bit_rate = 300; break; case T38_IND_V34_CNTL_CHANNEL_1200: t->tx_bit_rate = 1200; break; case T38_IND_V34_PRI_CHANNEL: t->tx_bit_rate = 33600; break; case T38_IND_V34_CC_RETRAIN: t->tx_bit_rate = 0; break; case T38_IND_V33_12000_TRAINING: t->tx_bit_rate = 12000; break; case T38_IND_V33_14400_TRAINING: t->tx_bit_rate = 14400; break; default: break; } /*endswitch*/ /* For any fast modem, set 200ms of preamble flags */ if (t->tx_bit_rate > 300) hdlc_tx_flags(&t->hdlc_tx, t->tx_bit_rate/(8*5)); /*endif*/ s->t38x.in_progress_rx_indicator = indicator; return TRUE; } /*- End of function --------------------------------------------------------*/ static void finalise_hdlc_frame(t38_gateway_state_t *s, int good_fcs) { t38_gateway_hdlc_buf_t *hdlc_buf; hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; if (!good_fcs || (hdlc_buf->flags & HDLC_FLAG_MISSING_DATA)) hdlc_buf->flags |= HDLC_FLAG_CORRUPT_CRC; /*endif*/ if (s->core.hdlc_to_modem.in == s->core.hdlc_to_modem.out) { /* This is the frame in progress at the output. */ if ((hdlc_buf->flags & HDLC_FLAG_PROCEED_WITH_OUTPUT) == 0) { /* Output of this frame has not yet begun. Throw it all out now. */ hdlc_tx_frame(&s->audio.modems.hdlc_tx, hdlc_buf->buf, hdlc_buf->len); } /*endif*/ if ((hdlc_buf->flags & HDLC_FLAG_CORRUPT_CRC)) hdlc_tx_corrupt_frame(&s->audio.modems.hdlc_tx); /*endif*/ } /*endif*/ hdlc_buf->flags |= (HDLC_FLAG_PROCEED_WITH_OUTPUT | HDLC_FLAG_FINISHED); if (++s->core.hdlc_to_modem.in >= T38_TX_HDLC_BUFS) s->core.hdlc_to_modem.in = 0; /*endif*/ hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; hdlc_buf->len = 0; hdlc_buf->flags = 0; hdlc_buf->contents = 0; } /*- End of function --------------------------------------------------------*/ static void edit_control_messages(t38_gateway_state_t *s, int from_modem, uint8_t *buf, int len) { /* Frames need to be fed to this routine byte by byte as they arrive. It basically just edits the last byte received, based on the frame up to that point. */ if (s->t38x.corrupt_current_frame[from_modem]) { /* We simply need to overwrite a section of the message, so it is not recognisable at the receiver. This is used for the NSF, NSC, and NSS messages. Several strategies are possible for the replacement data. If you have a manufacturer code of your own, the sane thing is to overwrite the original data with that. */ if (len <= s->t38x.suppress_nsx_len[from_modem]) buf[len - 1] = nsx_overwrite[from_modem][len - 4]; /*endif*/ return; } /*endif*/ /* Edit the message, if we need to control the communication between the end points. */ switch (len) { case 3: switch (buf[2]) { case T30_NSF: case T30_NSC: case T30_NSS: if (s->t38x.suppress_nsx_len[from_modem]) { /* Corrupt the message, so it will be ignored by the far end. If it were processed, 2 machines which recognise each other might do special things we cannot handle as a middle man. */ span_log(&s->logging, SPAN_LOG_FLOW, "Corrupting %s message to prevent recognition\n", t30_frametype(buf[2])); s->t38x.corrupt_current_frame[from_modem] = TRUE; } /*endif*/ break; } /*endswitch*/ break; case 4: switch (buf[2]) { case T30_DIS: /* Make sure the V.8 capability doesn't pass through. If it did, two V.34 capable FAX machines might start some V.8 re-negotiation. */ buf[3] &= ~DISBIT6; break; } /*endswitch*/ break; case 5: switch (buf[2]) { case T30_DIS: /* We may need to adjust the capabilities, so they do not exceed our own */ span_log(&s->logging, SPAN_LOG_FLOW, "Applying fast modem type constraints.\n"); switch (buf[4] & (DISBIT6 | DISBIT5 | DISBIT4 | DISBIT3)) { case 0: case DISBIT4: /* V.27ter only */ break; case DISBIT3: case (DISBIT4 | DISBIT3): /* V.27ter and V.29 */ if (!(s->core.supported_modems & T30_SUPPORT_V29)) buf[4] &= ~DISBIT3; /*endif*/ break; case (DISBIT6 | DISBIT4 | DISBIT3): /* V.27ter, V.29 and V.17 */ if (!(s->core.supported_modems & T30_SUPPORT_V17)) buf[4] &= ~DISBIT6; /*endif*/ if (!(s->core.supported_modems & T30_SUPPORT_V29)) buf[4] &= ~DISBIT3; /*endif*/ break; case (DISBIT5 | DISBIT4): case (DISBIT6 | DISBIT4): case (DISBIT6 | DISBIT5 | DISBIT4): case (DISBIT6 | DISBIT5 | DISBIT4 | DISBIT3): /* Reserved */ buf[4] &= ~(DISBIT6 | DISBIT5); buf[4] |= (DISBIT4 | DISBIT3); break; default: /* Not used */ buf[4] &= ~(DISBIT6 | DISBIT5); buf[4] |= (DISBIT4 | DISBIT3); break; } /*endswitch*/ break; } /*endswitch*/ break; case 7: switch (buf[2]) { case T30_DIS: if (!s->core.ecm_allowed) { /* Do not allow ECM or T.6 coding */ span_log(&s->logging, SPAN_LOG_FLOW, "Inhibiting ECM\n"); buf[6] &= ~(DISBIT3 | DISBIT7); } /*endif*/ break; } /*endswitch*/ break; } /*endswitch*/ } /*- End of function --------------------------------------------------------*/ static void monitor_control_messages(t38_gateway_state_t *s, int from_modem, const uint8_t *buf, int len) { static const struct { int bit_rate; int modem_type; uint8_t dcs_code; } modem_codes[] = { {14400, FAX_MODEM_V17_RX, DISBIT6}, {12000, FAX_MODEM_V17_RX, (DISBIT6 | DISBIT4)}, { 9600, FAX_MODEM_V17_RX, (DISBIT6 | DISBIT3)}, { 9600, FAX_MODEM_V29_RX, DISBIT3}, { 7200, FAX_MODEM_V17_RX, (DISBIT6 | DISBIT4 | DISBIT3)}, { 7200, FAX_MODEM_V29_RX, (DISBIT4 | DISBIT3)}, { 4800, FAX_MODEM_V27TER_RX, DISBIT4}, { 2400, FAX_MODEM_V27TER_RX, 0}, { 0, FAX_MODEM_NONE, 0} }; static const int minimum_scan_line_times[8] = { 20, 5, 10, 0, 40, 0, 0, 0 }; int dcs_code; int i; int j; /* Monitor the control messages, at the point where we have the whole message, so we can see what is happening to things like training success/failure. */ span_log(&s->logging, SPAN_LOG_FLOW, "Monitoring %s\n", t30_frametype(buf[2])); if (len < 3) return; /*endif*/ s->core.timed_mode = TIMED_MODE_IDLE; switch (buf[2]) { case T30_CFR: /* We are changing from TCF exchange to image exchange */ /* Successful training means we should change to short training */ s->core.image_data_mode = TRUE; s->core.short_train = TRUE; span_log(&s->logging, SPAN_LOG_FLOW, "CFR - short train = %d, ECM = %d\n", s->core.short_train, s->core.ecm_mode); if (!from_modem) restart_rx_modem(s); /*endif*/ break; case T30_RTN: case T30_RTP: /* We are going back to the exchange of fresh TCF */ s->core.image_data_mode = FALSE; s->core.short_train = FALSE; break; case T30_CTC: if (len >= 5) { /* The table is short, and not searched often, so a brain-dead linear scan seems OK */ dcs_code = buf[4] & (DISBIT6 | DISBIT5 | DISBIT4 | DISBIT3); for (i = 0; modem_codes[i].bit_rate; i++) { if (modem_codes[i].dcs_code == dcs_code) break; /*endif*/ } /*endfor*/ /* If we are processing a message from the modem side, the contents determine the fast receive modem. we are to use. If it comes from the T.38 side the contents do not. */ s->core.fast_bit_rate = modem_codes[i].bit_rate; if (from_modem) s->core.fast_rx_modem = modem_codes[i].modem_type; /*endif*/ } /*endif*/ break; case T30_CTR: /* T.30 says the first image data after this does full training, yet does not return to TCF. This seems to be the sole case of long training for image data. */ s->core.short_train = FALSE; break; case T30_DTC: case T30_DCS: case T30_DCS | 1: /* We need to check which modem type is about to be used, so we can start the correct modem. */ s->core.fast_bit_rate = 0; s->core.fast_rx_modem = FAX_MODEM_NONE; s->core.image_data_mode = FALSE; s->core.short_train = FALSE; if (from_modem) s->core.timed_mode = TIMED_MODE_TCF_PREDICTABLE_MODEM_START_BEGIN; /*endif*/ if (len >= 5) { /* The table is short, and not searched often, so a brain-dead linear scan seems OK */ dcs_code = buf[4] & (DISBIT6 | DISBIT5 | DISBIT4 | DISBIT3); for (i = 0; modem_codes[i].bit_rate; i++) { if (modem_codes[i].dcs_code == dcs_code) break; /*endif*/ } /*endfor*/ /* If we are processing a message from the modem side, the contents determine the fast receive modem. we are to use. If it comes from the T.38 side the contents do not. */ s->core.fast_bit_rate = modem_codes[i].bit_rate; if (from_modem) s->core.fast_rx_modem = modem_codes[i].modem_type; /*endif*/ } /*endif*/ if (len >= 6) { j = (buf[5] & (DISBIT7 | DISBIT6 | DISBIT5)) >> 4; s->core.min_row_bits = (s->core.fast_bit_rate*minimum_scan_line_times[j])/1000; } else { s->core.min_row_bits = 0; } /*endif*/ s->core.ecm_mode = (len >= 7) && (buf[6] & DISBIT3); span_log(&s->logging, SPAN_LOG_FLOW, "Fast rx modem = %d/%d, ECM = %d, Min bits per row = %d\n", s->core.fast_rx_modem, s->core.fast_bit_rate, s->core.ecm_mode, s->core.min_row_bits); break; case T30_PPS: case T30_PPS | 1: switch (buf[3] & 0xFE) { case T30_EOP: case T30_PRI_EOP: case T30_EOM: case T30_PRI_EOM: case T30_EOS: #if 0 /* If we are hitting one of these conditions, it will take another DCS/DTC to select the fast modem again, so abandon our idea of it. */ s->core.fast_bit_rate = 0; s->core.fast_rx_modem = FAX_MODEM_NONE; s->core.image_data_mode = FALSE; s->core.short_train = FALSE; #endif /* Fall through */ case T30_MPS: case T30_PRI_MPS: s->core.count_page_on_mcf = TRUE; break; } /*endswitch*/ break; case T30_EOP: case T30_EOP | 1: case T30_PRI_EOP: case T30_PRI_EOP | 1: case T30_EOM: case T30_EOM | 1: case T30_PRI_EOM: case T30_PRI_EOM | 1: case T30_EOS: case T30_EOS | 1: #if 0 /* If we are hitting one of these conditions, it will take another DCS/DTC to select the fast modem again, so abandon our idea of it. */ s->core.fast_bit_rate = 0; s->core.fast_rx_modem = FAX_MODEM_NONE; s->core.image_data_mode = FALSE; s->core.short_train = FALSE; #endif /* Fall through */ case T30_MPS: case T30_MPS | 1: case T30_PRI_MPS: case T30_PRI_MPS | 1: s->core.count_page_on_mcf = TRUE; break; case T30_MCF: case T30_MCF | 1: if (s->core.count_page_on_mcf) { s->core.pages_confirmed++; span_log(&s->logging, SPAN_LOG_FLOW, "Pages confirmed = %d\n", s->core.pages_confirmed); s->core.count_page_on_mcf = FALSE; } /*endif*/ break; default: break; } /*endswitch*/ } /*- End of function --------------------------------------------------------*/ static void queue_missing_indicator(t38_gateway_state_t *s, int data_type) { t38_core_state_t *t; int expected; int expected_alt; t = &s->t38x.t38; expected = -1; expected_alt = -1; /* Missing packets might have lost us the indicator that should have put us in the required mode of operation. It might be a bit late to fill in such a gap now, but we should try. We may also want to force indicators into the queue, such as when the data says 'end of signal'. */ /* We have an expectation of whether long or short training should occur, but be tolerant of either kind of indicator being present. */ switch (data_type) { case T38_DATA_NONE: expected = T38_IND_NO_SIGNAL; break; case T38_DATA_V21: expected = T38_IND_V21_PREAMBLE; break; case T38_DATA_V27TER_2400: expected = T38_IND_V27TER_2400_TRAINING; break; case T38_DATA_V27TER_4800: expected = T38_IND_V27TER_4800_TRAINING; break; case T38_DATA_V29_7200: expected = T38_IND_V29_7200_TRAINING; break; case T38_DATA_V29_9600: expected = T38_IND_V29_9600_TRAINING; break; case T38_DATA_V17_7200: expected = (s->core.short_train) ? T38_IND_V17_7200_SHORT_TRAINING : T38_IND_V17_7200_LONG_TRAINING; expected_alt = (s->core.short_train) ? T38_IND_V17_7200_LONG_TRAINING : T38_IND_V17_7200_SHORT_TRAINING; break; case T38_DATA_V17_9600: expected = (s->core.short_train) ? T38_IND_V17_9600_SHORT_TRAINING : T38_IND_V17_9600_LONG_TRAINING; expected_alt = (s->core.short_train) ? T38_IND_V17_9600_LONG_TRAINING : T38_IND_V17_9600_SHORT_TRAINING; break; case T38_DATA_V17_12000: expected = (s->core.short_train) ? T38_IND_V17_12000_SHORT_TRAINING : T38_IND_V17_12000_LONG_TRAINING; expected_alt = (s->core.short_train) ? T38_IND_V17_12000_LONG_TRAINING : T38_IND_V17_12000_SHORT_TRAINING; break; case T38_DATA_V17_14400: expected = (s->core.short_train) ? T38_IND_V17_14400_SHORT_TRAINING : T38_IND_V17_14400_LONG_TRAINING; expected_alt = (s->core.short_train) ? T38_IND_V17_14400_LONG_TRAINING : T38_IND_V17_14400_SHORT_TRAINING; break; case T38_DATA_V8: break; case T38_DATA_V34_PRI_RATE: break; case T38_DATA_V34_CC_1200: break; case T38_DATA_V34_PRI_CH: break; case T38_DATA_V33_12000: break; case T38_DATA_V33_14400: break; } /*endswitch*/ if (expected < 0) return; /*endif*/ if (t->current_rx_indicator == expected) return; /*endif*/ if (expected_alt >= 0 && t->current_rx_indicator == expected_alt) return; /*endif*/ span_log(&s->logging, SPAN_LOG_FLOW, "Queuing missing indicator - %s\n", t38_indicator_to_str(expected)); process_rx_indicator(t, (void *) s, expected); /* Force the indicator setting here, as the core won't set in when its missing. */ t->current_rx_indicator = expected; } /*- End of function --------------------------------------------------------*/ static int process_rx_missing(t38_core_state_t *t, void *user_data, int rx_seq_no, int expected_seq_no) { t38_gateway_state_t *s; s = (t38_gateway_state_t *) user_data; s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in].flags |= HDLC_FLAG_MISSING_DATA; return 0; } /*- End of function --------------------------------------------------------*/ static int process_rx_indicator(t38_core_state_t *t, void *user_data, int indicator) { t38_gateway_state_t *s; t38_gateway_hdlc_state_t *u; int immediate; s = (t38_gateway_state_t *) user_data; t38_non_ecm_buffer_report_input_status(&s->core.non_ecm_to_modem, &s->logging); if (t->current_rx_indicator == indicator) { /* This is probably due to the far end repeating itself. Ignore it. Its harmless */ return 0; } /*endif*/ u = &s->core.hdlc_to_modem; immediate = (u->in == u->out); if (u->buf[u->in].contents) { if (++u->in >= T38_TX_HDLC_BUFS) u->in = 0; /*endif*/ } /*endif*/ u->buf[u->in].contents = (indicator | FLAG_INDICATOR); if (++u->in >= T38_TX_HDLC_BUFS) u->in = 0; /*endif*/ if (immediate) { span_log(&s->logging, SPAN_LOG_FLOW, "Changing - (%d) %s -> %s\n", silence_gen_remainder(&s->audio.modems.silence_gen), t38_indicator_to_str(t->current_rx_indicator), t38_indicator_to_str(indicator)); switch (s->t38x.current_rx_field_class) { case T38_FIELD_CLASS_NONE: break; case T38_FIELD_CLASS_HDLC: span_log(&s->logging, SPAN_LOG_FLOW, "HDLC shutdown\n"); hdlc_tx_frame(&s->audio.modems.hdlc_tx, NULL, 0); break; case T38_FIELD_CLASS_NON_ECM: break; } } else { span_log(&s->logging, SPAN_LOG_FLOW, "Queued change - (%d) %s -> %s\n", silence_gen_remainder(&s->audio.modems.silence_gen), t38_indicator_to_str(t->current_rx_indicator), t38_indicator_to_str(indicator)); } s->t38x.current_rx_field_class = T38_FIELD_CLASS_NONE; /* We need to set this here, since we might have been called as a fake indication when the real one was missing */ t->current_rx_indicator = indicator; return 0; } /*- End of function --------------------------------------------------------*/ static void process_hdlc_data(t38_gateway_state_t *s, int data_type, const uint8_t *buf, int len) { t38_gateway_hdlc_buf_t *hdlc_buf; int i; hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; /* Check if this data would overflow the buffer. */ if (hdlc_buf->len + len > T38_MAX_HDLC_LEN) { s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in].flags |= HDLC_FLAG_MISSING_DATA; return; } /*endif*/ hdlc_buf->contents = (data_type | FLAG_DATA); bit_reverse(&hdlc_buf->buf[hdlc_buf->len], buf, len); /* We need to send out the control messages as they are arriving. They are too slow to capture a whole frame before starting to pass it on. For the faster frames, take in the whole frame before sending it out. Also, there is no need to monitor, or modify, the contents of the faster frames. */ if (data_type == T38_DATA_V21) { for (i = 1; i <= len; i++) edit_control_messages(s, 0, hdlc_buf->buf, hdlc_buf->len + i); /*endfor*/ /* Don't start pumping data into the actual output stream until there is enough backlog to create some elasticity for jitter tolerance. */ if (hdlc_buf->len + len >= HDLC_START_BUFFER_LEVEL) { if (s->core.hdlc_to_modem.in == s->core.hdlc_to_modem.out) { /* Output is not running, so kick it into life. */ if ((hdlc_buf->flags & HDLC_FLAG_PROCEED_WITH_OUTPUT) == 0) hdlc_tx_frame(&s->audio.modems.hdlc_tx, hdlc_buf->buf, hdlc_buf->len + len); else hdlc_tx_frame(&s->audio.modems.hdlc_tx, hdlc_buf->buf + hdlc_buf->len, len); /*endif*/ } /*endif*/ hdlc_buf->flags |= HDLC_FLAG_PROCEED_WITH_OUTPUT; } /*endif*/ } /*endif*/ hdlc_buf->len += len; } /*- End of function --------------------------------------------------------*/ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type, int field_type, const uint8_t *buf, int len) { t38_gateway_state_t *s; t38_gateway_t38_state_t *xx; t38_gateway_hdlc_buf_t *hdlc_buf; s = (t38_gateway_state_t *) user_data; xx = &s->t38x; /* There are a couple of special cases of data type that need their own treatment. */ switch (data_type) { case T38_DATA_V8: switch (field_type) { case T38_FIELD_CM_MESSAGE: if (len >= 1) span_log(&s->logging, SPAN_LOG_FLOW, "CM profile %d - %s\n", buf[0] - '0', t38_cm_profile_to_str(buf[0])); else span_log(&s->logging, SPAN_LOG_FLOW, "Bad length for CM message - %d\n", len); /*endif*/ break; case T38_FIELD_JM_MESSAGE: if (len >= 2) span_log(&s->logging, SPAN_LOG_FLOW, "JM - %s\n", t38_jm_to_str(buf, len)); else span_log(&s->logging, SPAN_LOG_FLOW, "Bad length for JM message - %d\n", len); /*endif*/ break; case T38_FIELD_CI_MESSAGE: if (len >= 1) span_log(&s->logging, SPAN_LOG_FLOW, "CI 0x%X\n", buf[0]); else span_log(&s->logging, SPAN_LOG_FLOW, "Bad length for CI message - %d\n", len); /*endif*/ break; default: break; } /*endswitch*/ return 0; case T38_DATA_V34_PRI_RATE: switch (field_type) { case T38_FIELD_V34RATE: if (len >= 3) { xx->t38.v34_rate = t38_v34rate_to_bps(buf, len); span_log(&s->logging, SPAN_LOG_FLOW, "V.34 rate %d bps\n", xx->t38.v34_rate); } else { span_log(&s->logging, SPAN_LOG_FLOW, "Bad length for V34rate message - %d\n", len); } /*endif*/ break; default: break; } /*endswitch*/ return 0; default: break; } /*endswitch*/ switch (field_type) { case T38_FIELD_HDLC_DATA: xx->current_rx_field_class = T38_FIELD_CLASS_HDLC; hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; if (hdlc_buf->contents != (data_type | FLAG_DATA)) { queue_missing_indicator(s, data_type); /* All real HDLC messages in the FAX world start with 0xFF. If this one is not starting with 0xFF it would appear some octets must have been missed before this one. */ if (len <= 0 || buf[0] != 0xFF) s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in].flags |= HDLC_FLAG_MISSING_DATA; /*endif*/ hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; } /*endif*/ if (len > 0) process_hdlc_data(s, data_type, buf, len); /*endif*/ break; case T38_FIELD_HDLC_FCS_OK: xx->current_rx_field_class = T38_FIELD_CLASS_HDLC; hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; if (len > 0) { span_log(&s->logging, SPAN_LOG_WARNING, "There is data in a T38_FIELD_HDLC_FCS_OK!\n"); /* The sender has incorrectly included data in this message. Cisco implemented inserting HDLC data here and Commetrex followed for compatibility reasons. We should, too. */ process_hdlc_data(s, data_type, buf, len); } /*endif*/ /* Some T.38 implementations send multiple T38_FIELD_HDLC_FCS_OK messages, in IFP packets with incrementing sequence numbers, which are actually repeats. They get through to this point because of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */ if (hdlc_buf->len > 0) { span_log(&s->logging, SPAN_LOG_FLOW, "HDLC frame type %s - CRC good\n", t30_frametype(hdlc_buf->buf[2])); if (hdlc_buf->contents != (data_type | FLAG_DATA)) { queue_missing_indicator(s, data_type); hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; } /*endif*/ if (data_type == T38_DATA_V21) { if ((hdlc_buf->flags & HDLC_FLAG_MISSING_DATA) == 0) { monitor_control_messages(s, FALSE, hdlc_buf->buf, hdlc_buf->len); if (s->core.real_time_frame_handler) s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, FALSE, hdlc_buf->buf, hdlc_buf->len); /*endif*/ } /*endif*/ } else { /* Make sure we go back to short training if CTC/CTR has kicked us into long training. There has to be more than one value HDLC frame in a chunk of image data, so just setting short training mode here should be enough. */ s->core.short_train = TRUE; } /*endif*/ hdlc_buf->contents = (data_type | FLAG_DATA); finalise_hdlc_frame(s, TRUE); } else { /* Just restart using the current frame buffer */ hdlc_buf->contents = 0; } /*endif*/ xx->corrupt_current_frame[0] = FALSE; break; case T38_FIELD_HDLC_FCS_BAD: xx->current_rx_field_class = T38_FIELD_CLASS_HDLC; hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; if (len > 0) { span_log(&s->logging, SPAN_LOG_WARNING, "There is data in a T38_FIELD_HDLC_FCS_BAD!\n"); /* The sender has incorrectly included data in this message. Cisco implemented inserting HDLC data here and Commetrex followed for compatibility reasons. We should, too. */ process_hdlc_data(s, data_type, buf, len); } /*endif*/ /* Some T.38 implementations send multiple T38_FIELD_HDLC_FCS_BAD messages, in IFP packets with incrementing sequence numbers, which are actually repeats. They get through to this point because of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */ if (hdlc_buf->len > 0) { span_log(&s->logging, SPAN_LOG_FLOW, "HDLC frame type %s - CRC bad\n", t30_frametype(hdlc_buf->buf[2])); if (hdlc_buf->contents != (data_type | FLAG_DATA)) { queue_missing_indicator(s, data_type); hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; } /*endif*/ hdlc_buf->contents = (data_type | FLAG_DATA); finalise_hdlc_frame(s, FALSE); } else { /* Just restart using the current frame buffer */ hdlc_buf->contents = 0; } /*endif*/ xx->corrupt_current_frame[0] = FALSE; break; case T38_FIELD_HDLC_FCS_OK_SIG_END: xx->current_rx_field_class = T38_FIELD_CLASS_HDLC; hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; if (len > 0) { span_log(&s->logging, SPAN_LOG_WARNING, "There is data in a T38_FIELD_HDLC_FCS_OK_SIG_END!\n"); /* The sender has incorrectly included data in this message. Cisco implemented inserting HDLC data here and Commetrex followed for compatibility reasons. We should, too. */ process_hdlc_data(s, data_type, buf, len); } /*endif*/ /* Some T.38 implementations send multiple T38_FIELD_HDLC_FCS_OK_SIG_END messages, in IFP packets with incrementing sequence numbers, which are actually repeats. They get through to this point because of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */ if (hdlc_buf->len > 0) { span_log(&s->logging, SPAN_LOG_FLOW, "HDLC frame type %s - CRC OK, sig end\n", t30_frametype(hdlc_buf->buf[2])); if (hdlc_buf->contents != (data_type | FLAG_DATA)) { queue_missing_indicator(s, data_type); hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; } /*endif*/ if (data_type == T38_DATA_V21) { if ((hdlc_buf->flags & HDLC_FLAG_MISSING_DATA) == 0) { monitor_control_messages(s, FALSE, hdlc_buf->buf, hdlc_buf->len); if (s->core.real_time_frame_handler) s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, FALSE, hdlc_buf->buf, hdlc_buf->len); /*endif*/ } /*endif*/ } else { /* Make sure we go back to short training if CTC/CTR has kicked us into long training. There has to be more than one value HDLC frame in a chunk of image data, so just setting short training mode here should be enough. */ s->core.short_train = TRUE; } /*endif*/ hdlc_buf->contents = (data_type | FLAG_DATA); finalise_hdlc_frame(s, TRUE); } else { /* Just restart using the current frame buffer */ hdlc_buf->contents = 0; } /*endif*/ if (t->current_rx_data_type != data_type || t->current_rx_field_type != field_type) { queue_missing_indicator(s, T38_DATA_NONE); xx->current_rx_field_class = T38_FIELD_CLASS_NONE; } /*endif*/ xx->corrupt_current_frame[0] = FALSE; break; case T38_FIELD_HDLC_FCS_BAD_SIG_END: xx->current_rx_field_class = T38_FIELD_CLASS_HDLC; hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; if (len > 0) { span_log(&s->logging, SPAN_LOG_WARNING, "There is data in a T38_FIELD_HDLC_FCS_BAD_SIG_END!\n"); /* The sender has incorrectly included data in this message. Cisco implemented inserting HDLC data here and Commetrex followed for compatibility reasons. We should, too. */ process_hdlc_data(s, data_type, buf, len); } /*endif*/ /* Some T.38 implementations send multiple T38_FIELD_HDLC_FCS_BAD_SIG_END messages, in IFP packets with incrementing sequence numbers, which are actually repeats. They get through to this point because of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */ if (hdlc_buf->len > 0) { span_log(&s->logging, SPAN_LOG_FLOW, "HDLC frame type %s - CRC bad, sig end\n", t30_frametype(hdlc_buf->buf[2])); if (hdlc_buf->contents != (data_type | FLAG_DATA)) { queue_missing_indicator(s, data_type); hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; } /*endif*/ hdlc_buf->contents = (data_type | FLAG_DATA); finalise_hdlc_frame(s, FALSE); } else { /* Just restart using the current frame buffer */ hdlc_buf->contents = 0; } /*endif*/ if (t->current_rx_data_type != data_type || t->current_rx_field_type != field_type) { queue_missing_indicator(s, T38_DATA_NONE); xx->current_rx_field_class = T38_FIELD_CLASS_NONE; } /*endif*/ xx->corrupt_current_frame[0] = FALSE; break; case T38_FIELD_HDLC_SIG_END: hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; if (len > 0) { span_log(&s->logging, SPAN_LOG_WARNING, "There is data in a T38_FIELD_HDLC_SIG_END!\n"); /* The sender has incorrectly included data in this message, but there seems nothing meaningful it could be. There could not be an FCS good/bad report beyond this. */ } /*endif*/ /* Some T.38 implementations send multiple T38_FIELD_HDLC_SIG_END messages, in IFP packets with incrementing sequence numbers, which are actually repeats. They get through to this point because of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */ if (t->current_rx_data_type != data_type || t->current_rx_field_type != field_type) { if (hdlc_buf->contents != (data_type | FLAG_DATA)) { queue_missing_indicator(s, data_type); hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; } /*endif*/ /* WORKAROUND: At least some Mediatrix boxes have a bug, where they can send this message at the end of non-ECM data. We need to tolerate this. */ if (xx->current_rx_field_class == T38_FIELD_CLASS_NON_ECM) { span_log(&s->logging, SPAN_LOG_WARNING, "T38_FIELD_HDLC_SIG_END received at the end of non-ECM data!\n"); /* Don't flow control the data any more. Just pump out the remainder as fast as we can. */ t38_non_ecm_buffer_push(&s->core.non_ecm_to_modem); } else { /* This message is expected under 2 circumstances. One is as an alternative to T38_FIELD_HDLC_FCS_OK_SIG_END - i.e. they send T38_FIELD_HDLC_FCS_OK, and then T38_FIELD_HDLC_SIG_END when the carrier actually drops. The other is because the HDLC signal drops unexpectedly - i.e. not just after a final frame. In this case we just clear out any partial frame data that might be in the buffer. */ /* TODO: what if any junk in the buffer has reached the HDLC_FLAG_PROCEED_WITH_OUTPUT stage? */ hdlc_buf->len = 0; hdlc_buf->flags = 0; hdlc_buf->contents = 0; } /*endif*/ queue_missing_indicator(s, T38_DATA_NONE); xx->current_rx_field_class = T38_FIELD_CLASS_NONE; } /*endif*/ xx->corrupt_current_frame[0] = FALSE; break; case T38_FIELD_T4_NON_ECM_DATA: if (xx->current_rx_field_class == T38_FIELD_CLASS_NONE) t38_non_ecm_buffer_set_mode(&s->core.non_ecm_to_modem, s->core.image_data_mode, s->core.min_row_bits); xx->current_rx_field_class = T38_FIELD_CLASS_NON_ECM; hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; if (hdlc_buf->contents != (data_type | FLAG_DATA)) { queue_missing_indicator(s, data_type); hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; } /*endif*/ if (len > 0) t38_non_ecm_buffer_inject(&s->core.non_ecm_to_modem, buf, len); /*endif*/ xx->corrupt_current_frame[0] = FALSE; break; case T38_FIELD_T4_NON_ECM_SIG_END: if (xx->current_rx_field_class == T38_FIELD_CLASS_NONE) t38_non_ecm_buffer_set_mode(&s->core.non_ecm_to_modem, s->core.image_data_mode, s->core.min_row_bits); hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; /* Some T.38 implementations send multiple T38_FIELD_T4_NON_ECM_SIG_END messages, in IFP packets with incrementing sequence numbers, which are actually repeats. They get through to this point because of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */ if (t->current_rx_data_type != data_type || t->current_rx_field_type != field_type) { /* WORKAROUND: At least some Mediatrix boxes have a bug, where they can send HDLC signal end where they should send non-ECM signal end. It is possible they also do the opposite. We need to tolerate this. */ if (xx->current_rx_field_class == T38_FIELD_CLASS_NON_ECM) { if (len > 0) { if (hdlc_buf->contents != (data_type | FLAG_DATA)) { queue_missing_indicator(s, data_type); hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; } /*endif*/ t38_non_ecm_buffer_inject(&s->core.non_ecm_to_modem, buf, len); } /*endif*/ if (hdlc_buf->contents != (data_type | FLAG_DATA)) { queue_missing_indicator(s, data_type); hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; } /*endif*/ /* Don't flow control the data any more. Just pump out the remainder as fast as we can. */ t38_non_ecm_buffer_push(&s->core.non_ecm_to_modem); } else { span_log(&s->logging, SPAN_LOG_WARNING, "T38_FIELD_NON_ECM_SIG_END received at the end of HDLC data!\n"); if (s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in].contents != (data_type | FLAG_DATA)) { queue_missing_indicator(s, data_type); hdlc_buf = &s->core.hdlc_to_modem.buf[s->core.hdlc_to_modem.in]; } /*endif*/ /* TODO: what if any junk in the buffer has reached the HDLC_FLAG_PROCEED_WITH_OUTPUT stage? */ hdlc_buf->len = 0; hdlc_buf->flags = 0; hdlc_buf->contents = 0; } /*endif*/ queue_missing_indicator(s, T38_DATA_NONE); xx->current_rx_field_class = T38_FIELD_CLASS_NONE; } /*endif*/ xx->corrupt_current_frame[0] = FALSE; break; default: break; } /*endswitch*/ #if 0 if (span_log_test(&s->logging, SPAN_LOG_FLOW)) { int i; if (len > 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Data: "); for (i = 0; i < len; i++) span_log(&s->logging, SPAN_LOG_FLOW | SPAN_LOG_SUPPRESS_LABELLING, " %02X", buf[i]); /*endfor*/ } /*endif*/ } /*endif*/ span_log(&s->logging, SPAN_LOG_FLOW | SPAN_LOG_SUPPRESS_LABELLING, "\n"); #endif return 0; } /*- End of function --------------------------------------------------------*/ static void set_octets_per_data_packet(t38_gateway_state_t *s, int bit_rate) { int octets; //octets = s->core.ms_per_tx_chunk*bit_rate/(8*1000); octets = DEFAULT_MS_PER_TX_CHUNK*bit_rate/(8*1000); if (octets < 1) octets = 1; /*endif*/ s->core.to_t38.octets_per_data_packet = octets; } /*- End of function --------------------------------------------------------*/ static int set_slow_packetisation(t38_gateway_state_t *s) { set_octets_per_data_packet(s, 300); s->t38x.current_tx_data_type = T38_DATA_V21; return T38_IND_V21_PREAMBLE; } /*- End of function --------------------------------------------------------*/ static int set_fast_packetisation(t38_gateway_state_t *s) { int ind; ind = T38_IND_NO_SIGNAL; switch (s->core.fast_rx_active) { case FAX_MODEM_V17_RX: set_octets_per_data_packet(s, s->core.fast_bit_rate); switch (s->core.fast_bit_rate) { case 7200: ind = (s->core.short_train) ? T38_IND_V17_7200_SHORT_TRAINING : T38_IND_V17_7200_LONG_TRAINING; s->t38x.current_tx_data_type = T38_DATA_V17_7200; break; case 9600: ind = (s->core.short_train) ? T38_IND_V17_9600_SHORT_TRAINING : T38_IND_V17_9600_LONG_TRAINING; s->t38x.current_tx_data_type = T38_DATA_V17_9600; break; case 12000: ind = (s->core.short_train) ? T38_IND_V17_12000_SHORT_TRAINING : T38_IND_V17_12000_LONG_TRAINING; s->t38x.current_tx_data_type = T38_DATA_V17_12000; break; default: case 14400: ind = (s->core.short_train) ? T38_IND_V17_14400_SHORT_TRAINING : T38_IND_V17_14400_LONG_TRAINING; s->t38x.current_tx_data_type = T38_DATA_V17_14400; break; } /*endswitch*/ break; case FAX_MODEM_V27TER_RX: set_octets_per_data_packet(s, s->core.fast_bit_rate); switch (s->core.fast_bit_rate) { case 2400: ind = T38_IND_V27TER_2400_TRAINING; s->t38x.current_tx_data_type = T38_DATA_V27TER_2400; break; default: case 4800: ind = T38_IND_V27TER_4800_TRAINING; s->t38x.current_tx_data_type = T38_DATA_V27TER_4800; break; } /*endswitch*/ break; case FAX_MODEM_V29_RX: set_octets_per_data_packet(s, s->core.fast_bit_rate); switch (s->core.fast_bit_rate) { case 7200: ind = T38_IND_V29_7200_TRAINING; s->t38x.current_tx_data_type = T38_DATA_V29_7200; break; default: case 9600: ind = T38_IND_V29_9600_TRAINING; s->t38x.current_tx_data_type = T38_DATA_V29_9600; break; } /*endswitch*/ break; } /*endswitch*/ return ind; } /*- End of function --------------------------------------------------------*/ static void announce_training(t38_gateway_state_t *s) { t38_core_send_indicator(&s->t38x.t38, set_fast_packetisation(s)); } /*- End of function --------------------------------------------------------*/ static void non_ecm_rx_status(void *user_data, int status) { t38_gateway_state_t *s; s = (t38_gateway_state_t *) user_data; span_log(&s->logging, SPAN_LOG_FLOW, "Non-ECM signal status is %s (%d)\n", signal_status_to_str(status), status); switch (status) { case SIG_STATUS_TRAINING_IN_PROGRESS: if (s->core.timed_mode == TIMED_MODE_IDLE) { announce_training(s); } else { if (s->core.timed_mode == TIMED_MODE_TCF_PREDICTABLE_MODEM_START_PAST_V21_MODEM) s->core.timed_mode = TIMED_MODE_TCF_PREDICTABLE_MODEM_START_FAST_MODEM_SEEN; else s->core.samples_to_timeout = ms_to_samples(500); /*endif*/ set_fast_packetisation(s); } /*endif*/ break; case SIG_STATUS_TRAINING_FAILED: break; case SIG_STATUS_TRAINING_SUCCEEDED: /* The modem is now trained */ s->audio.modems.rx_signal_present = TRUE; s->audio.modems.rx_trained = TRUE; s->core.timed_mode = TIMED_MODE_IDLE; s->core.samples_to_timeout = 0; s->core.short_train = TRUE; to_t38_buffer_init(&s->core.to_t38); break; case SIG_STATUS_CARRIER_UP: break; case SIG_STATUS_CARRIER_DOWN: switch (s->t38x.current_tx_data_type) { case T38_DATA_V17_7200: case T38_DATA_V17_9600: case T38_DATA_V17_12000: case T38_DATA_V17_14400: case T38_DATA_V27TER_2400: case T38_DATA_V27TER_4800: case T38_DATA_V29_7200: case T38_DATA_V29_9600: if (s->core.timed_mode != TIMED_MODE_TCF_PREDICTABLE_MODEM_START_FAST_MODEM_ANNOUNCED) { /* TODO: If the carrier really did fall for good during the 500ms TEP blocking timeout, we won't declare the no-signal condition. */ non_ecm_push_residue(s); t38_core_send_indicator(&s->t38x.t38, T38_IND_NO_SIGNAL); } /*endif*/ restart_rx_modem(s); break; } /*endswitch*/ break; default: span_log(&s->logging, SPAN_LOG_WARNING, "Unexpected non-ECM special bit - %d!\n", status); break; } /*endswitch*/ } /*- End of function --------------------------------------------------------*/ static void to_t38_buffer_init(t38_gateway_to_t38_state_t *s) { s->data_ptr = 0; s->bit_stream = 0xFFFF; s->bit_no = 0; s->in_bits = 0; s->out_octets = 0; } /*- End of function --------------------------------------------------------*/ static void non_ecm_push_residue(t38_gateway_state_t *t) { t38_gateway_to_t38_state_t *s; s = &t->core.to_t38; if (s->bit_no) { /* There is a fractional octet in progress. We might as well send every last bit we can. */ s->data[s->data_ptr++] = (uint8_t) (s->bit_stream << (8 - s->bit_no)); } /*endif*/ t38_core_send_data(&t->t38x.t38, t->t38x.current_tx_data_type, T38_FIELD_T4_NON_ECM_SIG_END, s->data, s->data_ptr, T38_PACKET_CATEGORY_IMAGE_DATA_END); s->in_bits += s->bits_absorbed; s->out_octets += s->data_ptr; s->data_ptr = 0; } /*- End of function --------------------------------------------------------*/ static void non_ecm_push(t38_gateway_state_t *t) { t38_gateway_to_t38_state_t *s; s = &t->core.to_t38; if (s->data_ptr) { t38_core_send_data(&t->t38x.t38, t->t38x.current_tx_data_type, T38_FIELD_T4_NON_ECM_DATA, s->data, s->data_ptr, T38_PACKET_CATEGORY_IMAGE_DATA); s->in_bits += s->bits_absorbed; s->out_octets += s->data_ptr; s->bits_absorbed = 0; s->data_ptr = 0; } /*endif*/ } /*- End of function --------------------------------------------------------*/ static void non_ecm_put_bit(void *user_data, int bit) { t38_gateway_state_t *t; t38_gateway_to_t38_state_t *s; if (bit < 0) { non_ecm_rx_status(user_data, bit); return; } /*endif*/ t = (t38_gateway_state_t *) user_data; s = &t->core.to_t38; s->in_bits++; bit &= 1; s->bit_stream = (s->bit_stream << 1) | bit; if (++s->bit_no >= 8) { s->data[s->data_ptr++] = (uint8_t) s->bit_stream & 0xFF; if (s->data_ptr >= s->octets_per_data_packet) non_ecm_push(t); /*endif*/ s->bit_no = 0; } /*endif*/ } /*- End of function --------------------------------------------------------*/ static void non_ecm_remove_fill_and_put_bit(void *user_data, int bit) { t38_gateway_state_t *t; t38_gateway_to_t38_state_t *s; if (bit < 0) { non_ecm_rx_status(user_data, bit); return; } /*endif*/ t = (t38_gateway_state_t *) user_data; s = &t->core.to_t38; s->bits_absorbed++; bit &= 1; /* Drop any extra zero bits when we already have enough for an EOL symbol. */ /* The snag here is that if we just look for 11 bits, a line ending with a code that has trailing zero bits will cause problems. The longest run of trailing zeros for any code is 3, so we need to look for at least 14 zeros if we don't want to actually analyse the compressed data in depth. This means we do not strip every fill bit, but we strip most of them. */ if ((s->bit_stream & 0x3FFF) == 0 && bit == 0) { if (s->bits_absorbed > 2*8*s->octets_per_data_packet) { /* We need to pump out what we have, even though we have not accumulated a full buffer of data. If we don't, we stand to delay rows excessively, so the far end gateway (assuming the far end is a gateway) cannot play them out. */ non_ecm_push(t); } /*endif*/ return; } /*endif*/ s->bit_stream = (s->bit_stream << 1) | bit; if (++s->bit_no >= 8) { s->data[s->data_ptr++] = (uint8_t) s->bit_stream & 0xFF; if (s->data_ptr >= s->octets_per_data_packet) non_ecm_push(t); /*endif*/ s->bit_no = 0; } /*endif*/ } /*- End of function --------------------------------------------------------*/ static void hdlc_rx_status(hdlc_rx_state_t *t, int status) { t38_gateway_state_t *s; int category; s = (t38_gateway_state_t *) t->frame_user_data; span_log(&s->logging, SPAN_LOG_FLOW, "HDLC signal status is %s (%d)\n", signal_status_to_str(status), status); switch (status) { case SIG_STATUS_TRAINING_IN_PROGRESS: announce_training(s); break; case SIG_STATUS_TRAINING_FAILED: break; case SIG_STATUS_TRAINING_SUCCEEDED: /* The modem is now trained. */ s->audio.modems.rx_signal_present = TRUE; s->audio.modems.rx_trained = TRUE; s->core.short_train = TRUE; /* Behave like HDLC preamble has been announced. */ t->framing_ok_announced = TRUE; to_t38_buffer_init(&s->core.to_t38); break; case SIG_STATUS_CARRIER_UP: /* Reset the HDLC receiver. */ t->raw_bit_stream = 0; t->len = 0; t->num_bits = 0; t->flags_seen = 0; t->framing_ok_announced = FALSE; to_t38_buffer_init(&s->core.to_t38); break; case SIG_STATUS_CARRIER_DOWN: if (t->framing_ok_announced) { category = (s->t38x.current_tx_data_type == T38_DATA_V21) ? T38_PACKET_CATEGORY_CONTROL_DATA_END : T38_PACKET_CATEGORY_IMAGE_DATA_END; t38_core_send_data(&s->t38x.t38, s->t38x.current_tx_data_type, T38_FIELD_HDLC_SIG_END, NULL, 0, category); t38_core_send_indicator(&s->t38x.t38, T38_IND_NO_SIGNAL); t->framing_ok_announced = FALSE; } /*endif*/ restart_rx_modem(s); if (s->core.timed_mode == TIMED_MODE_TCF_PREDICTABLE_MODEM_START_BEGIN) { /* If we are doing TCF, we need to announce the fast carrier training very quickly, to ensure it starts 75+-20ms after the HDLC carrier ends. Waiting until it trains will be too late. We need to announce the fast modem a fixed time after the end of the V.21 carrier, in anticipation of its arrival. If we announce it, and it doesn't arrive, we will worry about that later. */ s->core.samples_to_timeout = ms_to_samples(75); s->core.timed_mode = TIMED_MODE_TCF_PREDICTABLE_MODEM_START_PAST_V21_MODEM; } /*endif*/ break; default: span_log(&s->logging, SPAN_LOG_WARNING, "Unexpected HDLC special bit - %d!\n", status); break; } /*endswitch*/ } /*- End of function --------------------------------------------------------*/ static void rx_flag_or_abort(hdlc_rx_state_t *t) { t38_gateway_state_t *s; t38_gateway_to_t38_state_t *u; int category; s = (t38_gateway_state_t *) t->frame_user_data; u = &s->core.to_t38; if ((t->raw_bit_stream & 0x80)) { /* Hit HDLC abort */ t->rx_aborts++; if (t->flags_seen < t->framing_ok_threshold) t->flags_seen = 0; else t->flags_seen = t->framing_ok_threshold - 1; /*endif*/ } else { /* Hit HDLC flag */ if (t->flags_seen >= t->framing_ok_threshold) { category = (s->t38x.current_tx_data_type == T38_DATA_V21) ? T38_PACKET_CATEGORY_CONTROL_DATA : T38_PACKET_CATEGORY_IMAGE_DATA; if (t->len) { /* This is not back-to-back flags */ if (t->len >= 2) { if (u->data_ptr) { bit_reverse(u->data, t->buffer + t->len - 2 - u->data_ptr, u->data_ptr); t38_core_send_data(&s->t38x.t38, s->t38x.current_tx_data_type, T38_FIELD_HDLC_DATA, u->data, u->data_ptr, category); } /*endif*/ if (t->num_bits != 7) { t->rx_crc_errors++; span_log(&s->logging, SPAN_LOG_FLOW, "HDLC frame type %s, misaligned terminating flag at %d\n", t30_frametype(t->buffer[2]), t->len); /* It seems some boxes may not like us sending a _SIG_END here, and then another when the carrier actually drops. Lets just send T38_FIELD_HDLC_FCS_OK here. */ if (t->len > 2) t38_core_send_data(&s->t38x.t38, s->t38x.current_tx_data_type, T38_FIELD_HDLC_FCS_BAD, NULL, 0, category); /*endif*/ } else if ((u->crc & 0xFFFF) != 0xF0B8) { t->rx_crc_errors++; span_log(&s->logging, SPAN_LOG_FLOW, "HDLC frame type %s, bad CRC at %d\n", t30_frametype(t->buffer[2]), t->len); /* It seems some boxes may not like us sending a _SIG_END here, and then another when the carrier actually drops. Lets just send T38_FIELD_HDLC_FCS_OK here. */ if (t->len > 2) t38_core_send_data(&s->t38x.t38, s->t38x.current_tx_data_type, T38_FIELD_HDLC_FCS_BAD, NULL, 0, category); /*endif*/ } else { t->rx_frames++; t->rx_bytes += t->len - 2; span_log(&s->logging, SPAN_LOG_FLOW, "HDLC frame type %s, CRC OK\n", t30_frametype(t->buffer[2])); if (s->t38x.current_tx_data_type == T38_DATA_V21) { monitor_control_messages(s, TRUE, t->buffer, t->len - 2); if (s->core.real_time_frame_handler) s->core.real_time_frame_handler(s, s->core.real_time_frame_user_data, TRUE, t->buffer, t->len - 2); /*endif*/ } else { /* Make sure we go back to short training if CTC/CTR has kicked us into long training. Any successful HDLC frame received at a rate other than V.21 is an adequate indication we should change. */ s->core.short_train = TRUE; } /*endif*/ /* It seems some boxes may not like us sending a _SIG_END here, and then another when the carrier actually drops. Lets just send T38_FIELD_HDLC_FCS_OK here. */ t38_core_send_data(&s->t38x.t38, s->t38x.current_tx_data_type, T38_FIELD_HDLC_FCS_OK, NULL, 0, category); } /*endif*/ } else { /* Frame too short */ t->rx_length_errors++; } /*endif*/ } /*endif*/ } else { /* Check the flags are back-to-back when testing for valid preamble. This greatly reduces the chances of false preamble detection, and anything which doesn't send them back-to-back is badly broken. */ if (t->num_bits != 7) t->flags_seen = 0; /*endif*/ if (++t->flags_seen >= t->framing_ok_threshold && !t->framing_ok_announced) { if (s->t38x.current_tx_data_type == T38_DATA_V21) { t38_core_send_indicator(&s->t38x.t38, set_slow_packetisation(s)); s->audio.modems.rx_signal_present = TRUE; } /*endif*/ if (s->t38x.in_progress_rx_indicator == T38_IND_CNG) set_next_tx_type(s); /*endif*/ t->framing_ok_announced = TRUE; } /*endif*/ } /*endif*/ } /*endif*/ t->len = 0; t->num_bits = 0; u->crc = 0xFFFF; u->data_ptr = 0; s->t38x.corrupt_current_frame[1] = FALSE; } /*- End of function --------------------------------------------------------*/ static void t38_hdlc_rx_put_bit(hdlc_rx_state_t *t, int new_bit) { t38_gateway_state_t *s; t38_gateway_to_t38_state_t *u; int category; if (new_bit < 0) { hdlc_rx_status(t, new_bit); return; } /*endif*/ t->raw_bit_stream = (t->raw_bit_stream << 1) | (new_bit & 1); if ((t->raw_bit_stream & 0x3F) == 0x3E) { /* Its time to either skip a bit, for stuffing, or process a flag or abort */ if ((t->raw_bit_stream & 0x40)) rx_flag_or_abort(t); return; } /*endif*/ t->num_bits++; if (!t->framing_ok_announced) return; /*endif*/ t->byte_in_progress = (t->byte_in_progress >> 1) | ((t->raw_bit_stream & 0x01) << 7); if (t->num_bits != 8) return; /*endif*/ t->num_bits = 0; if (t->len >= (int) sizeof(t->buffer)) { /* This is too long. Abandon the frame, and wait for the next flag octet. */ t->rx_length_errors++; t->flags_seen = t->framing_ok_threshold - 1; t->len = 0; return; } /*endif*/ s = (t38_gateway_state_t *) t->frame_user_data; u = &s->core.to_t38; t->buffer[t->len] = (uint8_t) t->byte_in_progress; if (t->len == 1) { /* All valid HDLC frames in FAX communication begin 0xFF 0x03 or 0xFF 0x13. Anything else is bogus. */ if (t->buffer[0] != 0xFF || (t->buffer[1] & 0xEF) != 0x03) { /* Abandon the frame, and wait for the next flag octet. */ /* If this is a real frame where one of these first two octets has a bit error, we will fail to forward the frame with a CRC error, as we do for other bad frames. This will affect the timing of what goes forward. Hopefully such timing changes will have less frequent bad effects than the consequences of a bad bit stream simulating an HDLC frame start. */ span_log(&s->logging, SPAN_LOG_FLOW, "Bad HDLC frame header. Abandoning frame.\n"); t->flags_seen = t->framing_ok_threshold - 1; t->len = 0; return; } /*endif*/ } /*endif*/ /* Calculate the CRC progressively, before we start altering the frame */ u->crc = crc_itu16_calc(&t->buffer[t->len], 1, u->crc); /* Make the transmission lag by two octets, so we do not send the CRC, and do not report the CRC result too late. */ if (++t->len <= 2) return; /*endif*/ if (s->t38x.current_tx_data_type == T38_DATA_V21) { /* The V.21 control messages need to be monitored, and possibly corrupted, to manage the man-in-the-middle role of T.38 */ edit_control_messages(s, 1, t->buffer, t->len); } if (++u->data_ptr >= u->octets_per_data_packet) { bit_reverse(u->data, t->buffer + t->len - 2 - u->data_ptr, u->data_ptr); category = (s->t38x.current_tx_data_type == T38_DATA_V21) ? T38_PACKET_CATEGORY_CONTROL_DATA : T38_PACKET_CATEGORY_IMAGE_DATA; t38_core_send_data(&s->t38x.t38, s->t38x.current_tx_data_type, T38_FIELD_HDLC_DATA, u->data, u->data_ptr, category); /* Since we delay transmission by 2 octets, we should now have sent the last of the data octets when we have just received the last of the CRC octets. */ u->data_ptr = 0; } /*endif*/ } /*- End of function --------------------------------------------------------*/ static int restart_rx_modem(t38_gateway_state_t *s) { fax_modems_state_t *t; put_bit_func_t put_bit_func; void *put_bit_user_data; if (s->core.to_t38.in_bits || s->core.to_t38.out_octets) { span_log(&s->logging, SPAN_LOG_FLOW, "%d incoming audio bits. %d outgoing T.38 octets\n", s->core.to_t38.in_bits, s->core.to_t38.out_octets); s->core.to_t38.in_bits = 0; s->core.to_t38.out_octets = 0; } /*endif*/ span_log(&s->logging, SPAN_LOG_FLOW, "Restart rx modem - modem = %d, short train = %d, ECM = %d\n", s->core.fast_rx_modem, s->core.short_train, s->core.ecm_mode); t = &s->audio.modems; hdlc_rx_init(&t->hdlc_rx, FALSE, TRUE, HDLC_FRAMING_OK_THRESHOLD, NULL, s); t->rx_signal_present = FALSE; t->rx_trained = FALSE; /* Default to the transmit data being V.21, unless a faster modem pops up trained. */ s->t38x.current_tx_data_type = T38_DATA_V21; fsk_rx_init(&t->v21_rx, &preset_fsk_specs[FSK_V21CH2], FSK_FRAME_MODE_SYNC, (put_bit_func_t) t38_hdlc_rx_put_bit, &t->hdlc_rx); #if 0 fsk_rx_signal_cutoff(&t->v21_rx, -45.5f); #endif if (s->core.image_data_mode && s->core.ecm_mode) { put_bit_func = (put_bit_func_t) t38_hdlc_rx_put_bit; put_bit_user_data = (void *) &t->hdlc_rx; } else { if (s->core.image_data_mode && s->core.to_t38.fill_bit_removal) put_bit_func = non_ecm_remove_fill_and_put_bit; else put_bit_func = non_ecm_put_bit; /*endif*/ put_bit_user_data = (void *) s; } /*endif*/ to_t38_buffer_init(&s->core.to_t38); s->core.to_t38.octets_per_data_packet = 1; switch (s->core.fast_rx_modem) { case FAX_MODEM_V27TER_RX: v27ter_rx_restart(&t->fast_modems.v27ter_rx, s->core.fast_bit_rate, FALSE); v27ter_rx_set_put_bit(&t->fast_modems.v27ter_rx, put_bit_func, put_bit_user_data); set_rx_handler(s, &v27ter_v21_rx, &v27ter_v21_rx_fillin, s); s->core.fast_rx_active = FAX_MODEM_V27TER_RX; break; case FAX_MODEM_V29_RX: v29_rx_restart(&t->fast_modems.v29_rx, s->core.fast_bit_rate, FALSE); v29_rx_set_put_bit(&t->fast_modems.v29_rx, put_bit_func, put_bit_user_data); set_rx_handler(s, &v29_v21_rx, &v29_v21_rx_fillin, s); s->core.fast_rx_active = FAX_MODEM_V29_RX; break; case FAX_MODEM_V17_RX: v17_rx_restart(&t->fast_modems.v17_rx, s->core.fast_bit_rate, s->core.short_train); v17_rx_set_put_bit(&t->fast_modems.v17_rx, put_bit_func, put_bit_user_data); set_rx_handler(s, &v17_v21_rx, &v17_v21_rx_fillin, s); s->core.fast_rx_active = FAX_MODEM_V17_RX; break; default: set_rx_handler(s, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &t->v21_rx); s->core.fast_rx_active = FAX_MODEM_NONE; break; } /*endswitch*/ return 0; } /*- End of function --------------------------------------------------------*/ static void update_rx_timing(t38_gateway_state_t *s, int len) { if (s->core.samples_to_timeout > 0) { if ((s->core.samples_to_timeout -= len) <= 0) { switch (s->core.timed_mode) { case TIMED_MODE_TCF_PREDICTABLE_MODEM_START_PAST_V21_MODEM: /* Timed announcement of training, 75ms after the DCS carrier fell. */ s->core.timed_mode = TIMED_MODE_TCF_PREDICTABLE_MODEM_START_FAST_MODEM_ANNOUNCED; announce_training(s); break; case TIMED_MODE_TCF_PREDICTABLE_MODEM_START_FAST_MODEM_SEEN: /* Timed announcement of training, 75ms after the DCS carrier fell. */ /* Use a timeout to ride over TEP, if it is present */ s->core.samples_to_timeout = ms_to_samples(500); s->core.timed_mode = TIMED_MODE_TCF_PREDICTABLE_MODEM_START_FAST_MODEM_ANNOUNCED; announce_training(s); break; case TIMED_MODE_TCF_PREDICTABLE_MODEM_START_FAST_MODEM_ANNOUNCED: s->core.timed_mode = TIMED_MODE_IDLE; span_log(&s->logging, SPAN_LOG_FLOW, "TEP jamming expired\n"); break; case TIMED_MODE_STARTUP: /* Ensure a no-signal condition goes out the moment the received audio starts */ t38_core_send_indicator(&s->t38x.t38, T38_IND_NO_SIGNAL); s->core.timed_mode = TIMED_MODE_IDLE; break; } /*endswitch*/ } /*endif*/ } /*endif*/ } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) t38_gateway_rx(t38_gateway_state_t *s, int16_t amp[], int len) { int i; #if defined(LOG_FAX_AUDIO) if (s->audio.modems.audio_rx_log >= 0) write(s->audio.modems.audio_rx_log, amp, len*sizeof(int16_t)); /*endif*/ #endif update_rx_timing(s, len); for (i = 0; i < len; i++) amp[i] = dc_restore(&s->audio.modems.dc_restore, amp[i]); /*endfor*/ s->audio.modems.rx_handler(s->audio.modems.rx_user_data, amp, len); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) t38_gateway_rx_fillin(t38_gateway_state_t *s, int len) { /* To mitigate the effect of lost packets on a packet network we should try to sustain the status quo. If there is no receive modem running, keep things that way. If there is a receive modem running, try to sustain its operation, without causing a phase hop, or letting its adaptive functions diverge. */ #if defined(LOG_FAX_AUDIO) if (s->audio.modems.audio_rx_log >= 0) { int i; #if defined(_MSC_VER) int16_t *amp = (int16_t *) _alloca(sizeof(int16_t)*len); #else int16_t amp[len]; #endif vec_zeroi16(amp, len); write(s->modems.audio_rx_log, amp, len*sizeof(int16_t)); } #endif update_rx_timing(s, len); /* TODO: handle the modems properly */ s->audio.modems.rx_fillin_handler(s->audio.modems.rx_user_data, len); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) t38_gateway_tx(t38_gateway_state_t *s, int16_t amp[], int max_len) { int len; #if defined(LOG_FAX_AUDIO) int required_len; required_len = max_len; #endif if ((len = s->audio.modems.tx_handler(s->audio.modems.tx_user_data, amp, max_len)) < max_len) { if (set_next_tx_type(s)) { /* Give the new handler a chance to file the remaining buffer space */ len += s->audio.modems.tx_handler(s->audio.modems.tx_user_data, amp + len, max_len - len); if (len < max_len) { silence_gen_set(&s->audio.modems.silence_gen, 0); set_next_tx_type(s); } /*endif*/ } /*endif*/ } /*endif*/ if (s->audio.modems.transmit_on_idle) { /* Pad to the requested length with silence */ memset(amp + len, 0, (max_len - len)*sizeof(int16_t)); len = max_len; } /*endif*/ #if defined(LOG_FAX_AUDIO) if (s->audio.modems.audio_tx_log >= 0) { if (len < required_len) memset(amp + len, 0, (required_len - len)*sizeof(int16_t)); /*endif*/ write(s->audio.modems.audio_tx_log, amp, required_len*sizeof(int16_t)); } /*endif*/ #endif return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_gateway_get_transfer_statistics(t38_gateway_state_t *s, t38_stats_t *t) { memset(t, 0, sizeof(*t)); t->bit_rate = s->core.fast_bit_rate; t->error_correcting_mode = s->core.ecm_mode; t->pages_transferred = s->core.pages_confirmed; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(t38_core_state_t *) t38_gateway_get_t38_core_state(t38_gateway_state_t *s) { return &s->t38x.t38; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) t38_gateway_get_logging_state(t38_gateway_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_gateway_set_ecm_capability(t38_gateway_state_t *s, int ecm_allowed) { s->core.ecm_allowed = ecm_allowed; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_gateway_set_transmit_on_idle(t38_gateway_state_t *s, int transmit_on_idle) { s->audio.modems.transmit_on_idle = transmit_on_idle; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_gateway_set_supported_modems(t38_gateway_state_t *s, int supported_modems) { s->core.supported_modems = supported_modems; if ((s->core.supported_modems & T30_SUPPORT_V17)) t38_set_fastest_image_data_rate(&s->t38x.t38, 14400); else if ((s->core.supported_modems & T30_SUPPORT_V29)) t38_set_fastest_image_data_rate(&s->t38x.t38, 9600); else t38_set_fastest_image_data_rate(&s->t38x.t38, 4800); /*endif*/ } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_gateway_set_nsx_suppression(t38_gateway_state_t *s, const uint8_t *from_t38, int from_t38_len, const uint8_t *from_modem, int from_modem_len) { s->t38x.suppress_nsx_len[0] = (from_t38_len < 0 || from_t38_len < MAX_NSX_SUPPRESSION) ? (from_t38_len + 3) : 0; s->t38x.suppress_nsx_len[1] = (from_modem_len < 0 || from_modem_len < MAX_NSX_SUPPRESSION) ? (from_modem_len + 3) : 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_gateway_set_tep_mode(t38_gateway_state_t *s, int use_tep) { s->audio.modems.use_tep = use_tep; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_gateway_set_fill_bit_removal(t38_gateway_state_t *s, int remove) { s->core.to_t38.fill_bit_removal = remove; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_gateway_set_real_time_frame_handler(t38_gateway_state_t *s, t38_gateway_real_time_frame_handler_t *handler, void *user_data) { s->core.real_time_frame_handler = handler; s->core.real_time_frame_user_data = user_data; } /*- End of function --------------------------------------------------------*/ static int t38_gateway_audio_init(t38_gateway_state_t *s) { fax_modems_init(&s->audio.modems, FALSE, NULL, hdlc_underflow_handler, non_ecm_put_bit, t38_non_ecm_buffer_get_bit, tone_detected, s); /* We need to use progressive HDLC transmit, and a special HDLC receiver, which is different from the other uses of FAX modems. */ hdlc_tx_init(&s->audio.modems.hdlc_tx, FALSE, 2, TRUE, hdlc_underflow_handler, s); fsk_rx_set_put_bit(&s->audio.modems.v21_rx, (put_bit_func_t) t38_hdlc_rx_put_bit, &s->audio.modems.hdlc_rx); /* TODO: Don't use the very low cutoff levels we would like to. We get some quirks if we do. We need to sort this out. */ fsk_rx_signal_cutoff(&s->audio.modems.v21_rx, -30.0f); v29_rx_signal_cutoff(&s->audio.modems.fast_modems.v29_rx, -28.5f); return 0; } /*- End of function --------------------------------------------------------*/ static int t38_gateway_t38_init(t38_gateway_state_t *t, t38_tx_packet_handler_t *tx_packet_handler, void *tx_packet_user_data) { t38_gateway_t38_state_t *s; s = &t->t38x; t38_core_init(&s->t38, process_rx_indicator, process_rx_data, process_rx_missing, (void *) t, tx_packet_handler, tx_packet_user_data); t38_set_redundancy_control(&s->t38, T38_PACKET_CATEGORY_INDICATOR, INDICATOR_TX_COUNT); t38_set_redundancy_control(&s->t38, T38_PACKET_CATEGORY_CONTROL_DATA, DATA_TX_COUNT); t38_set_redundancy_control(&s->t38, T38_PACKET_CATEGORY_CONTROL_DATA_END, DATA_END_TX_COUNT); t38_set_redundancy_control(&s->t38, T38_PACKET_CATEGORY_IMAGE_DATA, DATA_TX_COUNT); t38_set_redundancy_control(&s->t38, T38_PACKET_CATEGORY_IMAGE_DATA_END, DATA_END_TX_COUNT); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(t38_gateway_state_t *) t38_gateway_init(t38_gateway_state_t *s, t38_tx_packet_handler_t *tx_packet_handler, void *tx_packet_user_data) { if (tx_packet_handler == NULL) return NULL; /*endif*/ if (s == NULL) { if ((s = (t38_gateway_state_t *) malloc(sizeof(*s))) == NULL) return NULL; /*endif*/ } /*endif*/ memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "T.38G"); t38_gateway_audio_init(s); t38_gateway_t38_init(s, tx_packet_handler, tx_packet_user_data); set_rx_active(s, TRUE); t38_gateway_set_supported_modems(s, T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17); t38_gateway_set_nsx_suppression(s, (const uint8_t *) "\x00\x00\x00", 3, (const uint8_t *) "\x00\x00\x00", 3); s->core.to_t38.octets_per_data_packet = 1; s->core.ecm_allowed = TRUE; //s->core.ms_per_tx_chunk = DEFAULT_MS_PER_TX_CHUNK; t38_non_ecm_buffer_init(&s->core.non_ecm_to_modem, FALSE, 0); restart_rx_modem(s); s->core.timed_mode = TIMED_MODE_STARTUP; s->core.samples_to_timeout = 1; #if defined(LOG_FAX_AUDIO) { char buf[100 + 1]; struct tm *tm; time_t now; time(&now); tm = localtime(&now); sprintf(buf, "/tmp/t38-rx-audio-%p-%02d%02d%02d%02d%02d%02d", s, tm->tm_year%100, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); s->audio.modems.audio_rx_log = open(buf, O_CREAT | O_TRUNC | O_WRONLY, 0666); sprintf(buf, "/tmp/t38-tx-audio-%p-%02d%02d%02d%02d%02d%02d", s, tm->tm_year%100, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); s->audio.modems.audio_tx_log = open(buf, O_CREAT | O_TRUNC | O_WRONLY, 0666); } #endif return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t38_gateway_release(t38_gateway_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t38_gateway_free(t38_gateway_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/tone_detect.c0000664000175000017500000002163311422612263013344 00000000000000/* * SpanDSP - a series of DSP components for telephony * * tone_detect.c - General telephony tone detection. * * Written by Steve Underwood * * Copyright (C) 2001-2003, 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include #include #include "spandsp/telephony.h" #include "spandsp/complex.h" #include "spandsp/complex_vector_float.h" #include "spandsp/tone_detect.h" #include "spandsp/tone_generate.h" #include "spandsp/private/tone_detect.h" #if !defined(M_PI) /* C99 systems may not define M_PI */ #define M_PI 3.14159265358979323846264338327 #endif SPAN_DECLARE(void) make_goertzel_descriptor(goertzel_descriptor_t *t, float freq, int samples) { #if defined(SPANDSP_USE_FIXED_POINT) t->fac = 16383.0f*2.0f*cosf(2.0f*M_PI*(freq/(float) SAMPLE_RATE)); #else t->fac = 2.0f*cosf(2.0f*M_PI*(freq/(float) SAMPLE_RATE)); #endif t->samples = samples; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(goertzel_state_t *) goertzel_init(goertzel_state_t *s, goertzel_descriptor_t *t) { if (s == NULL) { if ((s = (goertzel_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } #if defined(SPANDSP_USE_FIXED_POINT) s->v2 = s->v3 = 0; #else s->v2 = s->v3 = 0.0f; #endif s->fac = t->fac; s->samples = t->samples; s->current_sample = 0; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) goertzel_release(goertzel_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) goertzel_free(goertzel_state_t *s) { if (s) free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) goertzel_reset(goertzel_state_t *s) { #if defined(SPANDSP_USE_FIXED_POINT) s->v2 = s->v3 = 0; #else s->v2 = s->v3 = 0.0f; #endif s->current_sample = 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) goertzel_update(goertzel_state_t *s, const int16_t amp[], int samples) { int i; #if defined(SPANDSP_USE_FIXED_POINT) int16_t x; int16_t v1; #else float v1; #endif if (samples > s->samples - s->current_sample) samples = s->samples - s->current_sample; for (i = 0; i < samples; i++) { v1 = s->v2; s->v2 = s->v3; #if defined(SPANDSP_USE_FIXED_POINT) x = (((int32_t) s->fac*s->v2) >> 14); /* Scale down the input signal to avoid overflows. 9 bits is enough to monitor the signals of interest with adequate dynamic range and resolution. In telephony we generally only start with 13 or 14 bits, anyway. */ s->v3 = x - v1 + (amp[i] >> 7); #else s->v3 = s->fac*s->v2 - v1 + amp[i]; #endif } s->current_sample += samples; return samples; } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINT) SPAN_DECLARE(int32_t) goertzel_result(goertzel_state_t *s) #else SPAN_DECLARE(float) goertzel_result(goertzel_state_t *s) #endif { #if defined(SPANDSP_USE_FIXED_POINT) int16_t v1; int32_t x; int32_t y; #else float v1; #endif /* Push a zero through the process to finish things off. */ v1 = s->v2; s->v2 = s->v3; #if defined(SPANDSP_USE_FIXED_POINT) x = (((int32_t) s->fac*s->v2) >> 14); s->v3 = x - v1; #else s->v3 = s->fac*s->v2 - v1; #endif /* Now calculate the non-recursive side of the filter. */ /* The result here is not scaled down to allow for the magnification effect of the filter (the usual DFT magnification effect). */ #if defined(SPANDSP_USE_FIXED_POINT) x = (int32_t) s->v3*s->v3; y = (int32_t) s->v2*s->v2; x += y; y = ((int32_t) s->v3*s->fac) >> 14; y *= s->v2; x -= y; x <<= 1; goertzel_reset(s); /* The number returned in a floating point build will be 16384^2 times as big as for a fixed point build, due to the 14 bit shifts (or the square of the 7 bit shifts, depending how you look at it). */ return x; #else v1 = s->v3*s->v3 + s->v2*s->v2 - s->v2*s->v3*s->fac; v1 *= 2.0; goertzel_reset(s); return v1; #endif } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complexf_t) periodogram(const complexf_t coeffs[], const complexf_t amp[], int len) { complexf_t sum; complexf_t diff; complexf_t x; int i; x = complex_setf(0.0f, 0.0f); for (i = 0; i < len/2; i++) { sum = complex_addf(&[i], &[len - 1 - i]); diff = complex_subf(&[i], &[len - 1 - i]); x.re += (coeffs[i].re*sum.re - coeffs[i].im*diff.im); x.im += (coeffs[i].re*sum.im + coeffs[i].im*diff.re); } return x; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) periodogram_prepare(complexf_t sum[], complexf_t diff[], const complexf_t amp[], int len) { int i; for (i = 0; i < len/2; i++) { sum[i] = complex_addf(&[i], &[len - 1 - i]); diff[i] = complex_subf(&[i], &[len - 1 - i]); } return len/2; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complexf_t) periodogram_apply(const complexf_t coeffs[], const complexf_t sum[], const complexf_t diff[], int len) { complexf_t x; int i; x = complex_setf(0.0f, 0.0f); for (i = 0; i < len/2; i++) { x.re += (coeffs[i].re*sum[i].re - coeffs[i].im*diff[i].im); x.im += (coeffs[i].re*sum[i].im + coeffs[i].im*diff[i].re); } return x; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) periodogram_generate_coeffs(complexf_t coeffs[], float freq, int sample_rate, int window_len) { float window; float sum; float x; int i; sum = 0.0f; for (i = 0; i < window_len/2; i++) { /* Apply a Hamming window as we go */ window = 0.53836f - 0.46164f*cosf(2.0f*3.1415926535f*i/(window_len - 1.0f)); x = (i - window_len/2.0f + 0.5f)*freq*2.0f*3.1415926535f/sample_rate; coeffs[i].re = cosf(x)*window; coeffs[i].im = -sinf(x)*window; sum += window; } /* Rescale for unity gain in the periodogram. The 2.0 factor is to allow for the full window, rather than just the half over which we have summed the coefficients. */ sum = 1.0f/(2.0f*sum); for (i = 0; i < window_len/2; i++) { coeffs[i].re *= sum; coeffs[i].im *= sum; } return window_len/2; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) periodogram_generate_phase_offset(complexf_t *offset, float freq, int sample_rate, int interval) { float x; /* The phase offset is how far the phase rotates in one frame */ x = 2.0f*3.1415926535f*(float) interval/(float) sample_rate; offset->re = cosf(freq*x); offset->im = sinf(freq*x); return 1.0f/x; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) periodogram_freq_error(const complexf_t *phase_offset, float scale, const complexf_t *last_result, const complexf_t *result) { complexf_t prediction; /* Rotate the last result by the expected phasor offset to the current result. Then find the difference between that predicted position, and the actual one. When scaled by the current signal level, this gives us the frequency error. */ prediction = complex_mulf(last_result, phase_offset); return scale*(result->im*prediction.re - result->re*prediction.im)/(result->re*result->re + result->im*result->im); } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/make_math_fixed_tables.c0000644000175000017500000000607712101003037015475 00000000000000/* * SpanDSP - a series of DSP components for telephony * * make_fixed_point_math_tables.c - Generate lookup tables for some of the * fixed point maths functions. * * Written by Steve Underwood * * Copyright (C) 2010 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include int main(int argc, char *argv[]) { int i; double val; int ival; printf("static const uint16_t fixed_reciprocal_table[129] =\n"); printf("{\n"); for (i = 0; i < 129; i++) { val = 32768.0*128.0/(128 + i) + 0.5; ival = val; if (i < 128) printf(" %6d,\n", ival); else printf(" %6d\n", ival); } printf("};\n\n"); printf("static const uint16_t fixed_sqrt_table[193] =\n"); printf("{\n"); for (i = 64; i <= 256; i++) { ival = sqrt(i/256.0)*65536.0 + 0.5; if (ival > 65535) ival = 65535; if (i < 256) printf(" %6d,\n", ival); else printf(" %6d\n", ival); } printf("};\n\n"); printf("static const int16_t fixed_log10_table[129] =\n"); printf("{\n"); for (i = 128; i <= 256; i++) { ival = log10(i/256.0)*32768.0 - 0.5; if (i <= 255) printf(" %6d,\n", ival); else printf(" %6d\n", ival); } printf("};\n\n"); printf("static const int16_t fixed_sine_table[257] =\n"); printf("{\n"); for (i = 0; i <= 256; i++) { val = sin(i*3.1415926535/512.0)*32768.0; ival = val + 0.5; if (ival > 32767) ival = 32767; if (i <= 255) printf(" %6d,\n", ival); else printf(" %6d\n", ival); } printf("};\n\n"); printf("static const uint16_t fixed_arctan_table[257] =\n"); printf("{\n"); for (i = 0; i <= 256; i++) { val = atan(i/256.0)*65536.0/(2.0*3.1415926535); ival = val + 0.5; /* Nudge the result away from zero, so things sit consistently on the correct side of the axes. */ if (ival == 0) ival = 1; if (i <= 255) printf(" %6d,\n", ival); else printf(" %6d\n", ival); } printf("};\n\n"); return 0; } spandsp-0.0.6/src/async.c0000664000175000017500000002105512100744273012163 00000000000000/* * SpanDSP - a series of DSP components for telephony * * async.c - Asynchronous serial bit stream encoding and decoding * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include "spandsp/telephony.h" #include "spandsp/async.h" #include "spandsp/private/async.h" SPAN_DECLARE(const char *) signal_status_to_str(int status) { switch (status) { case SIG_STATUS_CARRIER_DOWN: return "Carrier down"; case SIG_STATUS_CARRIER_UP: return "Carrier up"; case SIG_STATUS_TRAINING_IN_PROGRESS: return "Training in progress"; case SIG_STATUS_TRAINING_SUCCEEDED: return "Training succeeded"; case SIG_STATUS_TRAINING_FAILED: return "Training failed"; case SIG_STATUS_FRAMING_OK: return "Framing OK"; case SIG_STATUS_END_OF_DATA: return "End of data"; case SIG_STATUS_ABORT: return "Abort"; case SIG_STATUS_BREAK: return "Break"; case SIG_STATUS_SHUTDOWN_COMPLETE: return "Shutdown complete"; case SIG_STATUS_OCTET_REPORT: return "Octet report"; case SIG_STATUS_POOR_SIGNAL_QUALITY: return "Poor signal quality"; case SIG_STATUS_MODEM_RETRAIN_OCCURRED: return "Modem retrain occurred"; case SIG_STATUS_LINK_CONNECTED: return "Link connected"; case SIG_STATUS_LINK_DISCONNECTED: return "Link disconnected"; case SIG_STATUS_LINK_ERROR: return "Link error"; } return "???"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(async_rx_state_t *) async_rx_init(async_rx_state_t *s, int data_bits, int parity, int stop_bits, int use_v14, put_byte_func_t put_byte, void *user_data) { if (s == NULL) { if ((s = (async_rx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } s->data_bits = data_bits; s->parity = parity; s->stop_bits = stop_bits; s->use_v14 = use_v14; s->put_byte = put_byte; s->user_data = user_data; s->byte_in_progress = 0; s->bitpos = 0; s->parity_bit = 0; s->parity_errors = 0; s->framing_errors = 0; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) async_rx_release(async_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) async_rx_free(async_rx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(void) async_rx_put_bit(void *user_data, int bit) { async_rx_state_t *s; s = (async_rx_state_t *) user_data; if (bit < 0) { /* Special conditions */ switch (bit) { case SIG_STATUS_CARRIER_UP: case SIG_STATUS_CARRIER_DOWN: case SIG_STATUS_TRAINING_IN_PROGRESS: case SIG_STATUS_TRAINING_SUCCEEDED: case SIG_STATUS_TRAINING_FAILED: case SIG_STATUS_END_OF_DATA: s->put_byte(s->user_data, bit); s->bitpos = 0; s->byte_in_progress = 0; break; default: //printf("Eh!\n"); break; } return; } if (s->bitpos == 0) { /* Search for the start bit */ s->bitpos += (bit ^ 1); s->parity_bit = 0; s->byte_in_progress = 0; } else if (s->bitpos <= s->data_bits) { s->byte_in_progress = (s->byte_in_progress >> 1) | (bit << 7); s->parity_bit ^= bit; s->bitpos++; } else if (s->parity && s->bitpos == s->data_bits + 1) { if (s->parity == ASYNC_PARITY_ODD) s->parity_bit ^= 1; if (s->parity_bit != bit) s->parity_errors++; s->bitpos++; } else { /* Stop bit */ if (bit == 1) { /* Align the received value */ if (s->data_bits < 8) s->byte_in_progress = (s->byte_in_progress & 0xFF) >> (8 - s->data_bits); s->put_byte(s->user_data, s->byte_in_progress); s->bitpos = 0; } else if (s->use_v14) { /* This is actually the start bit for the next character, and the stop bit has been dropped from the stream. This is the rate adaption specified in V.14 */ /* Align the received value */ if (s->data_bits < 8) s->byte_in_progress = (s->byte_in_progress & 0xFF) >> (8 - s->data_bits); s->put_byte(s->user_data, s->byte_in_progress); s->bitpos = 1; s->parity_bit = 0; s->byte_in_progress = 0; } else { s->framing_errors++; s->bitpos = 0; } } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(async_tx_state_t *) async_tx_init(async_tx_state_t *s, int data_bits, int parity, int stop_bits, int use_v14, get_byte_func_t get_byte, void *user_data) { if (s == NULL) { if ((s = (async_tx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } /* We have a use_v14 parameter for completeness, but right now V.14 only applies to the receive side. We are unlikely to have an application where flow control does not exist, so V.14 stuffing is not needed. */ s->data_bits = data_bits; s->parity = parity; s->stop_bits = stop_bits; if (parity != ASYNC_PARITY_NONE) s->stop_bits++; s->get_byte = get_byte; s->user_data = user_data; s->byte_in_progress = 0; s->bitpos = 0; s->parity_bit = 0; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) async_tx_release(async_tx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) async_tx_free(async_tx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) async_tx_get_bit(void *user_data) { async_tx_state_t *s; int bit; s = (async_tx_state_t *) user_data; if (s->bitpos == 0) { if ((s->byte_in_progress = s->get_byte(s->user_data)) < 0) { /* No more data */ bit = SIG_STATUS_END_OF_DATA; } else { /* Start bit */ bit = 0; s->parity_bit = 0; s->bitpos++; } } else if (s->bitpos <= s->data_bits) { bit = s->byte_in_progress & 1; s->byte_in_progress >>= 1; s->parity_bit ^= bit; s->bitpos++; } else if (s->parity && s->bitpos == s->data_bits + 1) { if (s->parity == ASYNC_PARITY_ODD) s->parity_bit ^= 1; bit = s->parity_bit; s->bitpos++; } else { /* Stop bit(s) */ bit = 1; if (++s->bitpos > s->data_bits + s->stop_bits) s->bitpos = 0; } return bit; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/image_translate.c0000664000175000017500000003744312101034735014211 00000000000000/* * SpanDSP - a series of DSP components for telephony * * image_translate.c - Image translation routines for reworking colour * and gray scale images to be bi-level images of an * appropriate size to be FAX compatible. * * Written by Steve Underwood * * Copyright (C) 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/logging.h" #include "spandsp/saturated.h" #include "spandsp/timezone.h" #include "spandsp/t4_rx.h" #include "spandsp/t4_tx.h" #if defined(SPANDSP_SUPPORT_T85) #include "spandsp/t81_t82_arith_coding.h" #include "spandsp/t85.h" #endif #include "spandsp/t4_t6_decode.h" #include "spandsp/t4_t6_encode.h" #include "spandsp/image_translate.h" #include "spandsp/private/logging.h" #if defined(SPANDSP_SUPPORT_T85) #include "spandsp/private/t81_t82_arith_coding.h" #include "spandsp/private/t85.h" #endif #include "spandsp/private/t4_t6_decode.h" #include "spandsp/private/t4_t6_encode.h" #include "spandsp/private/t4_rx.h" #include "spandsp/private/t4_tx.h" #include "spandsp/private/image_translate.h" static int image_colour16_to_gray8_row(uint8_t mono[], uint16_t colour[], int pixels) { int i; uint32_t gray; for (i = 0; i < pixels; i++) { gray = colour[3*i]*19595 + colour[3*i + 1]*38469 + colour[3*i + 2]*7472; mono[i] = saturateu8(gray >> 24); } return pixels; } /*- End of function --------------------------------------------------------*/ static int image_colour8_to_gray8_row(uint8_t mono[], uint8_t colour[], int pixels) { int i; uint32_t gray; for (i = 0; i < pixels; i++) { gray = colour[3*i]*19595 + colour[3*i + 1]*38469 + colour[3*i + 2]*7472; mono[i] = saturateu8(gray >> 16); } return pixels; } /*- End of function --------------------------------------------------------*/ static int image_gray16_to_gray8_row(uint8_t mono[], uint16_t gray[], int pixels) { int i; for (i = 0; i < pixels; i++) mono[i] = gray[i] >> 8; return pixels; } /*- End of function --------------------------------------------------------*/ static int get_and_scrunch_row(image_translate_state_t *s, uint8_t buf[], size_t len) { int row_len; row_len = (*s->row_read_handler)(s->row_read_user_data, buf, s->input_width*s->bytes_per_pixel); if (row_len != s->input_width*s->bytes_per_pixel) return 0; /* Scrunch colour down to gray, and scrunch 16 bit pixels down to 8 bit pixels */ switch (s->input_format) { case IMAGE_TRANSLATE_FROM_GRAY_16: image_gray16_to_gray8_row(buf, (uint16_t *) buf, s->input_width); break; case IMAGE_TRANSLATE_FROM_COLOUR_16: image_colour16_to_gray8_row(buf, (uint16_t *) buf, s->input_width); break; case IMAGE_TRANSLATE_FROM_COLOUR_8: image_colour8_to_gray8_row(buf, buf, s->input_width); break; } return row_len; } /*- End of function --------------------------------------------------------*/ static int image_resize_row(image_translate_state_t *s, uint8_t buf[], size_t len) { int i; int output_width; int output_length; int input_width; int input_length; int x; double c1; double c2; #if defined(SPANDSP_USE_FIXED_POINT) int frac_row; int frac_col; #else double int_part; double frac_row; double frac_col; #endif int row_len; int skip; uint8_t *p; if (s->raw_output_row < 0) return 0; output_width = s->output_width - 1; output_length = s->output_length - 1; input_width = s->input_width - 1; input_length = s->input_length - 1; skip = s->raw_output_row*input_length/output_length; if (skip >= s->raw_input_row) { skip++; while (skip >= s->raw_input_row) { if (s->raw_input_row >= s->input_length) { s->raw_output_row = -1; break; } row_len = get_and_scrunch_row(s, s->raw_pixel_row[0], s->input_width*s->bytes_per_pixel); if (row_len != s->input_width*s->bytes_per_pixel) { s->raw_output_row = -1; return 0; } s->raw_input_row++; p = s->raw_pixel_row[0]; s->raw_pixel_row[0] = s->raw_pixel_row[1]; s->raw_pixel_row[1] = p; } } #if defined(SPANDSP_USE_FIXED_POINT) frac_row = s->raw_output_row*input_length/output_length; frac_row = s->raw_output_row*input_length - frac_row*output_length; for (i = 0; i < output_width; i++) { x = i*input_width/output_width; frac_col = x - x*output_width; c1 = s->raw_pixel_row[0][x] + (s->raw_pixel_row[0][x + 1] - s->raw_pixel_row[0][x])*frac_col; c2 = s->raw_pixel_row[1][x] + (s->raw_pixel_row[1][x + 1] - s->raw_pixel_row[1][x])*frac_col; buf[i] = saturateu8(c1 + (c2 - c1)*frac_row); } #else frac_row = modf((double) s->raw_output_row*input_length/output_length, &int_part); for (i = 0; i < output_width; i++) { frac_col = modf((double) i*input_width/output_width, &int_part); x = int_part; c1 = s->raw_pixel_row[0][x] + (s->raw_pixel_row[0][x + 1] - s->raw_pixel_row[0][x])*frac_col; c2 = s->raw_pixel_row[1][x] + (s->raw_pixel_row[1][x + 1] - s->raw_pixel_row[1][x])*frac_col; buf[i] = saturateu8(c1 + (c2 - c1)*frac_row); } #endif if (++s->raw_output_row >= s->output_length) s->raw_output_row = -1; return len; } /*- End of function --------------------------------------------------------*/ static __inline__ uint8_t find_closest_palette_color(int in) { return (in >= 128) ? 255 : 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) image_translate_row(image_translate_state_t *s, uint8_t buf[], size_t len) { int x; int y; int i; int j; int limit; int old_pixel; int new_pixel; int quant_error; uint8_t *p; uint8_t xx; if (s->output_row < 0) return 0; y = s->output_row++; /* This algorithm works over two rows, and outputs the earlier of the two. To make this work: - At row 0 we grab and scrunch two rows. - From row 1 up to the last row we grab one new additional row each time. - At the last row we dither and output, without getting an extra row in. */ for (i = (y == 0) ? 0 : 1; i < 2; i++) { p = s->pixel_row[0]; s->pixel_row[0] = s->pixel_row[1]; s->pixel_row[1] = p; /* If this is the end of the image just ignore that there is now rubbish in pixel_row[1]. Mark that the end has occurred. This row will be properly output, and the next one will fail, with the end of image condition (i.e. returning zero length) */ if (s->resize) { if (image_resize_row(s, s->pixel_row[1], s->output_width*s->bytes_per_pixel) != s->output_width*s->bytes_per_pixel) s->output_row = -1; } else { if (get_and_scrunch_row(s, s->pixel_row[1], s->output_width*s->bytes_per_pixel) != s->output_width*s->bytes_per_pixel) s->output_row = -1; } } /* Apply Floyd-Steinberg dithering to the 8 bit pixels, using a bustrophodontic scan, to reduce the grayscale image to pure black and white */ /* The first and last pixels in each row need special treatment, so we do not step outside the row. */ if ((y & 1)) { x = s->output_width - 1; old_pixel = s->pixel_row[0][x]; new_pixel = find_closest_palette_color(old_pixel); quant_error = old_pixel - new_pixel; s->pixel_row[0][x + 0] = new_pixel; s->pixel_row[0][x - 1] = saturateu8(s->pixel_row[0][x - 1] + (7*quant_error)/16); s->pixel_row[1][x + 0] = saturateu8(s->pixel_row[1][x + 0] + (5*quant_error)/16); s->pixel_row[1][x - 1] = saturateu8(s->pixel_row[1][x - 1] + (1*quant_error)/16); for ( ; x > 0; x--) { old_pixel = s->pixel_row[0][x]; new_pixel = find_closest_palette_color(old_pixel); quant_error = old_pixel - new_pixel; s->pixel_row[0][x + 0] = new_pixel; s->pixel_row[0][x - 1] = saturateu8(s->pixel_row[0][x - 1] + (7*quant_error)/16); s->pixel_row[1][x + 1] = saturateu8(s->pixel_row[1][x + 1] + (3*quant_error)/16); s->pixel_row[1][x + 0] = saturateu8(s->pixel_row[1][x + 0] + (5*quant_error)/16); s->pixel_row[1][x - 1] = saturateu8(s->pixel_row[1][x - 1] + (1*quant_error)/16); } old_pixel = s->pixel_row[0][x]; new_pixel = find_closest_palette_color(old_pixel); quant_error = old_pixel - new_pixel; s->pixel_row[0][x + 0] = new_pixel; s->pixel_row[1][x + 1] = saturateu8(s->pixel_row[1][x + 1] + (3*quant_error)/16); s->pixel_row[1][x + 0] = saturateu8(s->pixel_row[1][x + 0] + (5*quant_error)/16); } else { x = 0; old_pixel = s->pixel_row[0][x]; new_pixel = find_closest_palette_color(old_pixel); quant_error = old_pixel - new_pixel; s->pixel_row[0][x + 0] = new_pixel; s->pixel_row[0][x + 1] = saturateu8(s->pixel_row[0][x + 1] + (7*quant_error)/16); s->pixel_row[1][x + 0] = saturateu8(s->pixel_row[1][x + 0] + (5*quant_error)/16); s->pixel_row[1][x + 1] = saturateu8(s->pixel_row[1][x + 1] + (1*quant_error)/16); for ( ; x < s->output_width - 1; x++) { old_pixel = s->pixel_row[0][x]; new_pixel = find_closest_palette_color(old_pixel); quant_error = old_pixel - new_pixel; s->pixel_row[0][x + 0] = new_pixel; s->pixel_row[0][x + 1] = saturateu8(s->pixel_row[0][x + 1] + (7*quant_error)/16); s->pixel_row[1][x - 1] = saturateu8(s->pixel_row[1][x - 1] + (3*quant_error)/16); s->pixel_row[1][x + 0] = saturateu8(s->pixel_row[1][x + 0] + (5*quant_error)/16); s->pixel_row[1][x + 1] = saturateu8(s->pixel_row[1][x + 1] + (1*quant_error)/16); } old_pixel = s->pixel_row[0][x]; new_pixel = find_closest_palette_color(old_pixel); quant_error = old_pixel - new_pixel; s->pixel_row[0][x + 0] = new_pixel; s->pixel_row[1][x - 1] = saturateu8(s->pixel_row[1][x - 1] + (3*quant_error)/16); s->pixel_row[1][x + 0] = saturateu8(s->pixel_row[1][x + 0] + (5*quant_error)/16); } /* Now bit pack the pixel per byte row into a pixel per bit row. */ for (i = 0, x = 0; x < s->output_width; i++, x += 8) { xx = 0; /* Allow for the possibility that the width is not a multiple of 8 */ limit = (8 <= s->output_width - x) ? 8 : (s->output_width - x); for (j = 0; j < limit; j++) { if (s->pixel_row[0][x + j] <= 128) xx |= (1 << (7 - j)); } buf[i] = xx; } return i; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) image_translate_get_output_width(image_translate_state_t *s) { return s->output_width; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) image_translate_get_output_length(image_translate_state_t *s) { return s->output_length; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(image_translate_state_t *) image_translate_init(image_translate_state_t *s, int input_format, int input_width, int input_length, int output_width, t4_row_read_handler_t row_read_handler, void *row_read_user_data) { int i; if (s == NULL) { if ((s = (image_translate_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); s->input_format = input_format; s->input_width = input_width; s->input_length = input_length; s->resize = (output_width > 0); s->output_width = (s->resize) ? output_width : s->input_width; s->output_length = (s->resize) ? s->input_length*s->output_width/s->input_width : s->input_length; switch (s->input_format) { case IMAGE_TRANSLATE_FROM_GRAY_8: s->bytes_per_pixel = 1; break; case IMAGE_TRANSLATE_FROM_GRAY_16: s->bytes_per_pixel = 2; break; case IMAGE_TRANSLATE_FROM_COLOUR_8: s->bytes_per_pixel = 3; break; case IMAGE_TRANSLATE_FROM_COLOUR_16: s->bytes_per_pixel = 6; break; default: s->bytes_per_pixel = 1; break; } /* Allocate the two row buffers we need, using the space requirements we now have */ if (s->resize) { for (i = 0; i < 2; i++) { if ((s->raw_pixel_row[i] = (uint8_t *) malloc(s->input_width*s->bytes_per_pixel)) == NULL) return NULL; memset(s->raw_pixel_row[i], 0, s->input_width*s->bytes_per_pixel); if ((s->pixel_row[i] = (uint8_t *) malloc(s->output_width*sizeof(uint8_t))) == NULL) return NULL; memset(s->pixel_row[i], 0, s->output_width*sizeof(uint8_t)); } } else { for (i = 0; i < 2; i++) { if ((s->pixel_row[i] = (uint8_t *) malloc(s->output_width*s->bytes_per_pixel)) == NULL) return NULL; memset(s->pixel_row[i], 0, s->output_width*s->bytes_per_pixel); } } s->row_read_handler = row_read_handler; s->row_read_user_data = row_read_user_data; s->raw_input_row = 0; s->raw_output_row = 0; s->output_row = 0; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) image_translate_release(image_translate_state_t *s) { int i; for (i = 0; i < 2; i++) { if (s->raw_pixel_row[i]) { free(s->raw_pixel_row[i]); s->raw_pixel_row[i] = NULL; } if (s->pixel_row[i]) { free(s->pixel_row[i]); s->pixel_row[i] = NULL; } } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) image_translate_free(image_translate_state_t *s) { int res; res = image_translate_release(s); free(s); return res; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/t30_local.h0000664000175000017500000000222611422612262012630 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t30_local.h - definitions for T.30 fax processing * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_T30_LOCAL_H_) #define _T30_LOCAL_H_ #if defined(__cplusplus) extern "C" { #endif int t30_build_dis_or_dtc(t30_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/v17rx.c0000664000175000017500000016717612354307223012055 00000000000000//#define RESCALER_TEST #define IAXMODEM_STUFF /* * SpanDSP - a series of DSP components for telephony * * v17rx.c - ITU V.17 modem receive part * * Written by Steve Underwood * * Copyright (C) 2004, 2005, 2006, 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/fast_convert.h" #include "spandsp/math_fixed.h" #include "spandsp/saturated.h" #include "spandsp/complex.h" #include "spandsp/vector_float.h" #include "spandsp/complex_vector_float.h" #include "spandsp/vector_int.h" #include "spandsp/complex_vector_int.h" #include "spandsp/async.h" #include "spandsp/power_meter.h" #include "spandsp/arctan2.h" #include "spandsp/dds.h" #include "spandsp/complex_filters.h" #include "spandsp/v29rx.h" #include "spandsp/v17tx.h" #include "spandsp/v17rx.h" #include "spandsp/private/logging.h" #include "spandsp/private/v17rx.h" //#if defined (SPANDSP_USE_FIXED_POINT) //#define SPANDSP_USE_FIXED_POINTx //#endif #if defined(SPANDSP_USE_FIXED_POINTx) #define FP_SCALE(x) FP_Q_4_12(x) #define FP_FACTOR 4096 #define FP_SHIFT_FACTOR 12 #include "v17_v32bis_rx_fixed_rrc.h" #else #define FP_SCALE(x) (x) #include "v17_v32bis_rx_floating_rrc.h" #endif #include "v17_v32bis_tx_constellation_maps.h" #include "v17_v32bis_rx_constellation_maps.h" /*! The nominal frequency of the carrier, in Hertz */ #define CARRIER_NOMINAL_FREQ 1800.0f /*! The nominal baud or symbol rate */ #define BAUD_RATE 2400 /*! The adaption rate coefficient for the equalizer during initial training */ #define EQUALIZER_FAST_ADAPTION_DELTA (0.21f/V17_EQUALIZER_LEN) /*! The adaption rate coefficient for the equalizer during initial fine tuning */ #define EQUALIZER_MEDIUM_ADAPTION_DELTA (0.1f*EQUALIZER_FAST_ADAPTION_DELTA) /*! The adaption rate coefficient for the equalizer during continuous fine tuning */ #define EQUALIZER_SLOW_ADAPTION_DELTA (0.03f*EQUALIZER_FAST_ADAPTION_DELTA) /* Segments of the training sequence */ /*! The length of training segment 1, in symbols */ #define V17_TRAINING_SEG_1_LEN 256 /*! The length of training segment 2 in long training mode, in symbols */ #define V17_TRAINING_SEG_2_LEN 2976 /*! The length of training segment 2 in short training mode, in symbols */ #define V17_TRAINING_SHORT_SEG_2_LEN 38 /*! The length of training segment 3, in symbols */ #define V17_TRAINING_SEG_3_LEN 64 /*! The length of training segment 4A, in symbols */ #define V17_TRAINING_SEG_4A_LEN 15 /*! The length of training segment 4, in symbols */ #define V17_TRAINING_SEG_4_LEN 48 /*! The 16 bit pattern used in the bridge section of the training sequence */ #define V17_BRIDGE_WORD 0x8880 enum { TRAINING_STAGE_NORMAL_OPERATION = 0, TRAINING_STAGE_SYMBOL_ACQUISITION, TRAINING_STAGE_LOG_PHASE, TRAINING_STAGE_SHORT_WAIT_FOR_CDBA, TRAINING_STAGE_WAIT_FOR_CDBA, TRAINING_STAGE_COARSE_TRAIN_ON_CDBA, TRAINING_STAGE_FINE_TRAIN_ON_CDBA, TRAINING_STAGE_SHORT_TRAIN_ON_CDBA_AND_TEST, TRAINING_STAGE_TRAIN_ON_CDBA_AND_TEST, TRAINING_STAGE_BRIDGE, TRAINING_STAGE_TCM_WINDUP, TRAINING_STAGE_TEST_ONES, TRAINING_STAGE_PARKED }; /* Coefficients for the band edge symbol timing synchroniser (alpha = 0.99) */ /* low_edge = 2.0f*M_PI*(CARRIER_NOMINAL_FREQ - BAUD_RATE/2.0f)/SAMPLE_RATE; */ /* high_edge = 2.0f*M_PI*(CARRIER_NOMINAL_FREQ + BAUD_RATE/2.0f)/SAMPLE_RATE; */ #define SIN_LOW_BAND_EDGE 0.453990499f #define COS_LOW_BAND_EDGE 0.891006542f #define SIN_HIGH_BAND_EDGE 0.707106781f #define COS_HIGH_BAND_EDGE -0.707106781f #define ALPHA 0.99f #if defined(SPANDSP_USE_FIXED_POINTx) #define SYNC_LOW_BAND_EDGE_COEFF_0 ((int)(FP_FACTOR*(2.0f*ALPHA*COS_LOW_BAND_EDGE))) #define SYNC_LOW_BAND_EDGE_COEFF_1 ((int)(FP_FACTOR*(-ALPHA*ALPHA))) #define SYNC_LOW_BAND_EDGE_COEFF_2 ((int)(FP_FACTOR*(-ALPHA*SIN_LOW_BAND_EDGE))) #define SYNC_HIGH_BAND_EDGE_COEFF_0 ((int)(FP_FACTOR*(2.0f*ALPHA*COS_HIGH_BAND_EDGE))) #define SYNC_HIGH_BAND_EDGE_COEFF_1 ((int)(FP_FACTOR*(-ALPHA*ALPHA))) #define SYNC_HIGH_BAND_EDGE_COEFF_2 ((int)(FP_FACTOR*(-ALPHA*SIN_HIGH_BAND_EDGE))) #define SYNC_MIXED_EDGES_COEFF_3 ((int)(FP_FACTOR*(-ALPHA*ALPHA*(SIN_HIGH_BAND_EDGE*COS_LOW_BAND_EDGE - SIN_LOW_BAND_EDGE*COS_HIGH_BAND_EDGE)))) #else #define SYNC_LOW_BAND_EDGE_COEFF_0 (2.0f*ALPHA*COS_LOW_BAND_EDGE) #define SYNC_LOW_BAND_EDGE_COEFF_1 (-ALPHA*ALPHA) #define SYNC_LOW_BAND_EDGE_COEFF_2 (-ALPHA*SIN_LOW_BAND_EDGE) #define SYNC_HIGH_BAND_EDGE_COEFF_0 (2.0f*ALPHA*COS_HIGH_BAND_EDGE) #define SYNC_HIGH_BAND_EDGE_COEFF_1 (-ALPHA*ALPHA) #define SYNC_HIGH_BAND_EDGE_COEFF_2 (-ALPHA*SIN_HIGH_BAND_EDGE) #define SYNC_MIXED_EDGES_COEFF_3 (-ALPHA*ALPHA*(SIN_HIGH_BAND_EDGE*COS_LOW_BAND_EDGE - SIN_LOW_BAND_EDGE*COS_HIGH_BAND_EDGE)) #endif #if defined(SPANDSP_USE_FIXED_POINTx) static const int constellation_spacing[4] = #else static const float constellation_spacing[4] = #endif { FP_SCALE(1.414f), FP_SCALE(2.0f), FP_SCALE(2.828f), FP_SCALE(4.0f) }; SPAN_DECLARE(float) v17_rx_carrier_frequency(v17_rx_state_t *s) { return dds_frequencyf(s->carrier_phase_rate); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) v17_rx_symbol_timing_correction(v17_rx_state_t *s) { return (float) s->total_baud_timing_correction/((float) RX_PULSESHAPER_COEFF_SETS*10.0f/3.0f); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) v17_rx_signal_power(v17_rx_state_t *s) { return power_meter_current_dbm0(&s->power) + 3.98f; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v17_rx_signal_cutoff(v17_rx_state_t *s, float cutoff) { /* The 0.4 factor allows for the gain of the DC blocker */ s->carrier_on_power = (int32_t) (power_meter_level_dbm0(cutoff + 2.5f)*0.4f); s->carrier_off_power = (int32_t) (power_meter_level_dbm0(cutoff - 2.5f)*0.4f); } /*- End of function --------------------------------------------------------*/ static void report_status_change(v17_rx_state_t *s, int status) { if (s->status_handler) s->status_handler(s->status_user_data, status); else if (s->put_bit) s->put_bit(s->put_bit_user_data, status); } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINTx) SPAN_DECLARE(int) v17_rx_equalizer_state(v17_rx_state_t *s, complexi16_t **coeffs) #else SPAN_DECLARE(int) v17_rx_equalizer_state(v17_rx_state_t *s, complexf_t **coeffs) #endif { *coeffs = s->eq_coeff; return V17_EQUALIZER_LEN; } /*- End of function --------------------------------------------------------*/ static void equalizer_save(v17_rx_state_t *s) { #if defined(SPANDSP_USE_FIXED_POINTx) cvec_copyi16(s->eq_coeff_save, s->eq_coeff, V17_EQUALIZER_LEN); #else cvec_copyf(s->eq_coeff_save, s->eq_coeff, V17_EQUALIZER_LEN); #endif } /*- End of function --------------------------------------------------------*/ static void equalizer_restore(v17_rx_state_t *s) { #if defined(SPANDSP_USE_FIXED_POINTx) cvec_copyi16(s->eq_coeff, s->eq_coeff_save, V17_EQUALIZER_LEN); cvec_zeroi16(s->eq_buf, V17_EQUALIZER_LEN); s->eq_delta = 32768.0f*EQUALIZER_MEDIUM_ADAPTION_DELTA; #else cvec_copyf(s->eq_coeff, s->eq_coeff_save, V17_EQUALIZER_LEN); cvec_zerof(s->eq_buf, V17_EQUALIZER_LEN); s->eq_delta = EQUALIZER_MEDIUM_ADAPTION_DELTA; #endif s->eq_put_step = RX_PULSESHAPER_COEFF_SETS*10/(3*2) - 1; s->eq_step = 0; s->eq_skip = 0; } /*- End of function --------------------------------------------------------*/ static void equalizer_reset(v17_rx_state_t *s) { /* Start with an equalizer based on everything being perfect */ #if defined(SPANDSP_USE_FIXED_POINTx) static const complexi16_t x = {FP_SCALE(3.0f), FP_SCALE(0.0f)}; cvec_zeroi16(s->eq_coeff, V17_EQUALIZER_LEN); s->eq_coeff[V17_EQUALIZER_PRE_LEN] = x; cvec_zeroi16(s->eq_buf, V17_EQUALIZER_LEN); s->eq_delta = 32768.0f*EQUALIZER_FAST_ADAPTION_DELTA; #else static const complexf_t x = {3.0f, 0.0f}; cvec_zerof(s->eq_coeff, V17_EQUALIZER_LEN); s->eq_coeff[V17_EQUALIZER_PRE_LEN] = x; cvec_zerof(s->eq_buf, V17_EQUALIZER_LEN); s->eq_delta = EQUALIZER_FAST_ADAPTION_DELTA; #endif s->eq_put_step = RX_PULSESHAPER_COEFF_SETS*10/(3*2) - 1; s->eq_step = 0; s->eq_skip = 0; } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINTx) static __inline__ complexi16_t equalizer_get(v17_rx_state_t *s) { complexi32_t zz; complexi16_t z; /* Get the next equalized value. */ zz = cvec_circular_dot_prodf(s->eq_buf, s->eq_coeff, V17_EQUALIZER_LEN, s->eq_step); z.re = zz.re >> FP_SHIFT_FACTOR; z.im = zz.im >> FP_SHIFT_FACTOR; return z; } #else static __inline__ complexf_t equalizer_get(v17_rx_state_t *s) { /* Get the next equalized value. */ return cvec_circular_dot_prodf(s->eq_buf, s->eq_coeff, V17_EQUALIZER_LEN, s->eq_step); } #endif /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINTx) static void tune_equalizer(v17_rx_state_t *s, const complexi16_t *z, const complexi16_t *target) { complexi16_t err; /* Find the x and y mismatch from the exact constellation position. */ err.re = target->re*FP_FACTOR - z->re; err.im = target->im*FP_FACTOR - z->im; err.re = ((int32_t) err.re*(int32_t) s->eq_delta) >> 15; err.im = ((int32_t) err.im*(int32_t) s->eq_delta) >> 15; cvec_circular_lmsi16(s->eq_buf, s->eq_coeff, V17_EQUALIZER_LEN, s->eq_step, &err); } #else static void tune_equalizer(v17_rx_state_t *s, const complexf_t *z, const complexf_t *target) { complexf_t err; /* Find the x and y mismatch from the exact constellation position. */ err = complex_subf(target, z); err.re *= s->eq_delta; err.im *= s->eq_delta; cvec_circular_lmsf(s->eq_buf, s->eq_coeff, V17_EQUALIZER_LEN, s->eq_step, &err); } #endif /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINTx) static __inline__ void track_carrier(v17_rx_state_t *s, const complexi16_t *z, const complexi16_t *target) #else static void track_carrier(v17_rx_state_t *s, const complexf_t *z, const complexf_t *target) #endif { #if defined(SPANDSP_USE_FIXED_POINTx) int32_t error; #else float error; #endif /* For small errors the imaginary part of the difference between the actual and the target positions is proportional to the phase error, for any particular target. However, the different amplitudes of the various target positions scale things. */ #if defined(SPANDSP_USE_FIXED_POINTx) error = z->im*(((int32_t) target->re) >> FP_SHIFT_FACTOR) - z->re*(((int32_t) target->im) >> FP_SHIFT_FACTOR); s->carrier_phase_rate += ((s->carrier_track_i*error) >> FP_SHIFT_FACTOR); s->carrier_phase += ((s->carrier_track_p*error) >> FP_SHIFT_FACTOR); #else error = z->im*target->re - z->re*target->im; s->carrier_phase_rate += (int32_t) (s->carrier_track_i*error); s->carrier_phase += (int32_t) (s->carrier_track_p*error); //span_log(&s->logging, SPAN_LOG_FLOW, "Im = %15.5f f = %15.5f\n", error, dds_frequencyf(s->carrier_phase_rate)); #endif } /*- End of function --------------------------------------------------------*/ static int descramble(v17_rx_state_t *s, int in_bit) { int out_bit; //out_bit = (in_bit ^ (s->scramble_reg >> s->scrambler_tap) ^ (s->scramble_reg >> (23 - 1))) & 1; out_bit = (in_bit ^ (s->scramble_reg >> (18 - 1)) ^ (s->scramble_reg >> (23 - 1))) & 1; s->scramble_reg <<= 1; if (s->training_stage > TRAINING_STAGE_NORMAL_OPERATION && s->training_stage < TRAINING_STAGE_TCM_WINDUP) s->scramble_reg |= out_bit; else s->scramble_reg |= (in_bit & 1); return out_bit; } /*- End of function --------------------------------------------------------*/ static __inline__ void put_bit(v17_rx_state_t *s, int bit) { int out_bit; /* We need to strip the last part of the training - the test period of all 1s - before we let data go to the application. */ out_bit = descramble(s, bit); if (s->training_stage == TRAINING_STAGE_NORMAL_OPERATION) { s->put_bit(s->put_bit_user_data, out_bit); } else if (s->training_stage == TRAINING_STAGE_TEST_ONES) { /* The bits during the final stage of training should be all ones. However, buggy modems mean you cannot rely on this. Therefore we don't bother testing for ones, but just rely on a constellation mismatch measurement. */ //span_log(&s->logging, SPAN_LOG_FLOW, "A 1 is really %d\n", out_bit); } } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINTx) static __inline__ uint32_t dist_sq(const complexi_t *x, const complexi_t *y) { return (x->re - y->re)*(x->re - y->re) + (x->im - y->im)*(x->im - y->im); } /*- End of function --------------------------------------------------------*/ #else static __inline__ float dist_sq(const complexf_t *x, const complexf_t *y) { return (x->re - y->re)*(x->re - y->re) + (x->im - y->im)*(x->im - y->im); } /*- End of function --------------------------------------------------------*/ #endif static int decode_baud(v17_rx_state_t *s, complexf_t *z) { static const uint8_t v32bis_4800_differential_decoder[4][4] = { {2, 3, 0, 1}, {0, 2, 1, 3}, {3, 1, 2, 0}, {1, 0, 3, 2} }; static const uint8_t v17_differential_decoder[4][4] = { {0, 1, 2, 3}, {3, 0, 1, 2}, {2, 3, 0, 1}, {1, 2, 3, 0} }; static const uint8_t tcm_paths[8][4] = { {0, 6, 2, 4}, {6, 0, 4, 2}, {2, 4, 0, 6}, {4, 2, 6, 0}, {1, 3, 7, 5}, {5, 7, 3, 1}, {7, 5, 1, 3}, {3, 1, 5, 7} }; int nearest; int i; int j; int k; int re; int im; int raw; int constellation_state; #if defined(SPANDSP_USE_FIXED_POINTx) #define DIST_FACTOR 2048 /* Something less than sqrt(0xFFFFFFFF/10)/10 */ complexi_t zi; uint32_t distances[8]; uint32_t new_distances[8]; uint32_t min; complexi_t ci; #else float distances[8]; float new_distances[8]; float min; #endif re = (int) ((z->re + 9.0f)*2.0f); if (re > 35) re = 35; else if (re < 0) re = 0; im = (int) ((z->im + 9.0f)*2.0f); if (im > 35) im = 35; else if (im < 0) im = 0; if (s->bits_per_symbol == 2) { /* 4800bps V.32bis mode, without trellis coding */ nearest = constel_map_4800[re][im]; raw = v32bis_4800_differential_decoder[s->diff][nearest]; s->diff = nearest; put_bit(s, raw); put_bit(s, raw >> 1); return nearest; } /* Find a set of 8 candidate constellation positions, that are the closest to the target, with different patterns in the last 3 bits. */ #if defined(SPANDSP_USE_FIXED_POINTx) min = 0xFFFFFFFF; zi = complex_seti(z->re*DIST_FACTOR, z->im*DIST_FACTOR); #else min = 9999999.0f; #endif j = 0; for (i = 0; i < 8; i++) { nearest = constel_maps[s->space_map][re][im][i]; #if defined(SPANDSP_USE_FIXED_POINTx) ci = complex_seti(s->constellation[nearest].re*DIST_FACTOR, s->constellation[nearest].im*DIST_FACTOR); distances[i] = dist_sq(&ci, &zi); #else distances[i] = dist_sq(&s->constellation[nearest], z); #endif if (min > distances[i]) { min = distances[i]; j = i; } } /* Use the nearest of these soft-decisions as the basis for DFE */ constellation_state = constel_maps[s->space_map][re][im][j]; /* Control the equalizer, carrier tracking, etc. based on the non-trellis corrected information. The trellis correct stuff comes out a bit late. */ track_carrier(s, z, &s->constellation[constellation_state]); #if defined(RESCALER_TEST) tune_equalizer(s, z, &s->constellation[constellation_state]); #endif /* Now do the trellis decoding */ /* TODO: change to processing blocks of stored symbols here, instead of processing one symbol at a time, to speed up the processing. */ /* Update the minimum accumulated distance to each of the 8 states */ if (++s->trellis_ptr >= V17_TRELLIS_STORAGE_DEPTH) s->trellis_ptr = 0; for (i = 0; i < 4; i++) { min = distances[tcm_paths[i][0]] + s->distances[0]; k = 0; for (j = 1; j < 4; j++) { if (min > distances[tcm_paths[i][j]] + s->distances[j << 1]) { min = distances[tcm_paths[i][j]] + s->distances[j << 1]; k = j; } } /* Use an elementary IIR filter to track the distance to date. */ #if defined(SPANDSP_USE_FIXED_POINTx) new_distances[i] = s->distances[k << 1]*9/10 + distances[tcm_paths[i][k]]*1/10; #else new_distances[i] = s->distances[k << 1]*0.9f + distances[tcm_paths[i][k]]*0.1f; #endif s->full_path_to_past_state_locations[s->trellis_ptr][i] = constel_maps[s->space_map][re][im][tcm_paths[i][k]]; s->past_state_locations[s->trellis_ptr][i] = k << 1; } for (i = 4; i < 8; i++) { min = distances[tcm_paths[i][0]] + s->distances[1]; k = 0; for (j = 1; j < 4; j++) { if (min > distances[tcm_paths[i][j]] + s->distances[(j << 1) + 1]) { min = distances[tcm_paths[i][j]] + s->distances[(j << 1) + 1]; k = j; } } #if defined(SPANDSP_USE_FIXED_POINTx) new_distances[i] = s->distances[(k << 1) + 1]*9/10 + distances[tcm_paths[i][k]]*1/10; #else new_distances[i] = s->distances[(k << 1) + 1]*0.9f + distances[tcm_paths[i][k]]*0.1f; #endif s->full_path_to_past_state_locations[s->trellis_ptr][i] = constel_maps[s->space_map][re][im][tcm_paths[i][k]]; s->past_state_locations[s->trellis_ptr][i] = (k << 1) + 1; } memcpy(s->distances, new_distances, sizeof(s->distances)); /* Find the minimum distance to date. This is the start of the path back to the result. */ min = s->distances[0]; k = 0; for (i = 1; i < 8; i++) { if (min > s->distances[i]) { min = s->distances[i]; k = i; } } /* Trace back through every time step, starting with the current one, and find the state from which the path came one step before. At the end of this search, the last state found also points to the constellation point at that state. This is the output of the trellis. */ for (i = 0, j = s->trellis_ptr; i < V17_TRELLIS_LOOKBACK_DEPTH - 1; i++) { k = s->past_state_locations[j][k]; if (--j < 0) j = V17_TRELLIS_STORAGE_DEPTH - 1; } nearest = s->full_path_to_past_state_locations[j][k] >> 1; /* Differentially decode */ raw = (nearest & 0x3C) | v17_differential_decoder[s->diff][nearest & 0x03]; s->diff = nearest & 0x03; for (i = 0; i < s->bits_per_symbol; i++) { put_bit(s, raw); raw >>= 1; } return constellation_state; } /*- End of function --------------------------------------------------------*/ static __inline__ void symbol_sync(v17_rx_state_t *s) { int i; #if defined(SPANDSP_USE_FIXED_POINTx) int32_t v; int32_t p; #else float v; float p; #endif /* This routine adapts the position of the half baud samples entering the equalizer. */ /* This symbol sync scheme is based on the technique first described by Dominique Godard in Passband Timing Recovery in an All-Digital Modem Receiver IEEE TRANSACTIONS ON COMMUNICATIONS, VOL. COM-26, NO. 5, MAY 1978 */ /* This is slightly rearranged from figure 3b of the Godard paper, as this saves a couple of maths operations */ #if defined(SPANDSP_USE_FIXED_POINTx) /* TODO: The scalings used here need more thorough evaluation, to see if overflows are possible. */ /* Cross correlate */ v = (((s->symbol_sync_low[1] >> 5)*(s->symbol_sync_high[0] >> 4)) >> 15)*SYNC_LOW_BAND_EDGE_COEFF_2 - (((s->symbol_sync_low[0] >> 5)*(s->symbol_sync_high[1] >> 4)) >> 15)*SYNC_HIGH_BAND_EDGE_COEFF_2 + (((s->symbol_sync_low[1] >> 5)*(s->symbol_sync_high[1] >> 4)) >> 15)*SYNC_MIXED_EDGES_COEFF_3; /* Filter away any DC component */ p = v - s->symbol_sync_dc_filter[1]; s->symbol_sync_dc_filter[1] = s->symbol_sync_dc_filter[0]; s->symbol_sync_dc_filter[0] = v; /* A little integration will now filter away much of the HF noise */ s->baud_phase -= p; v = labs(s->baud_phase); if (v > 100*FP_FACTOR) { i = (v > 1000*FP_FACTOR) ? 15 : 1; if (s->baud_phase < FP_SCALE(0.0f)) i = -i; //printf("v = %10.5f %5d - %f %f %d %d\n", v, i, p, s->baud_phase, s->total_baud_timing_correction); s->eq_put_step += i; s->total_baud_timing_correction += i; } #else /* Cross correlate */ v = s->symbol_sync_low[1]*s->symbol_sync_high[0]*SYNC_LOW_BAND_EDGE_COEFF_2 - s->symbol_sync_low[0]*s->symbol_sync_high[1]*SYNC_HIGH_BAND_EDGE_COEFF_2 + s->symbol_sync_low[1]*s->symbol_sync_high[1]*SYNC_MIXED_EDGES_COEFF_3; /* Filter away any DC component */ p = v - s->symbol_sync_dc_filter[1]; s->symbol_sync_dc_filter[1] = s->symbol_sync_dc_filter[0]; s->symbol_sync_dc_filter[0] = v; /* A little integration will now filter away much of the HF noise */ s->baud_phase -= p; v = fabsf(s->baud_phase); if (v > 100.0f) { i = (v > 1000.0f) ? 15 : 1; if (s->baud_phase < FP_SCALE(0.0f)) i = -i; //printf("v = %10.5f %5d - %f %f %d\n", v, i, p, s->baud_phase, s->total_baud_timing_correction); s->eq_put_step += i; s->total_baud_timing_correction += i; } #endif } /*- End of function --------------------------------------------------------*/ static void process_half_baud(v17_rx_state_t *s, const complexf_t *sample) { #if defined(SPANDSP_USE_FIXED_POINTx) static const complexi16_t cdba[4] = #else static const complexf_t cdba[4] = #endif { {FP_SCALE( 6.0f), FP_SCALE( 2.0f)}, {FP_SCALE(-2.0f), FP_SCALE( 6.0f)}, {FP_SCALE( 2.0f), FP_SCALE(-6.0f)}, {FP_SCALE(-6.0f), FP_SCALE(-2.0f)} }; complexf_t z; complexf_t zz; #if defined(SPANDSP_USE_FIXED_POINTx) const complexi_t *target; static const complexi16_t zero = {0, 0}; #else const complexf_t *target; static const complexf_t zero = {0.0f, 0.0f}; #endif float p; int bit; int i; int j; int32_t angle; int32_t ang; int constellation_state; /* This routine processes every half a baud, as we put things into the equalizer at the T/2 rate. */ /* Add a sample to the equalizer's circular buffer, but don't calculate anything at this time. */ s->eq_buf[s->eq_step] = *sample; if (++s->eq_step >= V17_EQUALIZER_LEN) s->eq_step = 0; /* On alternate insertions we have a whole baud and must process it. */ if ((s->baud_half ^= 1)) return; /* Symbol timing synchronisation */ symbol_sync(s); z = equalizer_get(s); constellation_state = 0; switch (s->training_stage) { case TRAINING_STAGE_NORMAL_OPERATION: /* Normal operation. */ constellation_state = decode_baud(s, &z); target = &s->constellation[constellation_state]; break; case TRAINING_STAGE_SYMBOL_ACQUISITION: /* Allow time for the symbol synchronisation to settle the symbol timing. */ target = &zero; if (++s->training_count >= 100) { /* Record the current phase angle */ s->angles[0] = s->start_angles[0] = arctan2(z.im, z.re); s->training_stage = TRAINING_STAGE_LOG_PHASE; if (s->agc_scaling_save == FP_SCALE(0.0f)) { #if defined(SPANDSP_USE_FIXED_POINTx) span_log(&s->logging, SPAN_LOG_FLOW, "Locking AGC at %d\n", s->agc_scaling); #else span_log(&s->logging, SPAN_LOG_FLOW, "Locking AGC at %.7f\n", s->agc_scaling); #endif s->agc_scaling_save = s->agc_scaling; #if defined(RESCALER_TEST) s->window_power_save = s->window_power; #endif } #if defined(RESCALER_TEST) else { float a; float b; float rescaling; a = sqrtf((float) s->window_power_save); b = sqrtf((float) s->window_power); rescaling = a/b; if (rescaling > 1.03 || rescaling < 0.97) { s->agc_scaling *= rescaling; #if defined(SPANDSP_USE_FIXED_POINTx) span_log(&s->logging, SPAN_LOG_FLOW, "Relocking AGC at %d (%d)\n", s->agc_scaling, rescaling); #else span_log(&s->logging, SPAN_LOG_FLOW, "Relocking AGC at %.7f (%.7f)\n", s->agc_scaling, rescaling); #endif } } #endif } break; case TRAINING_STAGE_LOG_PHASE: /* Record the current alternate phase angle */ target = &zero; angle = arctan2(z.im, z.re); s->training_count = 1; if (s->short_train) { /* We should already know the accurate carrier frequency. All we need to sort out is the phase. */ /* Check if we just saw A or B */ if ((uint32_t) (angle - s->start_angles[0]) < (uint32_t) DDS_PHASE(180.0f)) { angle = s->start_angles[0]; s->angles[0] = DDS_PHASE(270.0f + 18.433f); s->angles[1] = DDS_PHASE(180.0f + 18.433f); } else { s->angles[0] = DDS_PHASE(180.0f + 18.433f); s->angles[1] = DDS_PHASE(270.0f + 18.433f); } /* Make a step shift in the phase, to pull it into line. We need to rotate the equalizer buffer, as well as the carrier phase, for this to play out nicely. */ /* angle is now the difference between where A is, and where it should be */ p = 3.14159f + angle*2.0f*3.14159f/(65536.0f*65536.0f) - 0.321751f; span_log(&s->logging, SPAN_LOG_FLOW, "Spin (short) by %.5f rads\n", p); zz = complex_setf(cosf(p), -sinf(p)); for (i = 0; i < V17_EQUALIZER_LEN; i++) s->eq_buf[i] = complex_mulf(&s->eq_buf[i], &zz); s->carrier_phase += (0x80000000 + angle - 219937506); s->carrier_track_p = 500000.0f; s->training_stage = TRAINING_STAGE_SHORT_WAIT_FOR_CDBA; } else { s->angles[1] = s->start_angles[1] = angle; s->training_stage = TRAINING_STAGE_WAIT_FOR_CDBA; } break; case TRAINING_STAGE_WAIT_FOR_CDBA: target = &zero; angle = arctan2(z.im, z.re); /* Look for the initial ABAB sequence to display a phase reversal, which will signal the start of the scrambled CDBA segment */ ang = angle - s->angles[(s->training_count - 1) & 0xF]; s->angles[(s->training_count + 1) & 0xF] = angle; /* Do a coarse frequency adjustment about half way through the reversals, as if we wait until the end, we might have rotated too far to correct properly. */ if (s->training_count == 100) { i = s->training_count; j = i & 0xF; ang = (s->angles[j] - s->start_angles[0])/i + (s->angles[j | 0x1] - s->start_angles[1])/i; s->carrier_phase_rate += 3*(ang/20); //span_log(&s->logging, SPAN_LOG_FLOW, "Angles %x, %x, %x, %x, dist %d\n", s->angles[j], s->start_angles[0], s->angles[j | 0x1], s->start_angles[1], i); s->start_angles[0] = s->angles[j]; s->start_angles[1] = s->angles[j | 0x1]; //span_log(&s->logging, SPAN_LOG_FLOW, "%d %d %d %d %d\n", s->angles[s->training_count & 0xF], s->start_angles[0], s->angles[(s->training_count | 0x1) & 0xF], s->start_angles[1], s->training_count); span_log(&s->logging, SPAN_LOG_FLOW, "First coarse carrier frequency %7.2f (%d)\n", dds_frequencyf(s->carrier_phase_rate), s->training_count); } if ((ang > DDS_PHASE(90.0f) || ang < DDS_PHASE(-90.0f)) && s->training_count >= 13) { span_log(&s->logging, SPAN_LOG_FLOW, "We seem to have a reversal at symbol %d\n", s->training_count); /* We seem to have a phase reversal */ /* Slam the carrier frequency into line, based on the total phase drift over the last section. Use the shift from the odd bits and the shift from the even bits to get better jitter suppression. */ /* TODO: We are supposed to deal with frequancy errors up to +-8Hz. Over 200+ symbols that is more than half a cycle. We get confused an do crazy things. We can only cope with errors up to 5Hz right now. We need to implement greater tolerance to be compliant, although it doesn't really matter much these days. */ /* Step back a few symbols so we don't get ISI distorting things. */ i = (s->training_count - 8) & ~1; /* Avoid the possibility of a divide by zero */ if (i - 100 + 8) { j = i & 0xF; ang = (s->angles[j] - s->start_angles[0])/(i - 100 + 8) + (s->angles[j | 0x1] - s->start_angles[1])/(i - 100 + 8); s->carrier_phase_rate += 3*(ang/20); span_log(&s->logging, SPAN_LOG_FLOW, "Angles %x, %x, %x, %x, dist %d\n", s->angles[j], s->start_angles[0], s->angles[j | 0x1], s->start_angles[1], i); } //span_log(&s->logging, SPAN_LOG_FLOW, "%d %d %d %d %d\n", s->angles[s->training_count & 0xF], s->start_angles[0], s->angles[(s->training_count | 0x1) & 0xF], s->start_angles[1], s->training_count); span_log(&s->logging, SPAN_LOG_FLOW, "Second coarse carrier frequency %7.2f (%d)\n", dds_frequencyf(s->carrier_phase_rate), s->training_count); /* Check if the carrier frequency is plausible */ if (s->carrier_phase_rate < DDS_PHASE_RATE(CARRIER_NOMINAL_FREQ - 20.0f) || s->carrier_phase_rate > DDS_PHASE_RATE(CARRIER_NOMINAL_FREQ + 20.0f)) { span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (sequence failed)\n"); /* Park this modem */ s->agc_scaling_save = FP_SCALE(0.0f); s->training_stage = TRAINING_STAGE_PARKED; report_status_change(s, SIG_STATUS_TRAINING_FAILED); break; } /* Make a step shift in the phase, to pull it into line. We need to rotate the equalizer buffer, as well as the carrier phase, for this to play out nicely. */ /* angle is now the difference between where C is, and where it should be */ p = angle*2.0f*3.14159f/(65536.0f*65536.0f) - 0.321751f; span_log(&s->logging, SPAN_LOG_FLOW, "Spin (long) by %.5f rads\n", p); zz = complex_setf(cosf(p), -sinf(p)); for (i = 0; i < V17_EQUALIZER_LEN; i++) s->eq_buf[i] = complex_mulf(&s->eq_buf[i], &zz); s->carrier_phase += (angle - 219937506); /* We have just seen the first symbol of the scrambled sequence, so skip it. */ bit = descramble(s, 1); bit = (bit << 1) | descramble(s, 1); target = &cdba[bit]; s->training_count = 1; s->training_stage = TRAINING_STAGE_COARSE_TRAIN_ON_CDBA; report_status_change(s, SIG_STATUS_TRAINING_IN_PROGRESS); break; } if (++s->training_count > V17_TRAINING_SEG_1_LEN) { /* This is bogus. There are not this many bits in this section of a real training sequence. Note that this might be TEP. */ span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (sequence failed)\n"); /* Park this modem */ s->agc_scaling_save = FP_SCALE(0.0f); s->training_stage = TRAINING_STAGE_PARKED; report_status_change(s, SIG_STATUS_TRAINING_FAILED); } break; case TRAINING_STAGE_COARSE_TRAIN_ON_CDBA: /* Train on the scrambled CDBA section. */ bit = descramble(s, 1); bit = (bit << 1) | descramble(s, 1); target = &cdba[bit]; track_carrier(s, &z, target); tune_equalizer(s, &z, target); #if defined(IAXMODEM_STUFF) zz = complex_subf(&z, target); s->training_error = powerf(&zz); if (++s->training_count == V17_TRAINING_SEG_2_LEN - 2000 || s->training_error < 1.0f || s->training_error > 200.0f) #else if (++s->training_count == V17_TRAINING_SEG_2_LEN - 2000) #endif { /* Now the equaliser adaption should be getting somewhere, slow it down, or it will never tune very well on a noisy signal. */ #if defined(SPANDSP_USE_FIXED_POINTx) s->eq_delta = 32768.0f*EQUALIZER_MEDIUM_ADAPTION_DELTA; s->carrier_track_i = 1000; #else s->eq_delta = EQUALIZER_MEDIUM_ADAPTION_DELTA; s->carrier_track_i = 1000.0f; #endif s->training_stage = TRAINING_STAGE_FINE_TRAIN_ON_CDBA; } break; case TRAINING_STAGE_FINE_TRAIN_ON_CDBA: /* Train on the scrambled CDBA section. */ bit = descramble(s, 1); bit = (bit << 1) | descramble(s, 1); target = &cdba[bit]; /* By this point the training should be comming into focus. */ track_carrier(s, &z, target); tune_equalizer(s, &z, target); if (++s->training_count >= V17_TRAINING_SEG_2_LEN - 48) { s->training_error = FP_SCALE(0.0f); #if defined(SPANDSP_USE_FIXED_POINTx) s->carrier_track_i = 100; s->carrier_track_p = 500000; #else s->carrier_track_i = 100.0f; s->carrier_track_p = 500000.0f; #endif s->training_stage = TRAINING_STAGE_TRAIN_ON_CDBA_AND_TEST; } break; case TRAINING_STAGE_TRAIN_ON_CDBA_AND_TEST: /* Continue training on the scrambled CDBA section, but measure the quality of training too. */ bit = descramble(s, 1); bit = (bit << 1) | descramble(s, 1); target = &cdba[bit]; //span_log(&s->logging, SPAN_LOG_FLOW, "%5d [%15.5f, %15.5f] [%15.5f, %15.5f]\n", s->training_count, z.re, z.im, cdba[bit].re, cdba[bit].im); /* We ignore the last few symbols because it seems some modems do not end this part properly, and it throws things off. */ if (++s->training_count < V17_TRAINING_SEG_2_LEN - 20) { track_carrier(s, &z, target); tune_equalizer(s, &z, target); /* Measure the training error */ zz = complex_subf(&z, &cdba[bit]); s->training_error += powerf(&zz); } else if (s->training_count >= V17_TRAINING_SEG_2_LEN) { span_log(&s->logging, SPAN_LOG_FLOW, "Long training error %f\n", s->training_error); if (s->training_error < 20.0f*1.414f*constellation_spacing[s->space_map]) { s->training_error = FP_SCALE(0.0f); s->training_count = 0; s->training_stage = TRAINING_STAGE_BRIDGE; } else { span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (convergence failed)\n"); /* Park this modem */ s->agc_scaling_save = FP_SCALE(0.0f); s->training_stage = TRAINING_STAGE_PARKED; report_status_change(s, SIG_STATUS_TRAINING_FAILED); } } break; case TRAINING_STAGE_BRIDGE: descramble(s, V17_BRIDGE_WORD >> ((s->training_count & 0x7) << 1)); descramble(s, V17_BRIDGE_WORD >> (((s->training_count & 0x7) << 1) + 1)); target = &z; if (++s->training_count >= V17_TRAINING_SEG_3_LEN) { s->training_error = FP_SCALE(0.0f); s->training_count = 0; if (s->bits_per_symbol == 2) { /* Restart the differential decoder */ /* There is no trellis, so go straight to processing decoded data */ s->diff = (s->short_train) ? 0 : 1; s->training_stage = TRAINING_STAGE_TEST_ONES; } else { /* Wait for the trellis to wind up */ s->training_stage = TRAINING_STAGE_TCM_WINDUP; } } break; case TRAINING_STAGE_SHORT_WAIT_FOR_CDBA: /* Look for the initial ABAB sequence to display a phase reversal, which will signal the start of the scrambled CDBA segment */ angle = arctan2(z.im, z.re); ang = angle - s->angles[s->training_count & 1]; if (ang > DDS_PHASE(90.0f) || ang < DDS_PHASE(-90.0f)) { /* We seem to have a phase reversal */ /* We have just seen the first symbol of the scrambled sequence, so skip it. */ bit = descramble(s, 1); bit = (bit << 1) | descramble(s, 1); target = &cdba[bit]; s->training_error = FP_SCALE(0.0f); s->training_count = 1; s->training_stage = TRAINING_STAGE_SHORT_TRAIN_ON_CDBA_AND_TEST; break; } target = &cdba[(s->training_count & 1) + 2]; track_carrier(s, &z, target); if (++s->training_count > V17_TRAINING_SEG_1_LEN) { /* This is bogus. There are not this many bits in this section of a real training sequence. Note that this might be TEP. */ span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (sequence failed)\n"); /* Park this modem */ s->training_stage = TRAINING_STAGE_PARKED; report_status_change(s, SIG_STATUS_TRAINING_FAILED); } break; case TRAINING_STAGE_SHORT_TRAIN_ON_CDBA_AND_TEST: /* Short retrain on the scrambled CDBA section, but measure the quality of training too. */ bit = descramble(s, 1); bit = (bit << 1) | descramble(s, 1); //span_log(&s->logging, SPAN_LOG_FLOW, "%5d [%15.5f, %15.5f] [%15.5f, %15.5f] %d\n", s->training_count, z.re, z.im, cdba[bit].re, cdba[bit].im, arctan2(z.im, z.re)); target = &cdba[bit]; track_carrier(s, &z, target); #if defined(RESCALER_TEST) tune_equalizer(s, &z, target); #endif /* Measure the training error */ if (s->training_count > 8) { #if defined(SPANDSP_USE_FIXED_POINTx) z16 = complex_subi16(&z, &cdba[bit]); s->training_error += poweri16(&z16); #else zz = complex_subf(&z, &cdba[bit]); s->training_error += powerf(&zz); #endif } if (++s->training_count >= V17_TRAINING_SHORT_SEG_2_LEN) { #if defined(SPANDSP_USE_FIXED_POINTx) span_log(&s->logging, SPAN_LOG_FLOW, "Short training error %d\n", s->training_error); s->carrier_track_i = 100; s->carrier_track_p = 500000; #else span_log(&s->logging, SPAN_LOG_FLOW, "Short training error %f\n", s->training_error); s->carrier_track_i = 100.0f; s->carrier_track_p = 500000.0f; #endif /* TODO: This was increased by a factor of 10 after studying real world failures. However, it is not clear why this is an improvement, If something gives a huge training error, surely it shouldn't decode too well? */ if (s->training_error < (V17_TRAINING_SHORT_SEG_2_LEN - 8)*4.0f*constellation_spacing[s->space_map]) { s->training_count = 0; if (s->bits_per_symbol == 2) { /* There is no trellis, so go straight to processing decoded data */ /* Restart the differential decoder */ s->diff = (s->short_train) ? 0 : 1; s->training_error = FP_SCALE(0.0f); s->training_stage = TRAINING_STAGE_TEST_ONES; } else { /* Wait for the trellis to wind up */ s->training_stage = TRAINING_STAGE_TCM_WINDUP; } report_status_change(s, SIG_STATUS_TRAINING_IN_PROGRESS); } else { span_log(&s->logging, SPAN_LOG_FLOW, "Short training failed (convergence failed)\n"); /* Park this modem */ s->training_stage = TRAINING_STAGE_PARKED; report_status_change(s, SIG_STATUS_TRAINING_FAILED); } } break; case TRAINING_STAGE_TCM_WINDUP: /* We need to wait 15 bauds while the trellis fills up. */ //span_log(&s->logging, SPAN_LOG_FLOW, "%5d %15.5f, %15.5f\n", s->training_count, z.re, z.im); constellation_state = decode_baud(s, &z); target = &s->constellation[constellation_state]; /* Measure the training error */ zz = complex_subf(&z, target); s->training_error += powerf(&zz); if (++s->training_count >= V17_TRAINING_SEG_4A_LEN) { s->training_error = FP_SCALE(0.0f); s->training_count = 0; /* Restart the differential decoder */ s->diff = (s->short_train) ? 0 : 1; s->training_stage = TRAINING_STAGE_TEST_ONES; } break; case TRAINING_STAGE_TEST_ONES: /* We are in the test phase, where we check that we can receive reliably. We should get a run of 1's, 48 symbols long. */ //span_log(&s->logging, SPAN_LOG_FLOW, "%5d %15.5f, %15.5f\n", s->training_count, z.re, z.im); constellation_state = decode_baud(s, &z); target = &s->constellation[constellation_state]; /* Measure the training error */ zz = complex_subf(&z, target); s->training_error += powerf(&zz); if (++s->training_count >= V17_TRAINING_SEG_4_LEN) { if (s->training_error < V17_TRAINING_SEG_4_LEN*constellation_spacing[s->space_map]) { /* We are up and running */ span_log(&s->logging, SPAN_LOG_FLOW, "Training succeeded at %dbps (constellation mismatch %f)\n", s->bit_rate, s->training_error); report_status_change(s, SIG_STATUS_TRAINING_SUCCEEDED); /* Apply some lag to the carrier off condition, to ensure the last few bits get pushed through the processing. */ s->signal_present = 60; equalizer_save(s); s->carrier_phase_rate_save = s->carrier_phase_rate; s->short_train = TRUE; #if defined(SPANDSP_USE_FIXED_POINTx) s->eq_delta = 32768.0f*EQUALIZER_SLOW_ADAPTION_DELTA; #else s->eq_delta = EQUALIZER_SLOW_ADAPTION_DELTA; #endif s->training_stage = TRAINING_STAGE_NORMAL_OPERATION; } else { /* Training has failed. Park this modem. */ span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (constellation mismatch %f)\n", s->training_error); if (!s->short_train) s->agc_scaling_save = FP_SCALE(0.0f); s->training_stage = TRAINING_STAGE_PARKED; report_status_change(s, SIG_STATUS_TRAINING_FAILED); } } break; case TRAINING_STAGE_PARKED: default: /* We failed to train! */ /* Park here until the carrier drops. */ target = &zero; break; } if (s->qam_report) s->qam_report(s->qam_user_data, &z, target, constellation_state); } /*- End of function --------------------------------------------------------*/ static __inline__ int signal_detect(v17_rx_state_t *s, int16_t amp) { int16_t diff; int16_t x; int32_t power; /* There should be no DC in the signal, but sometimes there is. We need to measure the power with the DC blocked, but not using a slow to respond DC blocker. Use the most elementary HPF. */ x = amp >> 1; /* There could be overflow here, but it isn't a problem in practice */ diff = x - s->last_sample; s->last_sample = x; power = power_meter_update(&s->power, diff); #if defined(IAXMODEM_STUFF) /* Quick power drop fudge */ diff = abs(diff); if (10*diff < s->high_sample) { if (++s->low_samples > 120) { power_meter_init(&s->power, 4); s->high_sample = 0; s->low_samples = 0; } } else { s->low_samples = 0; if (diff > s->high_sample) s->high_sample = diff; } #endif if (s->signal_present > 0) { /* Look for power below turn-off threshold to turn the carrier off */ #if defined(IAXMODEM_STUFF) if (s->carrier_drop_pending || power < s->carrier_off_power) #else if (power < s->carrier_off_power) #endif { if (--s->signal_present <= 0) { /* Count down a short delay, to ensure we push the last few bits through the filters before stopping. */ v17_rx_restart(s, s->bit_rate, s->short_train); report_status_change(s, SIG_STATUS_CARRIER_DOWN); return 0; } #if defined(IAXMODEM_STUFF) /* Carrier has dropped, but the put_bit is pending the signal_present delay. */ s->carrier_drop_pending = TRUE; #endif } } else { /* Look for power exceeding turn-on threshold to turn the carrier on */ if (power < s->carrier_on_power) return 0; s->signal_present = 1; #if defined(IAXMODEM_STUFF) s->carrier_drop_pending = FALSE; #endif report_status_change(s, SIG_STATUS_CARRIER_UP); } return power; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) v17_rx(v17_rx_state_t *s, const int16_t amp[], int len) { int i; int step; complexf_t z; complexf_t zz; complexf_t sample; #if defined(SPANDSP_USE_FIXED_POINT) int32_t vi; #endif #if defined(SPANDSP_USE_FIXED_POINTx) int32_t v; #else float v; #endif int32_t power; for (i = 0; i < len; i++) { #if defined(RESCALER_TEST) s->window_power -= ((int32_t) s->power_window[s->power_window_ptr]*s->power_window[s->power_window_ptr]); s->window_power += ((int32_t) amp[i]*amp[i]); s->power_window[s->power_window_ptr] = amp[i]; if (++s->power_window_ptr >= 40) s->power_window_ptr = 0; #endif s->rrc_filter[s->rrc_filter_step] = amp[i]; if (++s->rrc_filter_step >= V17_RX_FILTER_STEPS) s->rrc_filter_step = 0; if ((power = signal_detect(s, amp[i])) == 0) continue; if (s->training_stage == TRAINING_STAGE_PARKED) continue; /* Only spend effort processing this data if the modem is not parked, after training failure. */ s->eq_put_step -= RX_PULSESHAPER_COEFF_SETS; step = -s->eq_put_step; if (step < 0) step += RX_PULSESHAPER_COEFF_SETS; if (step < 0) step = 0; else if (step > RX_PULSESHAPER_COEFF_SETS - 1) step = RX_PULSESHAPER_COEFF_SETS - 1; #if defined(SPANDSP_USE_FIXED_POINT) vi = vec_circular_dot_prodi16(s->rrc_filter, rx_pulseshaper_re[step], V17_RX_FILTER_STEPS, s->rrc_filter_step); //sample.re = (vi*(int32_t) s->agc_scaling) >> 15; sample.re = vi*s->agc_scaling; /* Symbol timing synchronisation band edge filters */ /* Low Nyquist band edge filter */ v = s->symbol_sync_low[0]*SYNC_LOW_BAND_EDGE_COEFF_0 + s->symbol_sync_low[1]*SYNC_LOW_BAND_EDGE_COEFF_1 + sample.re; s->symbol_sync_low[1] = s->symbol_sync_low[0]; s->symbol_sync_low[0] = v; /* High Nyquist band edge filter */ v = s->symbol_sync_high[0]*SYNC_HIGH_BAND_EDGE_COEFF_0 + s->symbol_sync_high[1]*SYNC_HIGH_BAND_EDGE_COEFF_1 + sample.re; s->symbol_sync_high[1] = s->symbol_sync_high[0]; s->symbol_sync_high[0] = v; #else v = vec_circular_dot_prodf(s->rrc_filter, rx_pulseshaper_re[step], V17_RX_FILTER_STEPS, s->rrc_filter_step); sample.re = v*s->agc_scaling; /* Symbol timing synchronisation band edge filters */ /* Low Nyquist band edge filter */ v = s->symbol_sync_low[0]*SYNC_LOW_BAND_EDGE_COEFF_0 + s->symbol_sync_low[1]*SYNC_LOW_BAND_EDGE_COEFF_1 + sample.re; s->symbol_sync_low[1] = s->symbol_sync_low[0]; s->symbol_sync_low[0] = v; /* High Nyquist band edge filter */ v = s->symbol_sync_high[0]*SYNC_HIGH_BAND_EDGE_COEFF_0 + s->symbol_sync_high[1]*SYNC_HIGH_BAND_EDGE_COEFF_1 + sample.re; s->symbol_sync_high[1] = s->symbol_sync_high[0]; s->symbol_sync_high[0] = v; #endif /* Put things into the equalization buffer at T/2 rate. The symbol synchronisation will fiddle the step to align this with the symbols. */ if (s->eq_put_step <= 0) { /* Only AGC until we have locked down the setting. */ if (s->agc_scaling_save == FP_SCALE(0.0f)) s->agc_scaling = (1.0f/RX_PULSESHAPER_GAIN)*2.17f/sqrtf(power); /* Pulse shape while still at the carrier frequency, using a quadrature pair of filters. This results in a properly bandpass filtered complex signal, which can be brought directly to baseband by complex mixing. No further filtering, to remove mixer harmonics, is needed. */ step = -s->eq_put_step; if (step > RX_PULSESHAPER_COEFF_SETS - 1) step = RX_PULSESHAPER_COEFF_SETS - 1; #if defined(SPANDSP_USE_FIXED_POINT) vi = vec_circular_dot_prodi16(s->rrc_filter, rx_pulseshaper_im[step], V17_RX_FILTER_STEPS, s->rrc_filter_step); //sample.im = (vi*(int32_t) s->agc_scaling) >> 15; sample.im = vi*s->agc_scaling; z = dds_lookup_complexf(s->carrier_phase); zz.re = sample.re*z.re - sample.im*z.im; zz.im = -sample.re*z.im - sample.im*z.re; #else v = vec_circular_dot_prodf(s->rrc_filter, rx_pulseshaper_im[step], V17_RX_FILTER_STEPS, s->rrc_filter_step); sample.im = v*s->agc_scaling; z = dds_lookup_complexf(s->carrier_phase); zz.re = sample.re*z.re - sample.im*z.im; zz.im = -sample.re*z.im - sample.im*z.re; #endif s->eq_put_step += RX_PULSESHAPER_COEFF_SETS*10/(3*2); process_half_baud(s, &zz); } #if defined(SPANDSP_USE_FIXED_POINT) dds_advance(&s->carrier_phase, s->carrier_phase_rate); #else dds_advancef(&s->carrier_phase, s->carrier_phase_rate); #endif } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) v17_rx_fillin(v17_rx_state_t *s, int len) { int i; /* We want to sustain the current state (i.e carrier on<->carrier off), and try to sustain the carrier phase. We should probably push the filters, as well */ span_log(&s->logging, SPAN_LOG_FLOW, "Fill-in %d samples\n", len); if (s->signal_present <= 0) return 0; if (s->training_stage == TRAINING_STAGE_PARKED) return 0; for (i = 0; i < len; i++) { #if defined(SPANDSP_USE_FIXED_POINT) dds_advance(&s->carrier_phase, s->carrier_phase_rate); #else dds_advancef(&s->carrier_phase, s->carrier_phase_rate); #endif /* Advance the symbol phase the appropriate amount */ s->eq_put_step -= RX_PULSESHAPER_COEFF_SETS; if (s->eq_put_step <= 0) s->eq_put_step += RX_PULSESHAPER_COEFF_SETS*10/(3*2); /* TODO: Should we rotate any buffers */ } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v17_rx_set_put_bit(v17_rx_state_t *s, put_bit_func_t put_bit, void *user_data) { s->put_bit = put_bit; s->put_bit_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v17_rx_set_modem_status_handler(v17_rx_state_t *s, modem_status_func_t handler, void *user_data) { s->status_handler = handler; s->status_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) v17_rx_get_logging_state(v17_rx_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v17_rx_restart(v17_rx_state_t *s, int bit_rate, int short_train) { int i; span_log(&s->logging, SPAN_LOG_FLOW, "Restarting V.17, %dbps, %s training\n", bit_rate, (short_train) ? "short" : "long"); switch (bit_rate) { case 14400: s->constellation = v17_v32bis_14400_constellation; s->space_map = 0; s->bits_per_symbol = 6; break; case 12000: s->constellation = v17_v32bis_12000_constellation; s->space_map = 1; s->bits_per_symbol = 5; break; case 9600: s->constellation = v17_v32bis_9600_constellation; s->space_map = 2; s->bits_per_symbol = 4; break; case 7200: s->constellation = v17_v32bis_7200_constellation; s->space_map = 3; s->bits_per_symbol = 3; break; case 4800: /* This does not exist in the V.17 spec as a valid mode of operation. However, it does exist in V.32bis, so it is here for completeness. */ s->constellation = v17_v32bis_4800_constellation; s->space_map = 0; s->bits_per_symbol = 2; break; default: return -1; } s->bit_rate = bit_rate; #if defined(SPANDSP_USE_FIXED_POINT) vec_zeroi16(s->rrc_filter, sizeof(s->rrc_filter)/sizeof(s->rrc_filter[0])); #else vec_zerof(s->rrc_filter, sizeof(s->rrc_filter)/sizeof(s->rrc_filter[0])); #endif s->training_error = FP_SCALE(0.0f); s->rrc_filter_step = 0; s->diff = 1; s->scramble_reg = 0x2ECDD5; s->training_stage = TRAINING_STAGE_SYMBOL_ACQUISITION; s->training_count = 0; s->signal_present = 0; #if defined(IAXMODEM_STUFF) s->high_sample = 0; s->low_samples = 0; s->carrier_drop_pending = FALSE; #endif if (short_train != 2) s->short_train = short_train; memset(s->start_angles, 0, sizeof(s->start_angles)); memset(s->angles, 0, sizeof(s->angles)); /* Initialise the TCM decoder parameters. */ /* The accumulated distance vectors are set so state zero starts at a value of zero, and all others start larger. This forces the initial paths to merge at the zero states. */ for (i = 0; i < 8; i++) #if defined(SPANDSP_USE_FIXED_POINTx) s->distances[i] = 99*DIST_FACTOR*DIST_FACTOR; #else s->distances[i] = 99.0f; #endif memset(s->full_path_to_past_state_locations, 0, sizeof(s->full_path_to_past_state_locations)); memset(s->past_state_locations, 0, sizeof(s->past_state_locations)); s->distances[0] = 0; s->trellis_ptr = 14; s->carrier_phase = 0; power_meter_init(&s->power, 4); if (s->short_train) { s->carrier_phase_rate = s->carrier_phase_rate_save; equalizer_restore(s); s->agc_scaling = s->agc_scaling_save; /* Don't allow any frequency correction at all, until we start to pull the phase in. */ #if defined(SPANDSP_USE_FIXED_POINTx) s->carrier_track_i = 0; s->carrier_track_p = 40000; #else s->carrier_track_i = 0.0f; s->carrier_track_p = 40000.0f; #endif } else { s->carrier_phase_rate = DDS_PHASE_RATE(CARRIER_NOMINAL_FREQ); equalizer_reset(s); s->agc_scaling_save = FP_SCALE(0.0f); #if defined(SPANDSP_USE_FIXED_POINTx) s->agc_scaling = (float) FP_FACTOR*32768.0f*0.0017f/RX_PULSESHAPER_GAIN; s->carrier_track_i = 5000; s->carrier_track_p = 40000; #else s->agc_scaling = 0.0017f/RX_PULSESHAPER_GAIN; s->carrier_track_i = 5000.0f; s->carrier_track_p = 40000.0f; #endif } s->last_sample = 0; span_log(&s->logging, SPAN_LOG_FLOW, "Gains %f %f\n", s->agc_scaling_save, s->agc_scaling); span_log(&s->logging, SPAN_LOG_FLOW, "Phase rates %f %f\n", dds_frequencyf(s->carrier_phase_rate), dds_frequencyf(s->carrier_phase_rate_save)); /* Initialise the working data for symbol timing synchronisation */ #if defined(SPANDSP_USE_FIXED_POINTx) for (i = 0; i < 2; i++) { s->symbol_sync_low[i] = 0; s->symbol_sync_high[i] = 0; s->symbol_sync_dc_filter[i] = 0; } #else for (i = 0; i < 2; i++) { s->symbol_sync_low[i] = 0.0f; s->symbol_sync_high[i] = 0.0f; s->symbol_sync_dc_filter[i] = 0.0f; } #endif s->baud_phase = FP_SCALE(0.0f); s->baud_half = 0; s->total_baud_timing_correction = 0; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(v17_rx_state_t *) v17_rx_init(v17_rx_state_t *s, int bit_rate, put_bit_func_t put_bit, void *user_data) { switch (bit_rate) { case 14400: case 12000: case 9600: case 7200: case 4800: /* 4800 is an extension of V.17, to provide full coverage of the V.32bis modes */ break; default: return NULL; } if (s == NULL) { if ((s = (v17_rx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "V.17 RX"); s->put_bit = put_bit; s->put_bit_user_data = user_data; s->short_train = FALSE; //s->scrambler_tap = 18 - 1; v17_rx_signal_cutoff(s, -45.5f); s->carrier_phase_rate_save = DDS_PHASE_RATE(CARRIER_NOMINAL_FREQ); v17_rx_restart(s, bit_rate, s->short_train); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v17_rx_release(v17_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v17_rx_free(v17_rx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v17_rx_set_qam_report_handler(v17_rx_state_t *s, qam_report_handler_t handler, void *user_data) { s->qam_report = handler; s->qam_user_data = user_data; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/gsm0610_encode.c0000664000175000017500000002557211422612262013466 00000000000000/* * SpanDSP - a series of DSP components for telephony * * gsm0610_encode.c - GSM 06.10 full rate speech codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * This code is based on the widely used GSM 06.10 code available from * http://kbs.cs.tu-berlin.de/~jutta/toast.html */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/bitstream.h" #include "spandsp/saturated.h" #include "spandsp/gsm0610.h" #include "gsm0610_local.h" /* 4.2 FIXED POINT IMPLEMENTATION OF THE RPE-LTP CODER */ /* The RPE-LTD coder works on a frame by frame basis. The length of the frame is equal to 160 samples. Some computations are done once per frame to produce at the output of the coder the LARc[1..8] parameters which are the coded LAR coefficients and also to realize the inverse filtering operation for the entire frame (160 samples of signal d[0..159]). These parts produce at the output of the coder: Procedure 4.2.11 to 4.2.18 are to be executed four times per frame. That means once for each sub-segment RPE-LTP analysis of 40 samples. These parts produce at the output of the coder. */ static void encode_a_frame(gsm0610_state_t *s, gsm0610_frame_t *f, const int16_t amp[]) { int k; int16_t *dp; int16_t *dpp; int16_t so[GSM0610_FRAME_LEN]; int i; dp = s->dp0 + 120; dpp = dp; gsm0610_preprocess(s, amp, so); gsm0610_lpc_analysis(s, so, f->LARc); gsm0610_short_term_analysis_filter(s, f->LARc, so); for (k = 0; k < 4; k++) { gsm0610_long_term_predictor(s, so + k*40, dp, s->e + 5, dpp, &f->Nc[k], &f->bc[k]); gsm0610_rpe_encoding(s, s->e + 5, &f->xmaxc[k], &f->Mc[k], f->xMc[k]); for (i = 0; i < 40; i++) dp[i] = saturated_add16(s->e[5 + i], dpp[i]); /*endfor*/ dp += 40; dpp += 40; } /*endfor*/ memcpy((char *) s->dp0, (char *) (s->dp0 + GSM0610_FRAME_LEN), 120*sizeof(*s->dp0)); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) gsm0610_set_packing(gsm0610_state_t *s, int packing) { s->packing = packing; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(gsm0610_state_t *) gsm0610_init(gsm0610_state_t *s, int packing) { if (s == NULL) { if ((s = (gsm0610_state_t *) malloc(sizeof (*s))) == NULL) return NULL; /*endif*/ } /*endif*/ memset((char *) s, '\0', sizeof (gsm0610_state_t)); s->nrp = 40; s->packing = packing; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) gsm0610_release(gsm0610_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) gsm0610_free(gsm0610_state_t *s) { if (s) free(s); /*endif*/ return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) gsm0610_pack_none(uint8_t c[], const gsm0610_frame_t *s) { int i; int j; int k; i = 0; for (j = 0; j < 8; j++) c[i++] = (uint8_t) s->LARc[j]; for (j = 0; j < 4; j++) { c[i++] = (uint8_t) s->Nc[j]; c[i++] = (uint8_t) s->bc[j]; c[i++] = (uint8_t) s->Mc[j]; c[i++] = (uint8_t) s->xmaxc[j]; for (k = 0; k < 13; k++) c[i++] = (uint8_t) s->xMc[j][k]; } /*endfor*/ return 76; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) gsm0610_pack_wav49(uint8_t c[], const gsm0610_frame_t *s) { uint16_t sr; int i; sr = 0; sr = (sr >> 6) | (s->LARc[0] << 10); sr = (sr >> 6) | (s->LARc[1] << 10); *c++ = (uint8_t) (sr >> 4); sr = (sr >> 5) | (s->LARc[2] << 11); *c++ = (uint8_t) (sr >> 7); sr = (sr >> 5) | (s->LARc[3] << 11); sr = (sr >> 4) | (s->LARc[4] << 12); *c++ = (uint8_t) (sr >> 6); sr = (sr >> 4) | (s->LARc[5] << 12); sr = (sr >> 3) | (s->LARc[6] << 13); *c++ = (uint8_t) (sr >> 7); sr = (sr >> 3) | (s->LARc[7] << 13); for (i = 0; i < 4; i++) { sr = (sr >> 7) | (s->Nc[i] << 9); *c++ = (uint8_t) (sr >> 5); sr = (sr >> 2) | (s->bc[i] << 14); sr = (sr >> 2) | (s->Mc[i] << 14); sr = (sr >> 6) | (s->xmaxc[i] << 10); *c++ = (uint8_t) (sr >> 3); sr = (sr >> 3) | (s->xMc[i][0] << 13); *c++ = (uint8_t) (sr >> 8); sr = (sr >> 3) | (s->xMc[i][1] << 13); sr = (sr >> 3) | (s->xMc[i][2] << 13); sr = (sr >> 3) | (s->xMc[i][3] << 13); *c++ = (uint8_t) (sr >> 7); sr = (sr >> 3) | (s->xMc[i][4] << 13); sr = (sr >> 3) | (s->xMc[i][5] << 13); sr = (sr >> 3) | (s->xMc[i][6] << 13); *c++ = (uint8_t) (sr >> 6); sr = (sr >> 3) | (s->xMc[i][7] << 13); sr = (sr >> 3) | (s->xMc[i][8] << 13); *c++ = (uint8_t) (sr >> 8); sr = (sr >> 3) | (s->xMc[i][9] << 13); sr = (sr >> 3) | (s->xMc[i][10] << 13); sr = (sr >> 3) | (s->xMc[i][11] << 13); *c++ = (uint8_t) (sr >> 7); sr = (sr >> 3) | (s->xMc[i][12] << 13); } /*endfor*/ s++; sr = (sr >> 6) | (s->LARc[0] << 10); *c++ = (uint8_t) (sr >> 6); sr = (sr >> 6) | (s->LARc[1] << 10); *c++ = (uint8_t) (sr >> 8); sr = (sr >> 5) | (s->LARc[2] << 11); sr = (sr >> 5) | (s->LARc[3] << 11); *c++ = (uint8_t) (sr >> 6); sr = (sr >> 4) | (s->LARc[4] << 12); sr = (sr >> 4) | (s->LARc[5] << 12); *c++ = (uint8_t) (sr >> 6); sr = (sr >> 3) | (s->LARc[6] << 13); sr = (sr >> 3) | (s->LARc[7] << 13); *c++ = (uint8_t) (sr >> 8); for (i = 0; i < 4; i++) { sr = (sr >> 7) | (s->Nc[i] << 9); sr = (sr >> 2) | (s->bc[i] << 14); *c++ = (uint8_t) (sr >> 7); sr = (sr >> 2) | (s->Mc[i] << 14); sr = (sr >> 6) | (s->xmaxc[i] << 10); *c++ = (uint8_t) (sr >> 7); sr = (sr >> 3) | (s->xMc[i][0] << 13); sr = (sr >> 3) | (s->xMc[i][1] << 13); sr = (sr >> 3) | (s->xMc[i][2] << 13); *c++ = (uint8_t) (sr >> 6); sr = (sr >> 3) | (s->xMc[i][3] << 13); sr = (sr >> 3) | (s->xMc[i][4] << 13); *c++ = (uint8_t) (sr >> 8); sr = (sr >> 3) | (s->xMc[i][5] << 13); sr = (sr >> 3) | (s->xMc[i][6] << 13); sr = (sr >> 3) | (s->xMc[i][7] << 13); *c++ = (uint8_t) (sr >> 7); sr = (sr >> 3) | (s->xMc[i][8] << 13); sr = (sr >> 3) | (s->xMc[i][9] << 13); sr = (sr >> 3) | (s->xMc[i][10] << 13); *c++ = (uint8_t) (sr >> 6); sr = (sr >> 3) | (s->xMc[i][11] << 13); sr = (sr >> 3) | (s->xMc[i][12] << 13); *c++ = (uint8_t) (sr >> 8); } /*endfor*/ return 65; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) gsm0610_pack_voip(uint8_t c[33], const gsm0610_frame_t *s) { int i; *c++ = (uint8_t) (((GSM0610_MAGIC & 0xF) << 4) | ((s->LARc[0] >> 2) & 0xF)); *c++ = (uint8_t) (((s->LARc[0] & 0x3) << 6) | (s->LARc[1] & 0x3F)); *c++ = (uint8_t) (((s->LARc[2] & 0x1F) << 3) | ((s->LARc[3] >> 2) & 0x7)); *c++ = (uint8_t) (((s->LARc[3] & 0x3) << 6) | ((s->LARc[4] & 0xF) << 2) | ((s->LARc[5] >> 2) & 0x3)); *c++ = (uint8_t) (((s->LARc[5] & 0x3) << 6) | ((s->LARc[6] & 0x7) << 3) | (s->LARc[7] & 0x7)); for (i = 0; i < 4; i++) { *c++ = (uint8_t) (((s->Nc[i] & 0x7F) << 1) | ((s->bc[i] >> 1) & 0x1)); *c++ = (uint8_t) (((s->bc[i] & 0x1) << 7) | ((s->Mc[i] & 0x3) << 5) | ((s->xmaxc[i] >> 1) & 0x1F)); *c++ = (uint8_t) (((s->xmaxc[i] & 0x1) << 7) | ((s->xMc[i][0] & 0x7) << 4) | ((s->xMc[i][1] & 0x7) << 1) | ((s->xMc[i][2] >> 2) & 0x1)); *c++ = (uint8_t) (((s->xMc[i][2] & 0x3) << 6) | ((s->xMc[i][3] & 0x7) << 3) | (s->xMc[i][4] & 0x7)); *c++ = (uint8_t) (((s->xMc[i][5] & 0x7) << 5) | ((s->xMc[i][6] & 0x7) << 2) | ((s->xMc[i][7] >> 1) & 0x3)); *c++ = (uint8_t) (((s->xMc[i][7] & 0x1) << 7) | ((s->xMc[i][8] & 0x7) << 4) | ((s->xMc[i][9] & 0x7) << 1) | ((s->xMc[i][10] >> 2) & 0x1)); *c++ = (uint8_t) (((s->xMc[i][10] & 0x3) << 6) | ((s->xMc[i][11] & 0x7) << 3) | (s->xMc[i][12] & 0x7)); } /*endfor*/ return 33; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) gsm0610_encode(gsm0610_state_t *s, uint8_t code[], const int16_t amp[], int len) { gsm0610_frame_t frame[2]; int bytes; int i; bytes = 0; for (i = 0; i < len; i += GSM0610_FRAME_LEN) { encode_a_frame(s, frame, &[i]); switch (s->packing) { case GSM0610_PACKING_WAV49: i += GSM0610_FRAME_LEN; encode_a_frame(s, frame + 1, &[i]); bytes += gsm0610_pack_wav49(&code[bytes], frame); break; case GSM0610_PACKING_VOIP: bytes += gsm0610_pack_voip(&code[bytes], frame); break; default: bytes += gsm0610_pack_none(&code[bytes], frame); break; } /*endswitch*/ } /*endfor*/ return bytes; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/t4_tx.c0000664000175000017500000015324212101166562012114 00000000000000//#define T4_STATE_DEBUGGING /* * SpanDSP - a series of DSP components for telephony * * t4_tx.c - ITU T.4 FAX image transmit processing * * Written by Steve Underwood * * Copyright (C) 2003, 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * Much of this file is based on the T.4 and T.6 support in libtiff, which requires * the following notice in any derived source code: * * Copyright (c) 1990-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. * * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/bit_operations.h" #include "spandsp/async.h" #include "spandsp/timezone.h" #include "spandsp/t4_rx.h" #include "spandsp/t4_tx.h" #if defined(SPANDSP_SUPPORT_T85) #include "spandsp/t81_t82_arith_coding.h" #include "spandsp/t85.h" #endif #include "spandsp/t4_t6_decode.h" #include "spandsp/t4_t6_encode.h" #include "spandsp/private/logging.h" #if defined(SPANDSP_SUPPORT_T85) #include "spandsp/private/t81_t82_arith_coding.h" #include "spandsp/private/t85.h" #endif #include "spandsp/private/t4_t6_decode.h" #include "spandsp/private/t4_t6_encode.h" #include "spandsp/private/t4_rx.h" #include "spandsp/private/t4_tx.h" /*! The number of centimetres in one inch */ #define CM_PER_INCH 2.54f /*! The number of EOLs to be sent at the end of a T.4 page */ #define EOLS_TO_END_T4_TX_PAGE 6 /*! The number of EOLs to be sent at the end of a T.6 page */ #define EOLS_TO_END_T6_TX_PAGE 2 #if defined(T4_STATE_DEBUGGING) static void STATE_TRACE(const char *format, ...) { va_list arg_ptr; va_start(arg_ptr, format); vprintf(format, arg_ptr); va_end(arg_ptr); } /*- End of function --------------------------------------------------------*/ #else #define STATE_TRACE(...) /**/ #endif /*! T.4 run length table entry */ typedef struct { /*! Length of T.4 code, in bits */ uint16_t length; /*! T.4 code */ uint16_t code; /*! Run length, in bits */ int16_t run_length; } t4_run_table_entry_t; #include "faxfont.h" /* Legitimate runs of zero bits which are the tail end of one code plus the start of the next code do not exceed 10 bits. */ /* * Note that these tables are ordered such that the index into the table * is known to be either the run length, or (run length / 64) + a fixed * offset. */ static const t4_run_table_entry_t t4_white_codes[] = { { 8, 0x00AC, 0}, /* 0011 0101 */ { 6, 0x0038, 1}, /* 0001 11 */ { 4, 0x000E, 2}, /* 0111 */ { 4, 0x0001, 3}, /* 1000 */ { 4, 0x000D, 4}, /* 1011 */ { 4, 0x0003, 5}, /* 1100 */ { 4, 0x0007, 6}, /* 1110 */ { 4, 0x000F, 7}, /* 1111 */ { 5, 0x0019, 8}, /* 1001 1 */ { 5, 0x0005, 9}, /* 1010 0 */ { 5, 0x001C, 10}, /* 0011 1 */ { 5, 0x0002, 11}, /* 0100 0 */ { 6, 0x0004, 12}, /* 0010 00 */ { 6, 0x0030, 13}, /* 0000 11 */ { 6, 0x000B, 14}, /* 1101 00 */ { 6, 0x002B, 15}, /* 1101 01 */ { 6, 0x0015, 16}, /* 1010 10 */ { 6, 0x0035, 17}, /* 1010 11 */ { 7, 0x0072, 18}, /* 0100 111 */ { 7, 0x0018, 19}, /* 0001 100 */ { 7, 0x0008, 20}, /* 0001 000 */ { 7, 0x0074, 21}, /* 0010 111 */ { 7, 0x0060, 22}, /* 0000 011 */ { 7, 0x0010, 23}, /* 0000 100 */ { 7, 0x000A, 24}, /* 0101 000 */ { 7, 0x006A, 25}, /* 0101 011 */ { 7, 0x0064, 26}, /* 0010 011 */ { 7, 0x0012, 27}, /* 0100 100 */ { 7, 0x000C, 28}, /* 0011 000 */ { 8, 0x0040, 29}, /* 0000 0010 */ { 8, 0x00C0, 30}, /* 0000 0011 */ { 8, 0x0058, 31}, /* 0001 1010 */ { 8, 0x00D8, 32}, /* 0001 1011 */ { 8, 0x0048, 33}, /* 0001 0010 */ { 8, 0x00C8, 34}, /* 0001 0011 */ { 8, 0x0028, 35}, /* 0001 0100 */ { 8, 0x00A8, 36}, /* 0001 0101 */ { 8, 0x0068, 37}, /* 0001 0110 */ { 8, 0x00E8, 38}, /* 0001 0111 */ { 8, 0x0014, 39}, /* 0010 1000 */ { 8, 0x0094, 40}, /* 0010 1001 */ { 8, 0x0054, 41}, /* 0010 1010 */ { 8, 0x00D4, 42}, /* 0010 1011 */ { 8, 0x0034, 43}, /* 0010 1100 */ { 8, 0x00B4, 44}, /* 0010 1101 */ { 8, 0x0020, 45}, /* 0000 0100 */ { 8, 0x00A0, 46}, /* 0000 0101 */ { 8, 0x0050, 47}, /* 0000 1010 */ { 8, 0x00D0, 48}, /* 0000 1011 */ { 8, 0x004A, 49}, /* 0101 0010 */ { 8, 0x00CA, 50}, /* 0101 0011 */ { 8, 0x002A, 51}, /* 0101 0100 */ { 8, 0x00AA, 52}, /* 0101 0101 */ { 8, 0x0024, 53}, /* 0010 0100 */ { 8, 0x00A4, 54}, /* 0010 0101 */ { 8, 0x001A, 55}, /* 0101 1000 */ { 8, 0x009A, 56}, /* 0101 1001 */ { 8, 0x005A, 57}, /* 0101 1010 */ { 8, 0x00DA, 58}, /* 0101 1011 */ { 8, 0x0052, 59}, /* 0100 1010 */ { 8, 0x00D2, 60}, /* 0100 1011 */ { 8, 0x004C, 61}, /* 0011 0010 */ { 8, 0x00CC, 62}, /* 0011 0011 */ { 8, 0x002C, 63}, /* 0011 0100 */ { 5, 0x001B, 64}, /* 1101 1 */ { 5, 0x0009, 128}, /* 1001 0 */ { 6, 0x003A, 192}, /* 0101 11 */ { 7, 0x0076, 256}, /* 0110 111 */ { 8, 0x006C, 320}, /* 0011 0110 */ { 8, 0x00EC, 384}, /* 0011 0111 */ { 8, 0x0026, 448}, /* 0110 0100 */ { 8, 0x00A6, 512}, /* 0110 0101 */ { 8, 0x0016, 576}, /* 0110 1000 */ { 8, 0x00E6, 640}, /* 0110 0111 */ { 9, 0x0066, 704}, /* 0110 0110 0 */ { 9, 0x0166, 768}, /* 0110 0110 1 */ { 9, 0x0096, 832}, /* 0110 1001 0 */ { 9, 0x0196, 896}, /* 0110 1001 1 */ { 9, 0x0056, 960}, /* 0110 1010 0 */ { 9, 0x0156, 1024}, /* 0110 1010 1 */ { 9, 0x00D6, 1088}, /* 0110 1011 0 */ { 9, 0x01D6, 1152}, /* 0110 1011 1 */ { 9, 0x0036, 1216}, /* 0110 1100 0 */ { 9, 0x0136, 1280}, /* 0110 1100 1 */ { 9, 0x00B6, 1344}, /* 0110 1101 0 */ { 9, 0x01B6, 1408}, /* 0110 1101 1 */ { 9, 0x0032, 1472}, /* 0100 1100 0 */ { 9, 0x0132, 1536}, /* 0100 1100 1 */ { 9, 0x00B2, 1600}, /* 0100 1101 0 */ { 6, 0x0006, 1664}, /* 0110 00 */ { 9, 0x01B2, 1728}, /* 0100 1101 1 */ {11, 0x0080, 1792}, /* 0000 0001 000 */ {11, 0x0180, 1856}, /* 0000 0001 100 */ {11, 0x0580, 1920}, /* 0000 0001 101 */ {12, 0x0480, 1984}, /* 0000 0001 0010 */ {12, 0x0C80, 2048}, /* 0000 0001 0011 */ {12, 0x0280, 2112}, /* 0000 0001 0100 */ {12, 0x0A80, 2176}, /* 0000 0001 0101 */ {12, 0x0680, 2240}, /* 0000 0001 0110 */ {12, 0x0E80, 2304}, /* 0000 0001 0111 */ {12, 0x0380, 2368}, /* 0000 0001 1100 */ {12, 0x0B80, 2432}, /* 0000 0001 1101 */ {12, 0x0780, 2496}, /* 0000 0001 1110 */ {12, 0x0F80, 2560}, /* 0000 0001 1111 */ }; static const t4_run_table_entry_t t4_black_codes[] = { {10, 0x03B0, 0}, /* 0000 1101 11 */ { 3, 0x0002, 1}, /* 010 */ { 2, 0x0003, 2}, /* 11 */ { 2, 0x0001, 3}, /* 10 */ { 3, 0x0006, 4}, /* 011 */ { 4, 0x000C, 5}, /* 0011 */ { 4, 0x0004, 6}, /* 0010 */ { 5, 0x0018, 7}, /* 0001 1 */ { 6, 0x0028, 8}, /* 0001 01 */ { 6, 0x0008, 9}, /* 0001 00 */ { 7, 0x0010, 10}, /* 0000 100 */ { 7, 0x0050, 11}, /* 0000 101 */ { 7, 0x0070, 12}, /* 0000 111 */ { 8, 0x0020, 13}, /* 0000 0100 */ { 8, 0x00E0, 14}, /* 0000 0111 */ { 9, 0x0030, 15}, /* 0000 1100 0 */ {10, 0x03A0, 16}, /* 0000 0101 11 */ {10, 0x0060, 17}, /* 0000 0110 00 */ {10, 0x0040, 18}, /* 0000 0010 00 */ {11, 0x0730, 19}, /* 0000 1100 111 */ {11, 0x00B0, 20}, /* 0000 1101 000 */ {11, 0x01B0, 21}, /* 0000 1101 100 */ {11, 0x0760, 22}, /* 0000 0110 111 */ {11, 0x00A0, 23}, /* 0000 0101 000 */ {11, 0x0740, 24}, /* 0000 0010 111 */ {11, 0x00C0, 25}, /* 0000 0011 000 */ {12, 0x0530, 26}, /* 0000 1100 1010 */ {12, 0x0D30, 27}, /* 0000 1100 1011 */ {12, 0x0330, 28}, /* 0000 1100 1100 */ {12, 0x0B30, 29}, /* 0000 1100 1101 */ {12, 0x0160, 30}, /* 0000 0110 1000 */ {12, 0x0960, 31}, /* 0000 0110 1001 */ {12, 0x0560, 32}, /* 0000 0110 1010 */ {12, 0x0D60, 33}, /* 0000 0110 1011 */ {12, 0x04B0, 34}, /* 0000 1101 0010 */ {12, 0x0CB0, 35}, /* 0000 1101 0011 */ {12, 0x02B0, 36}, /* 0000 1101 0100 */ {12, 0x0AB0, 37}, /* 0000 1101 0101 */ {12, 0x06B0, 38}, /* 0000 1101 0110 */ {12, 0x0EB0, 39}, /* 0000 1101 0111 */ {12, 0x0360, 40}, /* 0000 0110 1100 */ {12, 0x0B60, 41}, /* 0000 0110 1101 */ {12, 0x05B0, 42}, /* 0000 1101 1010 */ {12, 0x0DB0, 43}, /* 0000 1101 1011 */ {12, 0x02A0, 44}, /* 0000 0101 0100 */ {12, 0x0AA0, 45}, /* 0000 0101 0101 */ {12, 0x06A0, 46}, /* 0000 0101 0110 */ {12, 0x0EA0, 47}, /* 0000 0101 0111 */ {12, 0x0260, 48}, /* 0000 0110 0100 */ {12, 0x0A60, 49}, /* 0000 0110 0101 */ {12, 0x04A0, 50}, /* 0000 0101 0010 */ {12, 0x0CA0, 51}, /* 0000 0101 0011 */ {12, 0x0240, 52}, /* 0000 0010 0100 */ {12, 0x0EC0, 53}, /* 0000 0011 0111 */ {12, 0x01C0, 54}, /* 0000 0011 1000 */ {12, 0x0E40, 55}, /* 0000 0010 0111 */ {12, 0x0140, 56}, /* 0000 0010 1000 */ {12, 0x01A0, 57}, /* 0000 0101 1000 */ {12, 0x09A0, 58}, /* 0000 0101 1001 */ {12, 0x0D40, 59}, /* 0000 0010 1011 */ {12, 0x0340, 60}, /* 0000 0010 1100 */ {12, 0x05A0, 61}, /* 0000 0101 1010 */ {12, 0x0660, 62}, /* 0000 0110 0110 */ {12, 0x0E60, 63}, /* 0000 0110 0111 */ {10, 0x03C0, 64}, /* 0000 0011 11 */ {12, 0x0130, 128}, /* 0000 1100 1000 */ {12, 0x0930, 192}, /* 0000 1100 1001 */ {12, 0x0DA0, 256}, /* 0000 0101 1011 */ {12, 0x0CC0, 320}, /* 0000 0011 0011 */ {12, 0x02C0, 384}, /* 0000 0011 0100 */ {12, 0x0AC0, 448}, /* 0000 0011 0101 */ {13, 0x06C0, 512}, /* 0000 0011 0110 0 */ {13, 0x16C0, 576}, /* 0000 0011 0110 1 */ {13, 0x0A40, 640}, /* 0000 0010 0101 0 */ {13, 0x1A40, 704}, /* 0000 0010 0101 1 */ {13, 0x0640, 768}, /* 0000 0010 0110 0 */ {13, 0x1640, 832}, /* 0000 0010 0110 1 */ {13, 0x09C0, 896}, /* 0000 0011 1001 0 */ {13, 0x19C0, 960}, /* 0000 0011 1001 1 */ {13, 0x05C0, 1024}, /* 0000 0011 1010 0 */ {13, 0x15C0, 1088}, /* 0000 0011 1010 1 */ {13, 0x0DC0, 1152}, /* 0000 0011 1011 0 */ {13, 0x1DC0, 1216}, /* 0000 0011 1011 1 */ {13, 0x0940, 1280}, /* 0000 0010 1001 0 */ {13, 0x1940, 1344}, /* 0000 0010 1001 1 */ {13, 0x0540, 1408}, /* 0000 0010 1010 0 */ {13, 0x1540, 1472}, /* 0000 0010 1010 1 */ {13, 0x0B40, 1536}, /* 0000 0010 1101 0 */ {13, 0x1B40, 1600}, /* 0000 0010 1101 1 */ {13, 0x04C0, 1664}, /* 0000 0011 0010 0 */ {13, 0x14C0, 1728}, /* 0000 0011 0010 1 */ {11, 0x0080, 1792}, /* 0000 0001 000 */ {11, 0x0180, 1856}, /* 0000 0001 100 */ {11, 0x0580, 1920}, /* 0000 0001 101 */ {12, 0x0480, 1984}, /* 0000 0001 0010 */ {12, 0x0C80, 2048}, /* 0000 0001 0011 */ {12, 0x0280, 2112}, /* 0000 0001 0100 */ {12, 0x0A80, 2176}, /* 0000 0001 0101 */ {12, 0x0680, 2240}, /* 0000 0001 0110 */ {12, 0x0E80, 2304}, /* 0000 0001 0111 */ {12, 0x0380, 2368}, /* 0000 0001 1100 */ {12, 0x0B80, 2432}, /* 0000 0001 1101 */ {12, 0x0780, 2496}, /* 0000 0001 1110 */ {12, 0x0F80, 2560}, /* 0000 0001 1111 */ }; static int encode_row(t4_tx_state_t *s); static void make_header(t4_tx_state_t *s, char *header) { time_t now; struct tm tm; static const char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; time(&now); if (s->tz) tz_localtime(s->tz, &tm, now); else tm = *localtime(&now); snprintf(header, 132, " %2d-%s-%d %02d:%02d %-50s %-21s p.%d", tm.tm_mday, months[tm.tm_mon], tm.tm_year + 1900, tm.tm_hour, tm.tm_min, s->header_info, (s->tiff.metadata.local_ident) ? s->tiff.metadata.local_ident : "", s->current_page + 1); } /*- End of function --------------------------------------------------------*/ static int t4_tx_put_fax_header(t4_tx_state_t *s) { int row; int i; int repeats; int pattern; int row_bufptr; char *t; char header[132 + 1]; /* Modify the resulting image to include a header line, typical of hardware FAX machines */ make_header(s, header); switch (s->y_resolution) { case T4_Y_RESOLUTION_1200: repeats = 12; break; case T4_Y_RESOLUTION_800: repeats = 8; break; case T4_Y_RESOLUTION_600: repeats = 6; break; case T4_Y_RESOLUTION_SUPERFINE: repeats = 4; break; case T4_Y_RESOLUTION_300: repeats = 3; break; case T4_Y_RESOLUTION_FINE: repeats = 2; break; default: repeats = 1; break; } for (row = 0; row < 16; row++) { t = header; row_bufptr = 0; for (t = header; *t && row_bufptr <= s->bytes_per_row - 2; t++) { pattern = header_font[(uint8_t) *t][row]; s->row_buf[row_bufptr++] = (uint8_t) (pattern >> 8); s->row_buf[row_bufptr++] = (uint8_t) (pattern & 0xFF); } for ( ; row_bufptr < s->bytes_per_row; ) s->row_buf[row_bufptr++] = 0; for (i = 0; i < repeats; i++) { if (encode_row(s)) return -1; } } return 0; } /*- End of function --------------------------------------------------------*/ static int test_resolution(int res_unit, float actual, float expected) { if (res_unit == RESUNIT_INCH) actual *= 1.0f/CM_PER_INCH; return (expected*0.95f <= actual && actual <= expected*1.05f); } /*- End of function --------------------------------------------------------*/ static int get_tiff_directory_info(t4_tx_state_t *s) { static const struct { float resolution; int code; } x_res_table[] = { { 102.0f/CM_PER_INCH, T4_X_RESOLUTION_R4}, { 204.0f/CM_PER_INCH, T4_X_RESOLUTION_R8}, { 300.0f/CM_PER_INCH, T4_X_RESOLUTION_300}, { 408.0f/CM_PER_INCH, T4_X_RESOLUTION_R16}, { 600.0f/CM_PER_INCH, T4_X_RESOLUTION_600}, { 800.0f/CM_PER_INCH, T4_X_RESOLUTION_800}, {1200.0f/CM_PER_INCH, T4_X_RESOLUTION_1200}, { -1.00f, -1} }; static const struct { float resolution; int code; int max_rows_to_next_1d_row; } y_res_table[] = { { 38.50f, T4_Y_RESOLUTION_STANDARD, 2}, { 77.00f, T4_Y_RESOLUTION_FINE, 4}, { 300.0f/CM_PER_INCH, T4_Y_RESOLUTION_300, 6}, { 154.00f, T4_Y_RESOLUTION_SUPERFINE, 8}, { 600.0f/CM_PER_INCH, T4_Y_RESOLUTION_600, 12}, { 800.0f/CM_PER_INCH, T4_Y_RESOLUTION_800, 16}, {1200.0f/CM_PER_INCH, T4_Y_RESOLUTION_1200, 24}, { -1.00f, -1, -1} }; uint16_t res_unit; uint16_t parm16; uint32_t parm32; float x_resolution; float y_resolution; int i; t4_tiff_state_t *t; t = &s->tiff; parm16 = 0; TIFFGetField(t->tiff_file, TIFFTAG_BITSPERSAMPLE, &parm16); if (parm16 != 1) return -1; TIFFGetField(t->tiff_file, TIFFTAG_SAMPLESPERPIXEL, &parm16); if (parm16 != 1) return -1; parm32 = 0; TIFFGetField(t->tiff_file, TIFFTAG_IMAGEWIDTH, &parm32); s->image_width = parm32; s->bytes_per_row = (s->image_width + 7)/8; parm32 = 0; TIFFGetField(t->tiff_file, TIFFTAG_IMAGELENGTH, &parm32); s->image_length = parm32; x_resolution = 0.0f; TIFFGetField(t->tiff_file, TIFFTAG_XRESOLUTION, &x_resolution); y_resolution = 0.0f; TIFFGetField(t->tiff_file, TIFFTAG_YRESOLUTION, &y_resolution); res_unit = RESUNIT_INCH; TIFFGetField(t->tiff_file, TIFFTAG_RESOLUTIONUNIT, &res_unit); t->photo_metric = PHOTOMETRIC_MINISWHITE; TIFFGetField(t->tiff_file, TIFFTAG_PHOTOMETRIC, &t->photo_metric); if (t->photo_metric != PHOTOMETRIC_MINISWHITE) span_log(&s->logging, SPAN_LOG_FLOW, "%s: Photometric needs swapping.\n", t->file); t->fill_order = FILLORDER_LSB2MSB; #if 0 TIFFGetField(t->tiff_file, TIFFTAG_FILLORDER, &t->fill_order); if (t->fill_order != FILLORDER_LSB2MSB) span_log(&s->logging, SPAN_LOG_FLOW, "%s: Fill order needs swapping.\n", t->file); #endif /* Allow a little range for the X resolution in centimeters. The spec doesn't pin down the precise value. The other value should be exact. */ /* Treat everything we can't match as R8. Most FAXes are this resolution anyway. */ s->x_resolution = T4_X_RESOLUTION_R8; for (i = 0; x_res_table[i].code > 0; i++) { if (test_resolution(res_unit, x_resolution, x_res_table[i].resolution)) { s->x_resolution = x_res_table[i].code; break; } } s->y_resolution = T4_Y_RESOLUTION_STANDARD; s->t4_t6_tx.max_rows_to_next_1d_row = 2; for (i = 0; y_res_table[i].code > 0; i++) { if (test_resolution(res_unit, y_resolution, y_res_table[i].resolution)) { s->y_resolution = y_res_table[i].code; s->t4_t6_tx.max_rows_to_next_1d_row = y_res_table[i].max_rows_to_next_1d_row; break; } } return 0; } /*- End of function --------------------------------------------------------*/ static int test_tiff_directory_info(t4_tx_state_t *s) { static const struct { float resolution; int code; } x_res_table[] = { { 102.0f/CM_PER_INCH, T4_X_RESOLUTION_R4}, { 204.0f/CM_PER_INCH, T4_X_RESOLUTION_R8}, { 300.0f/CM_PER_INCH, T4_X_RESOLUTION_300}, { 408.0f/CM_PER_INCH, T4_X_RESOLUTION_R16}, { 600.0f/CM_PER_INCH, T4_X_RESOLUTION_600}, { 800.0f/CM_PER_INCH, T4_X_RESOLUTION_800}, {1200.0f/CM_PER_INCH, T4_X_RESOLUTION_1200}, { -1.00f, -1} }; static const struct { float resolution; int code; int max_rows_to_next_1d_row; } y_res_table[] = { { 38.50f, T4_Y_RESOLUTION_STANDARD, 2}, { 77.00f, T4_Y_RESOLUTION_FINE, 4}, { 300.0f/CM_PER_INCH, T4_Y_RESOLUTION_300, 6}, { 154.00f, T4_Y_RESOLUTION_SUPERFINE, 8}, { 600.0f/CM_PER_INCH, T4_Y_RESOLUTION_600, 12}, { 800.0f/CM_PER_INCH, T4_Y_RESOLUTION_800, 16}, {1200.0f/CM_PER_INCH, T4_Y_RESOLUTION_1200, 24}, { -1.00f, -1, -1} }; uint16_t res_unit; uint16_t parm16; uint32_t parm32; float x_resolution; float y_resolution; int i; t4_tiff_state_t *t; t = &s->tiff; parm16 = 0; TIFFGetField(t->tiff_file, TIFFTAG_BITSPERSAMPLE, &parm16); if (parm16 != 1) return -1; parm32 = 0; TIFFGetField(t->tiff_file, TIFFTAG_IMAGEWIDTH, &parm32); if (s->image_width != (int) parm32) return 1; x_resolution = 0.0f; TIFFGetField(t->tiff_file, TIFFTAG_XRESOLUTION, &x_resolution); y_resolution = 0.0f; TIFFGetField(t->tiff_file, TIFFTAG_YRESOLUTION, &y_resolution); res_unit = RESUNIT_INCH; TIFFGetField(t->tiff_file, TIFFTAG_RESOLUTIONUNIT, &res_unit); /* Allow a little range for the X resolution in centimeters. The spec doesn't pin down the precise value. The other value should be exact. */ /* Treat everything we can't match as R8. Most FAXes are this resolution anyway. */ for (i = 0; x_res_table[i].code > 0; i++) { if (test_resolution(res_unit, x_resolution, x_res_table[i].resolution)) break; } if (s->x_resolution != x_res_table[i].code) return 1; for (i = 0; y_res_table[i].code > 0; i++) { if (test_resolution(res_unit, y_resolution, y_res_table[i].resolution)) break; } if (s->y_resolution != y_res_table[i].code) return 1; return 0; } /*- End of function --------------------------------------------------------*/ static int get_tiff_total_pages(t4_tx_state_t *s) { int max; /* Each page *should* contain the total number of pages, but can this be trusted? Some files say 0. Actually searching for the last page is more reliable. */ max = 0; while (TIFFSetDirectory(s->tiff.tiff_file, (tdir_t) max)) max++; /* Back to the previous page */ if (!TIFFSetDirectory(s->tiff.tiff_file, (tdir_t) s->current_page)) return -1; return max; } /*- End of function --------------------------------------------------------*/ static int open_tiff_input_file(t4_tx_state_t *s, const char *file) { if ((s->tiff.tiff_file = TIFFOpen(file, "r")) == NULL) return -1; return 0; } /*- End of function --------------------------------------------------------*/ static int read_tiff_image(t4_tx_state_t *s) { int row; int image_length; int i; image_length = 0; TIFFGetField(s->tiff.tiff_file, TIFFTAG_IMAGELENGTH, &image_length); for (row = 0; row < image_length; row++) { if (TIFFReadScanline(s->tiff.tiff_file, s->row_buf, row, 0) <= 0) { span_log(&s->logging, SPAN_LOG_WARNING, "%s: Read error at row %d.\n", s->tiff.file, row); break; } if (s->tiff.photo_metric != PHOTOMETRIC_MINISWHITE) { for (i = 0; i < s->bytes_per_row; i++) s->row_buf[i] = ~s->row_buf[i]; } if (s->tiff.fill_order != FILLORDER_LSB2MSB) bit_reverse(s->row_buf, s->row_buf, s->bytes_per_row); if (encode_row(s)) return -1; } return image_length; } /*- End of function --------------------------------------------------------*/ static int close_tiff_input_file(t4_tx_state_t *s) { TIFFClose(s->tiff.tiff_file); s->tiff.tiff_file = NULL; if (s->tiff.file) free((char *) s->tiff.file); s->tiff.file = NULL; return 0; } /*- End of function --------------------------------------------------------*/ static void update_row_bit_info(t4_tx_state_t *s) { if (s->row_bits > s->max_row_bits) s->max_row_bits = s->row_bits; if (s->row_bits < s->min_row_bits) s->min_row_bits = s->row_bits; s->row_bits = 0; } /*- End of function --------------------------------------------------------*/ static int free_buffers(t4_tx_state_t *s) { if (s->image_buffer) { free(s->image_buffer); s->image_buffer = NULL; s->image_buffer_size = 0; } if (s->cur_runs) { free(s->cur_runs); s->cur_runs = NULL; } if (s->ref_runs) { free(s->ref_runs); s->ref_runs = NULL; } if (s->row_buf) { free(s->row_buf); s->row_buf = NULL; } return 0; } /*- End of function --------------------------------------------------------*/ static int row_to_run_lengths(uint32_t list[], const uint8_t row[], int width) { uint32_t flip; uint32_t x; int span; int entry; int frag; int rem; int limit; int i; int pos; /* Deal with whole words first. We know we are starting on a word boundary. */ entry = 0; flip = 0; limit = (width >> 3) & ~3; span = 0; pos = 0; for (i = 0; i < limit; i += sizeof(uint32_t)) { x = *((uint32_t *) &row[i]); if (x != flip) { x = ((uint32_t) row[i] << 24) | ((uint32_t) row[i + 1] << 16) | ((uint32_t) row[i + 2] << 8) | ((uint32_t) row[i + 3]); /* We know we are going to find at least one transition. */ frag = 31 - top_bit(x ^ flip); pos += ((i << 3) - span + frag); list[entry++] = pos; x <<= frag; flip ^= 0xFFFFFFFF; rem = 32 - frag; /* Now see if there are any more */ while ((frag = 31 - top_bit(x ^ flip)) < rem) { pos += frag; list[entry++] = pos; x <<= frag; flip ^= 0xFFFFFFFF; rem -= frag; } /* Save the remainder of the word */ span = (i << 3) + 32 - rem; } } /* Now deal with some whole bytes, if there are any left. */ limit = width >> 3; flip &= 0xFF000000; if (i < limit) { for ( ; i < limit; i++) { x = (uint32_t) row[i] << 24; if (x != flip) { /* We know we are going to find at least one transition. */ frag = 31 - top_bit(x ^ flip); pos += ((i << 3) - span + frag); list[entry++] = pos; x <<= frag; flip ^= 0xFF000000; rem = 8 - frag; /* Now see if there are any more */ while ((frag = 31 - top_bit(x ^ flip)) < rem) { pos += frag; list[entry++] = pos; x <<= frag; flip ^= 0xFF000000; rem -= frag; } /* Save the remainder of the word */ span = (i << 3) + 8 - rem; } } } /* Deal with any left over fractional byte. */ span = (i << 3) - span; if ((rem = width & 7)) { x = row[i]; x <<= 24; do { frag = 31 - top_bit(x ^ flip); if (frag > rem) frag = rem; pos += (span + frag); list[entry++] = pos; x <<= frag; span = 0; flip ^= 0xFF000000; rem -= frag; } while (rem > 0); } else { if (span) { pos += span; list[entry++] = pos; } } return entry; } /*- End of function --------------------------------------------------------*/ static __inline__ int put_encoded_bits(t4_tx_state_t *s, uint32_t bits, int length) { uint8_t *t; /* We might be called with a large length value, to spew out a mass of zero bits for minimum row length padding. */ s->tx_bitstream |= (bits << s->tx_bits); s->tx_bits += length; s->row_bits += length; if ((s->image_size + (s->tx_bits + 7)/8) >= s->image_buffer_size) { if ((t = realloc(s->image_buffer, s->image_buffer_size + 100*s->bytes_per_row)) == NULL) return -1; s->image_buffer = t; s->image_buffer_size += 100*s->bytes_per_row; } while (s->tx_bits >= 8) { s->image_buffer[s->image_size++] = (uint8_t) (s->tx_bitstream & 0xFF); s->tx_bitstream >>= 8; s->tx_bits -= 8; } return 0; } /*- End of function --------------------------------------------------------*/ /* * Write the sequence of codes that describes * the specified span of zero's or one's. The * appropriate table that holds the make-up and * terminating codes is supplied. */ static __inline__ int put_1d_span(t4_tx_state_t *s, int32_t span, const t4_run_table_entry_t *tab) { const t4_run_table_entry_t *te; te = &tab[63 + (2560 >> 6)]; while (span >= 2560 + 64) { if (put_encoded_bits(s, te->code, te->length)) return -1; span -= te->run_length; } te = &tab[63 + (span >> 6)]; if (span >= 64) { if (put_encoded_bits(s, te->code, te->length)) return -1; span -= te->run_length; } if (put_encoded_bits(s, tab[span].code, tab[span].length)) return -1; return 0; } /*- End of function --------------------------------------------------------*/ #define pixel_is_black(x,bit) (((x)[(bit) >> 3] << ((bit) & 7)) & 0x80) /* * Write an EOL code to the output stream. We also handle writing the tag * bit for the next scanline when doing 2D encoding. */ static void encode_eol(t4_tx_state_t *s) { uint32_t code; int length; if (s->line_encoding == T4_COMPRESSION_ITU_T4_2D) { code = 0x0800 | ((!s->row_is_2d) << 12); length = 13; } else { /* T.4 1D EOL, or T.6 EOFB */ code = 0x800; length = 12; } if (s->row_bits) { /* We may need to pad the row to a minimum length, unless we are in T.6 mode. In T.6 we only come here at the end of the page to add the EOFB marker, which is like two 1D EOLs. */ if (s->line_encoding != T4_COMPRESSION_ITU_T6) { if (s->row_bits + length < s->t4_t6_tx.min_bits_per_row) put_encoded_bits(s, 0, s->t4_t6_tx.min_bits_per_row - (s->row_bits + length)); } put_encoded_bits(s, code, length); update_row_bit_info(s); } else { /* We don't pad zero length rows. They are the consecutive EOLs which end a page. */ put_encoded_bits(s, code, length); /* Don't do the full update row bit info, or the minimum suddenly drops to the length of an EOL. Just clear the row bits, so we treat the next EOL as an end of page EOL, with no padding. */ s->row_bits = 0; } } /*- End of function --------------------------------------------------------*/ /* * 2D-encode a row of pixels. Consult ITU specification T.4 for the algorithm. */ static void encode_2d_row(t4_tx_state_t *s) { static const t4_run_table_entry_t codes[] = { { 7, 0x60, 0 }, /* VR3 0000 011 */ { 6, 0x30, 0 }, /* VR2 0000 11 */ { 3, 0x06, 0 }, /* VR1 011 */ { 1, 0x01, 0 }, /* V0 1 */ { 3, 0x02, 0 }, /* VL1 010 */ { 6, 0x10, 0 }, /* VL2 0000 10 */ { 7, 0x20, 0 }, /* VL3 0000 010 */ { 3, 0x04, 0 }, /* horizontal 001 */ { 4, 0x08, 0 } /* pass 0001 */ }; /* The reference or starting changing element on the coding line. At the start of the coding line, a0 is set on an imaginary white changing element situated just before the first element on the line. During the coding of the coding line, the position of a0 is defined by the previous coding mode. (See T.4/4.2.1.3.2.) */ int a0; /* The next changing element to the right of a0 on the coding line. */ int a1; /* The next changing element to the right of a1 on the coding line. */ int a2; /* The first changing element on the reference line to the right of a0 and of opposite colour to a0. */ int b1; /* The next changing element to the right of b1 on the reference line. */ int b2; int diff; int a_cursor; int b_cursor; int cur_steps; uint32_t *p; /* b1 b2 XX XX XX XX XX -- -- -- -- -- XX XX XX -- -- -- -- -- XX XX XX -- -- -- -- -- XX XX XX XX XX XX -- -- -- -- a0 a1 a2 a) Pass mode This mode is identified when the position of b2 lies to the left of a1. When this mode has been coded, a0 is set on the element of the coding line below b2 in preparation for the next coding (i.e. on a0'). b1 b2 XX XX XX XX -- -- XX XX XX -- -- -- -- -- XX XX -- -- -- -- -- -- -- -- -- -- XX XX a0 a0' a1 Pass mode However, the state where b2 occurs just above a1, as shown in the figure below, is not considered as a pass mode. b1 b2 XX XX XX XX -- -- XX XX XX -- -- -- -- -- XX XX -- -- -- -- -- -- -- XX XX XX XX XX a0 a1 Not pass mode b) Vertical mode When this mode is identified, the position of a1 is coded relative to the position of b1. The relative distance a1b1 can take on one of seven values V(0), VR(1), VR(2), VR(3), VL(1), VL(2) and VL(3), each of which is represented by a separate code word. The subscripts R and L indicate that a1 is to the right or left respectively of b1, and the number in brackets indicates the value of the distance a1b1. After vertical mode coding has occurred, the position of a0 is set on a1 (see figure below). c) Horizontal mode When this mode is identified, both the run-lengths a0a1 and a1a2 are coded using the code words H + M(a0a1) + M(a1a2). H is the flag code word 001 taken from the two-dimensional code table. M(a0a1) and M(a1a2) are code words which represent the length and "colour" of the runs a0a1 and a1a2 respectively and are taken from the appropriate white or black one-dimensional code tables. After a horizontal mode coding, the position of a0 is set on a2 (see figure below). Vertical b1 b2 -- XX XX XX XX XX -- -- -- -- -- -- -- -- XX XX XX XX -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- XX XX XX XX XX XX XX -- -- a0 a1 a2 <-------- a0a1 --------><-------- a1a2 ------------> Horizontal mode Vertical and horizontal modes */ /* The following implements the 2-D encoding section of the flow chart in Figure7/T.4 */ cur_steps = row_to_run_lengths(s->cur_runs, s->row_buf, s->image_width); /* Stretch the row a little, so when we step by 2 we are guaranteed to hit an entry showing the row length */ s->cur_runs[cur_steps] = s->cur_runs[cur_steps + 1] = s->cur_runs[cur_steps + 2] = s->cur_runs[cur_steps - 1]; a0 = 0; a1 = s->cur_runs[0]; b1 = s->ref_runs[0]; a_cursor = 0; b_cursor = 0; for (;;) { b2 = s->ref_runs[b_cursor + 1]; if (b2 >= a1) { diff = b1 - a1; if (abs(diff) <= 3) { /* Vertical mode coding */ put_encoded_bits(s, codes[diff + 3].code, codes[diff + 3].length); a0 = a1; a_cursor++; } else { /* Horizontal mode coding */ a2 = s->cur_runs[a_cursor + 1]; put_encoded_bits(s, codes[7].code, codes[7].length); if (a0 + a1 == 0 || pixel_is_black(s->row_buf, a0) == 0) { put_1d_span(s, a1 - a0, t4_white_codes); put_1d_span(s, a2 - a1, t4_black_codes); } else { put_1d_span(s, a1 - a0, t4_black_codes); put_1d_span(s, a2 - a1, t4_white_codes); } a0 = a2; a_cursor += 2; } if (a0 >= s->image_width) break; if (a_cursor >= cur_steps) a_cursor = cur_steps - 1; a1 = s->cur_runs[a_cursor]; } else { /* Pass mode coding */ put_encoded_bits(s, codes[8].code, codes[8].length); /* We now set a0 to somewhere in the middle of its current run, but we know are aren't moving beyond that run. */ a0 = b2; if (a0 >= s->image_width) break; } /* We need to hunt for the correct position in the reference row, as the runs there have no particular alignment with the runs in the current row. */ if (pixel_is_black(s->row_buf, a0)) b_cursor |= 1; else b_cursor &= ~1; if (a0 < (int) s->ref_runs[b_cursor]) { for ( ; b_cursor >= 0; b_cursor -= 2) { if (a0 >= (int) s->ref_runs[b_cursor]) break; } b_cursor += 2; } else { for ( ; b_cursor < s->t4_t6_tx.ref_steps; b_cursor += 2) { if (a0 < (int) s->ref_runs[b_cursor]) break; } if (b_cursor >= s->t4_t6_tx.ref_steps) b_cursor = s->t4_t6_tx.ref_steps - 1; } b1 = s->ref_runs[b_cursor]; } /* Swap the buffers */ s->t4_t6_tx.ref_steps = cur_steps; p = s->cur_runs; s->cur_runs = s->ref_runs; s->ref_runs = p; } /*- End of function --------------------------------------------------------*/ /* * 1D-encode a row of pixels. The encoding is a sequence of all-white or * all-black spans of pixels encoded with Huffman codes. */ static void encode_1d_row(t4_tx_state_t *s) { int i; /* Do our work in the reference row buffer, and it is already in place if we need a reference row for a following 2D encoded row. */ s->t4_t6_tx.ref_steps = row_to_run_lengths(s->ref_runs, s->row_buf, s->image_width); put_1d_span(s, s->ref_runs[0], t4_white_codes); for (i = 1; i < s->t4_t6_tx.ref_steps; i++) put_1d_span(s, s->ref_runs[i] - s->ref_runs[i - 1], (i & 1) ? t4_black_codes : t4_white_codes); /* Stretch the row a little, so when we step by 2 we are guaranteed to hit an entry showing the row length */ s->ref_runs[s->t4_t6_tx.ref_steps] = s->ref_runs[s->t4_t6_tx.ref_steps + 1] = s->ref_runs[s->t4_t6_tx.ref_steps + 2] = s->ref_runs[s->t4_t6_tx.ref_steps - 1]; } /*- End of function --------------------------------------------------------*/ static int encode_row(t4_tx_state_t *s) { switch (s->line_encoding) { case T4_COMPRESSION_ITU_T6: /* T.6 compression is a trivial step up from T.4 2D, so we just throw it in here. T.6 is only used with error correction, so it does not need independantly compressed (i.e. 1D) lines to recover from data errors. It doesn't need EOLs, either. */ if (s->row_bits) update_row_bit_info(s); encode_2d_row(s); break; case T4_COMPRESSION_ITU_T4_2D: encode_eol(s); if (s->row_is_2d) { encode_2d_row(s); s->t4_t6_tx.rows_to_next_1d_row--; } else { encode_1d_row(s); s->row_is_2d = TRUE; } if (s->t4_t6_tx.rows_to_next_1d_row <= 0) { /* Insert a row of 1D encoding */ s->row_is_2d = FALSE; s->t4_t6_tx.rows_to_next_1d_row = s->t4_t6_tx.max_rows_to_next_1d_row - 1; } break; default: case T4_COMPRESSION_ITU_T4_1D: encode_eol(s); encode_1d_row(s); break; } s->row++; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_tx_set_row_read_handler(t4_tx_state_t *s, t4_row_read_handler_t handler, void *user_data) { s->t4_t6_tx.row_read_handler = handler; s->t4_t6_tx.row_read_user_data = user_data; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_tx_start_page(t4_tx_state_t *s) { int row; int i; int run_space; int len; int old_image_width; uint8_t *bufptr8; uint32_t *bufptr; span_log(&s->logging, SPAN_LOG_FLOW, "Start tx page %d\n", s->current_page); if (s->current_page > s->tiff.stop_page) return -1; if (s->tiff.tiff_file == NULL) return -1; old_image_width = s->image_width; if (s->t4_t6_tx.row_read_handler == NULL) { #if defined(HAVE_LIBTIFF) if (!TIFFSetDirectory(s->tiff.tiff_file, (tdir_t) s->current_page)) return -1; get_tiff_directory_info(s); #endif } s->image_size = 0; s->tx_bitstream = 0; s->tx_bits = 0; s->row_is_2d = (s->line_encoding == T4_COMPRESSION_ITU_T6); s->t4_t6_tx.rows_to_next_1d_row = s->t4_t6_tx.max_rows_to_next_1d_row - 1; /* Allow for pages being of different width. */ run_space = (s->image_width + 4)*sizeof(uint32_t); if (old_image_width != s->image_width) { s->bytes_per_row = (s->image_width + 7)/8; if ((bufptr = (uint32_t *) realloc(s->cur_runs, run_space)) == NULL) return -1; s->cur_runs = bufptr; if ((bufptr = (uint32_t *) realloc(s->ref_runs, run_space)) == NULL) return -1; s->ref_runs = bufptr; if ((bufptr8 = realloc(s->row_buf, s->bytes_per_row)) == NULL) return -1; s->row_buf = bufptr8; } s->ref_runs[0] = s->ref_runs[1] = s->ref_runs[2] = s->ref_runs[3] = s->image_width; s->t4_t6_tx.ref_steps = 1; s->row_bits = 0; s->min_row_bits = INT_MAX; s->max_row_bits = 0; if (s->header_info && s->header_info[0]) { if (t4_tx_put_fax_header(s)) return -1; } if (s->t4_t6_tx.row_read_handler) { for (row = 0; ; row++) { if ((len = s->t4_t6_tx.row_read_handler(s->t4_t6_tx.row_read_user_data, s->row_buf, s->bytes_per_row)) < 0) { span_log(&s->logging, SPAN_LOG_WARNING, "%s: Read error at row %d.\n", s->tiff.file, row); break; } if (len == 0) break; if (encode_row(s)) return -1; } s->image_length = row; } else { if ((s->image_length = read_tiff_image(s)) < 0) return -1; } if (s->line_encoding == T4_COMPRESSION_ITU_T6) { /* Attach an EOFB (end of facsimile block == 2 x EOLs) to the end of the page */ for (i = 0; i < EOLS_TO_END_T6_TX_PAGE; i++) encode_eol(s); } else { /* Attach an RTC (return to control == 6 x EOLs) to the end of the page */ s->row_is_2d = FALSE; for (i = 0; i < EOLS_TO_END_T4_TX_PAGE; i++) encode_eol(s); } /* Force any partial byte in progress to flush using ones. Any post EOL padding when sending is normally ones, so this is consistent. */ put_encoded_bits(s, 0xFF, 7); s->t4_t6_tx.bit_pos = 7; s->t4_t6_tx.bit_ptr = 0; s->line_image_size = s->image_size*8; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_tx_next_page_has_different_format(t4_tx_state_t *s) { span_log(&s->logging, SPAN_LOG_FLOW, "Checking for the existance of page %d\n", s->current_page + 1); if (s->current_page >= s->tiff.stop_page) return -1; if (s->t4_t6_tx.row_read_handler == NULL) { #if defined(HAVE_LIBTIFF) if (s->tiff.tiff_file == NULL) return -1; if (!TIFFSetDirectory(s->tiff.tiff_file, (tdir_t) s->current_page + 1)) return -1; return test_tiff_directory_info(s); #endif } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_tx_restart_page(t4_tx_state_t *s) { s->t4_t6_tx.bit_pos = 7; s->t4_t6_tx.bit_ptr = 0; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_tx_end_page(t4_tx_state_t *s) { s->current_page++; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_tx_get_bit(t4_tx_state_t *s) { int bit; if (s->t4_t6_tx.bit_ptr >= s->image_size) return SIG_STATUS_END_OF_DATA; bit = (s->image_buffer[s->t4_t6_tx.bit_ptr] >> (7 - s->t4_t6_tx.bit_pos)) & 1; if (--s->t4_t6_tx.bit_pos < 0) { s->t4_t6_tx.bit_pos = 7; s->t4_t6_tx.bit_ptr++; } return bit; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_tx_get_byte(t4_tx_state_t *s) { if (s->t4_t6_tx.bit_ptr >= s->image_size) return 0x100; return s->image_buffer[s->t4_t6_tx.bit_ptr++]; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_tx_get_chunk(t4_tx_state_t *s, uint8_t buf[], int max_len) { if (s->t4_t6_tx.bit_ptr >= s->image_size) return 0; if (s->t4_t6_tx.bit_ptr + max_len > s->image_size) max_len = s->image_size - s->t4_t6_tx.bit_ptr; memcpy(buf, &s->image_buffer[s->t4_t6_tx.bit_ptr], max_len); s->t4_t6_tx.bit_ptr += max_len; return max_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_tx_check_bit(t4_tx_state_t *s) { int bit; if (s->t4_t6_tx.bit_ptr >= s->image_size) return SIG_STATUS_END_OF_DATA; bit = (s->image_buffer[s->t4_t6_tx.bit_ptr] >> s->t4_t6_tx.bit_pos) & 1; return bit; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t4_tx_set_tx_encoding(t4_tx_state_t *s, int encoding) { s->line_encoding = encoding; s->t4_t6_tx.rows_to_next_1d_row = s->t4_t6_tx.max_rows_to_next_1d_row - 1; s->row_is_2d = FALSE; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t4_tx_set_min_bits_per_row(t4_tx_state_t *s, int bits) { s->t4_t6_tx.min_bits_per_row = bits; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t4_tx_set_local_ident(t4_tx_state_t *s, const char *ident) { s->tiff.metadata.local_ident = (ident && ident[0]) ? ident : NULL; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t4_tx_set_header_info(t4_tx_state_t *s, const char *info) { s->header_info = (info && info[0]) ? info : NULL; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t4_tx_set_header_tz(t4_tx_state_t *s, struct tz_s *tz) { s->tz = tz; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_tx_get_y_resolution(t4_tx_state_t *s) { return s->y_resolution; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_tx_get_x_resolution(t4_tx_state_t *s) { return s->x_resolution; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_tx_get_image_width(t4_tx_state_t *s) { return s->image_width; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_tx_get_pages_in_file(t4_tx_state_t *s) { int max; max = 0; if (s->t4_t6_tx.row_read_handler == NULL) max = get_tiff_total_pages(s); if (max >= 0) s->tiff.pages_in_file = max; return max; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_tx_get_current_page_in_file(t4_tx_state_t *s) { return s->current_page; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t4_tx_get_transfer_statistics(t4_tx_state_t *s, t4_stats_t *t) { t->pages_transferred = s->current_page - s->tiff.start_page; t->pages_in_file = s->tiff.pages_in_file; t->width = s->image_width; t->length = s->image_length; t->bad_rows = s->t4_t6_rx.bad_rows; t->longest_bad_row_run = s->t4_t6_rx.longest_bad_row_run; t->x_resolution = s->x_resolution; t->y_resolution = s->y_resolution; t->encoding = s->line_encoding; t->line_image_size = s->line_image_size/8; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(t4_tx_state_t *) t4_tx_init(t4_tx_state_t *s, const char *file, int start_page, int stop_page) { int run_space; int allocated; allocated = FALSE; if (s == NULL) { if ((s = (t4_tx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; allocated = TRUE; } memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "T.4"); s->rx = FALSE; span_log(&s->logging, SPAN_LOG_FLOW, "Start tx document\n"); if (open_tiff_input_file(s, file) < 0) { if (allocated) free(s); return NULL; } s->tiff.file = strdup(file); s->current_page = s->tiff.start_page = (start_page >= 0) ? start_page : 0; s->tiff.stop_page = (stop_page >= 0) ? stop_page : INT_MAX; if (!TIFFSetDirectory(s->tiff.tiff_file, (tdir_t) s->current_page)) { if (allocated) free(s); return NULL; } if (get_tiff_directory_info(s)) { close_tiff_input_file(s); if (allocated) free(s); return NULL; } s->t4_t6_tx.rows_to_next_1d_row = s->t4_t6_tx.max_rows_to_next_1d_row - 1; s->tiff.pages_in_file = -1; run_space = (s->image_width + 4)*sizeof(uint32_t); if ((s->cur_runs = (uint32_t *) malloc(run_space)) == NULL) { if (allocated) free(s); return NULL; } if ((s->ref_runs = (uint32_t *) malloc(run_space)) == NULL) { free_buffers(s); close_tiff_input_file(s); if (allocated) free(s); return NULL; } if ((s->row_buf = malloc(s->bytes_per_row)) == NULL) { free_buffers(s); close_tiff_input_file(s); if (allocated) free(s); return NULL; } s->ref_runs[0] = s->ref_runs[1] = s->ref_runs[2] = s->ref_runs[3] = s->image_width; s->t4_t6_tx.ref_steps = 1; s->image_buffer_size = 0; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_tx_release(t4_tx_state_t *s) { if (s->rx) return -1; if (s->tiff.tiff_file) close_tiff_input_file(s); free_buffers(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_tx_free(t4_tx_state_t *s) { int ret; ret = t4_tx_release(s); free(s); return ret; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/gsm0610_local.h0000664000175000017500000001533611422612262013325 00000000000000/* * SpanDSP - a series of DSP components for telephony * * gsm0610_local.h - GSM 06.10 full rate speech codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * This code is based on the widely used GSM 06.10 code available from * http://kbs.cs.tu-berlin.de/~jutta/toast.html */ #if !defined(_GSM0610_LOCAL_H_) #define _GSM0610_LOCAL_H_ #define GSM0610_FRAME_LEN 160 #define GSM0610_MAGIC 0xD #include "spandsp/private/gsm0610.h" static __inline__ int16_t gsm_add(int16_t a, int16_t b) { #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) __asm__ __volatile__( " addw %2,%0;\n" " jno 0f;\n" " movw $0x7fff,%0;\n" " adcw $0,%0;\n" "0:" : "=&r" (a) : "0" (a), "ir" (b) : "cc" ); return a; #else int32_t sum; sum = (int32_t) a + (int32_t) b; return saturate(sum); #endif } /*- End of function --------------------------------------------------------*/ static __inline__ int32_t gsm_l_add(int32_t a, int32_t b) { #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) __asm__ __volatile__( " addl %2,%0;\n" " jno 0f;\n" " movl $0x7fffffff,%0;\n" " adcl $0,%0;\n" "0:" : "=&r" (a) : "0" (a), "ir" (b) : "cc" ); return a; #else uint32_t A; if (a < 0) { if (b >= 0) return a + b; /*endif*/ A = (uint32_t) -(a + 1) + (uint32_t) -(b + 1); return (A >= INT32_MAX) ? INT32_MIN : -(int32_t) A - 2; } /*endif*/ if (b <= 0) return a + b; /*endif*/ A = (uint32_t) a + (uint32_t) b; return (A > INT32_MAX) ? INT32_MAX : A; #endif } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t gsm_sub(int16_t a, int16_t b) { int32_t diff; diff = (int32_t) a - (int32_t) b; return saturate(diff); } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t gsm_mult(int16_t a, int16_t b) { if (a == INT16_MIN && b == INT16_MIN) return INT16_MAX; /*endif*/ return (int16_t) (((int32_t) a * (int32_t) b) >> 15); } /*- End of function --------------------------------------------------------*/ static __inline__ int32_t gsm_l_mult(int16_t a, int16_t b) { assert (a != INT16_MIN || b != INT16_MIN); return ((int32_t) a * (int32_t) b) << 1; } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t gsm_mult_r(int16_t a, int16_t b) { int32_t prod; if (b == INT16_MIN && a == INT16_MIN) return INT16_MAX; /*endif*/ prod = (int32_t) a * (int32_t) b + 16384; prod >>= 15; return (int16_t) (prod & 0xFFFF); } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t gsm_abs(int16_t a) { return (a == INT16_MIN) ? INT16_MAX : (int16_t) abs(a); } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t gsm_asr(int16_t a, int n) { if (n >= 16) return (int16_t) (-(a < 0)); /*endif*/ if (n <= -16) return 0; /*endif*/ if (n < 0) return (int16_t) (a << -n); /*endif*/ return (int16_t) (a >> n); } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t gsm_asl(int16_t a, int n) { if (n >= 16) return 0; /*endif*/ if (n <= -16) return (int16_t) (-(a < 0)); /*endif*/ if (n < 0) return gsm_asr(a, -n); /*endif*/ return (int16_t) (a << n); } /*- End of function --------------------------------------------------------*/ extern void gsm0610_long_term_predictor(gsm0610_state_t *s, int16_t d[40], int16_t *dp, /* [-120..-1] d' IN */ int16_t e[40], int16_t dpp[40], int16_t *Nc, int16_t *bc); extern void gsm0610_lpc_analysis(gsm0610_state_t *s, int16_t amp[160], int16_t LARc[8]); extern void gsm0610_preprocess(gsm0610_state_t *s, const int16_t amp[], int16_t so[]); extern void gsm0610_short_term_analysis_filter(gsm0610_state_t *s, int16_t LARc[8], int16_t amp[160]); extern void gsm0610_long_term_synthesis_filtering(gsm0610_state_t *s, int16_t Ncr, int16_t bcr, int16_t erp[40], int16_t *drp); /* [-120..-1] IN, [0..40] OUT */ extern void gsm0610_rpe_decoding(gsm0610_state_t *s, int16_t xmaxcr, int16_t Mcr, int16_t *xMcr, /* [0..12], 3 bits IN */ int16_t erp[40]); extern void gsm0610_rpe_encoding(gsm0610_state_t *s, int16_t *e, /* [-5..-1][0..39][40..44] IN/OUT */ int16_t *xmaxc, int16_t *Mc, int16_t xMc[13]); extern void gsm0610_short_term_synthesis_filter(gsm0610_state_t *s, int16_t LARcr[8], int16_t drp[40], int16_t amp[160]); extern int16_t gsm0610_norm(int32_t a); #endif /*- End of include ---------------------------------------------------------*/ spandsp-0.0.6/src/gsm0610_lpc.c0000664000175000017500000004116111422612262012777 00000000000000/* * SpanDSP - a series of DSP components for telephony * * gsm0610_lpc.c - GSM 06.10 full rate speech codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * This code is based on the widely used GSM 06.10 code available from * http://kbs.cs.tu-berlin.de/~jutta/toast.html */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/bitstream.h" #include "spandsp/bit_operations.h" #include "spandsp/saturated.h" #include "spandsp/vector_int.h" #include "spandsp/gsm0610.h" #include "gsm0610_local.h" /* 4.2.4 .. 4.2.7 LPC ANALYSIS SECTION */ /* The number of left shifts needed to normalize the 32 bit variable x for positive values on the interval with minimum of minimum of 1073741824 (01000000000000000000000000000000) and maximum of 2147483647 (01111111111111111111111111111111) and for negative values on the interval with minimum of -2147483648 (-10000000000000000000000000000000) and maximum of -1073741824 ( -1000000000000000000000000000000). In order to normalize the result, the following operation must be done: norm_var1 = x << gsm0610_norm(x); (That's 'ffs', only from the left, not the right..) */ int16_t gsm0610_norm(int32_t x) { assert(x != 0); if (x < 0) { if (x <= -1073741824) return 0; /*endif*/ x = ~x; } /*endif*/ return (int16_t) (30 - top_bit(x)); } /*- End of function --------------------------------------------------------*/ /* (From p. 46, end of section 4.2.5) NOTE: The following lines gives [sic] one correct implementation of the div(num, denum) arithmetic operation. Compute div which is the integer division of num by denom: with denom >= num > 0 */ static int16_t gsm_div(int16_t num, int16_t denom) { int32_t num32; int32_t denom32; int16_t div; int k; /* The parameter num sometimes becomes zero. Although this is explicitly guarded against in 4.2.5, we assume that the result should then be zero as well. */ assert(num >= 0 && denom >= num); if (num == 0) return 0; /*endif*/ num32 = num; denom32 = denom; div = 0; k = 15; while (k--) { div <<= 1; num32 <<= 1; if (num32 >= denom32) { num32 -= denom32; div++; } /*endif*/ } /*endwhile*/ return div; } /*- End of function --------------------------------------------------------*/ #if defined(__GNUC__) && defined(SPANDSP_USE_MMX) static void gsm0610_vec_vsraw(const int16_t *p, int n, int bits) { static const int64_t ones = 0x0001000100010001LL; if (n == 0) return; /*endif*/ #if defined(__x86_64__) __asm__ __volatile__( " leaq -16(%%rsi,%%rax,2),%%rdx;\n" /* edx = top - 16 */ " emms;\n" " movd %%ecx,%%mm3;\n" " movq %[ones],%%mm2;\n" " psllw %%mm3,%%mm2;\n" " psrlw $1,%%mm2;\n" " cmpq %%rdx,%%rsi;" " ja 4f;\n" " .p2align 2;\n" /* 8 words per iteration */ "6:\n" " movq (%%rsi),%%mm0;\n" " movq 8(%%rsi),%%mm1;\n" " paddsw %%mm2,%%mm0;\n" " psraw %%mm3,%%mm0;\n" " paddsw %%mm2,%%mm1;\n" " psraw %%mm3,%%mm1;\n" " movq %%mm0,(%%rsi);\n" " movq %%mm1,8(%%rsi);\n" " addq $16,%%rsi;\n" " cmpq %%rdx,%%rsi;\n" " jbe 6b;\n" " .p2align 2;\n" "4:\n" " addq $12,%%rdx;\n" /* now edx = top-4 */ " cmpq %%rdx,%%rsi;\n" " ja 3f;\n" " .p2align 2;\n" /* do up to 6 words, two per iteration */ "5:\n" " movd (%%rsi),%%mm0;\n" " paddsw %%mm2,%%mm0;\n" " psraw %%mm3,%%mm0;\n" " movd %%mm0,(%%rsi);\n" " addq $4,%%rsi;\n" " cmpq %%rdx,%%rsi;\n" " jbe 5b;\n" " .p2align 2;\n" "3:\n" " addq $2,%%rdx;\n" /* now edx = top-2 */ " cmpq %%rdx,%%rsi;\n" " ja 2f;\n" " movzwl (%%rsi),%%eax;\n" " movd %%eax,%%mm0;\n" " paddsw %%mm2,%%mm0;\n" " psraw %%mm3,%%mm0;\n" " movd %%mm0,%%eax;\n" " movw %%ax,(%%rsi);\n" " .p2align 2;\n" "2:\n" " emms;\n" : : "S" (p), "a" (n), "c" (bits), [ones] "m" (ones) : "edx" ); #else __asm__ __volatile__( " leal -16(%%esi,%%eax,2),%%edx;\n" /* edx = top - 16 */ " emms;\n" " movd %%ecx,%%mm3;\n" " movq %[ones],%%mm2;\n" " psllw %%mm3,%%mm2;\n" " psrlw $1,%%mm2;\n" " cmpl %%edx,%%esi;" " ja 4f;\n" " .p2align 2;\n" /* 8 words per iteration */ "6:\n" " movq (%%esi),%%mm0;\n" " movq 8(%%esi),%%mm1;\n" " paddsw %%mm2,%%mm0;\n" " psraw %%mm3,%%mm0;\n" " paddsw %%mm2,%%mm1;\n" " psraw %%mm3,%%mm1;\n" " movq %%mm0,(%%esi);\n" " movq %%mm1,8(%%esi);\n" " addl $16,%%esi;\n" " cmpl %%edx,%%esi;\n" " jbe 6b;\n" " .p2align 2;\n" "4:\n" " addl $12,%%edx;\n" /* now edx = top-4 */ " cmpl %%edx,%%esi;\n" " ja 3f;\n" " .p2align 2;\n" /* do up to 6 words, two per iteration */ "5:\n" " movd (%%esi),%%mm0;\n" " paddsw %%mm2,%%mm0;\n" " psraw %%mm3,%%mm0;\n" " movd %%mm0,(%%esi);\n" " addl $4,%%esi;\n" " cmpl %%edx,%%esi;\n" " jbe 5b;\n" " .p2align 2;\n" "3:\n" " addl $2,%%edx;\n" /* now edx = top-2 */ " cmpl %%edx,%%esi;\n" " ja 2f;\n" " movzwl (%%esi),%%eax;\n" " movd %%eax,%%mm0;\n" " paddsw %%mm2,%%mm0;\n" " psraw %%mm3,%%mm0;\n" " movd %%mm0,%%eax;\n" " movw %%ax,(%%esi);\n" " .p2align 2;\n" "2:\n" " emms;\n" : : "S" (p), "a" (n), "c" (bits), [ones] "m" (ones) : "edx" ); #endif } /*- End of function --------------------------------------------------------*/ #endif /* 4.2.4 */ static void autocorrelation(int16_t amp[GSM0610_FRAME_LEN], int32_t L_ACF[9]) { int k; int16_t smax; int16_t scalauto; #if !(defined(__GNUC__) && defined(SPANDSP_USE_MMX)) int i; int temp; int16_t *sp; int16_t sl; #endif /* The goal is to compute the array L_ACF[k]. The signal s[i] must be scaled in order to avoid an overflow situation. */ /* Dynamic scaling of the array s[0..159] */ /* Search for the maximum. */ #if defined(__GNUC__) && defined(SPANDSP_USE_MMX) smax = saturate(vec_min_maxi16(amp, GSM0610_FRAME_LEN, NULL)); #else for (smax = 0, k = 0; k < GSM0610_FRAME_LEN; k++) { temp = saturated_abs16(amp[k]); if (temp > smax) smax = (int16_t) temp; /*endif*/ } /*endfor*/ #endif /* Computation of the scaling factor. */ if (smax == 0) { scalauto = 0; } else { assert(smax > 0); scalauto = (int16_t) (4 - gsm0610_norm((int32_t) smax << 16)); } /*endif*/ /* Scaling of the array s[0...159] */ #if defined(__GNUC__) && defined(SPANDSP_USE_MMX) if (scalauto > 0) gsm0610_vec_vsraw(amp, GSM0610_FRAME_LEN, scalauto); /*endif*/ #else if (scalauto > 0) { for (k = 0; k < GSM0610_FRAME_LEN; k++) amp[k] = gsm_mult_r(amp[k], 16384 >> (scalauto - 1)); /*endfor*/ } /*endif*/ #endif /* Compute the L_ACF[..]. */ #if defined(__GNUC__) && defined(SPANDSP_USE_MMX) for (k = 0; k < 9; k++) L_ACF[k] = vec_dot_prodi16(amp, amp + k, GSM0610_FRAME_LEN - k) << 1; /*endfor*/ #else sp = amp; sl = *sp; L_ACF[0] = ((int32_t) sl*(int32_t) sp[0]); sl = *++sp; L_ACF[0] += ((int32_t) sl*(int32_t) sp[0]); L_ACF[1] = ((int32_t) sl*(int32_t) sp[-1]); sl = *++sp; L_ACF[0] += ((int32_t) sl*(int32_t) sp[0]); L_ACF[1] += ((int32_t) sl*(int32_t) sp[-1]); L_ACF[2] = ((int32_t) sl*(int32_t) sp[-2]); sl = *++sp; L_ACF[0] += ((int32_t) sl*(int32_t) sp[0]); L_ACF[1] += ((int32_t) sl*(int32_t) sp[-1]); L_ACF[2] += ((int32_t) sl*(int32_t) sp[-2]); L_ACF[3] = ((int32_t) sl*(int32_t) sp[-3]); sl = *++sp; L_ACF[0] += ((int32_t) sl*(int32_t) sp[0]); L_ACF[1] += ((int32_t) sl*(int32_t) sp[-1]); L_ACF[2] += ((int32_t) sl*(int32_t) sp[-2]); L_ACF[3] += ((int32_t) sl*(int32_t) sp[-3]); L_ACF[4] = ((int32_t) sl*(int32_t) sp[-4]); sl = *++sp; L_ACF[0] += ((int32_t) sl*(int32_t) sp[0]); L_ACF[1] += ((int32_t) sl*(int32_t) sp[-1]); L_ACF[2] += ((int32_t) sl*(int32_t) sp[-2]); L_ACF[3] += ((int32_t) sl*(int32_t) sp[-3]); L_ACF[4] += ((int32_t) sl*(int32_t) sp[-4]); L_ACF[5] = ((int32_t) sl*(int32_t) sp[-5]); sl = *++sp; L_ACF[0] += ((int32_t) sl*(int32_t) sp[0]); L_ACF[1] += ((int32_t) sl*(int32_t) sp[-1]); L_ACF[2] += ((int32_t) sl*(int32_t) sp[-2]); L_ACF[3] += ((int32_t) sl*(int32_t) sp[-3]); L_ACF[4] += ((int32_t) sl*(int32_t) sp[-4]); L_ACF[5] += ((int32_t) sl*(int32_t) sp[-5]); L_ACF[6] = ((int32_t) sl*(int32_t) sp[-6]); sl = *++sp; L_ACF[0] += ((int32_t) sl*(int32_t) sp[0]); L_ACF[1] += ((int32_t) sl*(int32_t) sp[-1]); L_ACF[2] += ((int32_t) sl*(int32_t) sp[-2]); L_ACF[3] += ((int32_t) sl*(int32_t) sp[-3]); L_ACF[4] += ((int32_t) sl*(int32_t) sp[-4]); L_ACF[5] += ((int32_t) sl*(int32_t) sp[-5]); L_ACF[6] += ((int32_t) sl*(int32_t) sp[-6]); L_ACF[7] = ((int32_t) sl*(int32_t) sp[-7]); sl = *++sp; L_ACF[0] += ((int32_t) sl*(int32_t) sp[0]); L_ACF[1] += ((int32_t) sl*(int32_t) sp[-1]); L_ACF[2] += ((int32_t) sl*(int32_t) sp[-2]); L_ACF[3] += ((int32_t) sl*(int32_t) sp[-3]); L_ACF[4] += ((int32_t) sl*(int32_t) sp[-4]); L_ACF[5] += ((int32_t) sl*(int32_t) sp[-5]); L_ACF[6] += ((int32_t) sl*(int32_t) sp[-6]); L_ACF[7] += ((int32_t) sl*(int32_t) sp[-7]); L_ACF[8] = ((int32_t) sl*(int32_t) sp[-8]); for (i = 9; i < GSM0610_FRAME_LEN; i++) { sl = *++sp; L_ACF[0] += ((int32_t) sl*(int32_t) sp[0]); L_ACF[1] += ((int32_t) sl*(int32_t) sp[-1]); L_ACF[2] += ((int32_t) sl*(int32_t) sp[-2]); L_ACF[3] += ((int32_t) sl*(int32_t) sp[-3]); L_ACF[4] += ((int32_t) sl*(int32_t) sp[-4]); L_ACF[5] += ((int32_t) sl*(int32_t) sp[-5]); L_ACF[6] += ((int32_t) sl*(int32_t) sp[-6]); L_ACF[7] += ((int32_t) sl*(int32_t) sp[-7]); L_ACF[8] += ((int32_t) sl*(int32_t) sp[-8]); } /*endfor*/ for (k = 0; k < 9; k++) L_ACF[k] <<= 1; /*endfor*/ #endif /* Rescaling of the array s[0..159] */ if (scalauto > 0) { assert(scalauto <= 4); for (k = 0; k < GSM0610_FRAME_LEN; k++) amp[k] <<= scalauto; /*endfor*/ } /*endif*/ } /*- End of function --------------------------------------------------------*/ /* 4.2.5 */ static void reflection_coefficients(int32_t L_ACF[9], int16_t r[8]) { int i; int m; int n; int16_t temp; int16_t ACF[9]; int16_t P[9]; int16_t K[9]; /* Schur recursion with 16 bits arithmetic. */ if (L_ACF[0] == 0) { for (i = 8; i--; *r++ = 0) ; /*endfor*/ return; } /*endif*/ assert(L_ACF[0] != 0); temp = gsm0610_norm(L_ACF[0]); assert(temp >= 0 && temp < 32); /* ? overflow ? */ for (i = 0; i <= 8; i++) ACF[i] = (int16_t) ((L_ACF[i] << temp) >> 16); /*endfor*/ /* Initialize array P[..] and K[..] for the recursion. */ for (i = 1; i <= 7; i++) K[i] = ACF[i]; /*endfor*/ for (i = 0; i <= 8; i++) P[i] = ACF[i]; /*endfor*/ /* Compute reflection coefficients */ for (n = 1; n <= 8; n++, r++) { temp = P[1]; temp = saturated_abs16(temp); if (P[0] < temp) { for (i = n; i <= 8; i++) *r++ = 0; /*endfor*/ return; } /*endif*/ *r = gsm_div(temp, P[0]); assert(*r >= 0); if (P[1] > 0) *r = -*r; /* r[n] = sub(0, r[n]) */ /*endif*/ assert(*r != INT16_MIN); if (n == 8) return; /*endif*/ /* Schur recursion */ temp = gsm_mult_r(P[1], *r); P[0] = saturated_add16(P[0], temp); for (m = 1; m <= 8 - n; m++) { temp = gsm_mult_r(K[m], *r); P[m] = saturated_add16(P[m + 1], temp); temp = gsm_mult_r(P[m + 1], *r); K[m] = saturated_add16(K[m], temp); } /*endfor*/ } /*endfor*/ } /*- End of function --------------------------------------------------------*/ /* 4.2.6 */ static void transform_to_log_area_ratios(int16_t r[8]) { int16_t temp; int i; /* The following scaling for r[..] and LAR[..] has been used: r[..] = integer (real_r[..]*32768.); -1 <= real_r < 1. LAR[..] = integer (real_LAR[..] * 16384); with -1.625 <= real_LAR <= 1.625 */ /* Computation of the LAR[0..7] from the r[0..7] */ for (i = 1; i <= 8; i++, r++) { temp = saturated_abs16(*r); assert(temp >= 0); if (temp < 22118) { temp >>= 1; } else if (temp < 31130) { assert(temp >= 11059); temp -= 11059; } else { assert(temp >= 26112); temp -= 26112; temp <<= 2; } /*endif*/ *r = (*r < 0) ? -temp : temp; assert(*r != INT16_MIN); } /*endfor*/ } /*- End of function --------------------------------------------------------*/ /* 4.2.7 */ static void quantization_and_coding(int16_t LAR[8]) { int16_t temp; /* This procedure needs four tables; the following equations give the optimum scaling for the constants: A[0..7] = integer(real_A[0..7] * 1024) B[0..7] = integer(real_B[0..7] * 512) MAC[0..7] = maximum of the LARc[0..7] MIC[0..7] = minimum of the LARc[0..7] */ #undef STEP #define STEP(A,B,MAC,MIC) \ temp = saturated_mul16(A, *LAR); \ temp = saturated_add16(temp, B); \ temp = saturated_add16(temp, 256); \ temp >>= 9; \ *LAR = (int16_t) ((temp > MAC) \ ? \ MAC - MIC \ : \ ((temp < MIC) ? 0 : temp - MIC)); \ LAR++; STEP(20480, 0, 31, -32); STEP(20480, 0, 31, -32); STEP(20480, 2048, 15, -16); STEP(20480, -2560, 15, -16); STEP(13964, 94, 7, -8); STEP(15360, -1792, 7, -8); STEP( 8534, -341, 3, -4); STEP( 9036, -1144, 3, -4); #undef STEP } /*- End of function --------------------------------------------------------*/ void gsm0610_lpc_analysis(gsm0610_state_t *s, int16_t amp[GSM0610_FRAME_LEN], int16_t LARc[8]) { int32_t L_ACF[9]; autocorrelation(amp, L_ACF); reflection_coefficients(L_ACF, LARc); transform_to_log_area_ratios(LARc); quantization_and_coding(LARc); } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/noise.c0000664000175000017500000000772311422612262012167 00000000000000/* * SpanDSP - a series of DSP components for telephony * * noise.c - A low complexity audio noise generator, suitable for * real time generation (current AWGN, and Hoth) * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/saturated.h" #include "spandsp/noise.h" #include "spandsp/private/noise.h" SPAN_DECLARE(int16_t) noise(noise_state_t *s) { int32_t val; int i; /* The central limit theorem says if you add a few random numbers together, the result starts to look Gaussian. Quantities above 7 give diminishing returns. Quantites above 20 are exceedingly Gaussian. */ val = 0; for (i = 0; i < s->quality; i++) { s->rndnum = 1664525U*s->rndnum + 1013904223U; val += ((int32_t) s->rndnum) >> 22; } if (s->class_of_noise == NOISE_CLASS_HOTH) { /* Hoth noise is room-like. It should be sculpted, at the high and low ends, and roll off at 5dB/octave across the main part of the band. However, merely rolling off at 6dB/octave across the band gets you close to the subjective effect. */ s->state = (3*val + 5*s->state) >> 3; /* Bring the overall power level back to the pre-filtered level. This simple approx. leaves the signal about 0.35dB low. */ val = s->state << 1; } return saturate((val*s->rms) >> 10); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(noise_state_t *) noise_init_dbov(noise_state_t *s, int seed, float level, int class_of_noise, int quality) { float rms; if (s == NULL) { if ((s = (noise_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); s->rndnum = (uint32_t) seed; rms = 32768.0f*powf(10.0f, level/20.0f); if (quality < 4) s->quality = 4; else if (quality > 20) s->quality = 20; else s->quality = quality; if (class_of_noise == NOISE_CLASS_HOTH) { /* Allow for the gain of the filter */ rms *= 1.043f; } s->rms = (int32_t) (rms*sqrtf(12.0f/s->quality)); s->class_of_noise = class_of_noise; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(noise_state_t *) noise_init_dbm0(noise_state_t *s, int seed, float level, int class_of_noise, int quality) { return noise_init_dbov(s, seed, (level - DBM0_MAX_POWER), class_of_noise, quality); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) noise_release(noise_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) noise_free(noise_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/fax.c0000664000175000017500000006240512343635351011635 00000000000000//#define LOG_FAX_AUDIO /* * SpanDSP - a series of DSP components for telephony * * fax.c - Analogue line ITU T.30 FAX transfer processing * * Written by Steve Underwood * * Copyright (C) 2003, 2005, 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include #if defined(LOG_FAX_AUDIO) #include #endif #include #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/queue.h" #include "spandsp/dc_restore.h" #include "spandsp/vector_int.h" #include "spandsp/power_meter.h" #include "spandsp/complex.h" #include "spandsp/tone_detect.h" #include "spandsp/tone_generate.h" #include "spandsp/async.h" #include "spandsp/hdlc.h" #include "spandsp/silence_gen.h" #include "spandsp/super_tone_rx.h" #include "spandsp/fsk.h" #include "spandsp/modem_connect_tones.h" #include "spandsp/v8.h" #include "spandsp/v29tx.h" #include "spandsp/v29rx.h" #include "spandsp/v27ter_tx.h" #include "spandsp/v27ter_rx.h" #include "spandsp/v17tx.h" #include "spandsp/v17rx.h" #include "spandsp/timezone.h" #include "spandsp/t4_rx.h" #include "spandsp/t4_tx.h" #if defined(SPANDSP_SUPPORT_T85) #include "spandsp/t81_t82_arith_coding.h" #include "spandsp/t85.h" #endif #include "spandsp/t4_t6_decode.h" #include "spandsp/t4_t6_encode.h" #include "spandsp/t30_fcf.h" #include "spandsp/t35.h" #include "spandsp/t30.h" #include "spandsp/t30_api.h" #include "spandsp/t30_logging.h" #include "spandsp/fax_modems.h" #include "spandsp/fax.h" #include "spandsp/private/logging.h" #include "spandsp/private/silence_gen.h" #include "spandsp/private/fsk.h" #include "spandsp/private/modem_connect_tones.h" #include "spandsp/private/v8.h" #include "spandsp/private/v17tx.h" #include "spandsp/private/v17rx.h" #include "spandsp/private/v27ter_tx.h" #include "spandsp/private/v27ter_rx.h" #include "spandsp/private/v29tx.h" #include "spandsp/private/v29rx.h" #include "spandsp/private/hdlc.h" #include "spandsp/private/fax_modems.h" #include "spandsp/private/timezone.h" #if defined(SPANDSP_SUPPORT_T85) #include "spandsp/private/t81_t82_arith_coding.h" #include "spandsp/private/t85.h" #endif #include "spandsp/private/t4_t6_decode.h" #include "spandsp/private/t4_t6_encode.h" #include "spandsp/private/t4_rx.h" #include "spandsp/private/t4_tx.h" #include "spandsp/private/t30.h" #include "spandsp/private/fax.h" #define HDLC_FRAMING_OK_THRESHOLD 8 static void fax_send_hdlc(void *user_data, const uint8_t *msg, int len) { fax_state_t *s; s = (fax_state_t *) user_data; fax_modems_hdlc_tx_frame(&s->modems, msg, len); } /*- End of function --------------------------------------------------------*/ static void tone_detected(void *user_data, int tone, int level, int delay) { t30_state_t *s; s = (t30_state_t *) user_data; span_log(&s->logging, SPAN_LOG_FLOW, "%s detected (%ddBm0)\n", modem_connect_tone_to_str(tone), level); } /*- End of function --------------------------------------------------------*/ #if 0 static void v8_handler(void *user_data, v8_parms_t *result) { fax_state_t *s; s = (fax_state_t *) user_data; span_log(&s->logging, SPAN_LOG_FLOW, "V.8 report received\n"); } /*- End of function --------------------------------------------------------*/ #endif static void hdlc_underflow_handler(void *user_data) { t30_state_t *s; s = (t30_state_t *) user_data; t30_front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE); } /*- End of function --------------------------------------------------------*/ static void set_rx_handler(fax_state_t *s, span_rx_handler_t *rx_handler, span_rx_fillin_handler_t *fillin_handler, void *user_data) { s->modems.rx_handler = rx_handler; s->modems.rx_fillin_handler = fillin_handler; s->modems.rx_user_data = user_data; } /*- End of function --------------------------------------------------------*/ static void fax_modems_set_tx_handler(fax_state_t *s, span_tx_handler_t *handler, void *user_data) { s->modems.tx_handler = handler; s->modems.tx_user_data = user_data; } /*- End of function --------------------------------------------------------*/ static void fax_modems_set_next_tx_handler(fax_state_t *s, span_tx_handler_t *handler, void *user_data) { s->modems.next_tx_handler = handler; s->modems.next_tx_user_data = user_data; } /*- End of function --------------------------------------------------------*/ static int v17_v21_rx(void *user_data, const int16_t amp[], int len) { fax_state_t *t; fax_modems_state_t *s; t = (fax_state_t *) user_data; s = &t->modems; v17_rx(&s->fast_modems.v17_rx, amp, len); if (t->t30.rx_trained) { /* The fast modem has trained, so we no longer need to run the slow one in parallel. */ span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.17 + V.21 to V.17 (%.2fdBm0)\n", v17_rx_signal_power(&s->fast_modems.v17_rx)); set_rx_handler(t, (span_rx_handler_t *) &v17_rx, (span_rx_fillin_handler_t *) &v17_rx_fillin, &s->fast_modems.v17_rx); } else { fsk_rx(&s->v21_rx, amp, len); if (t->t30.rx_frame_received) { /* We have received something, and the fast modem has not trained. We must be receiving valid V.21 */ span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.17 + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx)); set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &s->v21_rx); } } return 0; } /*- End of function --------------------------------------------------------*/ static int v17_v21_rx_fillin(void *user_data, int len) { fax_state_t *t; fax_modems_state_t *s; t = (fax_state_t *) user_data; s = &t->modems; v17_rx_fillin(&s->fast_modems.v17_rx, len); fsk_rx_fillin(&s->v21_rx, len); return 0; } /*- End of function --------------------------------------------------------*/ static int v27ter_v21_rx(void *user_data, const int16_t amp[], int len) { fax_state_t *t; fax_modems_state_t *s; t = (fax_state_t *) user_data; s = &t->modems; v27ter_rx(&s->fast_modems.v27ter_rx, amp, len); if (t->t30.rx_trained) { /* The fast modem has trained, so we no longer need to run the slow one in parallel. */ span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.27ter + V.21 to V.27ter (%.2fdBm0)\n", v27ter_rx_signal_power(&s->fast_modems.v27ter_rx)); set_rx_handler(t, (span_rx_handler_t *) &v27ter_rx, (span_rx_fillin_handler_t *) &v27ter_rx_fillin, &s->fast_modems.v27ter_rx); } else { fsk_rx(&s->v21_rx, amp, len); if (t->t30.rx_frame_received) { /* We have received something, and the fast modem has not trained. We must be receiving valid V.21 */ span_log(&s->logging, SPAN_LOG_FLOW, "Switching from V.27ter + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx)); set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &s->v21_rx); } } return 0; } /*- End of function --------------------------------------------------------*/ static int v27ter_v21_rx_fillin(void *user_data, int len) { fax_state_t *t; fax_modems_state_t *s; t = (fax_state_t *) user_data; s = &t->modems; v27ter_rx_fillin(&s->fast_modems.v27ter_rx, len); fsk_rx_fillin(&s->v21_rx, len); return 0; } /*- End of function --------------------------------------------------------*/ static int v29_v21_rx(void *user_data, const int16_t amp[], int len) { fax_state_t *t; fax_modems_state_t *s; t = (fax_state_t *) user_data; s = &t->modems; v29_rx(&s->fast_modems.v29_rx, amp, len); if (t->t30.rx_trained) { /* The fast modem has trained, so we no longer need to run the slow one in parallel. */ span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.29 + V.21 to V.29 (%.2fdBm0)\n", v29_rx_signal_power(&s->fast_modems.v29_rx)); set_rx_handler(t, (span_rx_handler_t *) &v29_rx, (span_rx_fillin_handler_t *) &v29_rx_fillin, &s->fast_modems.v29_rx); } else { fsk_rx(&s->v21_rx, amp, len); if (t->t30.rx_frame_received) { /* We have received something, and the fast modem has not trained. We must be receiving valid V.21 */ span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.29 + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx)); set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &s->v21_rx); } } return 0; } /*- End of function --------------------------------------------------------*/ static int v29_v21_rx_fillin(void *user_data, int len) { fax_state_t *t; fax_modems_state_t *s; t = (fax_state_t *) user_data; s = &t->modems; v29_rx_fillin(&s->fast_modems.v29_rx, len); fsk_rx_fillin(&s->v21_rx, len); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) fax_rx(fax_state_t *s, int16_t *amp, int len) { int i; #if defined(LOG_FAX_AUDIO) if (s->modems.audio_rx_log >= 0) write(s->modems.audio_rx_log, amp, len*sizeof(int16_t)); #endif for (i = 0; i < len; i++) amp[i] = dc_restore(&s->modems.dc_restore, amp[i]); s->modems.rx_handler(s->modems.rx_user_data, amp, len); t30_timer_update(&s->t30, len); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) fax_rx_fillin(fax_state_t *s, int len) { /* To mitigate the effect of lost packets on a packet network we should try to sustain the status quo. If there is no receive modem running, keep things that way. If there is a receive modem running, try to sustain its operation, without causing a phase hop, or letting its adaptive functions diverge. */ #if defined(LOG_FAX_AUDIO) if (s->modems.audio_rx_log >= 0) { int i; #if defined(_MSC_VER) int16_t *amp = (int16_t *) _alloca(sizeof(int16_t)*len); #else int16_t amp[len]; #endif vec_zeroi16(amp, len); write(s->modems.audio_rx_log, amp, len*sizeof(int16_t)); } #endif /* Call the fillin function of the current modem (if there is one). */ s->modems.rx_fillin_handler(s->modems.rx_user_data, len); t30_timer_update(&s->t30, len); return 0; } /*- End of function --------------------------------------------------------*/ static int set_next_tx_type(fax_state_t *s) { fax_modems_state_t *t; t = &s->modems; if (t->next_tx_handler) { fax_modems_set_tx_handler(s, t->next_tx_handler, t->next_tx_user_data); t->next_tx_handler = NULL; return 0; } /* If there is nothing else to change to, so use zero length silence */ silence_gen_alter(&t->silence_gen, 0); fax_modems_set_tx_handler(s, (span_tx_handler_t *) &silence_gen, &t->silence_gen); fax_modems_set_next_tx_handler(s, (span_tx_handler_t *) NULL, NULL); t->transmit = FALSE; return -1; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) fax_tx(fax_state_t *s, int16_t *amp, int max_len) { int len; #if defined(LOG_FAX_AUDIO) int required_len; required_len = max_len; #endif len = 0; if (s->modems.transmit) { while ((len += s->modems.tx_handler(s->modems.tx_user_data, amp + len, max_len - len)) < max_len) { /* Allow for a change of tx handler within a block */ if (set_next_tx_type(s) && s->modems.current_tx_type != T30_MODEM_NONE && s->modems.current_tx_type != T30_MODEM_DONE) t30_front_end_status(&s->t30, T30_FRONT_END_SEND_STEP_COMPLETE); if (!s->modems.transmit) { if (s->modems.transmit_on_idle) { /* Pad to the requested length with silence */ memset(amp + len, 0, (max_len - len)*sizeof(int16_t)); len = max_len; } break; } } } else { if (s->modems.transmit_on_idle) { /* Pad to the requested length with silence */ memset(amp, 0, max_len*sizeof(int16_t)); len = max_len; } } #if defined(LOG_FAX_AUDIO) if (s->modems.audio_tx_log >= 0) { if (len < required_len) memset(amp + len, 0, (required_len - len)*sizeof(int16_t)); write(s->modems.audio_tx_log, amp, required_len*sizeof(int16_t)); } #endif return len; } /*- End of function --------------------------------------------------------*/ static void fax_set_rx_type(void *user_data, int type, int bit_rate, int short_train, int use_hdlc) { fax_state_t *s; put_bit_func_t put_bit_func; void *put_bit_user_data; fax_modems_state_t *t; s = (fax_state_t *) user_data; t = &s->modems; span_log(&s->logging, SPAN_LOG_FLOW, "Set rx type %d\n", type); if (t->current_rx_type == type) return; t->current_rx_type = type; t->rx_bit_rate = bit_rate; if (use_hdlc) { put_bit_func = (put_bit_func_t) hdlc_rx_put_bit; put_bit_user_data = (void *) &t->hdlc_rx; hdlc_rx_init(&t->hdlc_rx, FALSE, TRUE, HDLC_FRAMING_OK_THRESHOLD, t30_hdlc_accept, &s->t30); } else { put_bit_func = t30_non_ecm_put_bit; put_bit_user_data = (void *) &s->t30; } switch (type) { case T30_MODEM_V21: fsk_rx_init(&t->v21_rx, &preset_fsk_specs[FSK_V21CH2], FSK_FRAME_MODE_SYNC, (put_bit_func_t) hdlc_rx_put_bit, put_bit_user_data); fsk_rx_signal_cutoff(&t->v21_rx, -45.5f); set_rx_handler(s, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &t->v21_rx); break; case T30_MODEM_V27TER: v27ter_rx_restart(&t->fast_modems.v27ter_rx, bit_rate, FALSE); v27ter_rx_set_put_bit(&t->fast_modems.v27ter_rx, put_bit_func, put_bit_user_data); set_rx_handler(s, &v27ter_v21_rx, &v27ter_v21_rx_fillin, s); break; case T30_MODEM_V29: v29_rx_restart(&t->fast_modems.v29_rx, bit_rate, FALSE); v29_rx_set_put_bit(&t->fast_modems.v29_rx, put_bit_func, put_bit_user_data); set_rx_handler(s, &v29_v21_rx, &v29_v21_rx_fillin, s); break; case T30_MODEM_V17: v17_rx_restart(&t->fast_modems.v17_rx, bit_rate, short_train); v17_rx_set_put_bit(&t->fast_modems.v17_rx, put_bit_func, put_bit_user_data); set_rx_handler(s, &v17_v21_rx, &v17_v21_rx_fillin, s); break; case T30_MODEM_DONE: span_log(&s->logging, SPAN_LOG_FLOW, "FAX exchange complete\n"); default: set_rx_handler(s, (span_rx_handler_t *) &span_dummy_rx, (span_rx_fillin_handler_t *) &span_dummy_rx_fillin, s); break; } } /*- End of function --------------------------------------------------------*/ static void fax_set_tx_type(void *user_data, int type, int bit_rate, int short_train, int use_hdlc) { fax_state_t *s; get_bit_func_t get_bit_func; void *get_bit_user_data; fax_modems_state_t *t; int tone; s = (fax_state_t *) user_data; t = &s->modems; span_log(&s->logging, SPAN_LOG_FLOW, "Set tx type %d\n", type); if (t->current_tx_type == type) return; if (use_hdlc) { get_bit_func = (get_bit_func_t) hdlc_tx_get_bit; get_bit_user_data = (void *) &t->hdlc_tx; } else { get_bit_func = t30_non_ecm_get_bit; get_bit_user_data = (void *) &s->t30; } switch (type) { case T30_MODEM_PAUSE: silence_gen_alter(&t->silence_gen, ms_to_samples(short_train)); fax_modems_set_tx_handler(s, (span_tx_handler_t *) &silence_gen, &t->silence_gen); fax_modems_set_next_tx_handler(s, (span_tx_handler_t *) NULL, NULL); t->transmit = TRUE; break; case T30_MODEM_CED: case T30_MODEM_CNG: if (type == T30_MODEM_CED) tone = MODEM_CONNECT_TONES_FAX_CED; else tone = MODEM_CONNECT_TONES_FAX_CNG; modem_connect_tones_tx_init(&t->connect_tx, tone); fax_modems_set_tx_handler(s, (span_tx_handler_t *) &modem_connect_tones_tx, &t->connect_tx); fax_modems_set_next_tx_handler(s, (span_tx_handler_t *) NULL, NULL); t->transmit = TRUE; break; case T30_MODEM_V21: fsk_tx_init(&t->v21_tx, &preset_fsk_specs[FSK_V21CH2], get_bit_func, get_bit_user_data); /* The spec says 1s +-15% of preamble. So, the minimum is 32 octets. */ hdlc_tx_flags(&t->hdlc_tx, 32); /* Pause before switching from phase C, as per T.30 5.3.2.2. If we omit this, the receiver might not see the carrier fall between the high speed and low speed sections. In practice, a 75ms gap before any V.21 transmission is harmless, adds little to the overall length of a call, and ensures the receiving end is ready. */ silence_gen_alter(&t->silence_gen, ms_to_samples(75)); fax_modems_set_tx_handler(s, (span_tx_handler_t *) &silence_gen, &t->silence_gen); fax_modems_set_next_tx_handler(s, (span_tx_handler_t *) &fsk_tx, &t->v21_tx); t->transmit = TRUE; break; case T30_MODEM_V27TER: silence_gen_alter(&t->silence_gen, ms_to_samples(75)); /* For any fast modem, set 200ms of preamble flags */ hdlc_tx_flags(&t->hdlc_tx, bit_rate/(8*5)); v27ter_tx_restart(&t->fast_modems.v27ter_tx, bit_rate, t->use_tep); v27ter_tx_set_get_bit(&t->fast_modems.v27ter_tx, get_bit_func, get_bit_user_data); fax_modems_set_tx_handler(s, (span_tx_handler_t *) &silence_gen, &t->silence_gen); fax_modems_set_next_tx_handler(s, (span_tx_handler_t *) &v27ter_tx, &t->fast_modems.v27ter_tx); t->transmit = TRUE; break; case T30_MODEM_V29: silence_gen_alter(&t->silence_gen, ms_to_samples(75)); /* For any fast modem, set 200ms of preamble flags */ hdlc_tx_flags(&t->hdlc_tx, bit_rate/(8*5)); v29_tx_restart(&t->fast_modems.v29_tx, bit_rate, t->use_tep); v29_tx_set_get_bit(&t->fast_modems.v29_tx, get_bit_func, get_bit_user_data); fax_modems_set_tx_handler(s, (span_tx_handler_t *) &silence_gen, &t->silence_gen); fax_modems_set_next_tx_handler(s, (span_tx_handler_t *) &v29_tx, &t->fast_modems.v29_tx); t->transmit = TRUE; break; case T30_MODEM_V17: silence_gen_alter(&t->silence_gen, ms_to_samples(75)); /* For any fast modem, set 200ms of preamble flags */ hdlc_tx_flags(&t->hdlc_tx, bit_rate/(8*5)); v17_tx_restart(&t->fast_modems.v17_tx, bit_rate, t->use_tep, short_train); v17_tx_set_get_bit(&t->fast_modems.v17_tx, get_bit_func, get_bit_user_data); fax_modems_set_tx_handler(s, (span_tx_handler_t *) &silence_gen, &t->silence_gen); fax_modems_set_next_tx_handler(s, (span_tx_handler_t *) &v17_tx, &t->fast_modems.v17_tx); t->transmit = TRUE; break; case T30_MODEM_DONE: span_log(&s->logging, SPAN_LOG_FLOW, "FAX exchange complete\n"); /* Fall through */ default: silence_gen_alter(&t->silence_gen, 0); fax_modems_set_tx_handler(s, (span_tx_handler_t *) &silence_gen, &t->silence_gen); fax_modems_set_next_tx_handler(s, (span_tx_handler_t *) NULL, NULL); t->transmit = FALSE; break; } t->tx_bit_rate = bit_rate; t->current_tx_type = type; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) fax_set_transmit_on_idle(fax_state_t *s, int transmit_on_idle) { s->modems.transmit_on_idle = transmit_on_idle; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) fax_set_tep_mode(fax_state_t *s, int use_tep) { s->modems.use_tep = use_tep; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(t30_state_t *) fax_get_t30_state(fax_state_t *s) { return &s->t30; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) fax_get_logging_state(fax_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) fax_restart(fax_state_t *s, int calling_party) { #if 0 v8_parms_t v8_parms; #endif fax_modems_restart(&s->modems); #if 0 v8_parms.modem_connect_tone = MODEM_CONNECT_TONES_ANSAM_PR; v8_parms.call_function = V8_CALL_T30_RX; v8_parms.modulations = V8_MOD_V21; if (s->t30.supported_modems & T30_SUPPORT_V27TER) v8_parms.modulations |= V8_MOD_V27TER; if (s->t30.supported_modems & T30_SUPPORT_V29) v8_parms.modulations |= V8_MOD_V29; if (s->t30.supported_modems & T30_SUPPORT_V17) v8_parms.modulations |= V8_MOD_V17; if (s->t30.supported_modems & T30_SUPPORT_V34HDX) v8_parms.modulations |= V8_MOD_V34HDX; v8_parms.protocol = V8_PROTOCOL_NONE; v8_parms.pcm_modem_availability = 0; v8_parms.pstn_access = 0; v8_parms.nsf = -1; v8_parms.t66 = -1; v8_restart(&s->v8, calling_party, &v8_parms); #endif t30_restart(&s->t30); #if defined(LOG_FAX_AUDIO) { char buf[100 + 1]; struct tm *tm; time_t now; time(&now); tm = localtime(&now); sprintf(buf, "/tmp/fax-rx-audio-%p-%02d%02d%02d%02d%02d%02d", s, tm->tm_year%100, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); s->modems.audio_rx_log = open(buf, O_CREAT | O_TRUNC | O_WRONLY, 0666); sprintf(buf, "/tmp/fax-tx-audio-%p-%02d%02d%02d%02d%02d%02d", s, tm->tm_year%100, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); s->modems.audio_tx_log = open(buf, O_CREAT | O_TRUNC | O_WRONLY, 0666); } #endif return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(fax_state_t *) fax_init(fax_state_t *s, int calling_party) { #if 0 v8_parms_t v8_parms; #endif if (s == NULL) { if ((s = (fax_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "FAX"); fax_modems_init(&s->modems, FALSE, t30_hdlc_accept, hdlc_underflow_handler, t30_non_ecm_put_bit, t30_non_ecm_get_bit, tone_detected, &s->t30); t30_init(&s->t30, calling_party, fax_set_rx_type, (void *) s, fax_set_tx_type, (void *) s, fax_send_hdlc, (void *) s); t30_set_supported_modems(&s->t30, T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17); #if 0 v8_parms.modem_connect_tone = MODEM_CONNECT_TONES_ANSAM_PR; v8_parms.call_function = V8_CALL_T30_RX; v8_parms.modulations = V8_MOD_V21; if (s->t30.supported_modems & T30_SUPPORT_V27TER) v8_parms.modulations |= V8_MOD_V27TER; if (s->t30.supported_modems & T30_SUPPORT_V29) v8_parms.modulations |= V8_MOD_V29; if (s->t30.supported_modems & T30_SUPPORT_V17) v8_parms.modulations |= V8_MOD_V17; if (s->t30.supported_modems & T30_SUPPORT_V34HDX) v8_parms.modulations |= V8_MOD_V34HDX; v8_parms.protocol = V8_PROTOCOL_NONE; v8_parms.pcm_modem_availability = 0; v8_parms.pstn_access = 0; v8_parms.nsf = -1; v8_parms.t66 = -1; v8_init(&s->v8, calling_party, &v8_parms, v8_handler, s); #endif fax_restart(s, calling_party); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) fax_release(fax_state_t *s) { t30_release(&s->t30); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) fax_free(fax_state_t *s) { t30_release(&s->t30); free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/awgn.c0000664000175000017500000001117211422612261011776 00000000000000/* * SpanDSP - a series of DSP components for telephony * * awgn.c - An additive Gaussian white noise generator * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /* This code is based on some demonstration code in a research paper somewhere. I can't track down where I got the original from, so that due recognition can be given. The original had no explicit copyright notice, and I hope nobody objects to its use here. Having a reasonable Gaussian noise generator is pretty important for telephony testing (in fact, pretty much any DSP testing), and this one seems to have served me OK. Since the generation of Gaussian noise is only for test purposes, and not a core system component, I don't intend to worry excessively about copyright issues, unless someone worries me. The non-core nature of this code also explains why it is unlikely to ever be optimised. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/saturated.h" #include "spandsp/awgn.h" #include "spandsp/private/awgn.h" /* Gaussian noise generator constants */ #define M1 259200 #define IA1 7141 #define IC1 54773 #define RM1 (1.0/M1) #define M2 134456 #define IA2 8121 #define IC2 28411 #define RM2 (1.0/M2) #define M3 243000 #define IA3 4561 #define IC3 51349 static double ran1(awgn_state_t *s) { double temp; int j; s->ix1 = (IA1*s->ix1 + IC1)%M1; s->ix2 = (IA2*s->ix2 + IC2)%M2; s->ix3 = (IA3*s->ix3 + IC3)%M3; j = 1 + ((97*s->ix3)/M3); if (j > 97 || j < 1) { /* Error */ return -1; } temp = s->r[j]; s->r[j] = (s->ix1 + s->ix2*RM2)*RM1; return temp; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(awgn_state_t *) awgn_init_dbov(awgn_state_t *s, int idum, float level) { int j; if (s == NULL) { if ((s = (awgn_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } if (idum < 0) idum = -idum; s->rms = pow(10.0, level/20.0)*32768.0; s->ix1 = (IC1 + idum)%M1; s->ix1 = (IA1*s->ix1 + IC1)%M1; s->ix2 = s->ix1%M2; s->ix1 = (IA1*s->ix1 + IC1)%M1; s->ix3 = s->ix1%M3; s->r[0] = 0.0; for (j = 1; j <= 97; j++) { s->ix1 = (IA1*s->ix1 + IC1)%M1; s->ix2 = (IA2*s->ix2 + IC2)%M2; s->r[j] = (s->ix1 + s->ix2*RM2)*RM1; } s->gset = 0.0; s->iset = 0; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(awgn_state_t *) awgn_init_dbm0(awgn_state_t *s, int idum, float level) { return awgn_init_dbov(s, idum, level - DBM0_MAX_POWER); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) awgn_release(awgn_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) awgn_free(awgn_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int16_t) awgn(awgn_state_t *s) { double fac; double r; double v1; double v2; double amp; if (s->iset == 0) { do { v1 = 2.0*ran1(s) - 1.0; v2 = 2.0*ran1(s) - 1.0; r = v1*v1 + v2*v2; } while (r >= 1.0); fac = sqrt(-2.0*log(r)/r); s->gset = v1*fac; s->iset = 1; amp = v2*fac*s->rms; } else { s->iset = 0; amp = s->gset*s->rms; } return fsaturate(amp); } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/dds_int.c0000664000175000017500000002345412100745452012477 00000000000000/* * SpanDSP - a series of DSP components for telephony * * dds.c * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/complex.h" #include "spandsp/dds.h" /* In a A-law or u-law channel, a fairly coarse step sine table is adequate to keep the spectral mess due to the DDS at a similar level to the spectral mess due to the A-law or u-law compression. */ #define SLENK 8 #define DDS_STEPS (1 << SLENK) #define DDS_SHIFT (32 - 2 - SLENK) /* This is a simple set of direct digital synthesis (DDS) functions to generate sine waves. This version uses a 256 entry sin/cos table to cover one quadrant. */ static const int16_t sine_table[DDS_STEPS + 1] = { 0, 201, 402, 603, 804, 1005, 1206, 1407, 1608, 1809, 2009, 2210, 2410, 2611, 2811, 3012, 3212, 3412, 3612, 3811, 4011, 4210, 4410, 4609, 4808, 5007, 5205, 5404, 5602, 5800, 5998, 6195, 6393, 6590, 6786, 6983, 7179, 7375, 7571, 7767, 7962, 8157, 8351, 8545, 8739, 8933, 9126, 9319, 9512, 9704, 9896, 10087, 10278, 10469, 10659, 10849, 11039, 11228, 11417, 11605, 11793, 11980, 12167, 12353, 12539, 12725, 12910, 13094, 13279, 13462, 13645, 13828, 14010, 14191, 14372, 14553, 14732, 14912, 15090, 15269, 15446, 15623, 15800, 15976, 16151, 16325, 16499, 16673, 16846, 17018, 17189, 17360, 17530, 17700, 17869, 18037, 18204, 18371, 18537, 18703, 18868, 19032, 19195, 19357, 19519, 19680, 19841, 20000, 20159, 20317, 20475, 20631, 20787, 20942, 21096, 21250, 21403, 21554, 21705, 21856, 22005, 22154, 22301, 22448, 22594, 22739, 22884, 23027, 23170, 23311, 23452, 23592, 23731, 23870, 24007, 24143, 24279, 24413, 24547, 24680, 24811, 24942, 25072, 25201, 25329, 25456, 25582, 25708, 25832, 25955, 26077, 26198, 26319, 26438, 26556, 26674, 26790, 26905, 27019, 27133, 27245, 27356, 27466, 27575, 27683, 27790, 27896, 28001, 28105, 28208, 28310, 28411, 28510, 28609, 28706, 28803, 28898, 28992, 29085, 29177, 29268, 29358, 29447, 29534, 29621, 29706, 29791, 29874, 29956, 30037, 30117, 30195, 30273, 30349, 30424, 30498, 30571, 30643, 30714, 30783, 30852, 30919, 30985, 31050, 31113, 31176, 31237, 31297, 31356, 31414, 31470, 31526, 31580, 31633, 31685, 31736, 31785, 31833, 31880, 31926, 31971, 32014, 32057, 32098, 32137, 32176, 32213, 32250, 32285, 32318, 32351, 32382, 32412, 32441, 32469, 32495, 32521, 32545, 32567, 32589, 32609, 32628, 32646, 32663, 32678, 32692, 32705, 32717, 32728, 32737, 32745, 32752, 32757, 32761, 32765, 32766, 32767 }; SPAN_DECLARE(int32_t) dds_phase_rate(float frequency) { return (int32_t) (frequency*65536.0f*65536.0f/SAMPLE_RATE); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) dds_frequency(int32_t phase_rate) { return (float) phase_rate*(float) SAMPLE_RATE/(65536.0f*65536.0f); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int16_t) dds_scaling_dbm0(float level) { return (int16_t) (powf(10.0f, (level - DBM0_MAX_SINE_POWER)/20.0f)*32767.0f); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int16_t) dds_scaling_dbov(float level) { return (int16_t) (powf(10.0f, (level - DBOV_MAX_SINE_POWER)/20.0f)*32767.0f); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int16_t) dds_lookup(uint32_t phase) { uint32_t step; int16_t amp; phase >>= DDS_SHIFT; step = phase & (DDS_STEPS - 1); if ((phase & DDS_STEPS)) step = DDS_STEPS - step; amp = sine_table[step]; if ((phase & (2*DDS_STEPS))) amp = -amp; return amp; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int16_t) dds_offset(uint32_t phase_acc, int32_t phase_offset) { return dds_lookup(phase_acc + phase_offset); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) dds_advance(uint32_t *phase_acc, int32_t phase_rate) { *phase_acc += phase_rate; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int16_t) dds(uint32_t *phase_acc, int32_t phase_rate) { int16_t amp; amp = dds_lookup(*phase_acc); *phase_acc += phase_rate; return amp; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int16_t) dds_mod(uint32_t *phase_acc, int32_t phase_rate, int16_t scale, int32_t phase) { int16_t amp; amp = (int16_t) (((int32_t) dds_lookup(*phase_acc + phase)*scale) >> 15); *phase_acc += phase_rate; return amp; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complexi_t) dds_lookup_complexi(uint32_t phase) { return complex_seti(dds_lookup(phase + (1 << 30)), dds_lookup(phase)); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complexi_t) dds_complexi(uint32_t *phase_acc, int32_t phase_rate) { complexi_t amp; amp = complex_seti(dds_lookup(*phase_acc + (1 << 30)), dds_lookup(*phase_acc)); *phase_acc += phase_rate; return amp; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complexi_t) dds_complexi_mod(uint32_t *phase_acc, int32_t phase_rate, int16_t scale, int32_t phase) { complexi_t amp; amp = complex_seti(((int32_t) dds_lookup(*phase_acc + phase + (1 << 30))*scale) >> 15, ((int32_t) dds_lookup(*phase_acc + phase)*scale) >> 15); *phase_acc += phase_rate; return amp; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complexi16_t) dds_lookup_complexi16(uint32_t phase) { return complex_seti16(dds_lookup(phase + (1 << 30)), dds_lookup(phase)); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complexi16_t) dds_complexi16(uint32_t *phase_acc, int32_t phase_rate) { complexi16_t amp; amp = complex_seti16(dds_lookup(*phase_acc + (1 << 30)), dds_lookup(*phase_acc)); *phase_acc += phase_rate; return amp; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complexi16_t) dds_complexi16_mod(uint32_t *phase_acc, int32_t phase_rate, int16_t scale, int32_t phase) { complexi16_t amp; amp = complex_seti16((int16_t) (((int32_t) dds_lookup(*phase_acc + phase + (1 << 30))*scale) >> 15), (int16_t) (((int32_t) dds_lookup(*phase_acc + phase)*scale) >> 15)); *phase_acc += phase_rate; return amp; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complexi32_t) dds_lookup_complexi32(uint32_t phase) { return complex_seti32(dds_lookup(phase + (1 << 30)), dds_lookup(phase)); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complexi32_t) dds_complexi32(uint32_t *phase_acc, int32_t phase_rate) { complexi32_t amp; amp = complex_seti32(dds_lookup(*phase_acc + (1 << 30)), dds_lookup(*phase_acc)); *phase_acc += phase_rate; return amp; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complexi32_t) dds_complexi32_mod(uint32_t *phase_acc, int32_t phase_rate, int16_t scale, int32_t phase) { complexi32_t amp; amp = complex_seti32(((int32_t) dds_lookup(*phase_acc + phase + (1 << 30))*scale) >> 15, ((int32_t) dds_lookup(*phase_acc + phase)*scale) >> 15); *phase_acc += phase_rate; return amp; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/queue.c0000664000175000017500000002536312100560264012174 00000000000000/* * SpanDSP - a series of DSP components for telephony * * queue.c - simple in-process message queuing * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #define SPANDSP_FULLY_DEFINE_QUEUE_STATE_T #include "spandsp/telephony.h" #include "spandsp/queue.h" #include "spandsp/private/queue.h" SPAN_DECLARE(int) queue_empty(queue_state_t *s) { return (s->iptr == s->optr); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) queue_free_space(queue_state_t *s) { int len; if ((len = s->optr - s->iptr - 1) < 0) len += s->len; /*endif*/ return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) queue_contents(queue_state_t *s) { int len; if ((len = s->iptr - s->optr) < 0) len += s->len; /*endif*/ return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) queue_flush(queue_state_t *s) { s->optr = s->iptr; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) queue_view(queue_state_t *s, uint8_t *buf, int len) { int real_len; int to_end; int iptr; int optr; /* Snapshot the values (although only iptr should be changeable during this processing) */ iptr = s->iptr; optr = s->optr; if ((real_len = iptr - optr) < 0) real_len += s->len; /*endif*/ if (real_len < len) { if (s->flags & QUEUE_READ_ATOMIC) return -1; /*endif*/ } else { real_len = len; } /*endif*/ if (real_len == 0) return 0; /*endif*/ to_end = s->len - optr; if (iptr < optr && to_end < real_len) { /* A two step process */ if (buf) { memcpy(buf, s->data + optr, to_end); memcpy(buf + to_end, s->data, real_len - to_end); } /*endif*/ } else { /* A one step process */ if (buf) memcpy(buf, s->data + optr, real_len); /*endif*/ } /*endif*/ return real_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) queue_read(queue_state_t *s, uint8_t *buf, int len) { int real_len; int to_end; int new_optr; int iptr; int optr; /* Snapshot the values (although only iptr should be changeable during this processing) */ iptr = s->iptr; optr = s->optr; if ((real_len = iptr - optr) < 0) real_len += s->len; /*endif*/ if (real_len < len) { if (s->flags & QUEUE_READ_ATOMIC) return -1; /*endif*/ } else { real_len = len; } /*endif*/ if (real_len == 0) return 0; /*endif*/ to_end = s->len - optr; if (iptr < optr && to_end < real_len) { /* A two step process */ if (buf) { memcpy(buf, s->data + optr, to_end); memcpy(buf + to_end, s->data, real_len - to_end); } /*endif*/ new_optr = real_len - to_end; } else { /* A one step process */ if (buf) memcpy(buf, s->data + optr, real_len); /*endif*/ new_optr = optr + real_len; if (new_optr >= s->len) new_optr = 0; /*endif*/ } /*endif*/ /* Only change the pointer now we have really finished */ s->optr = new_optr; return real_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) queue_read_byte(queue_state_t *s) { int real_len; int iptr; int optr; int byte; /* Snapshot the values (although only iptr should be changeable during this processing) */ iptr = s->iptr; optr = s->optr; if ((real_len = iptr - optr) < 0) real_len += s->len; /*endif*/ if (real_len < 1) return -1; /*endif*/ byte = s->data[optr]; if (++optr >= s->len) optr = 0; /*endif*/ /* Only change the pointer now we have really finished */ s->optr = optr; return byte; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) queue_write(queue_state_t *s, const uint8_t *buf, int len) { int real_len; int to_end; int new_iptr; int iptr; int optr; /* Snapshot the values (although only optr should be changeable during this processing) */ iptr = s->iptr; optr = s->optr; if ((real_len = optr - iptr - 1) < 0) real_len += s->len; /*endif*/ if (real_len < len) { if (s->flags & QUEUE_WRITE_ATOMIC) return -1; /*endif*/ } else { real_len = len; } /*endif*/ if (real_len == 0) return 0; /*endif*/ to_end = s->len - iptr; if (iptr < optr || to_end >= real_len) { /* A one step process */ memcpy(s->data + iptr, buf, real_len); new_iptr = iptr + real_len; if (new_iptr >= s->len) new_iptr = 0; /*endif*/ } else { /* A two step process */ memcpy(s->data + iptr, buf, to_end); memcpy(s->data, buf + to_end, real_len - to_end); new_iptr = real_len - to_end; } /*endif*/ /* Only change the pointer now we have really finished */ s->iptr = new_iptr; return real_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) queue_write_byte(queue_state_t *s, uint8_t byte) { int real_len; int iptr; int optr; /* Snapshot the values (although only optr should be changeable during this processing) */ iptr = s->iptr; optr = s->optr; if ((real_len = optr - iptr - 1) < 0) real_len += s->len; /*endif*/ if (real_len < 1) { if (s->flags & QUEUE_WRITE_ATOMIC) return -1; /*endif*/ return 0; } /*endif*/ s->data[iptr] = byte; if (++iptr >= s->len) iptr = 0; /*endif*/ /* Only change the pointer now we have really finished */ s->iptr = iptr; return 1; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) queue_state_test_msg(queue_state_t *s) { uint16_t lenx; if (queue_view(s, (uint8_t *) &lenx, sizeof(uint16_t)) != sizeof(uint16_t)) return -1; /*endif*/ return lenx; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) queue_read_msg(queue_state_t *s, uint8_t *buf, int len) { uint16_t lenx; /* If we assume the write message was atomic, this read message should be safe when conducted in multiple chunks */ if (queue_read(s, (uint8_t *) &lenx, sizeof(uint16_t)) != sizeof(uint16_t)) return -1; /*endif*/ /* If we got this far, the actual message chunk should be guaranteed to be available */ if (lenx == 0) return 0; /*endif*/ if ((int) lenx > len) { len = queue_read(s, buf, len); /* Discard the rest of the message */ queue_read(s, NULL, lenx - len); return len; } /*endif*/ return queue_read(s, buf, lenx); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) queue_write_msg(queue_state_t *s, const uint8_t *buf, int len) { int real_len; int to_end; int new_iptr; int iptr; int optr; uint16_t lenx; /* Snapshot the values (although only optr should be changeable during this processing) */ iptr = s->iptr; optr = s->optr; if ((real_len = optr - iptr - 1) < 0) real_len += s->len; /*endif*/ if (real_len < len + (int) sizeof(uint16_t)) return -1; /*endif*/ real_len = len + (int) sizeof(uint16_t); to_end = s->len - iptr; lenx = (uint16_t) len; if (iptr < optr || to_end >= real_len) { /* A one step process */ memcpy(s->data + iptr, &lenx, sizeof(uint16_t)); memcpy(s->data + iptr + sizeof(uint16_t), buf, len); new_iptr = iptr + real_len; if (new_iptr >= s->len) new_iptr = 0; /*endif*/ } else { /* A two step process */ if (to_end >= sizeof(uint16_t)) { /* The actual message wraps around the end of the buffer */ memcpy(s->data + iptr, &lenx, sizeof(uint16_t)); memcpy(s->data + iptr + sizeof(uint16_t), buf, to_end - sizeof(uint16_t)); memcpy(s->data, buf + to_end - sizeof(uint16_t), real_len - to_end); } else { /* The message length wraps around the end of the buffer */ memcpy(s->data + iptr, (uint8_t *) &lenx, to_end); memcpy(s->data, ((uint8_t *) &lenx) + to_end, sizeof(uint16_t) - to_end); memcpy(s->data + sizeof(uint16_t) - to_end, buf, len); } new_iptr = real_len - to_end; } /*endif*/ /* Only change the pointer now we have really finished */ s->iptr = new_iptr; return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(queue_state_t *) queue_init(queue_state_t *s, int len, int flags) { if (s == NULL) { if ((s = (queue_state_t *) malloc(sizeof(*s) + len + 1)) == NULL) return NULL; } s->iptr = s->optr = 0; s->flags = flags; s->len = len + 1; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) queue_release(queue_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) queue_free(queue_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/lpc10_encode.c0000664000175000017500000002611311422612262013300 00000000000000/* * SpanDSP - a series of DSP components for telephony * * lpc10_encode.c - LPC10 low bit rate speech codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * This code is based on the U.S. Department of Defense reference * implementation of the LPC-10 2400 bps Voice Coder. They do not * exert copyright claims on their code, and it may be freely used. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/dc_restore.h" #include "spandsp/lpc10.h" #include "spandsp/private/lpc10.h" #include "lpc10_encdecs.h" static void lpc10_pack(lpc10_encode_state_t *s, uint8_t ibits[], lpc10_frame_t *t) { static const int iblist[53] = { 13, 12, 11, 1, 2, 13, 12, 11, 1, 2, 13, 10, 11, 2, 1, 10, 13, 12, 11, 10, 2, 13, 12, 11, 10, 2, 1, 12, 7, 6, 1, 10, 9, 8, 7, 4, 6, 9, 8, 7, 5, 1, 9, 8, 4, 6, 1, 5, 9, 8, 7, 5, 6 }; int32_t itab[13]; int x; int i; /* ibits is 54 bits of LPC data ordered as follows: */ /* R1-0, R2-0, R3-0, P-0, A-0, */ /* R1-1, R2-1, R3-1, P-1, A-1, */ /* R1-2, R4-0, R3-2, A-2, P-2, R4-1, */ /* R1-3, R2-2, R3-3, R4-2, A-3, */ /* R1-4, R2-3, R3-4, R4-3, A-4, */ /* P-3, R2-4, R7-0, R8-0, P-4, R4-4, */ /* R5-0, R6-0, R7-1,R10-0, R8-1, */ /* R5-1, R6-1, R7-2, R9-0, P-5, */ /* R5-2, R6-2,R10-1, R8-2, P-6, R9-1, */ /* R5-3, R6-3, R7-3, R9-2, R8-3, SYNC */ itab[0] = t->ipitch; itab[1] = t->irms; itab[2] = 0; for (i = 0; i < LPC10_ORDER; i++) itab[i + 3] = t->irc[LPC10_ORDER - 1 - i] & 0x7FFF; /* Put 54 bits into the output buffer */ x = 0; for (i = 0; i < 53; i++) { x = (x << 1) | (itab[iblist[i] - 1] & 1); if ((i & 7) == 7) ibits[i >> 3] = (uint8_t) (x & 0xFF); itab[iblist[i] - 1] >>= 1; } x = (x << 1) | (s->isync & 1); s->isync ^= 1; x <<= 2; ibits[6] = (uint8_t) (x & 0xFF); } /*- End of function --------------------------------------------------------*/ /* Quantize LPC parameters for transmission */ static int encode(lpc10_encode_state_t *s, lpc10_frame_t *t, int32_t *voice, int32_t pitch, float rms, float *rc) { static const int32_t enctab[16] = { 0, 7, 11, 12, 13, 10, 6, 1, 14, 9, 5, 2, 3, 4, 8, 15 }; static const int32_t entau[60] = { 19, 11, 27, 25, 29, 21, 23, 22, 30, 14, 15, 7, 39, 38, 46, 42, 43, 41, 45, 37, 53, 49, 51, 50, 54, 52, 60, 56, 58, 26, 90, 88, 92, 84, 86, 82, 83, 81, 85, 69, 77, 73, 75, 74, 78, 70, 71, 67, 99, 97, 113, 112, 114, 98, 106, 104, 108, 100, 101, 76 }; static const int32_t enadd[8] = { 1920, -768, 2432, 1280, 3584, 1536, 2816, -1152 }; static const float enscl[8] = { 0.0204f, 0.0167f, 0.0145f, 0.0147f, 0.0143f, 0.0135f, 0.0125f, 0.0112f }; static const int32_t enbits[8] = { 6, 5, 4, 4, 4, 4, 3, 3 }; static const int32_t entab6[64] = { 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 13, 14, 15 }; static const int32_t rmst[64] = { 1024, 936, 856, 784, 718, 656, 600, 550, 502, 460, 420, 384, 352, 328, 294, 270, 246, 226, 206, 188, 172, 158, 144, 132, 120, 110, 102, 92, 84, 78, 70, 64, 60, 54, 50, 46, 42, 38, 34, 32, 30, 26, 24, 22, 20, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 }; int32_t idel; int32_t nbit; int32_t i; int32_t j; int32_t i2; int32_t i3; int32_t mrk; /* Scale RMS and RC's to int32_ts */ t->irms = (int32_t) rms; for (i = 0; i < LPC10_ORDER; i++) t->irc[i] = (int32_t) (rc[i]*32768.0f); if (voice[0] != 0 && voice[1] != 0) { t->ipitch = entau[pitch - 1]; } else { if (s->error_correction) { t->ipitch = 0; if (voice[0] != voice[1]) t->ipitch = 127; } else { t->ipitch = (voice[0] << 1) + voice[1]; } } /* Encode RMS by binary table search */ j = 32; idel = 16; t->irms = min(t->irms, 1023); while (idel > 0) { if (t->irms > rmst[j - 1]) j -= idel; if (t->irms < rmst[j - 1]) j += idel; idel /= 2; } if (t->irms > rmst[j - 1]) --j; t->irms = 31 - j/2; /* Encode RC(1) and (2) as log-area-ratios */ for (i = 0; i < 2; i++) { i2 = t->irc[i]; mrk = 0; if (i2 < 0) { i2 = -i2; mrk = 1; } i2 = min(i2/512, 63); i2 = entab6[i2]; if (mrk != 0) i2 = -i2; t->irc[i] = i2; } /* Encode RC(3) - (10) linearly, remove bias then scale */ for (i = 2; i < LPC10_ORDER; i++) { i2 = (int32_t) ((t->irc[i]/2 + enadd[LPC10_ORDER - 1 - i])*enscl[LPC10_ORDER - 1 - i]); i2 = max(i2, -127); i2 = min(i2, 127); nbit = enbits[LPC10_ORDER - 1 - i]; i3 = (i2 < 0); i2 /= pow_ii(2, nbit); if (i3) i2--; t->irc[i] = i2; } /* Protect the most significant bits of the most important parameters during non-voiced frames. RC(1) - RC(4) are protected using 20 parity bits replacing RC(5) - RC(10). */ if (s->error_correction) { if (t->ipitch == 0 || t->ipitch == 127) { t->irc[4] = enctab[(t->irc[0] & 0x1E) >> 1]; t->irc[5] = enctab[(t->irc[1] & 0x1E) >> 1]; t->irc[6] = enctab[(t->irc[2] & 0x1E) >> 1]; t->irc[7] = enctab[(t->irms & 0x1E) >> 1]; t->irc[8] = enctab[(t->irc[3] & 0x1E) >> 1] >> 1; t->irc[9] = enctab[(t->irc[3] & 0x1E) >> 1] & 1; } } return 0; } /*- End of function --------------------------------------------------------*/ static void high_pass_100hz(lpc10_encode_state_t *s, float speech[], int start, int len) { float si; float err; int i; /* 100 Hz high pass filter */ for (i = start; i < len; i++) { si = speech[i]; err = si + s->z11*1.859076f - s->z21*0.8648249f; si = err - s->z11*2.0f + s->z21; s->z21 = s->z11; s->z11 = err; err = si + s->z12*1.935715f - s->z22*0.9417004f; si = err - s->z12*2.0f + s->z22; s->z22 = s->z12; s->z12 = err; speech[i] = si*0.902428f; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(lpc10_encode_state_t *) lpc10_encode_init(lpc10_encode_state_t *s, int error_correction) { int i; int j; if (s == NULL) { if ((s = (lpc10_encode_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } s->error_correction = error_correction; /* State used only by function high_pass_100hz */ s->z11 = 0.0f; s->z21 = 0.0f; s->z12 = 0.0f; s->z22 = 0.0f; /* State used by function lpc10_analyse */ for (i = 0; i < 540; i++) { s->inbuf[i] = 0.0f; s->pebuf[i] = 0.0f; } for (i = 0; i < 696; i++) s->lpbuf[i] = 0.0f; for (i = 0; i < 312; i++) s->ivbuf[i] = 0.0f; s->bias = 0.0f; s->osptr = 1; for (i = 0; i < 3; i++) s->obound[i] = 0; s->vwin[2][0] = 307; s->vwin[2][1] = 462; s->awin[2][0] = 307; s->awin[2][1] = 462; for (i = 0; i < 4; i++) { s->voibuf[i][0] = 0; s->voibuf[i][1] = 0; } for (i = 0; i < 3; i++) s->rmsbuf[i] = 0.0f; for (i = 0; i < 3; i++) { for (j = 0; j < 10; j++) s->rcbuf[i][j] = 0.0f; } s->zpre = 0.0f; /* State used by function onset */ s->n = 0.0f; s->d__ = 1.0f; for (i = 0; i < 16; i++) s->l2buf[i] = 0.0f; s->l2sum1 = 0.0f; s->l2ptr1 = 1; s->l2ptr2 = 9; s->hyst = FALSE; /* State used by function lpc10_voicing */ s->dither = 20.0f; s->maxmin = 0.0f; for (i = 0; i < 3; i++) { s->voice[i][0] = 0.0f; s->voice[i][1] = 0.0f; } s->lbve = 3000; s->fbve = 3000; s->fbue = 187; s->ofbue = 187; s->sfbue = 187; s->lbue = 93; s->olbue = 93; s->slbue = 93; s->snr = (float) (s->fbve / s->fbue << 6); /* State used by function dynamic_pitch_tracking */ for (i = 0; i < 60; i++) s->s[i] = 0.0f; for (i = 0; i < 2; i++) { for (j = 0; j < 60; j++) s->p[i][j] = 0; } s->ipoint = 0; s->alphax = 0.0f; /* State used by function lpc10_pack */ s->isync = 0; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) lpc10_encode_release(lpc10_encode_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) lpc10_encode_free(lpc10_encode_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) lpc10_encode(lpc10_encode_state_t *s, uint8_t code[], const int16_t amp[], int len) { int32_t voice[2]; int32_t pitch; float speech[LPC10_SAMPLES_PER_FRAME]; float rc[LPC10_ORDER]; float rms; lpc10_frame_t frame; int i; int j; len /= LPC10_SAMPLES_PER_FRAME; for (i = 0; i < len; i++) { for (j = 0; j < LPC10_SAMPLES_PER_FRAME; j++) speech[j] = (float) amp[i*LPC10_SAMPLES_PER_FRAME + j]/32768.0f; high_pass_100hz(s, speech, 0, LPC10_SAMPLES_PER_FRAME); lpc10_analyse(s, speech, voice, &pitch, &rms, rc); encode(s, &frame, voice, pitch, rms, rc); lpc10_pack(s, &code[7*i], &frame); } return len*7; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/bit_operations.c0000664000175000017500000001325211422612261014064 00000000000000/* * SpanDSP - a series of DSP components for telephony * * bit_operations.c - Various bit level operations, such as bit reversal * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include "spandsp/telephony.h" #include "spandsp/bit_operations.h" SPAN_DECLARE(uint16_t) bit_reverse16(uint16_t x) { x = (x >> 8) | (x << 8); x = ((x & 0xF0F0) >> 4) | ((x & 0x0F0F) << 4); x = ((x & 0xCCCC) >> 2) | ((x & 0x3333) << 2); return ((x & 0xAAAA) >> 1) | ((x & 0x5555) << 1); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(uint32_t) bit_reverse32(uint32_t x) { x = (x >> 16) | (x << 16); x = ((x & 0xFF00FF00) >> 8) | ((x & 0x00FF00FF) << 8); x = ((x & 0xF0F0F0F0) >> 4) | ((x & 0x0F0F0F0F) << 4); x = ((x & 0xCCCCCCCC) >> 2) | ((x & 0x33333333) << 2); return ((x & 0xAAAAAAAA) >> 1) | ((x & 0x55555555) << 1); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(uint32_t) bit_reverse_4bytes(uint32_t x) { x = ((x & 0xF0F0F0F0) >> 4) | ((x & 0x0F0F0F0F) << 4); x = ((x & 0xCCCCCCCC) >> 2) | ((x & 0x33333333) << 2); return ((x & 0xAAAAAAAA) >> 1) | ((x & 0x55555555) << 1); } /*- End of function --------------------------------------------------------*/ #if defined(__x86_64__) SPAN_DECLARE(uint64_t) bit_reverse_8bytes(uint64_t x) { x = ((x & 0xF0F0F0F0F0F0F0F0LLU) >> 4) | ((x & 0x0F0F0F0F0F0F0F0FLLU) << 4); x = ((x & 0xCCCCCCCCCCCCCCCCLLU) >> 2) | ((x & 0x3333333333333333LLU) << 2); return ((x & 0xAAAAAAAAAAAAAAAALLU) >> 1) | ((x & 0x5555555555555555LLU) << 1); } /*- End of function --------------------------------------------------------*/ #endif SPAN_DECLARE(void) bit_reverse(uint8_t to[], const uint8_t from[], int len) { #if defined(SPANDSP_MISALIGNED_ACCESS_FAILS) int i; #else const uint8_t *y1; uint8_t *z1; const uint32_t *y4; uint32_t *z4; uint32_t x4; #if defined(__x86_64__) const uint64_t *y8; uint64_t *z8; uint64_t x8; #endif #endif #if defined(SPANDSP_MISALIGNED_ACCESS_FAILS) /* This code works byte by byte, so it works on machines where misalignment is either desperately slow (its a bit slow on practically any machine, but some machines make it desparately slow) or fails. */ for (i = 0; i < len; i++) to[i] = bit_reverse8(from[i]); #else /* This code is this is based on the woolly assumption that the start of the buffers is memory aligned. If it isn't, the routine will be less efficient on some machines, but might not work at all on others. */ #if defined(__x86_64__) y8 = (const uint64_t *) from; z8 = (uint64_t *) to; while (len >= sizeof(uint64_t)) { x8 = *y8++; x8 = ((x8 & 0xF0F0F0F0F0F0F0F0LLU) >> 4) | ((x8 & 0x0F0F0F0F0F0F0F0FLLU) << 4); x8 = ((x8 & 0xCCCCCCCCCCCCCCCCLLU) >> 2) | ((x8 & 0x3333333333333333LLU) << 2); *z8++ = ((x8 & 0xAAAAAAAAAAAAAAAALLU) >> 1) | ((x8 & 0x5555555555555555LLU) << 1); len -= sizeof(uint64_t); } y4 = (const uint32_t *) y8; z4 = (uint32_t *) z8; #else y4 = (const uint32_t *) from; z4 = (uint32_t *) to; #endif while (len >= sizeof(uint32_t)) { x4 = *y4++; x4 = ((x4 & 0xF0F0F0F0) >> 4) | ((x4 & 0x0F0F0F0F) << 4); x4 = ((x4 & 0xCCCCCCCC) >> 2) | ((x4 & 0x33333333) << 2); *z4++ = ((x4 & 0xAAAAAAAA) >> 1) | ((x4 & 0x55555555) << 1); len -= sizeof(uint32_t); } y1 = (const uint8_t *) y4; z1 = (uint8_t *) z4; while (len-- > 0) *z1++ = bit_reverse8(*y1++); #endif } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) one_bits32(uint32_t x) { x = x - ((x >> 1) & 0x55555555); /* We now have 16 2-bit counts */ x = (x & 0x33333333) + ((x >> 2) & 0x33333333); /* We now have 8 4-bit counts */ x = (x + (x >> 4)) & 0x0F0F0F0F; /* We now have 4 8-bit counts */ #if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__powerpc__) /* If multiply is fast */ return (x*0x01010101) >> 24; #else /* If multiply is slow */ x += (x >> 8); x += (x >> 16); return (x & 0x0000003F); #endif } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(uint32_t) make_mask32(uint32_t x) { x |= (x >> 1); x |= (x >> 2); x |= (x >> 4); x |= (x >> 8); x |= (x >> 16); return x; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(uint16_t) make_mask16(uint16_t x) { x |= (x >> 1); x |= (x >> 2); x |= (x >> 4); x |= (x >> 8); return x; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/super_tone_rx.c0000664000175000017500000003741612101217764013753 00000000000000/* * SpanDSP - a series of DSP components for telephony * * super_tone_rx.c - Flexible telephony supervisory tone detection. * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/complex.h" #include "spandsp/vector_float.h" #include "spandsp/complex_vector_float.h" #include "spandsp/tone_detect.h" #include "spandsp/tone_generate.h" #include "spandsp/super_tone_rx.h" #include "spandsp/private/super_tone_rx.h" #if defined(SPANDSP_USE_FIXED_POINT) #define DETECTION_THRESHOLD 16439 /* -42dBm0 [((SUPER_TONE_BINS*SUPER_TONE_BINS*32768.0/(1.4142*128.0))*10^((-42 - DBM0_MAX_SINE_POWER)/20.0))^2] */ #define TONE_TWIST 4 /* 6dB */ #define TONE_TO_TOTAL_ENERGY 64 /* -3dB */ #else #define DETECTION_THRESHOLD 2104205.6f /* -42dBm0 [((SUPER_TONE_BINS*SUPER_TONE_BINS*32768.0/1.4142)*10^((-42 - DBM0_MAX_SINE_POWER)/20.0))^2] */ #define TONE_TWIST 3.981f /* 6dB */ #define TONE_TO_TOTAL_ENERGY 1.995f /* 3dB */ #endif static int add_super_tone_freq(super_tone_rx_descriptor_t *desc, int freq) { int i; if (freq == 0) return -1; /* Look for an existing frequency */ for (i = 0; i < desc->used_frequencies; i++) { if (desc->pitches[i][0] == freq) return desc->pitches[i][1]; } /* Look for an existing tone which is very close. We may need to merge the detectors. */ for (i = 0; i < desc->used_frequencies; i++) { if ((desc->pitches[i][0] - 10) <= freq && freq <= (desc->pitches[i][0] + 10)) { /* Merge these two */ desc->pitches[desc->used_frequencies][0] = freq; desc->pitches[desc->used_frequencies][1] = i; make_goertzel_descriptor(&desc->desc[desc->pitches[i][1]], (float) (freq + desc->pitches[i][0])/2, SUPER_TONE_BINS); desc->used_frequencies++; return desc->pitches[i][1]; } } desc->pitches[i][0] = freq; desc->pitches[i][1] = desc->monitored_frequencies; if (desc->monitored_frequencies%5 == 0) { desc->desc = (goertzel_descriptor_t *) realloc(desc->desc, (desc->monitored_frequencies + 5)*sizeof(goertzel_descriptor_t)); } make_goertzel_descriptor(&desc->desc[desc->monitored_frequencies++], (float) freq, SUPER_TONE_BINS); desc->used_frequencies++; return desc->pitches[i][1]; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) super_tone_rx_add_tone(super_tone_rx_descriptor_t *desc) { if (desc->tones%5 == 0) { desc->tone_list = (super_tone_rx_segment_t **) realloc(desc->tone_list, (desc->tones + 5)*sizeof(super_tone_rx_segment_t *)); desc->tone_segs = (int *) realloc(desc->tone_segs, (desc->tones + 5)*sizeof(int)); } desc->tone_list[desc->tones] = NULL; desc->tone_segs[desc->tones] = 0; desc->tones++; return desc->tones - 1; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) super_tone_rx_add_element(super_tone_rx_descriptor_t *desc, int tone, int f1, int f2, int min, int max) { int step; step = desc->tone_segs[tone]; if (step%5 == 0) { desc->tone_list[tone] = (super_tone_rx_segment_t *) realloc(desc->tone_list[tone], (step + 5)*sizeof(super_tone_rx_segment_t)); } desc->tone_list[tone][step].f1 = add_super_tone_freq(desc, f1); desc->tone_list[tone][step].f2 = add_super_tone_freq(desc, f2); desc->tone_list[tone][step].min_duration = min*8; desc->tone_list[tone][step].max_duration = (max == 0) ? 0x7FFFFFFF : max*8; desc->tone_segs[tone]++; return step; } /*- End of function --------------------------------------------------------*/ static int test_cadence(super_tone_rx_segment_t *pattern, int steps, super_tone_rx_segment_t *test, int rotation) { int i; int j; if (rotation >= 0) { /* Check only for the sustaining of a tone in progress. This means we only need to check each block if the latest step is compatible with the tone template. */ if (steps < 0) { /* A -ve value for steps indicates we just changed step, and need to check the last one ended within spec. If we don't do this extra test a low duration segment might be accepted as OK. */ steps = -steps; j = (rotation + steps - 2)%steps; if (pattern[j].f1 != test[8].f1 || pattern[j].f2 != test[8].f2) return 0; if (pattern[j].min_duration > test[8].min_duration*SUPER_TONE_BINS || pattern[j].max_duration < test[8].min_duration*SUPER_TONE_BINS) { return 0; } } j = (rotation + steps - 1)%steps; if (pattern[j].f1 != test[9].f1 || pattern[j].f2 != test[9].f2) return 0; if (pattern[j].max_duration < test[9].min_duration*SUPER_TONE_BINS) return 0; } else { /* Look for a complete template match. */ for (i = 0; i < steps; i++) { j = i + 10 - steps; if (pattern[i].f1 != test[j].f1 || pattern[i].f2 != test[j].f2) return 0; if (pattern[i].min_duration > test[j].min_duration*SUPER_TONE_BINS || pattern[i].max_duration < test[j].min_duration*SUPER_TONE_BINS) { return 0; } } } return 1; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(super_tone_rx_descriptor_t *) super_tone_rx_make_descriptor(super_tone_rx_descriptor_t *desc) { if (desc == NULL) { if ((desc = (super_tone_rx_descriptor_t *) malloc(sizeof(*desc))) == NULL) return NULL; } desc->tone_list = NULL; desc->tone_segs = NULL; desc->used_frequencies = 0; desc->monitored_frequencies = 0; desc->desc = NULL; desc->tones = 0; return desc; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) super_tone_rx_free_descriptor(super_tone_rx_descriptor_t *desc) { int i; if (desc) { for (i = 0; i < desc->tones; i++) { if (desc->tone_list[i]) free(desc->tone_list[i]); } if (desc->tone_list) free(desc->tone_list); if (desc->tone_segs) free(desc->tone_segs); if (desc->desc) free(desc->desc); free(desc); } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) super_tone_rx_tone_callback(super_tone_rx_state_t *s, tone_report_func_t callback, void *user_data) { s->tone_callback = callback; s->callback_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) super_tone_rx_segment_callback(super_tone_rx_state_t *s, tone_segment_func_t callback) { s->segment_callback = callback; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(super_tone_rx_state_t *) super_tone_rx_init(super_tone_rx_state_t *s, super_tone_rx_descriptor_t *desc, tone_report_func_t callback, void *user_data) { int i; if (desc == NULL) return NULL; if (callback == NULL) return NULL; if (s == NULL) { if ((s = (super_tone_rx_state_t *) malloc(sizeof(*s) + desc->monitored_frequencies*sizeof(goertzel_state_t))) == NULL) return NULL; } for (i = 0; i < 11; i++) { s->segments[i].f1 = -1; s->segments[i].f2 = -1; s->segments[i].min_duration = 0; } s->segment_callback = NULL; s->tone_callback = callback; s->callback_data = user_data; if (desc) s->desc = desc; s->detected_tone = -1; #if defined(SPANDSP_USE_FIXED_POINT) s->energy = 0; #else s->energy = 0.0f; #endif for (i = 0; i < desc->monitored_frequencies; i++) goertzel_init(&s->state[i], &s->desc->desc[i]); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) super_tone_rx_release(super_tone_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) super_tone_rx_free(super_tone_rx_state_t *s) { if (s) free(s); return 0; } /*- End of function --------------------------------------------------------*/ static void super_tone_chunk(super_tone_rx_state_t *s) { int i; int j; int k1; int k2; #if defined(SPANDSP_USE_FIXED_POINT) int32_t res[SUPER_TONE_BINS/2]; #else float res[SUPER_TONE_BINS/2]; #endif for (i = 0; i < s->desc->monitored_frequencies; i++) res[i] = goertzel_result(&s->state[i]); /* Find our two best monitored frequencies, which also have adequate energy. */ if (s->energy < DETECTION_THRESHOLD) { k1 = -1; k2 = -1; } else { if (res[0] > res[1]) { k1 = 0; k2 = 1; } else { k1 = 1; k2 = 0; } for (j = 2; j < s->desc->monitored_frequencies; j++) { if (res[j] >= res[k1]) { k2 = k1; k1 = j; } else if (res[j] >= res[k2]) { k2 = j; } } if ((res[k1] + res[k2]) < TONE_TO_TOTAL_ENERGY*s->energy) { k1 = -1; k2 = -1; } else if (res[k1] > TONE_TWIST*res[k2]) { k2 = -1; } else if (k2 < k1) { j = k1; k1 = k2; k2 = j; } } /* See if this differs from last time. */ if (k1 != s->segments[10].f1 || k2 != s->segments[10].f2) { /* It is different, but this might just be a transitional quirk, or a one shot hiccup (eg due to noise). Only if this same thing is seen a second time should we change state. */ s->segments[10].f1 = k1; s->segments[10].f2 = k2; /* While things are hopping around, consider this a continuance of the previous state. */ s->segments[9].min_duration++; } else { if (k1 != s->segments[9].f1 || k2 != s->segments[9].f2) { if (s->detected_tone >= 0) { /* Test for the continuance of the existing tone pattern, based on our new knowledge of an entire segment length. */ if (!test_cadence(s->desc->tone_list[s->detected_tone], -s->desc->tone_segs[s->detected_tone], s->segments, s->rotation++)) { s->detected_tone = -1; s->tone_callback(s->callback_data, s->detected_tone, -10, 0); } } if (s->segment_callback) { s->segment_callback(s->callback_data, s->segments[9].f1, s->segments[9].f2, s->segments[9].min_duration*SUPER_TONE_BINS/8); } memcpy (&s->segments[0], &s->segments[1], 9*sizeof(s->segments[0])); s->segments[9].f1 = k1; s->segments[9].f2 = k2; s->segments[9].min_duration = 1; } else { /* This is a continuance of the previous state */ if (s->detected_tone >= 0) { /* Test for the continuance of the existing tone pattern. We must do this here, so we can sense the discontinuance of the tone on an excessively long segment. */ if (!test_cadence(s->desc->tone_list[s->detected_tone], s->desc->tone_segs[s->detected_tone], s->segments, s->rotation)) { s->detected_tone = -1; s->tone_callback(s->callback_data, s->detected_tone, -10, 0); } } s->segments[9].min_duration++; } } if (s->detected_tone < 0) { /* Test for the start of any of the monitored tone patterns */ for (j = 0; j < s->desc->tones; j++) { if (test_cadence(s->desc->tone_list[j], s->desc->tone_segs[j], s->segments, -1)) { s->detected_tone = j; s->rotation = 0; s->tone_callback(s->callback_data, s->detected_tone, -10, 0); break; } } } #if defined(SPANDSP_USE_FIXED_POINT) s->energy = 0; #else s->energy = 0.0f; #endif } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) super_tone_rx(super_tone_rx_state_t *s, const int16_t amp[], int samples) { int i; int x; int sample; #if defined(SPANDSP_USE_FIXED_POINT) int16_t xamp; #else float xamp; #endif x = 0; for (sample = 0; sample < samples; sample += x) { for (i = 0; i < s->desc->monitored_frequencies; i++) x = goertzel_update(&s->state[i], amp + sample, samples - sample); for (i = 0; i < x; i++) { xamp = goertzel_preadjust_amp(amp[sample + i]); #if defined(SPANDSP_USE_FIXED_POINT) s->energy += ((int32_t) xamp*xamp); #else s->energy += xamp*xamp; #endif } if (s->state[0].current_sample >= SUPER_TONE_BINS) { /* We have finished a Goertzel block. */ super_tone_chunk(s); #if defined(SPANDSP_USE_FIXED_POINT) s->energy = 0; #else s->energy = 0.0f; #endif } } return samples; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) super_tone_rx_fillin(super_tone_rx_state_t *s, int samples) { /* TODO: Roll the detector forward without a state change */ return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/mmx_sse_decs.h0000664000175000017500000000312411422612262013517 00000000000000/* * SpanDSP - a series of DSP components for telephony * * mmx_sse_decs.h - Pull in the appropriate systems headers for the MMX/SSE settings. * * Written by Steve Underwood * * Copyright (C) 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_MMX_SSE_DECS_H_) #define _MMX_SSE_DECS_H_ #if defined(SPANDSP_USE_MMX) #include #endif #if defined(SPANDSP_USE_SSE) #include #endif #if defined(SPANDSP_USE_SSE2) #include #endif #if defined(SPANDSP_USE_SSE3) #include #endif #if defined(SPANDSP_USE_SSSE3) #include #endif #if defined(SPANDSP_USE_SSE4_1) #include #endif #if defined(SPANDSP_USE_SSE4_2) #include #endif #if defined(SPANDSP_USE_SSE4A) #include #endif #if defined(SPANDSP_USE_SSE5) #include #endif #endif /*- End of include ---------------------------------------------------------*/ spandsp-0.0.6/src/t4_rx.c0000664000175000017500000013203412101170420012072 00000000000000//#define T4_STATE_DEBUGGING /* * SpanDSP - a series of DSP components for telephony * * t4_rx.c - ITU T.4 FAX image receive processing * * Written by Steve Underwood * * Copyright (C) 2003, 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * Much of this file is based on the T.4 and T.6 support in libtiff, which requires * the following notice in any derived source code: * * Copyright (c) 1990-1997 Sam Leffler * Copyright (c) 1991-1997 Silicon Graphics, Inc. * * Permission to use, copy, modify, distribute, and sell this software and * its documentation for any purpose is hereby granted without fee, provided * that (i) the above copyright notices and this permission notice appear in * all copies of the software and related documentation, and (ii) the names of * Sam Leffler and Silicon Graphics may not be used in any advertising or * publicity relating to the software without the specific, prior written * permission of Sam Leffler and Silicon Graphics. * * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. * * Decoder support is derived from code in Frank Cringle's viewfax program; * Copyright (C) 1990, 1995 Frank D. Cringle. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/bit_operations.h" #include "spandsp/async.h" #include "spandsp/timezone.h" #include "spandsp/t4_rx.h" #include "spandsp/t4_tx.h" #if defined(SPANDSP_SUPPORT_T85) #include "spandsp/t81_t82_arith_coding.h" #include "spandsp/t85.h" #endif #include "spandsp/t4_t6_decode.h" #include "spandsp/t4_t6_encode.h" #include "spandsp/version.h" #include "spandsp/private/logging.h" #if defined(SPANDSP_SUPPORT_T85) #include "spandsp/private/t81_t82_arith_coding.h" #include "spandsp/private/t85.h" #endif #include "spandsp/private/t4_t6_decode.h" #include "spandsp/private/t4_t6_encode.h" #include "spandsp/private/t4_rx.h" #include "spandsp/private/t4_tx.h" /*! The number of centimetres in one inch */ #define CM_PER_INCH 2.54f /*! The number of EOLs to expect at the end of a T.4 page */ #define EOLS_TO_END_ANY_RX_PAGE 6 /*! The number of EOLs to check at the end of a T.4 page */ #define EOLS_TO_END_T4_RX_PAGE 5 /*! The number of EOLs to check at the end of a T.6 page */ #define EOLS_TO_END_T6_RX_PAGE 2 #include "t4_t6_decode_states.h" #if defined(T4_STATE_DEBUGGING) static void STATE_TRACE(const char *format, ...) { va_list arg_ptr; va_start(arg_ptr, format); vprintf(format, arg_ptr); va_end(arg_ptr); } /*- End of function --------------------------------------------------------*/ #else #define STATE_TRACE(...) /**/ #endif #if defined(HAVE_LIBTIFF) static int set_tiff_directory_info(t4_rx_state_t *s) { time_t now; struct tm *tm; char buf[256 + 1]; uint16_t resunit; float x_resolution; float y_resolution; t4_tiff_state_t *t; t = &s->tiff; /* Prepare the directory entry fully before writing the image, or libtiff complains */ TIFFSetField(t->tiff_file, TIFFTAG_COMPRESSION, t->output_compression); if (t->output_compression == COMPRESSION_CCITT_T4) { TIFFSetField(t->tiff_file, TIFFTAG_T4OPTIONS, t->output_t4_options); TIFFSetField(t->tiff_file, TIFFTAG_FAXMODE, FAXMODE_CLASSF); } TIFFSetField(t->tiff_file, TIFFTAG_IMAGEWIDTH, s->image_width); TIFFSetField(t->tiff_file, TIFFTAG_BITSPERSAMPLE, 1); TIFFSetField(t->tiff_file, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); TIFFSetField(t->tiff_file, TIFFTAG_SAMPLESPERPIXEL, 1); if (t->output_compression == COMPRESSION_CCITT_T4 || t->output_compression == COMPRESSION_CCITT_T6) { TIFFSetField(t->tiff_file, TIFFTAG_ROWSPERSTRIP, -1L); } else { TIFFSetField(t->tiff_file, TIFFTAG_ROWSPERSTRIP, TIFFDefaultStripSize(t->tiff_file, 0)); } TIFFSetField(t->tiff_file, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); TIFFSetField(t->tiff_file, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE); TIFFSetField(t->tiff_file, TIFFTAG_FILLORDER, FILLORDER_LSB2MSB); x_resolution = s->x_resolution/100.0f; y_resolution = s->y_resolution/100.0f; /* Metric seems the sane thing to use in the 21st century, but a lot of lousy software gets FAX resolutions wrong, and more get it wrong using metric than using inches. */ #if 0 TIFFSetField(t->tiff_file, TIFFTAG_XRESOLUTION, x_resolution); TIFFSetField(t->tiff_file, TIFFTAG_YRESOLUTION, y_resolution); resunit = RESUNIT_CENTIMETER; TIFFSetField(t->tiff_file, TIFFTAG_RESOLUTIONUNIT, resunit); #else TIFFSetField(t->tiff_file, TIFFTAG_XRESOLUTION, floorf(x_resolution*CM_PER_INCH + 0.5f)); TIFFSetField(t->tiff_file, TIFFTAG_YRESOLUTION, floorf(y_resolution*CM_PER_INCH + 0.5f)); resunit = RESUNIT_INCH; TIFFSetField(t->tiff_file, TIFFTAG_RESOLUTIONUNIT, resunit); #endif /* TODO: add the version of spandsp */ TIFFSetField(t->tiff_file, TIFFTAG_SOFTWARE, "Spandsp " SPANDSP_RELEASE_DATETIME_STRING); if (gethostname(buf, sizeof(buf)) == 0) TIFFSetField(t->tiff_file, TIFFTAG_HOSTCOMPUTER, buf); #if defined(TIFFTAG_FAXDCS) if (t->metadata.dcs) TIFFSetField(t->tiff_file, TIFFTAG_FAXDCS, t->metadata.dcs); #endif if (t->metadata.sub_address) TIFFSetField(t->tiff_file, TIFFTAG_FAXSUBADDRESS, t->metadata.sub_address); if (t->metadata.far_ident) TIFFSetField(t->tiff_file, TIFFTAG_IMAGEDESCRIPTION, t->metadata.far_ident); if (t->metadata.vendor) TIFFSetField(t->tiff_file, TIFFTAG_MAKE, t->metadata.vendor); if (t->metadata.model) TIFFSetField(t->tiff_file, TIFFTAG_MODEL, t->metadata.model); time(&now); tm = localtime(&now); sprintf(buf, "%4d/%02d/%02d %02d:%02d:%02d", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); TIFFSetField(t->tiff_file, TIFFTAG_DATETIME, buf); TIFFSetField(t->tiff_file, TIFFTAG_FAXRECVTIME, now - s->page_start_time); TIFFSetField(t->tiff_file, TIFFTAG_IMAGELENGTH, s->image_length); /* Set the total pages to 1. For any one page document we will get this right. For multi-page documents we will need to come back and fill in the right answer when we know it. */ TIFFSetField(t->tiff_file, TIFFTAG_PAGENUMBER, s->current_page++, 1); s->tiff.pages_in_file = s->current_page; if (t->output_compression == COMPRESSION_CCITT_T4) { if (s->t4_t6_rx.bad_rows) { TIFFSetField(t->tiff_file, TIFFTAG_BADFAXLINES, s->t4_t6_rx.bad_rows); TIFFSetField(t->tiff_file, TIFFTAG_CLEANFAXDATA, CLEANFAXDATA_REGENERATED); TIFFSetField(t->tiff_file, TIFFTAG_CONSECUTIVEBADFAXLINES, s->t4_t6_rx.longest_bad_row_run); } else { TIFFSetField(t->tiff_file, TIFFTAG_CLEANFAXDATA, CLEANFAXDATA_CLEAN); } } TIFFSetField(t->tiff_file, TIFFTAG_IMAGEWIDTH, s->image_width); return 0; } /*- End of function --------------------------------------------------------*/ static int open_tiff_output_file(t4_rx_state_t *s, const char *file) { if ((s->tiff.tiff_file = TIFFOpen(file, "w")) == NULL) return -1; return 0; } /*- End of function --------------------------------------------------------*/ static void write_tiff_image(t4_rx_state_t *s) { /* Set up the TIFF directory info... */ set_tiff_directory_info(s); /* ..and then write the image... */ if (TIFFWriteEncodedStrip(s->tiff.tiff_file, 0, s->image_buffer, s->image_length*s->bytes_per_row) < 0) span_log(&s->logging, SPAN_LOG_WARNING, "%s: Error writing TIFF strip.\n", s->tiff.file); /* ...then the directory entry, and libtiff is happy. */ TIFFWriteDirectory(s->tiff.tiff_file); } /*- End of function --------------------------------------------------------*/ static int close_tiff_output_file(t4_rx_state_t *s) { int i; t4_tiff_state_t *t; t = &s->tiff; /* Perform any operations needed to tidy up a written TIFF file before closure. */ if (s->current_page > 1) { /* We need to edit the TIFF directories. Until now we did not know the total page count, so the TIFF file currently says one. Now we need to set the correct total page count associated with each page. */ for (i = 0; i < s->current_page; i++) { TIFFSetDirectory(t->tiff_file, (tdir_t) i); TIFFSetField(t->tiff_file, TIFFTAG_PAGENUMBER, i, s->current_page); TIFFWriteDirectory(t->tiff_file); } } TIFFClose(t->tiff_file); t->tiff_file = NULL; if (t->file) { /* Try not to leave a file behind, if we didn't receive any pages to put in it. */ if (s->current_page == 0) remove(t->file); free((char *) t->file); t->file = NULL; } return 0; } /*- End of function --------------------------------------------------------*/ #else static int set_tiff_directory_info(t4_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ static int get_tiff_directory_info(t4_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ static int test_tiff_directory_info(t4_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ static int open_tiff_input_file(t4_rx_state_t *s, const char *file) { return 0; } /*- End of function --------------------------------------------------------*/ static int read_tiff_image(t4_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ static int close_tiff_input_file(t4_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ static int open_tiff_output_file(t4_rx_state_t *s, const char *file) { return 0; } /*- End of function --------------------------------------------------------*/ static void write_tiff_image(t4_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ static int close_tiff_output_file(t4_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ #endif static void update_row_bit_info(t4_rx_state_t *s) { if (s->row_bits > s->max_row_bits) s->max_row_bits = s->row_bits; if (s->row_bits < s->min_row_bits) s->min_row_bits = s->row_bits; s->row_bits = 0; } /*- End of function --------------------------------------------------------*/ #if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__powerpc__) static __inline__ int run_length(unsigned int bits) { return 7 - top_bit(bits); } /*- End of function --------------------------------------------------------*/ #else static __inline__ int run_length(unsigned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0 - 0xFF */ }; return run_len[bits]; } /*- End of function --------------------------------------------------------*/ #endif static int free_buffers(t4_rx_state_t *s) { if (s->image_buffer) { free(s->image_buffer); s->image_buffer = NULL; s->image_buffer_size = 0; } if (s->cur_runs) { free(s->cur_runs); s->cur_runs = NULL; } if (s->ref_runs) { free(s->ref_runs); s->ref_runs = NULL; } if (s->row_buf) { free(s->row_buf); s->row_buf = NULL; } return 0; } /*- End of function --------------------------------------------------------*/ static __inline__ void add_run_to_row(t4_rx_state_t *s) { if (s->t4_t6_rx.run_length >= 0) { s->row_len += s->t4_t6_rx.run_length; /* Don't allow rows to grow too long, and overflow the buffers */ if (s->row_len <= s->image_width) s->cur_runs[s->t4_t6_rx.a_cursor++] = s->t4_t6_rx.run_length; } s->t4_t6_rx.run_length = 0; } /*- End of function --------------------------------------------------------*/ static int put_decoded_row(t4_rx_state_t *s) { static const int msbmask[9] = { 0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff }; uint8_t *t; uint32_t i; uint32_t *p; int fudge; int row_starts_at; int x; int j; if (s->t4_t6_rx.run_length) add_run_to_row(s); #if defined(T4_STATE_DEBUGGING) /* Dump the runs of black and white for analysis */ { int total; total = 0; for (x = 0; x < s->t4_t6_rx.b_cursor; x++) total += s->ref_runs[x]; printf("Ref (%d)", total); for (x = 0; x < s->t4_t6_rx.b_cursor; x++) printf(" %" PRIu32, s->ref_runs[x]); printf("\n"); total = 0; for (x = 0; x < s->t4_t6_rx.a_cursor; x++) total += s->cur_runs[x]; printf("Cur (%d)", total); for (x = 0; x < s->t4_t6_rx.a_cursor; x++) printf(" %" PRIu32, s->cur_runs[x]); printf("\n"); } #endif row_starts_at = s->image_size; /* Make sure there is enough room for another row */ if (s->image_size + s->bytes_per_row >= s->image_buffer_size) { if ((t = realloc(s->image_buffer, s->image_buffer_size + 100*s->bytes_per_row)) == NULL) return -1; s->image_buffer_size += 100*s->bytes_per_row; s->image_buffer = t; } if (s->row_len == s->image_width) { STATE_TRACE("%d Good row - %d %s\n", s->image_length, s->row_len, (s->row_is_2d) ? "2D" : "1D"); if (s->t4_t6_rx.curr_bad_row_run) { if (s->t4_t6_rx.curr_bad_row_run > s->t4_t6_rx.longest_bad_row_run) s->t4_t6_rx.longest_bad_row_run = s->t4_t6_rx.curr_bad_row_run; s->t4_t6_rx.curr_bad_row_run = 0; } /* Convert the runs to a bit image of the row */ /* White/black/white... runs, always starting with white. That means the first run could be zero length. */ for (x = 0, fudge = 0; x < s->t4_t6_rx.a_cursor; x++, fudge ^= 0xFF) { i = s->cur_runs[x]; if ((int) i >= s->tx_bits) { s->tx_bitstream = (s->tx_bitstream << s->tx_bits) | (msbmask[s->tx_bits] & fudge); for (i += (8 - s->tx_bits); i >= 8; i -= 8) { s->tx_bits = 8; s->image_buffer[s->image_size++] = (uint8_t) s->tx_bitstream; s->tx_bitstream = fudge; } } s->tx_bitstream = (s->tx_bitstream << i) | (msbmask[i] & fudge); s->tx_bits -= i; } s->image_length++; } else { STATE_TRACE("%d Bad row - %d %s\n", s->image_length, s->row_len, (s->row_is_2d) ? "2D" : "1D"); /* Try to clean up the bad runs, and produce something reasonable as the reference row for the next row. Use a copy of the previous good row as the actual current row. If the row only fell apart near the end, reusing it might be the best solution. */ for (j = 0, fudge = 0; j < s->t4_t6_rx.a_cursor && fudge < s->image_width; j++) fudge += s->cur_runs[j]; if (fudge < s->image_width) { /* Try to pad with white, and avoid black, to minimise mess on the image. */ if ((s->t4_t6_rx.a_cursor & 1)) { /* We currently finish in white. We could extend that, but it is probably of the right length. Changing it would only further mess up what happens in the next row. It seems better to add a black spot, and an extra white run. */ s->cur_runs[s->t4_t6_rx.a_cursor++] = 1; fudge++; if (fudge < s->image_width) s->cur_runs[s->t4_t6_rx.a_cursor++] = s->image_width - fudge; } else { /* We currently finish on black, so we add an extra white run to fill out the line. */ s->cur_runs[s->t4_t6_rx.a_cursor++] = s->image_width - fudge; } } else { /* Trim the last element to align with the proper image width */ s->cur_runs[s->t4_t6_rx.a_cursor] += (s->image_width - fudge); } /* Ensure there is a previous line to copy from. */ if (s->image_size != s->t4_t6_rx.last_row_starts_at) { /* Copy the previous row over this one */ memcpy(s->image_buffer + s->image_size, s->image_buffer + s->t4_t6_rx.last_row_starts_at, s->bytes_per_row); s->image_size += s->bytes_per_row; s->image_length++; } s->t4_t6_rx.bad_rows++; s->t4_t6_rx.curr_bad_row_run++; } /* Pad the row as it becomes the reference row, so there are no odd runs to pick up if we step off the end of the list. */ s->cur_runs[s->t4_t6_rx.a_cursor] = 0; s->cur_runs[s->t4_t6_rx.a_cursor + 1] = 0; /* Prepare the buffers for the next row. */ s->t4_t6_rx.last_row_starts_at = row_starts_at; /* Swap the buffers */ p = s->cur_runs; s->cur_runs = s->ref_runs; s->ref_runs = p; s->t4_t6_rx.b_cursor = 1; s->t4_t6_rx.a_cursor = 0; s->t4_t6_rx.b1 = s->ref_runs[0]; s->t4_t6_rx.a0 = 0; s->t4_t6_rx.run_length = 0; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_rx_end_page(t4_rx_state_t *s) { int row; int i; if (s->line_encoding == T4_COMPRESSION_ITU_T6) { /* Push enough zeros through the decoder to flush out any remaining codes */ for (i = 0; i < 13; i++) t4_rx_put_bit(s, 0); } if (s->t4_t6_rx.curr_bad_row_run) { if (s->t4_t6_rx.curr_bad_row_run > s->t4_t6_rx.longest_bad_row_run) s->t4_t6_rx.longest_bad_row_run = s->t4_t6_rx.curr_bad_row_run; s->t4_t6_rx.curr_bad_row_run = 0; } if (s->image_size == 0) return -1; if (s->t4_t6_rx.row_write_handler) { for (row = 0; row < s->image_length; row++) { if (s->t4_t6_rx.row_write_handler(s->t4_t6_rx.row_write_user_data, s->image_buffer + row*s->bytes_per_row, s->bytes_per_row) < 0) { span_log(&s->logging, SPAN_LOG_WARNING, "Write error at row %d.\n", row); break; } } /* Write a blank row to indicate the end of the image. */ if (s->t4_t6_rx.row_write_handler(s->t4_t6_rx.row_write_user_data, NULL, 0) < 0) span_log(&s->logging, SPAN_LOG_WARNING, "Write error at row %d.\n", row); } else { write_tiff_image(s); } s->t4_t6_rx.rx_bits = 0; s->t4_t6_rx.rx_skip_bits = 0; s->t4_t6_rx.rx_bitstream = 0; s->t4_t6_rx.consecutive_eols = EOLS_TO_END_ANY_RX_PAGE; s->image_size = 0; return 0; } /*- End of function --------------------------------------------------------*/ static __inline__ void drop_rx_bits(t4_rx_state_t *s, int bits) { /* Only remove one bit right now. The rest need to be removed step by step, checking for a misaligned EOL along the way. This is time consuming, but if we don't do it a single bit error can severely damage an image. */ s->row_bits += bits; s->t4_t6_rx.rx_skip_bits += (bits - 1); s->t4_t6_rx.rx_bits--; s->t4_t6_rx.rx_bitstream >>= 1; } /*- End of function --------------------------------------------------------*/ static __inline__ void force_drop_rx_bits(t4_rx_state_t *s, int bits) { /* This should only be called to drop the bits of an EOL, as that is the only place where it is safe to drop them all at once. */ s->row_bits += bits; s->t4_t6_rx.rx_skip_bits = 0; s->t4_t6_rx.rx_bits -= bits; s->t4_t6_rx.rx_bitstream >>= bits; } /*- End of function --------------------------------------------------------*/ static int rx_put_bits(t4_rx_state_t *s, uint32_t bit_string, int quantity) { int bits; int old_a0; /* We decompress bit by bit, as the data stream is received. We need to scan continuously for EOLs, so we might as well work this way. */ s->line_image_size += quantity; s->t4_t6_rx.rx_bitstream |= (bit_string << s->t4_t6_rx.rx_bits); /* The longest item we need to scan for is 13 bits long (a 2D EOL), so we need a minimum of 13 bits in the buffer to proceed with any bit stream analysis. */ if ((s->t4_t6_rx.rx_bits += quantity) < 13) return FALSE; if (s->t4_t6_rx.consecutive_eols) { /* Check if the image has already terminated. */ if (s->t4_t6_rx.consecutive_eols >= EOLS_TO_END_ANY_RX_PAGE) return TRUE; /* Check if the image hasn't even started. */ if (s->t4_t6_rx.consecutive_eols < 0) { /* We are waiting for the very first EOL (1D or 2D only). */ /* We need to take this bit by bit, as the EOL could be anywhere, and any junk could preceed it. */ while ((s->t4_t6_rx.rx_bitstream & 0xFFF) != 0x800) { s->t4_t6_rx.rx_bitstream >>= 1; if (--s->t4_t6_rx.rx_bits < 13) return FALSE; } /* We have an EOL, so now the page begins and we can proceed to process the bit stream as image data. */ s->t4_t6_rx.consecutive_eols = 0; if (s->line_encoding == T4_COMPRESSION_ITU_T4_1D) { s->row_is_2d = FALSE; force_drop_rx_bits(s, 12); } else { s->row_is_2d = !(s->t4_t6_rx.rx_bitstream & 0x1000); force_drop_rx_bits(s, 13); } } } while (s->t4_t6_rx.rx_bits >= 13) { /* We need to check for EOLs bit by bit through the whole stream. If we just try looking between code words, we will miss an EOL when a bit error has throw the code words completely out of step. The can mean recovery takes many lines, and the image gets really messed up. */ /* Although EOLs are not inserted at the end of each row of a T.6 image, they are still perfectly valid, and can terminate an image. */ if ((s->t4_t6_rx.rx_bitstream & 0x0FFF) == 0x0800) { STATE_TRACE("EOL\n"); if (s->row_len == 0) { /* A zero length row - i.e. 2 consecutive EOLs - is distinctly the end of page condition. That's all we actually get on a T.6 page. However, there are a minimum of 6 EOLs at the end of any T.4 page. We can look for more than 2 EOLs in case bit errors simulate the end of page condition at the wrong point. Such robust checking is irrelevant for a T.6 page, as it should be error free. */ /* Note that for a T.6 page we should get here on the very first EOL, as the row length should be zero at that point. Therefore we should count up both EOLs, unless there is some bogus partial row ahead of them. */ s->t4_t6_rx.consecutive_eols++; if (s->line_encoding == T4_COMPRESSION_ITU_T6) { if (s->t4_t6_rx.consecutive_eols >= EOLS_TO_END_T6_RX_PAGE) { s->t4_t6_rx.consecutive_eols = EOLS_TO_END_ANY_RX_PAGE; return TRUE; } } else { if (s->t4_t6_rx.consecutive_eols >= EOLS_TO_END_T4_RX_PAGE) { s->t4_t6_rx.consecutive_eols = EOLS_TO_END_ANY_RX_PAGE; return TRUE; } } } else { /* The EOLs are not back-to-back, so they are not part of the end of page condition. */ if (s->t4_t6_rx.run_length > 0) add_run_to_row(s); s->t4_t6_rx.consecutive_eols = 0; if (put_decoded_row(s)) return TRUE; update_row_bit_info(s); } if (s->line_encoding == T4_COMPRESSION_ITU_T4_2D) { s->row_is_2d = !(s->t4_t6_rx.rx_bitstream & 0x1000); force_drop_rx_bits(s, 13); } else { force_drop_rx_bits(s, 12); } s->t4_t6_rx.its_black = FALSE; s->t4_t6_rx.black_white = 0; s->t4_t6_rx.run_length = 0; s->row_len = 0; continue; } if (s->t4_t6_rx.rx_skip_bits) { /* We are clearing out the remaining bits of the last code word we absorbed. */ s->t4_t6_rx.rx_skip_bits--; s->t4_t6_rx.rx_bits--; s->t4_t6_rx.rx_bitstream >>= 1; continue; } if (s->row_is_2d && s->t4_t6_rx.black_white == 0) { bits = s->t4_t6_rx.rx_bitstream & 0x7F; STATE_TRACE("State %d, %d - ", t4_2d_table[bits].state, t4_2d_table[bits].width); if (s->row_len >= s->image_width) { drop_rx_bits(s, t4_2d_table[bits].width); continue; } if (s->t4_t6_rx.a_cursor) { /* Move past a0, always staying on the current colour */ for ( ; s->t4_t6_rx.b1 <= s->t4_t6_rx.a0; s->t4_t6_rx.b_cursor += 2) s->t4_t6_rx.b1 += (s->ref_runs[s->t4_t6_rx.b_cursor] + s->ref_runs[s->t4_t6_rx.b_cursor + 1]); } switch (t4_2d_table[bits].state) { case S_Horiz: STATE_TRACE("Horiz %d %d %d\n", s->image_width, s->t4_t6_rx.a0, s->t4_t6_rx.a_cursor); /* We now need to extract a white/black or black/white pair of runs, using the 1D method. If the first of the pair takes us exactly to the end of the row, there should still be a zero length element for the second of the pair. */ s->t4_t6_rx.its_black = s->t4_t6_rx.a_cursor & 1; s->t4_t6_rx.black_white = 2; break; case S_Vert: STATE_TRACE("Vert[%d] %d %d %d %d\n", t4_2d_table[bits].param, s->image_width, s->t4_t6_rx.a0, s->t4_t6_rx.b1, s->t4_t6_rx.run_length); old_a0 = s->t4_t6_rx.a0; s->t4_t6_rx.a0 = s->t4_t6_rx.b1 + t4_2d_table[bits].param; /* We need to check if a bad or malicious image is failing to move forward along the row. Going back is obviously bad. We also need to avoid a stall on the spot, except for the special case of the start of the row. Zero movement as the very first element in the row is perfectly normal. */ if (s->t4_t6_rx.a0 <= old_a0) { if (s->t4_t6_rx.a0 < old_a0 || s->t4_t6_rx.b_cursor > 1) { /* Undo the update we just started, and carry on as if this code does not exist */ /* TODO: we really should record that something wasn't right at this point. */ s->t4_t6_rx.a0 = old_a0; break; } } s->t4_t6_rx.run_length += (s->t4_t6_rx.a0 - old_a0); add_run_to_row(s); /* We need to move one step in one direction or the other, to change to the opposite colour */ if (t4_2d_table[bits].param >= 0) { s->t4_t6_rx.b1 += s->ref_runs[s->t4_t6_rx.b_cursor++]; } else { if (s->t4_t6_rx.b_cursor) s->t4_t6_rx.b1 -= s->ref_runs[--s->t4_t6_rx.b_cursor]; } break; case S_Pass: STATE_TRACE("Pass %d %d %d %d %d\n", s->image_width, s->t4_t6_rx.a0, s->t4_t6_rx.b1, s->ref_runs[s->t4_t6_rx.b_cursor], s->ref_runs[s->t4_t6_rx.b_cursor + 1]); s->t4_t6_rx.b1 += s->ref_runs[s->t4_t6_rx.b_cursor++]; old_a0 = s->t4_t6_rx.a0; s->t4_t6_rx.a0 = s->t4_t6_rx.b1; s->t4_t6_rx.run_length += (s->t4_t6_rx.a0 - old_a0); s->t4_t6_rx.b1 += s->ref_runs[s->t4_t6_rx.b_cursor++]; break; case S_Ext: /* We do not currently handle any kind of extension */ STATE_TRACE("Ext %d %d %d 0x%x\n", s->image_width, s->t4_t6_rx.a0, ((s->t4_t6_rx.rx_bitstream >> t4_2d_table[bits].width) & 0x7), s->t4_t6_rx.rx_bitstream); /* TODO: The uncompressed option should be implemented. */ break; case S_Null: STATE_TRACE("Null\n"); break; default: STATE_TRACE("Unexpected T.4 state\n"); span_log(&s->logging, SPAN_LOG_WARNING, "Unexpected T.4 state %d\n", t4_2d_table[bits].state); break; } drop_rx_bits(s, t4_2d_table[bits].width); } else { if (s->t4_t6_rx.its_black) { bits = s->t4_t6_rx.rx_bitstream & 0x1FFF; STATE_TRACE("State %d, %d - Black %d %d %d\n", t4_1d_black_table[bits].state, t4_1d_black_table[bits].width, s->image_width, s->t4_t6_rx.a0, t4_1d_black_table[bits].param); switch (t4_1d_black_table[bits].state) { case S_MakeUpB: case S_MakeUp: s->t4_t6_rx.run_length += t4_1d_black_table[bits].param; s->t4_t6_rx.a0 += t4_1d_black_table[bits].param; break; case S_TermB: s->t4_t6_rx.its_black = FALSE; if (s->row_len < s->image_width) { s->t4_t6_rx.run_length += t4_1d_black_table[bits].param; s->t4_t6_rx.a0 += t4_1d_black_table[bits].param; add_run_to_row(s); } if (s->t4_t6_rx.black_white) s->t4_t6_rx.black_white--; break; default: /* Bad black */ s->t4_t6_rx.black_white = 0; break; } drop_rx_bits(s, t4_1d_black_table[bits].width); } else { bits = s->t4_t6_rx.rx_bitstream & 0xFFF; STATE_TRACE("State %d, %d - White %d %d %d\n", t4_1d_white_table[bits].state, t4_1d_white_table[bits].width, s->image_width, s->t4_t6_rx.a0, t4_1d_white_table[bits].param); switch (t4_1d_white_table[bits].state) { case S_MakeUpW: case S_MakeUp: s->t4_t6_rx.run_length += t4_1d_white_table[bits].param; s->t4_t6_rx.a0 += t4_1d_white_table[bits].param; break; case S_TermW: s->t4_t6_rx.its_black = TRUE; if (s->row_len < s->image_width) { s->t4_t6_rx.run_length += t4_1d_white_table[bits].param; s->t4_t6_rx.a0 += t4_1d_white_table[bits].param; add_run_to_row(s); } if (s->t4_t6_rx.black_white) s->t4_t6_rx.black_white--; break; default: /* Bad white */ s->t4_t6_rx.black_white = 0; break; } drop_rx_bits(s, t4_1d_white_table[bits].width); } } if (s->t4_t6_rx.a0 >= s->image_width) s->t4_t6_rx.a0 = s->image_width - 1; if (s->line_encoding == T4_COMPRESSION_ITU_T6) { /* T.6 has no EOL markers. We sense the end of a line by its length alone. */ /* The last test here is a backstop protection, so a corrupt image cannot cause us to do bad things. Bad encoders have actually been seen, which demand such protection. */ if (s->t4_t6_rx.black_white == 0 && s->row_len >= s->image_width) { STATE_TRACE("EOL T.6\n"); if (s->t4_t6_rx.run_length > 0) add_run_to_row(s); update_row_bit_info(s); if (put_decoded_row(s)) return TRUE; s->t4_t6_rx.its_black = FALSE; s->t4_t6_rx.black_white = 0; s->t4_t6_rx.run_length = 0; s->row_len = 0; } } } return FALSE; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_rx_put_bit(t4_rx_state_t *s, int bit) { return rx_put_bits(s, bit & 1, 1); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_rx_put_byte(t4_rx_state_t *s, uint8_t byte) { return rx_put_bits(s, byte & 0xFF, 8); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_rx_put_chunk(t4_rx_state_t *s, const uint8_t buf[], int len) { int i; uint8_t byte; for (i = 0; i < len; i++) { byte = buf[i]; if (rx_put_bits(s, byte & 0xFF, 8)) return TRUE; } return FALSE; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_rx_set_row_write_handler(t4_rx_state_t *s, t4_row_write_handler_t handler, void *user_data) { s->t4_t6_rx.row_write_handler = handler; s->t4_t6_rx.row_write_user_data = user_data; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_rx_start_page(t4_rx_state_t *s) { int bytes_per_row; int run_space; uint32_t *bufptr; span_log(&s->logging, SPAN_LOG_FLOW, "Start rx page - compression %d\n", s->line_encoding); if (s->tiff.tiff_file == NULL) return -1; /* Calculate the scanline/tile width. */ bytes_per_row = (s->image_width + 7)/8; run_space = (s->image_width + 4)*sizeof(uint32_t); if (bytes_per_row != s->bytes_per_row) { /* Allocate the space required for decoding the new row length. */ s->bytes_per_row = bytes_per_row; if ((bufptr = (uint32_t *) realloc(s->cur_runs, run_space)) == NULL) return -1; s->cur_runs = bufptr; if ((bufptr = (uint32_t *) realloc(s->ref_runs, run_space)) == NULL) return -1; s->ref_runs = bufptr; } memset(s->cur_runs, 0, run_space); memset(s->ref_runs, 0, run_space); s->t4_t6_rx.rx_bits = 0; s->t4_t6_rx.rx_skip_bits = 0; s->t4_t6_rx.rx_bitstream = 0; s->row_bits = 0; s->min_row_bits = INT_MAX; s->max_row_bits = 0; s->row_is_2d = (s->line_encoding == T4_COMPRESSION_ITU_T6); /* We start at -1 EOLs for 1D and 2D decoding, as an indication we are waiting for the first EOL. T.6 coding starts without any preamble. */ s->t4_t6_rx.consecutive_eols = (s->line_encoding == T4_COMPRESSION_ITU_T6) ? 0 : -1; s->t4_t6_rx.bad_rows = 0; s->t4_t6_rx.longest_bad_row_run = 0; s->t4_t6_rx.curr_bad_row_run = 0; s->image_length = 0; s->tx_bitstream = 0; s->tx_bits = 8; s->image_size = 0; s->line_image_size = 0; s->t4_t6_rx.last_row_starts_at = 0; s->row_len = 0; s->t4_t6_rx.its_black = FALSE; s->t4_t6_rx.black_white = 0; /* Initialise the reference line to all white */ s->ref_runs[0] = s->image_width; s->t4_t6_rx.b_cursor = 1; s->t4_t6_rx.a_cursor = 0; s->t4_t6_rx.b1 = s->ref_runs[0]; s->t4_t6_rx.a0 = 0; s->t4_t6_rx.run_length = 0; time (&s->page_start_time); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t4_rx_set_rx_encoding(t4_rx_state_t *s, int encoding) { s->line_encoding = encoding; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t4_rx_set_image_width(t4_rx_state_t *s, int width) { s->image_width = width; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t4_rx_set_y_resolution(t4_rx_state_t *s, int resolution) { s->y_resolution = resolution; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t4_rx_set_x_resolution(t4_rx_state_t *s, int resolution) { s->x_resolution = resolution; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t4_rx_set_dcs(t4_rx_state_t *s, const char *dcs) { s->tiff.metadata.dcs = (dcs && dcs[0]) ? dcs : NULL; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t4_rx_set_sub_address(t4_rx_state_t *s, const char *sub_address) { s->tiff.metadata.sub_address = (sub_address && sub_address[0]) ? sub_address : NULL; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t4_rx_set_far_ident(t4_rx_state_t *s, const char *ident) { s->tiff.metadata.far_ident = (ident && ident[0]) ? ident : NULL; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t4_rx_set_vendor(t4_rx_state_t *s, const char *vendor) { s->tiff.metadata.vendor = vendor; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t4_rx_set_model(t4_rx_state_t *s, const char *model) { s->tiff.metadata.model = model; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t4_rx_get_transfer_statistics(t4_rx_state_t *s, t4_stats_t *t) { t->pages_transferred = s->current_page - s->tiff.start_page; t->pages_in_file = s->tiff.pages_in_file; t->width = s->image_width; t->length = s->image_length; t->bad_rows = s->t4_t6_rx.bad_rows; t->longest_bad_row_run = s->t4_t6_rx.longest_bad_row_run; t->x_resolution = s->x_resolution; t->y_resolution = s->y_resolution; t->encoding = s->line_encoding; t->line_image_size = s->line_image_size/8; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) t4_encoding_to_str(int encoding) { switch (encoding) { case T4_COMPRESSION_NONE: return "None"; case T4_COMPRESSION_ITU_T4_1D: return "T.4 1-D"; case T4_COMPRESSION_ITU_T4_2D: return "T.4 2-D"; case T4_COMPRESSION_ITU_T6: return "T.6"; case T4_COMPRESSION_ITU_T42: return "T.42"; case T4_COMPRESSION_ITU_SYCC_T42: return "sYCC T.42"; case T4_COMPRESSION_ITU_T43: return "T.43"; case T4_COMPRESSION_ITU_T45: return "T.45"; case T4_COMPRESSION_ITU_T85: return "T.85"; case T4_COMPRESSION_ITU_T85_L0: return "T.85(L0)"; } return "???"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(t4_rx_state_t *) t4_rx_init(t4_rx_state_t *s, const char *file, int output_encoding) { if (s == NULL) { if ((s = (t4_rx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "T.4"); s->rx = TRUE; span_log(&s->logging, SPAN_LOG_FLOW, "Start rx document\n"); if (open_tiff_output_file(s, file) < 0) return NULL; /* Save the file name for logging reports. */ s->tiff.file = strdup(file); /* Only provide for one form of coding throughout the file, even though the coding on the wire could change between pages. */ switch (output_encoding) { case T4_COMPRESSION_ITU_T4_1D: s->tiff.output_compression = COMPRESSION_CCITT_T4; s->tiff.output_t4_options = GROUP3OPT_FILLBITS; break; case T4_COMPRESSION_ITU_T4_2D: s->tiff.output_compression = COMPRESSION_CCITT_T4; s->tiff.output_t4_options = GROUP3OPT_FILLBITS | GROUP3OPT_2DENCODING; break; case T4_COMPRESSION_ITU_T6: s->tiff.output_compression = COMPRESSION_CCITT_T6; s->tiff.output_t4_options = 0; break; } /* Until we have a valid figure for the bytes per row, we need it to be set to a suitable value to ensure it will be seen as changing when the real value is used. */ s->bytes_per_row = 0; s->current_page = 0; s->tiff.pages_in_file = 0; s->tiff.start_page = 0; s->tiff.stop_page = INT_MAX; s->image_buffer = NULL; s->image_buffer_size = 0; /* Set some default values */ s->x_resolution = T4_X_RESOLUTION_R8; s->y_resolution = T4_Y_RESOLUTION_FINE; s->image_width = T4_WIDTH_R8_A4; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_rx_release(t4_rx_state_t *s) { if (!s->rx) return -1; if (s->tiff.tiff_file) close_tiff_output_file(s); free_buffers(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t4_rx_free(t4_rx_state_t *s) { int ret; ret = t4_rx_release(s); free(s); return ret; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/g711.c0000664000175000017500000001555511422612261011532 00000000000000/* * SpanDSP - a series of DSP components for telephony * * g711.c - A-law and u-law transcoding routines * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include "spandsp/telephony.h" #include "spandsp/bit_operations.h" #include "spandsp/g711.h" #include "spandsp/private/g711.h" /* Copied from the CCITT G.711 specification */ static const uint8_t ulaw_to_alaw_table[256] = { 42, 43, 40, 41, 46, 47, 44, 45, 34, 35, 32, 33, 38, 39, 36, 37, 58, 59, 56, 57, 62, 63, 60, 61, 50, 51, 48, 49, 54, 55, 52, 53, 10, 11, 8, 9, 14, 15, 12, 13, 2, 3, 0, 1, 6, 7, 4, 26, 27, 24, 25, 30, 31, 28, 29, 18, 19, 16, 17, 22, 23, 20, 21, 106, 104, 105, 110, 111, 108, 109, 98, 99, 96, 97, 102, 103, 100, 101, 122, 120, 126, 127, 124, 125, 114, 115, 112, 113, 118, 119, 116, 117, 75, 73, 79, 77, 66, 67, 64, 65, 70, 71, 68, 69, 90, 91, 88, 89, 94, 95, 92, 93, 82, 82, 83, 83, 80, 80, 81, 81, 86, 86, 87, 87, 84, 84, 85, 85, 170, 171, 168, 169, 174, 175, 172, 173, 162, 163, 160, 161, 166, 167, 164, 165, 186, 187, 184, 185, 190, 191, 188, 189, 178, 179, 176, 177, 182, 183, 180, 181, 138, 139, 136, 137, 142, 143, 140, 141, 130, 131, 128, 129, 134, 135, 132, 154, 155, 152, 153, 158, 159, 156, 157, 146, 147, 144, 145, 150, 151, 148, 149, 234, 232, 233, 238, 239, 236, 237, 226, 227, 224, 225, 230, 231, 228, 229, 250, 248, 254, 255, 252, 253, 242, 243, 240, 241, 246, 247, 244, 245, 203, 201, 207, 205, 194, 195, 192, 193, 198, 199, 196, 197, 218, 219, 216, 217, 222, 223, 220, 221, 210, 210, 211, 211, 208, 208, 209, 209, 214, 214, 215, 215, 212, 212, 213, 213 }; /* These transcoding tables are copied from the CCITT G.711 specification. To achieve optimal results, do not change them. */ static const uint8_t alaw_to_ulaw_table[256] = { 42, 43, 40, 41, 46, 47, 44, 45, 34, 35, 32, 33, 38, 39, 36, 37, 57, 58, 55, 56, 61, 62, 59, 60, 49, 50, 47, 48, 53, 54, 51, 52, 10, 11, 8, 9, 14, 15, 12, 13, 2, 3, 0, 1, 6, 7, 4, 5, 26, 27, 24, 25, 30, 31, 28, 29, 18, 19, 16, 17, 22, 23, 20, 21, 98, 99, 96, 97, 102, 103, 100, 101, 93, 93, 92, 92, 95, 95, 94, 94, 116, 118, 112, 114, 124, 126, 120, 122, 106, 107, 104, 105, 110, 111, 108, 109, 72, 73, 70, 71, 76, 77, 74, 75, 64, 65, 63, 63, 68, 69, 66, 67, 86, 87, 84, 85, 90, 91, 88, 89, 79, 79, 78, 78, 82, 83, 80, 81, 170, 171, 168, 169, 174, 175, 172, 173, 162, 163, 160, 161, 166, 167, 164, 165, 185, 186, 183, 184, 189, 190, 187, 188, 177, 178, 175, 176, 181, 182, 179, 180, 138, 139, 136, 137, 142, 143, 140, 141, 130, 131, 128, 129, 134, 135, 132, 133, 154, 155, 152, 153, 158, 159, 156, 157, 146, 147, 144, 145, 150, 151, 148, 149, 226, 227, 224, 225, 230, 231, 228, 229, 221, 221, 220, 220, 223, 223, 222, 222, 244, 246, 240, 242, 252, 254, 248, 250, 234, 235, 232, 233, 238, 239, 236, 237, 200, 201, 198, 199, 204, 205, 202, 203, 192, 193, 191, 191, 196, 197, 194, 195, 214, 215, 212, 213, 218, 219, 216, 217, 207, 207, 206, 206, 210, 211, 208, 209 }; SPAN_DECLARE(uint8_t) alaw_to_ulaw(uint8_t alaw) { return alaw_to_ulaw_table[alaw]; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(uint8_t) ulaw_to_alaw(uint8_t ulaw) { return ulaw_to_alaw_table[ulaw]; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g711_decode(g711_state_t *s, int16_t amp[], const uint8_t g711_data[], int g711_bytes) { int i; if (s->mode == G711_ALAW) { for (i = 0; i < g711_bytes; i++) amp[i] = alaw_to_linear(g711_data[i]); /*endfor*/ } else { for (i = 0; i < g711_bytes; i++) amp[i] = ulaw_to_linear(g711_data[i]); /*endfor*/ } /*endif*/ return g711_bytes; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g711_encode(g711_state_t *s, uint8_t g711_data[], const int16_t amp[], int len) { int i; if (s->mode == G711_ALAW) { for (i = 0; i < len; i++) g711_data[i] = linear_to_alaw(amp[i]); /*endfor*/ } else { for (i = 0; i < len; i++) g711_data[i] = linear_to_ulaw(amp[i]); /*endfor*/ } /*endif*/ return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g711_transcode(g711_state_t *s, uint8_t g711_out[], const uint8_t g711_in[], int g711_bytes) { int i; if (s->mode == G711_ALAW) { for (i = 0; i < g711_bytes; i++) g711_out[i] = alaw_to_ulaw_table[g711_in[i]]; /*endfor*/ } else { for (i = 0; i < g711_bytes; i++) g711_out[i] = ulaw_to_alaw_table[g711_in[i]]; /*endfor*/ } /*endif*/ return g711_bytes; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(g711_state_t *) g711_init(g711_state_t *s, int mode) { if (s == NULL) { if ((s = (g711_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } s->mode = mode; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g711_release(g711_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g711_free(g711_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/complex_filters.c0000664000175000017500000000561311422612261014244 00000000000000/* * SpanDSP - a series of DSP components for telephony * * complex_filters.c * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include "spandsp/telephony.h" #include "spandsp/complex.h" #include "spandsp/complex_filters.h" SPAN_DECLARE(filter_t *) filter_create(fspec_t *fs) { int i; filter_t *fi; if ((fi = (filter_t *) malloc(sizeof(*fi) + sizeof(float)*(fs->np + 1)))) { fi->fs = fs; fi->sum = 0.0; /* Moving average filters only */ fi->ptr = 0; for (i = 0; i <= fi->fs->np; i++) fi->v[i] = 0.0; } return fi; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) filter_delete(filter_t *fi) { if (fi) free(fi); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) filter_step(filter_t *fi, float x) { return fi->fs->fsf(fi, x); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(cfilter_t *) cfilter_create(fspec_t *fs) { cfilter_t *cfi; if ((cfi = (cfilter_t *) malloc(sizeof(*cfi)))) { if ((cfi->ref = filter_create(fs)) == NULL) { free(cfi); return NULL; } if ((cfi->imf = filter_create(fs)) == NULL) { free(cfi->ref); free(cfi); return NULL; } } return cfi; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) cfilter_delete(cfilter_t *cfi) { if (cfi) { filter_delete(cfi->ref); filter_delete(cfi->imf); } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complexf_t) cfilter_step(cfilter_t *cfi, const complexf_t *z) { complexf_t cc; cc.re = filter_step(cfi->ref, z->re); cc.im = filter_step(cfi->imf, z->im); return cc; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/libspandsp.2005.vcproj0000664000175000017500000003514412343640732014663 00000000000000 spandsp-0.0.6/src/t30.c0000664000175000017500000066730212351263214011466 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t30.c - ITU T.30 FAX transfer processing * * Written by Steve Underwood * * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #if defined(HAVE_STDBOOL_H) #include #else #include "spandsp/stdbool.h" #endif #include "floating_fudge.h" #include #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/bit_operations.h" #include "spandsp/queue.h" #include "spandsp/power_meter.h" #include "spandsp/complex.h" #include "spandsp/tone_generate.h" #include "spandsp/async.h" #include "spandsp/hdlc.h" #include "spandsp/fsk.h" #include "spandsp/v29rx.h" #include "spandsp/v29tx.h" #include "spandsp/v27ter_rx.h" #include "spandsp/v27ter_tx.h" #include "spandsp/timezone.h" #include "spandsp/t4_rx.h" #include "spandsp/t4_tx.h" #if defined(SPANDSP_SUPPORT_T85) #include "spandsp/t81_t82_arith_coding.h" #include "spandsp/t85.h" #endif #include "spandsp/t4_t6_decode.h" #include "spandsp/t4_t6_encode.h" #include "spandsp/t30_fcf.h" #include "spandsp/t35.h" #include "spandsp/t30.h" #include "spandsp/t30_api.h" #include "spandsp/t30_logging.h" #include "spandsp/private/logging.h" #include "spandsp/private/timezone.h" #if defined(SPANDSP_SUPPORT_T85) #include "spandsp/private/t81_t82_arith_coding.h" #include "spandsp/private/t85.h" #endif #include "spandsp/private/t4_t6_decode.h" #include "spandsp/private/t4_t6_encode.h" #include "spandsp/private/t4_rx.h" #include "spandsp/private/t4_tx.h" #include "spandsp/private/t30.h" #include "spandsp/private/t30_dis_dtc_dcs_bits.h" #include "t30_local.h" /*! The maximum permitted number of retries of a single command allowed. */ #define MAX_COMMAND_TRIES 3 /*! The maximum permitted number of retries of a single response request allowed. This is not specified in T.30. However, if you don't apply some limit a messed up FAX terminal could keep you retrying all day. Its a backstop protection. */ #define MAX_RESPONSE_TRIES 6 /* T.30 defines the following call phases: Phase A: Call set-up. Exchange of CNG, CED and the called terminal identification. Phase B: Pre-message procedure for identifying and selecting the required facilities. Capabilities negotiation, and training, up the the confirmation to receive. Phase C: Message transmission (includes phasing and synchronization where appropriate). Transfer of the message at high speed. Phase D: Post-message procedure, including end-of-message and confirmation and multi-document procedures. End of message and acknowledgement. Phase E: Call release Final call disconnect. */ enum { T30_PHASE_IDLE = 0, /* Freshly initialised */ T30_PHASE_A_CED, /* Doing the CED (answer) sequence */ T30_PHASE_A_CNG, /* Doing the CNG (caller) sequence */ T30_PHASE_B_RX, /* Receiving pre-message control messages */ T30_PHASE_B_TX, /* Transmitting pre-message control messages */ T30_PHASE_C_NON_ECM_RX, /* Receiving a document message in non-ECM mode */ T30_PHASE_C_NON_ECM_TX, /* Transmitting a document message in non-ECM mode */ T30_PHASE_C_ECM_RX, /* Receiving a document message in ECM (HDLC) mode */ T30_PHASE_C_ECM_TX, /* Transmitting a document message in ECM (HDLC) mode */ T30_PHASE_D_RX, /* Receiving post-message control messages */ T30_PHASE_D_TX, /* Transmitting post-message control messages */ T30_PHASE_E, /* In phase E */ T30_PHASE_CALL_FINISHED /* Call completely finished */ }; static const char *phase_names[] = { "T30_PHASE_IDLE", "T30_PHASE_A_CED", "T30_PHASE_A_CNG", "T30_PHASE_B_RX", "T30_PHASE_B_TX", "T30_PHASE_C_NON_ECM_RX", "T30_PHASE_C_NON_ECM_TX", "T30_PHASE_C_ECM_RX", "T30_PHASE_C_ECM_TX", "T30_PHASE_D_RX", "T30_PHASE_D_TX", "T30_PHASE_E", "T30_PHASE_CALL_FINISHED" }; /* These state names are modelled after places in the T.30 flow charts. */ enum { T30_STATE_ANSWERING = 1, T30_STATE_B, T30_STATE_C, T30_STATE_D, T30_STATE_D_TCF, T30_STATE_D_POST_TCF, T30_STATE_F_TCF, T30_STATE_F_CFR, T30_STATE_F_FTT, T30_STATE_F_DOC_NON_ECM, T30_STATE_F_POST_DOC_NON_ECM, T30_STATE_F_DOC_ECM, T30_STATE_F_POST_DOC_ECM, T30_STATE_F_POST_RCP_MCF, T30_STATE_F_POST_RCP_PPR, T30_STATE_F_POST_RCP_RNR, T30_STATE_R, T30_STATE_T, T30_STATE_I, T30_STATE_II, T30_STATE_II_Q, T30_STATE_III_Q, T30_STATE_IV, T30_STATE_IV_PPS_NULL, T30_STATE_IV_PPS_Q, T30_STATE_IV_PPS_RNR, T30_STATE_IV_CTC, T30_STATE_IV_EOR, T30_STATE_IV_EOR_RNR, T30_STATE_CALL_FINISHED }; #if 0 static const char *state_names[] = { "NONE", "ANSWERING", "B", "C", "D", "D_TCF", "D_POST_TCF", "F_TCF", "F_CFR", "F_FTT", "F_DOC_NON_ECM", "F_POST_DOC_NON_ECM", "F_DOC_ECM", "F_POST_DOC_ECM", "F_POST_RCP_MCF", "F_POST_RCP_PPR", "F_POST_RCP_RNR", "R", "T", "I", "II", "II_Q", "III_Q_MCF", "III_Q_RTP", "III_Q_RTN", "IV", "IV_PPS_NULL", "IV_PPS_Q", "IV_PPS_RNR", "IV_CTC", "IV_EOR", "IV_EOR_RNR", "CALL_FINISHED" }; #endif enum { T30_MIN_SCAN_20MS = 0, T30_MIN_SCAN_5MS = 1, T30_MIN_SCAN_10MS = 2, T30_MIN_SCAN_40MS = 4, T30_MIN_SCAN_0MS = 7, }; enum { T30_MODE_SEND_DOC = 1, T30_MODE_RECEIVE_DOC }; /*! These are internal assessments of received image quality, used to determine whether we continue, retrain, or abandon the call. This is only relevant to non-ECM operation. */ enum { T30_COPY_QUALITY_PERFECT = 0, T30_COPY_QUALITY_GOOD, T30_COPY_QUALITY_POOR, T30_COPY_QUALITY_BAD }; enum { DISBIT1 = 0x01, DISBIT2 = 0x02, DISBIT3 = 0x04, DISBIT4 = 0x08, DISBIT5 = 0x10, DISBIT6 = 0x20, DISBIT7 = 0x40, DISBIT8 = 0x80 }; /*! There are high level indications of what is happening at any instant, to guide the cleanup continue, retrain, or abandoning of the call. */ enum { OPERATION_IN_PROGRESS_NONE = 0, OPERATION_IN_PROGRESS_T4_RX, OPERATION_IN_PROGRESS_T4_TX, OPERATION_IN_PROGRESS_POST_T4_RX, OPERATION_IN_PROGRESS_POST_T4_TX }; /* All timers specified in milliseconds */ /*! Time-out T0 defines the amount of time an automatic calling terminal waits for the called terminal to answer the call. T0 begins after the dialling of the number is completed and is reset: a) when T0 times out; or b) when timer T1 is started; or c) if the terminal is capable of detecting any condition which indicates that the call will not be successful, when such a condition is detected. The recommended value of T0 is 60+-5s. However, when it is anticipated that a long call set-up time may be encountered, an alternative value of up to 120s may be used. NOTE - National regulations may require the use of other values for T0. */ #define DEFAULT_TIMER_T0 60000 /*! Time-out T1 defines the amount of time two terminals will continue to attempt to identify each other. T1 is 35+-5s, begins upon entering phase B, and is reset upon detecting a valid signal or when T1 times out. For operating methods 3 and 4 (see 3.1), the calling terminal starts time-out T1 upon reception of the V.21 modulation scheme. For operating method 4 bis a (see 3.1), the calling terminal starts time-out T1 upon starting transmission using the V.21 modulation scheme. Annex A says T1 is also the timeout to be used for the receipt of the first HDLC frame after the start of high speed flags in ECM mode. This seems a strange reuse of the T1 name, so we distinguish it here by calling it T1A. */ #define DEFAULT_TIMER_T1 35000 #define DEFAULT_TIMER_T1A 35000 /*! Time-out T2 makes use of the tight control between commands and responses to detect the loss of command/response synchronization. T2 is 6+-1s, and begins when initiating a command search (e.g., the first entrance into the "command received" subroutine, reference flow diagram in section 5.2). T2 is reset when an HDLC flag is received or when T2 times out. */ #define DEFAULT_TIMER_T2 7000 /*! Once HDLC flags begin, T2 is reset, and a 3s timer begins. This timer is unnamed in T.30. Here we term it T2A. No tolerance is specified for this timer. T2A specifies the maximum time to wait for the end of a frame, after the initial flag has been seen. */ #define DEFAULT_TIMER_T2A 3000 /*! If the HDLC carrier falls during reception, we need to apply a minimum time before continuing. If we don't, there are circumstances where we could continue and reply before the incoming signals have really finished. E.g. if a bad DCS is received in a DCS-TCF sequence, we need wait for the TCF carrier to pass, before continuing. This timer is specified as 200ms, but no tolerance is specified. It is unnamed in T.30. Here we term it T2B */ #define DEFAULT_TIMER_T2B 200 /*! Time-out T3 defines the amount of time a terminal will attempt to alert the local operator in response to a procedural interrupt. Failing to achieve operator intervention, the terminal will discontinue this attempt and shall issue other commands or responses. T3 is 10+-5s, begins on the first detection of a procedural interrupt command/response signal (i.e., PIN/PIP or PRI-Q) and is reset when T3 times out or when the operator initiates a line request. */ #define DEFAULT_TIMER_T3 15000 /*! Time-out T4 defines the amount of time a terminal will wait for flags to begin, when waiting for a response from a remote terminal. T2 is 3s +-15%, and begins when initiating a response search (e.g., the first entrance into the "response received" subroutine, reference flow diagram in section 5.2). T4 is reset when an HDLC flag is received or when T4 times out. NOTE - For manual FAX units, the value of timer T4 may be either 3.0s +-15% or 4.5s +-15%. If the value of 4.5s is used, then after detection of a valid response to the first DIS, it may be reduced to 3.0s +-15%. T4 = 3.0s +-15% for automatic units. */ #define DEFAULT_TIMER_T4 3450 /*! Once HDLC flags begin, T4 is reset, and a 3s timer begins. This timer is unnamed in T.30. Here we term it T4A. No tolerance is specified for this timer. T4A specifies the maximum time to wait for the end of a frame, after the initial flag has been seen. Note that a different timer is used for the fast HDLC in ECM mode, to provide time for physical paper handling. */ #define DEFAULT_TIMER_T4A 3000 /*! If the HDLC carrier falls during reception, we need to apply a minimum time before continuing. if we don't, there are circumstances where we could continue and reply before the incoming signals have really finished. E.g. if a bad DCS is received in a DCS-TCF sequence, we need wait for the TCF carrier to pass, before continuing. This timer is specified as 200ms, but no tolerance is specified. It is unnamed in T.30. Here we term it T4B */ #define DEFAULT_TIMER_T4B 200 /*! Time-out T5 is defined for the optional T.4 error correction mode. Time-out T5 defines the amount of time waiting for clearance of the busy condition of the receiving terminal. T5 is 60+-5s and begins on the first detection of the RNR response. T5 is reset when T5 times out or the MCF or PIP response is received or when the ERR or PIN response is received in the flow control process after transmitting the EOR command. If the timer T5 has expired, the DCN command is transmitted for call release. */ #define DEFAULT_TIMER_T5 65000 /*! (Annex C - ISDN) Time-out T6 defines the amount of time two terminals will continue to attempt to identify each other. T6 is 5+-0.5s. The timeout begins upon entering Phase B, and is reset upon detecting a valid signal, or when T6 times out. */ #define DEFAULT_TIMER_T6 5000 /*! (Annex C - ISDN) Time-out T7 is used to detect loss of command/response synchronization. T7 is 6+-1s. The timeout begins when initiating a command search (e.g., the first entrance into the "command received" subroutine - see flow diagram in C.5) and is reset upon detecting a valid signal or when T7 times out. */ #define DEFAULT_TIMER_T7 7000 /*! (Annex C - ISDN) Time-out T8 defines the amount of time waiting for clearance of the busy condition of the receiving terminal. T8 is 10+-1s. The timeout begins on the first detection of the combination of no outstanding corrections and the RNR response. T8 is reset when T8 times out or MCF response is received. If the timer T8 expires, a DCN command is transmitted for call release. */ #define DEFAULT_TIMER_T8 10000 /*! Final time we allow for things to flush through the system, before we disconnect, in milliseconds. 200ms should be fine for a PSTN call. For a T.38 call something longer is desirable. This delay is to allow sufficient time for the last message to be flushed all the way through to the far end. */ #define FINAL_FLUSH_TIME 1000 /*! The number of PPRs received before CTC or EOR is sent in ECM mode. T.30 defines this as 4, but it could be varied, and the Japanese spec, for example, does make this value a variable. */ #define PPR_LIMIT_BEFORE_CTC_OR_EOR 4 /* HDLC message header byte values */ #define ADDRESS_FIELD 0xFF #define CONTROL_FIELD_NON_FINAL_FRAME 0x03 #define CONTROL_FIELD_FINAL_FRAME 0x13 enum { TIMER_IS_IDLE = 0, TIMER_IS_T2, TIMER_IS_T1A, TIMER_IS_T2A, TIMER_IS_T2B, TIMER_IS_T2C, TIMER_IS_T4, TIMER_IS_T4A, TIMER_IS_T4B, TIMER_IS_T4C }; /* Start points in the fallback table for different capabilities */ /*! The starting point in the modem fallback sequence if V.17 is allowed */ #define T30_V17_FALLBACK_START 0 /*! The starting point in the modem fallback sequence if V.17 is not allowed */ #define T30_V29_FALLBACK_START 3 /*! The starting point in the modem fallback sequence if V.29 is not allowed */ #define T30_V27TER_FALLBACK_START 6 static const struct { int bit_rate; int modem_type; int which; uint8_t dcs_code; } fallback_sequence[] = { {14400, T30_MODEM_V17, T30_SUPPORT_V17, DISBIT6}, {12000, T30_MODEM_V17, T30_SUPPORT_V17, (DISBIT6 | DISBIT4)}, { 9600, T30_MODEM_V17, T30_SUPPORT_V17, (DISBIT6 | DISBIT3)}, { 9600, T30_MODEM_V29, T30_SUPPORT_V29, DISBIT3}, { 7200, T30_MODEM_V17, T30_SUPPORT_V17, (DISBIT6 | DISBIT4 | DISBIT3)}, { 7200, T30_MODEM_V29, T30_SUPPORT_V29, (DISBIT4 | DISBIT3)}, { 4800, T30_MODEM_V27TER, T30_SUPPORT_V27TER, DISBIT4}, { 2400, T30_MODEM_V27TER, T30_SUPPORT_V27TER, 0}, { 0, 0, 0, 0} }; static void queue_phase(t30_state_t *s, int phase); static void set_phase(t30_state_t *s, int phase); static void set_state(t30_state_t *s, int state); static void shut_down_hdlc_tx(t30_state_t *s); static void send_frame(t30_state_t *s, const uint8_t *fr, int frlen); static void send_simple_frame(t30_state_t *s, int type); static void send_dcn(t30_state_t *s); static void repeat_last_command(t30_state_t *s); static void terminate_call(t30_state_t *s); static void start_final_pause(t30_state_t *s); static void decode_20digit_msg(t30_state_t *s, char *msg, const uint8_t *pkt, int len); static void decode_url_msg(t30_state_t *s, char *msg, const uint8_t *pkt, int len); static int decode_nsf_nss_nsc(t30_state_t *s, uint8_t *msg[], const uint8_t *pkt, int len); static int set_min_scan_time_code(t30_state_t *s); static int send_cfr_sequence(t30_state_t *s, int start); static void timer_t2_start(t30_state_t *s); static void timer_t2a_start(t30_state_t *s); static void timer_t2b_start(t30_state_t *s); static void timer_t4_start(t30_state_t *s); static void timer_t4a_start(t30_state_t *s); static void timer_t4b_start(t30_state_t *s); static void timer_t2_t4_stop(t30_state_t *s); /*! Test a specified bit within a DIS, DTC or DCS frame */ #define test_ctrl_bit(s,bit) ((s)[3 + ((bit - 1)/8)] & (1 << ((bit - 1)%8))) /*! Set a specified bit within a DIS, DTC or DCS frame */ #define set_ctrl_bit(s,bit) (s)[3 + ((bit - 1)/8)] |= (1 << ((bit - 1)%8)) /*! Set a specified block of bits within a DIS, DTC or DCS frame */ #define set_ctrl_bits(s,val,bit) (s)[3 + ((bit - 1)/8)] |= ((val) << ((bit - 1)%8)) /*! Clear a specified bit within a DIS, DTC or DCS frame */ #define clr_ctrl_bit(s,bit) (s)[3 + ((bit - 1)/8)] &= ~(1 << ((bit - 1)%8)) static int terminate_operation_in_progress(t30_state_t *s) { /* Make sure any FAX in progress is tidied up. If the tidying up has already happened, repeating it here is harmless. */ switch (s->operation_in_progress) { case OPERATION_IN_PROGRESS_T4_TX: t4_tx_release(&s->t4.tx); s->operation_in_progress = OPERATION_IN_PROGRESS_POST_T4_TX; break; case OPERATION_IN_PROGRESS_T4_RX: t4_rx_release(&s->t4.rx); s->operation_in_progress = OPERATION_IN_PROGRESS_POST_T4_RX; break; } return 0; } /*- End of function --------------------------------------------------------*/ static int tx_start_page(t30_state_t *s) { if (t4_tx_start_page(&s->t4.tx)) { terminate_operation_in_progress(s); return -1; } s->ecm_block = 0; s->error_correcting_mode_retries = 0; span_log(&s->logging, SPAN_LOG_FLOW, "Starting page %d of transfer\n", s->tx_page_number + 1); return 0; } /*- End of function --------------------------------------------------------*/ static int tx_end_page(t30_state_t *s) { s->retries = 0; if (t4_tx_end_page(&s->t4.tx) == 0) { s->tx_page_number++; s->ecm_block = 0; } return 0; } /*- End of function --------------------------------------------------------*/ static int rx_start_page(t30_state_t *s) { int i; t4_rx_set_image_width(&s->t4.rx, s->image_width); t4_rx_set_sub_address(&s->t4.rx, s->rx_info.sub_address); t4_rx_set_dcs(&s->t4.rx, s->rx_dcs_string); t4_rx_set_far_ident(&s->t4.rx, s->rx_info.ident); t4_rx_set_vendor(&s->t4.rx, s->vendor); t4_rx_set_model(&s->t4.rx, s->model); t4_rx_set_rx_encoding(&s->t4.rx, s->line_encoding); t4_rx_set_x_resolution(&s->t4.rx, s->x_resolution); t4_rx_set_y_resolution(&s->t4.rx, s->y_resolution); if (t4_rx_start_page(&s->t4.rx)) return -1; /* Clear the ECM buffer */ for (i = 0; i < 256; i++) s->ecm_len[i] = -1; s->ecm_block = 0; s->ecm_frames = -1; s->ecm_frames_this_tx_burst = 0; s->error_correcting_mode_retries = 0; return 0; } /*- End of function --------------------------------------------------------*/ static int rx_end_page(t30_state_t *s) { if (t4_rx_end_page(&s->t4.rx) == 0) { s->rx_page_number++; s->ecm_block = 0; } return 0; } /*- End of function --------------------------------------------------------*/ static void report_rx_ecm_page_result(t30_state_t *s) { t4_stats_t stats; /* This is only used for ECM pages, as copy_quality() does a similar job for non-ECM pages as a byproduct of assessing copy quality. */ t4_rx_get_transfer_statistics(&s->t4.rx, &stats); span_log(&s->logging, SPAN_LOG_FLOW, "Page no = %d\n", stats.pages_transferred); span_log(&s->logging, SPAN_LOG_FLOW, "Image size = %d x %d pixels\n", stats.width, stats.length); span_log(&s->logging, SPAN_LOG_FLOW, "Image resolution = %d/m x %d/m\n", stats.x_resolution, stats.y_resolution); span_log(&s->logging, SPAN_LOG_FLOW, "Compression = %s (%d)\n", t4_encoding_to_str(stats.encoding), stats.encoding); span_log(&s->logging, SPAN_LOG_FLOW, "Compressed image size = %d bytes\n", stats.line_image_size); } /*- End of function --------------------------------------------------------*/ static int copy_quality(t30_state_t *s) { t4_stats_t stats; int quality; t4_rx_get_transfer_statistics(&s->t4.rx, &stats); /* There is no specification for judging copy quality. However, we need to classify it at three levels, to control what we do next: OK; tolerable, but retrain; intolerable. */ /* Based on the thresholds used in the TSB85 tests, we consider: <5% bad rows is OK <15% bad rows to be tolerable, but retrain >15% bad rows to be intolerable */ /* This is called before the page is confirmed, so we need to add one to get the page number right */ span_log(&s->logging, SPAN_LOG_FLOW, "Page no = %d\n", stats.pages_transferred + 1); span_log(&s->logging, SPAN_LOG_FLOW, "Image size = %d x %d pixels\n", stats.width, stats.length); span_log(&s->logging, SPAN_LOG_FLOW, "Image resolution = %d/m x %d/m\n", stats.x_resolution, stats.y_resolution); span_log(&s->logging, SPAN_LOG_FLOW, "Compression = %s (%d)\n", t4_encoding_to_str(stats.encoding), stats.encoding); span_log(&s->logging, SPAN_LOG_FLOW, "Compressed image size = %d bytes\n", stats.line_image_size); span_log(&s->logging, SPAN_LOG_FLOW, "Bad rows = %d\n", stats.bad_rows); span_log(&s->logging, SPAN_LOG_FLOW, "Longest bad row run = %d\n", stats.longest_bad_row_run); /* Don't treat a page as perfect because it has zero bad rows out of zero total rows. A zero row page has got to be some kind of total page failure. */ if (stats.bad_rows == 0 && stats.length != 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Page quality is perfect\n"); quality = T30_COPY_QUALITY_PERFECT; } else if (stats.bad_rows*20 < stats.length) { span_log(&s->logging, SPAN_LOG_FLOW, "Page quality is good\n"); quality = T30_COPY_QUALITY_GOOD; } else if (stats.bad_rows*20 < stats.length*3) { span_log(&s->logging, SPAN_LOG_FLOW, "Page quality is poor\n"); quality = T30_COPY_QUALITY_POOR; } else { span_log(&s->logging, SPAN_LOG_FLOW, "Page quality is bad\n"); quality = T30_COPY_QUALITY_BAD; } return quality; } /*- End of function --------------------------------------------------------*/ static void report_tx_result(t30_state_t *s, int result) { t4_stats_t stats; if (span_log_test(&s->logging, SPAN_LOG_FLOW)) { t4_tx_get_transfer_statistics(&s->t4.tx, &stats); span_log(&s->logging, SPAN_LOG_FLOW, "%s - delivered %d pages\n", (result) ? "Success" : "Failure", stats.pages_transferred); } } /*- End of function --------------------------------------------------------*/ static void release_resources(t30_state_t *s) { if (s->tx_info.nsf) { free(s->tx_info.nsf); s->tx_info.nsf = NULL; } s->tx_info.nsf_len = 0; if (s->tx_info.nsc) { free(s->tx_info.nsc); s->tx_info.nsc = NULL; } s->tx_info.nsc_len = 0; if (s->tx_info.nss) { free(s->tx_info.nss); s->tx_info.nss = NULL; } s->tx_info.nss_len = 0; if (s->tx_info.tsa) { free(s->tx_info.tsa); s->tx_info.tsa = NULL; } if (s->tx_info.ira) { free(s->tx_info.ira); s->tx_info.ira = NULL; } if (s->tx_info.cia) { free(s->tx_info.cia); s->tx_info.cia = NULL; } if (s->tx_info.isp) { free(s->tx_info.isp); s->tx_info.isp = NULL; } if (s->tx_info.csa) { free(s->tx_info.csa); s->tx_info.csa = NULL; } if (s->rx_info.nsf) { free(s->rx_info.nsf); s->rx_info.nsf = NULL; } s->rx_info.nsf_len = 0; if (s->rx_info.nsc) { free(s->rx_info.nsc); s->rx_info.nsc = NULL; } s->rx_info.nsc_len = 0; if (s->rx_info.nss) { free(s->rx_info.nss); s->rx_info.nss = NULL; } s->rx_info.nss_len = 0; if (s->rx_info.tsa) { free(s->rx_info.tsa); s->rx_info.tsa = NULL; } if (s->rx_info.ira) { free(s->rx_info.ira); s->rx_info.ira = NULL; } if (s->rx_info.cia) { free(s->rx_info.cia); s->rx_info.cia = NULL; } if (s->rx_info.isp) { free(s->rx_info.isp); s->rx_info.isp = NULL; } if (s->rx_info.csa) { free(s->rx_info.csa); s->rx_info.csa = NULL; } } /*- End of function --------------------------------------------------------*/ static uint8_t check_next_tx_step(t30_state_t *s) { int res; int more; res = t4_tx_next_page_has_different_format(&s->t4.tx); if (res == 0) { span_log(&s->logging, SPAN_LOG_FLOW, "More pages to come with the same format\n"); return (s->local_interrupt_pending) ? T30_PRI_MPS : T30_MPS; } if (res > 0) { span_log(&s->logging, SPAN_LOG_FLOW, "More pages to come with a different format\n"); s->tx_start_page = t4_tx_get_current_page_in_file(&s->t4.tx) + 1; return (s->local_interrupt_pending) ? T30_PRI_EOM : T30_EOM; } /* Call a user handler, if one is set, to check if another document is to be sent. If so, we send an EOM, rather than an EOP. Then we will renegotiate, and the new document will begin. */ if (s->document_handler) more = s->document_handler(s, s->document_user_data, 0); else more = false; if (more) { //if (test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_MULTIPLE_SELECTIVE_POLLING_CAPABLE)) // return T30_EOS; return (s->local_interrupt_pending) ? T30_PRI_EOM : T30_EOM; } return (s->local_interrupt_pending) ? T30_PRI_EOP : T30_EOP; } /*- End of function --------------------------------------------------------*/ static int get_partial_ecm_page(t30_state_t *s) { int i; int len; s->ppr_count = 0; s->ecm_progress = 0; /* Fill our partial page buffer with a partial page. Use the negotiated preferred frame size as the basis for the size of the frames produced. */ /* We fill the buffer with complete HDLC frames, ready to send out. */ /* The frames are all marked as not being final frames. When sent, the are followed by a partial page signal, which is marked as the final frame. */ for (i = 3; i < 32 + 3; i++) s->ecm_frame_map[i] = 0xFF; for (i = 0; i < 256; i++) { s->ecm_len[i] = -1; s->ecm_data[i][0] = ADDRESS_FIELD; s->ecm_data[i][1] = CONTROL_FIELD_NON_FINAL_FRAME; s->ecm_data[i][2] = T4_FCD; /* These frames contain a frame sequence number within the partial page (one octet) followed by some image data. */ s->ecm_data[i][3] = (uint8_t) i; if ((len = t4_tx_get_chunk(&s->t4.tx, &s->ecm_data[i][4], s->octets_per_ecm_frame)) < s->octets_per_ecm_frame) { /* The image is not big enough to fill the entire buffer */ /* We need to pad to a full frame, as most receivers expect that. */ if (len > 0) { memset(&s->ecm_data[i][4 + len], 0, s->octets_per_ecm_frame - len); s->ecm_len[i++] = (int16_t) (s->octets_per_ecm_frame + 4); } s->ecm_frames = i; span_log(&s->logging, SPAN_LOG_FLOW, "Partial page buffer contains %d frames (%d per frame)\n", i, s->octets_per_ecm_frame); s->ecm_at_page_end = true; return i; } s->ecm_len[i] = (int16_t) (4 + len); } /* We filled the entire buffer */ s->ecm_frames = 256; span_log(&s->logging, SPAN_LOG_FLOW, "Partial page buffer full (%d per frame)\n", s->octets_per_ecm_frame); s->ecm_at_page_end = ((t4_tx_check_bit(&s->t4.tx) & 2) != 0); return 256; } /*- End of function --------------------------------------------------------*/ static int send_next_ecm_frame(t30_state_t *s) { int i; uint8_t frame[3]; if (s->ecm_current_tx_frame < s->ecm_frames) { /* Search for the next frame, within the current partial page, which has not been tagged as transferred OK. */ for (i = s->ecm_current_tx_frame; i < s->ecm_frames; i++) { if (s->ecm_len[i] >= 0) { send_frame(s, s->ecm_data[i], s->ecm_len[i]); s->ecm_current_tx_frame = i + 1; s->ecm_frames_this_tx_burst++; return 0; } } s->ecm_current_tx_frame = s->ecm_frames; } if (s->ecm_current_tx_frame < s->ecm_frames + 3) { /* We have sent all the FCD frames. Send three RCP frames, as per T.4/A.1 and T.4/A.2. The repeats are to minimise the risk of a bit error stopping the receiving end from recognising the RCP. */ s->ecm_current_tx_frame++; /* The RCP frame is an odd man out, as its a simple 1 byte control frame, but is specified to not have the final bit set. It doesn't seem to have the DIS received bit set, either. */ frame[0] = ADDRESS_FIELD; frame[1] = CONTROL_FIELD_NON_FINAL_FRAME; frame[2] = T4_RCP; send_frame(s, frame, 3); /* In case we are just after a CTC/CTR exchange, which kicked us back to long training */ s->short_train = true; return 0; } return -1; } /*- End of function --------------------------------------------------------*/ static void send_rr(t30_state_t *s) { if (s->current_status != T30_ERR_TX_T5EXP) send_simple_frame(s, T30_RR); else send_dcn(s); } /*- End of function --------------------------------------------------------*/ static int send_first_ecm_frame(t30_state_t *s) { s->ecm_current_tx_frame = 0; s->ecm_frames_this_tx_burst = 0; return send_next_ecm_frame(s); } /*- End of function --------------------------------------------------------*/ static void print_frame(t30_state_t *s, const char *io, const uint8_t *msg, int len) { span_log(&s->logging, SPAN_LOG_FLOW, "%s %s with%s final frame tag\n", io, t30_frametype(msg[2]), (msg[1] & 0x10) ? "" : "out"); span_log_buf(&s->logging, SPAN_LOG_FLOW, io, msg, len); } /*- End of function --------------------------------------------------------*/ static void shut_down_hdlc_tx(t30_state_t *s) { if (s->send_hdlc_handler) s->send_hdlc_handler(s->send_hdlc_user_data, NULL, 0); } /*- End of function --------------------------------------------------------*/ static void send_frame(t30_state_t *s, const uint8_t *msg, int len) { print_frame(s, "Tx: ", msg, len); if (s->real_time_frame_handler) s->real_time_frame_handler(s, s->real_time_frame_user_data, false, msg, len); if (s->send_hdlc_handler) s->send_hdlc_handler(s->send_hdlc_user_data, msg, len); } /*- End of function --------------------------------------------------------*/ static void send_simple_frame(t30_state_t *s, int type) { uint8_t frame[3]; /* The simple command/response frames are always final frames */ frame[0] = ADDRESS_FIELD; frame[1] = CONTROL_FIELD_FINAL_FRAME; frame[2] = (uint8_t) (type | s->dis_received); send_frame(s, frame, 3); } /*- End of function --------------------------------------------------------*/ static void send_20digit_msg_frame(t30_state_t *s, int cmd, char *msg) { size_t len; int p; uint8_t frame[23]; len = strlen(msg); p = 0; frame[p++] = ADDRESS_FIELD; frame[p++] = CONTROL_FIELD_NON_FINAL_FRAME; frame[p++] = (uint8_t) (cmd | s->dis_received); while (len > 0) frame[p++] = msg[--len]; while (p < 23) frame[p++] = ' '; send_frame(s, frame, 23); } /*- End of function --------------------------------------------------------*/ static int send_nsf_frame(t30_state_t *s) { /* Only send if there is an NSF message to send. */ if (s->tx_info.nsf && s->tx_info.nsf_len) { span_log(&s->logging, SPAN_LOG_FLOW, "Sending user supplied NSF - %d octets\n", s->tx_info.nsf_len); s->tx_info.nsf[0] = ADDRESS_FIELD; s->tx_info.nsf[1] = CONTROL_FIELD_NON_FINAL_FRAME; s->tx_info.nsf[2] = (uint8_t) (T30_NSF | s->dis_received); send_frame(s, s->tx_info.nsf, s->tx_info.nsf_len + 3); return true; } return false; } /*- End of function --------------------------------------------------------*/ static int send_nss_frame(t30_state_t *s) { /* Only send if there is an NSF message to send. */ if (s->tx_info.nss && s->tx_info.nss_len) { span_log(&s->logging, SPAN_LOG_FLOW, "Sending user supplied NSS - %d octets\n", s->tx_info.nss_len); s->tx_info.nss[0] = ADDRESS_FIELD; s->tx_info.nss[1] = CONTROL_FIELD_NON_FINAL_FRAME; s->tx_info.nss[2] = (uint8_t) (T30_NSS | s->dis_received); send_frame(s, s->tx_info.nss, s->tx_info.nss_len + 3); return true; } return false; } /*- End of function --------------------------------------------------------*/ static int send_nsc_frame(t30_state_t *s) { /* Only send if there is an NSF message to send. */ if (s->tx_info.nsc && s->tx_info.nsc_len) { span_log(&s->logging, SPAN_LOG_FLOW, "Sending user supplied NSC - %d octets\n", s->tx_info.nsc_len); s->tx_info.nsc[0] = ADDRESS_FIELD; s->tx_info.nsc[1] = CONTROL_FIELD_NON_FINAL_FRAME; s->tx_info.nsc[2] = (uint8_t) (T30_NSC | s->dis_received); send_frame(s, s->tx_info.nsc, s->tx_info.nsc_len + 3); return true; } return false; } /*- End of function --------------------------------------------------------*/ static int send_ident_frame(t30_state_t *s, uint8_t cmd) { if (s->tx_info.ident[0]) { span_log(&s->logging, SPAN_LOG_FLOW, "Sending ident '%s'\n", s->tx_info.ident); /* 'cmd' should be T30_TSI, T30_CIG or T30_CSI */ send_20digit_msg_frame(s, cmd, s->tx_info.ident); return true; } return false; } /*- End of function --------------------------------------------------------*/ static int send_psa_frame(t30_state_t *s) { if (test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_POLLED_SUBADDRESSING_CAPABLE) && s->tx_info.polled_sub_address[0]) { span_log(&s->logging, SPAN_LOG_FLOW, "Sending polled sub-address '%s'\n", s->tx_info.polled_sub_address); send_20digit_msg_frame(s, T30_PSA, s->tx_info.polled_sub_address); set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_POLLED_SUBADDRESSING_CAPABLE); return true; } clr_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_POLLED_SUBADDRESSING_CAPABLE); return false; } /*- End of function --------------------------------------------------------*/ static int send_sep_frame(t30_state_t *s) { if (test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_SELECTIVE_POLLING_CAPABLE) && s->tx_info.selective_polling_address[0]) { span_log(&s->logging, SPAN_LOG_FLOW, "Sending selective polling address '%s'\n", s->tx_info.selective_polling_address); send_20digit_msg_frame(s, T30_SEP, s->tx_info.selective_polling_address); set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_SELECTIVE_POLLING_CAPABLE); return true; } clr_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_SELECTIVE_POLLING_CAPABLE); return false; } /*- End of function --------------------------------------------------------*/ static int send_sid_frame(t30_state_t *s) { /* Only send if there is an ID to send. */ if (test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_PASSWORD) && s->tx_info.sender_ident[0]) { span_log(&s->logging, SPAN_LOG_FLOW, "Sending sender identification '%s'\n", s->tx_info.sender_ident); send_20digit_msg_frame(s, T30_SID, s->tx_info.sender_ident); set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_SENDER_ID_TRANSMISSION); return true; } clr_ctrl_bit(s->dcs_frame, T30_DCS_BIT_SENDER_ID_TRANSMISSION); return false; } /*- End of function --------------------------------------------------------*/ static int send_pwd_frame(t30_state_t *s) { /* Only send if there is a password to send. */ if (test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_PASSWORD) && s->tx_info.password[0]) { span_log(&s->logging, SPAN_LOG_FLOW, "Sending password '%s'\n", s->tx_info.password); send_20digit_msg_frame(s, T30_PWD, s->tx_info.password); set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_PASSWORD); return true; } clr_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_PASSWORD); return false; } /*- End of function --------------------------------------------------------*/ static int send_sub_frame(t30_state_t *s) { /* Only send if there is a sub-address to send. */ if (test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_SUBADDRESSING_CAPABLE) && s->tx_info.sub_address[0]) { span_log(&s->logging, SPAN_LOG_FLOW, "Sending sub-address '%s'\n", s->tx_info.sub_address); send_20digit_msg_frame(s, T30_SUB, s->tx_info.sub_address); set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_SUBADDRESS_TRANSMISSION); return true; } clr_ctrl_bit(s->dcs_frame, T30_DCS_BIT_SUBADDRESS_TRANSMISSION); return false; } /*- End of function --------------------------------------------------------*/ static int send_tsa_frame(t30_state_t *s) { if ((test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_T37) || test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_T38)) && 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Sending transmitting subscriber internet address '%s'\n", ""); return true; } return false; } /*- End of function --------------------------------------------------------*/ static int send_ira_frame(t30_state_t *s) { if (test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_INTERNET_ROUTING_ADDRESS) && 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Sending internet routing address '%s'\n", ""); set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_INTERNET_ROUTING_ADDRESS_TRANSMISSION); return true; } clr_ctrl_bit(s->dcs_frame, T30_DCS_BIT_INTERNET_ROUTING_ADDRESS_TRANSMISSION); return false; } /*- End of function --------------------------------------------------------*/ static int send_cia_frame(t30_state_t *s) { if ((test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_T37) || test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_T38)) && 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Sending calling subscriber internet address '%s'\n", ""); return true; } return false; } /*- End of function --------------------------------------------------------*/ static int send_isp_frame(t30_state_t *s) { if (test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_INTERNET_SELECTIVE_POLLING_ADDRESS) && 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Sending internet selective polling address '%s'\n", ""); set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_INTERNET_SELECTIVE_POLLING_ADDRESS); return true; } clr_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_INTERNET_SELECTIVE_POLLING_ADDRESS); return false; } /*- End of function --------------------------------------------------------*/ static int send_csa_frame(t30_state_t *s) { #if 0 if (("in T.37 mode" || "in T.38 mode") && 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Sending called subscriber internet address '%s'\n", ""); return true; } #endif return false; } /*- End of function --------------------------------------------------------*/ static int send_pps_frame(t30_state_t *s) { uint8_t frame[7]; frame[0] = ADDRESS_FIELD; frame[1] = CONTROL_FIELD_FINAL_FRAME; frame[2] = (uint8_t) (T30_PPS | s->dis_received); frame[3] = (s->ecm_at_page_end) ? ((uint8_t) (s->next_tx_step | s->dis_received)) : T30_NULL; frame[4] = (uint8_t) (s->tx_page_number & 0xFF); frame[5] = (uint8_t) (s->ecm_block & 0xFF); frame[6] = (uint8_t) ((s->ecm_frames_this_tx_burst == 0) ? 0 : (s->ecm_frames_this_tx_burst - 1)); span_log(&s->logging, SPAN_LOG_FLOW, "Sending PPS + %s\n", t30_frametype(frame[3])); send_frame(s, frame, 7); return frame[3] & 0xFE; } /*- End of function --------------------------------------------------------*/ static int set_dis_or_dtc(t30_state_t *s) { /* Whether we use a DIS or a DTC is determined by whether we have received a DIS. We just need to edit the prebuilt message. */ s->local_dis_dtc_frame[2] = (uint8_t) (T30_DIS | s->dis_received); /* If we have a file name to receive into, then we are receive capable */ if (s->rx_file[0]) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_READY_TO_RECEIVE_FAX_DOCUMENT); else clr_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_READY_TO_RECEIVE_FAX_DOCUMENT); /* If we have a file name to transmit, then we are ready to transmit (polling) */ if (s->tx_file[0]) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_READY_TO_TRANSMIT_FAX_DOCUMENT); else clr_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_READY_TO_TRANSMIT_FAX_DOCUMENT); return 0; } /*- End of function --------------------------------------------------------*/ int t30_build_dis_or_dtc(t30_state_t *s) { int i; /* Build a skeleton for the DIS and DTC messages. This will be edited for the dynamically changing capabilities (e.g. can receive) just before it is sent. It might also be edited if the application changes our capabilities (e.g. disabling fine mode). Right now we set up all the unchanging stuff about what we are capable of doing. */ s->local_dis_dtc_frame[0] = ADDRESS_FIELD; s->local_dis_dtc_frame[1] = CONTROL_FIELD_FINAL_FRAME; s->local_dis_dtc_frame[2] = (uint8_t) (T30_DIS | s->dis_received); for (i = 3; i < 19; i++) s->local_dis_dtc_frame[i] = 0x00; /* Always say 256 octets per ECM frame preferred, as 64 is never used in the real world. */ if ((s->iaf & T30_IAF_MODE_T37)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T37); if ((s->iaf & T30_IAF_MODE_T38)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T38); /* No 3G mobile */ /* No V.8 */ /* 256 octets preferred - don't bother making this optional, as everything uses 256 */ /* Ready to transmit a fax (polling) will be determined separately, and this message edited. */ /* Ready to receive a fax will be determined separately, and this message edited. */ /* With no modems set we are actually selecting V.27ter fallback at 2400bps */ if ((s->supported_modems & T30_SUPPORT_V27TER)) set_ctrl_bit(s->local_dis_dtc_frame, 12); if ((s->supported_modems & T30_SUPPORT_V29)) set_ctrl_bit(s->local_dis_dtc_frame, 11); /* V.17 is only valid when combined with V.29 and V.27ter, so if we enable V.17 we force the others too. */ if ((s->supported_modems & T30_SUPPORT_V17)) s->local_dis_dtc_frame[4] |= (DISBIT6 | DISBIT4 | DISBIT3); if ((s->supported_resolutions & T30_SUPPORT_FINE_RESOLUTION)) set_ctrl_bit(s->local_dis_dtc_frame, 15); if ((s->supported_compressions & T30_SUPPORT_T4_2D_COMPRESSION)) set_ctrl_bit(s->local_dis_dtc_frame, 16); /* 215mm wide is always supported */ if ((s->supported_image_sizes & T30_SUPPORT_303MM_WIDTH)) set_ctrl_bit(s->local_dis_dtc_frame, 18); else if ((s->supported_image_sizes & T30_SUPPORT_255MM_WIDTH)) set_ctrl_bit(s->local_dis_dtc_frame, 17); /* A4 is always supported. */ if ((s->supported_image_sizes & T30_SUPPORT_UNLIMITED_LENGTH)) set_ctrl_bit(s->local_dis_dtc_frame, 20); else if ((s->supported_image_sizes & T30_SUPPORT_B4_LENGTH)) set_ctrl_bit(s->local_dis_dtc_frame, 19); /* No scan-line padding required, but some may be specified by the application. */ set_ctrl_bits(s->local_dis_dtc_frame, s->local_min_scan_time_code, 21); if ((s->supported_compressions & T30_SUPPORT_NO_COMPRESSION)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_UNCOMPRESSED_CAPABLE); if (s->ecm_allowed) { /* ECM allowed */ set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_ECM_CAPABLE); /* Only offer the option of fancy compression schemes, if we are also offering the ECM option needed to support them. */ if ((s->supported_compressions & T30_SUPPORT_T6_COMPRESSION)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T6_CAPABLE); if ((s->supported_compressions & T30_SUPPORT_T43_COMPRESSION)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T43_CAPABLE); if ((s->supported_compressions & T30_SUPPORT_T45_COMPRESSION)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T45_CAPABLE); if ((s->supported_compressions & T30_SUPPORT_T81_COMPRESSION)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T81_CAPABLE); if ((s->supported_compressions & T30_SUPPORT_SYCC_T81_COMPRESSION)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_SYCC_T81_CAPABLE); if ((s->supported_compressions & T30_SUPPORT_T85_COMPRESSION)) { set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T85_CAPABLE); if ((s->supported_compressions & T30_SUPPORT_T85_L0_COMPRESSION)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T85_L0_CAPABLE); } //if ((s->supported_compressions & T30_SUPPORT_T89_COMPRESSION)) // set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T89_CAPABLE); } if ((s->supported_t30_features & T30_SUPPORT_FIELD_NOT_VALID)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_FNV_CAPABLE); if ((s->supported_t30_features & T30_SUPPORT_MULTIPLE_SELECTIVE_POLLING)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_MULTIPLE_SELECTIVE_POLLING_CAPABLE); if ((s->supported_t30_features & T30_SUPPORT_POLLED_SUB_ADDRESSING)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_POLLED_SUBADDRESSING_CAPABLE); /* No plane interleave */ /* No G.726 */ /* No extended voice coding */ if ((s->supported_resolutions & T30_SUPPORT_SUPERFINE_RESOLUTION)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_200_400_CAPABLE); if ((s->supported_resolutions & T30_SUPPORT_300_300_RESOLUTION)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_300_300_CAPABLE); if ((s->supported_resolutions & (T30_SUPPORT_400_400_RESOLUTION | T30_SUPPORT_R16_RESOLUTION))) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_400_400_CAPABLE); /* Metric */ set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_METRIC_RESOLUTION_PREFERRED); /* Superfine minimum scan line time pattern follows fine */ if ((s->supported_t30_features & T30_SUPPORT_SELECTIVE_POLLING)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_SELECTIVE_POLLING_CAPABLE); if ((s->supported_t30_features & T30_SUPPORT_SUB_ADDRESSING)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_SUBADDRESSING_CAPABLE); if ((s->supported_t30_features & T30_SUPPORT_IDENTIFICATION)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_PASSWORD); /* Ready to transmit a data file (polling) */ if (s->tx_file[0]) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_READY_TO_TRANSMIT_DATA_FILE); /* No Binary file transfer (BFT) */ /* No Document transfer mode (DTM) */ /* No Electronic data interchange (EDI) */ /* No Basic transfer mode (BTM) */ /* No mixed mode (polling) */ /* No character mode */ /* No mixed mode (T.4/Annex E) */ /* No mode 26 (T.505) */ /* No digital network capability */ /* No duplex operation */ /* No JPEG */ /* No full colour */ /* No 12bits/pel */ /* No sub-sampling (1:1:1) */ /* No custom illuminant */ /* No custom gamut range */ if ((s->supported_image_sizes & T30_SUPPORT_US_LETTER_LENGTH)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_NORTH_AMERICAN_LETTER_CAPABLE); if ((s->supported_image_sizes & T30_SUPPORT_US_LEGAL_LENGTH)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_NORTH_AMERICAN_LEGAL_CAPABLE); /* No HKM key management */ /* No RSA key management */ /* No override */ /* No HFX40 cipher */ /* No alternative cipher number 2 */ /* No alternative cipher number 3 */ /* No HFX40-I hashing */ /* No alternative hashing system number 2 */ /* No alternative hashing system number 3 */ /* No T.44 (mixed raster content) */ /* No page length maximum strip size for T.44 (mixed raster content) */ /* No colour/grey scale 300x300 or 400x400 */ /* No colour/grey scale 100x100 */ /* No simple phase C BFT negotiations */ /* No extended BFT negotiations */ if ((s->supported_t30_features & T30_SUPPORT_INTERNET_SELECTIVE_POLLING_ADDRESS)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_INTERNET_SELECTIVE_POLLING_ADDRESS); if ((s->supported_t30_features & T30_SUPPORT_INTERNET_ROUTING_ADDRESS)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_INTERNET_ROUTING_ADDRESS); if ((s->supported_resolutions & T30_SUPPORT_600_600_RESOLUTION)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_600_600_CAPABLE); if ((s->supported_resolutions & T30_SUPPORT_1200_1200_RESOLUTION)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_1200_1200_CAPABLE); if ((s->supported_resolutions & T30_SUPPORT_300_600_RESOLUTION)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_300_600_CAPABLE); if ((s->supported_resolutions & T30_SUPPORT_400_800_RESOLUTION)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_400_800_CAPABLE); if ((s->supported_resolutions & T30_SUPPORT_600_1200_RESOLUTION)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_600_1200_CAPABLE); /* No colour/grey scale 600x600 */ /* No colour/grey scale 1200x1200 */ /* No double sided printing (alternate mode) */ /* No double sided printing (continuous mode) */ /* No black and white mixed raster content profile */ /* No shared data memory */ /* No T.44 colour space */ if ((s->iaf & T30_IAF_MODE_FLOW_CONTROL)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T38_FLOW_CONTROL_CAPABLE); /* No k > 4 */ if ((s->iaf & T30_IAF_MODE_CONTINUOUS_FLOW)) set_ctrl_bit(s->local_dis_dtc_frame, T30_DIS_BIT_T38_FAX_CAPABLE); /* No T.88/T.89 profile */ s->local_dis_dtc_len = 19; //t30_decode_dis_dtc_dcs(s, s->local_dis_dtc_frame, s->local_dis_dtc_len); return 0; } /*- End of function --------------------------------------------------------*/ static int prune_dis_dtc(t30_state_t *s) { int i; /* Find the last octet that is really needed, set the extension bits, and trim the message length */ for (i = 18; i >= 6; i--) { /* Strip the top bit */ s->local_dis_dtc_frame[i] &= (DISBIT1 | DISBIT2 | DISBIT3 | DISBIT4 | DISBIT5 | DISBIT6 | DISBIT7); /* Check if there is some real message content here */ if (s->local_dis_dtc_frame[i]) break; } s->local_dis_dtc_len = i + 1; /* Fill in any required extension bits */ s->local_dis_dtc_frame[i] &= ~DISBIT8; for (i--; i > 4; i--) s->local_dis_dtc_frame[i] |= DISBIT8; t30_decode_dis_dtc_dcs(s, s->local_dis_dtc_frame, s->local_dis_dtc_len); return s->local_dis_dtc_len; } /*- End of function --------------------------------------------------------*/ static int build_dcs(t30_state_t *s) { int i; int bad; /* Make a DCS frame based on local issues and the latest received DIS/DTC frame. Negotiate the result based on what both parties can do. */ s->dcs_frame[0] = ADDRESS_FIELD; s->dcs_frame[1] = CONTROL_FIELD_FINAL_FRAME; s->dcs_frame[2] = (uint8_t) (T30_DCS | s->dis_received); for (i = 3; i < 19; i++) s->dcs_frame[i] = 0x00; #if 0 /* Check for T.37 simple mode. */ if (test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_T37)) set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_T37); /* Check for T.38 mode. */ if (test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_T38)) set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_T38); #endif /* Set to required modem rate */ s->dcs_frame[4] |= fallback_sequence[s->current_fallback].dcs_code; /* Select the compression to use. */ switch (s->line_encoding) { case T4_COMPRESSION_ITU_T85: set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_T85_MODE); clr_ctrl_bit(s->dcs_frame, T30_DCS_BIT_T85_L0_MODE); set_ctrl_bits(s->dcs_frame, T30_MIN_SCAN_0MS, 21); break; case T4_COMPRESSION_ITU_T85_L0: set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_T85_MODE); set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_T85_L0_MODE); set_ctrl_bits(s->dcs_frame, T30_MIN_SCAN_0MS, 21); break; case T4_COMPRESSION_ITU_T6: set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_T6_MODE); set_ctrl_bits(s->dcs_frame, T30_MIN_SCAN_0MS, 21); break; case T4_COMPRESSION_ITU_T4_2D: set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_2D_MODE); set_ctrl_bits(s->dcs_frame, s->min_scan_time_code, 21); break; case T4_COMPRESSION_ITU_T4_1D: set_ctrl_bits(s->dcs_frame, s->min_scan_time_code, 21); break; default: set_ctrl_bits(s->dcs_frame, T30_MIN_SCAN_0MS, 21); break; } /* We have a file to send, so tell the far end to go into receive mode. */ set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_RECEIVE_FAX_DOCUMENT); /* Set the Y resolution bits */ bad = T30_ERR_OK; switch (s->y_resolution) { case T4_Y_RESOLUTION_1200: switch (s->x_resolution) { case T4_X_RESOLUTION_600: if (!(s->supported_resolutions & T30_SUPPORT_600_1200_RESOLUTION)) bad = T30_ERR_NORESSUPPORT; else set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_600_1200); break; case T4_X_RESOLUTION_1200: if (!(s->supported_resolutions & T30_SUPPORT_1200_1200_RESOLUTION)) bad = T30_ERR_NORESSUPPORT; else set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_1200_1200); break; default: bad = T30_ERR_NORESSUPPORT; break; } break; case T4_Y_RESOLUTION_800: switch (s->x_resolution) { case T4_X_RESOLUTION_R16: if (!(s->supported_resolutions & T30_SUPPORT_400_800_RESOLUTION)) bad = T30_ERR_NORESSUPPORT; else set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_400_800); break; default: bad = T30_ERR_NORESSUPPORT; break; } break; case T4_Y_RESOLUTION_600: switch (s->x_resolution) { case T4_X_RESOLUTION_300: if (!(s->supported_resolutions & T30_SUPPORT_300_600_RESOLUTION)) bad = T30_ERR_NORESSUPPORT; else set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_300_600); break; case T4_X_RESOLUTION_600: if (!(s->supported_resolutions & T30_SUPPORT_600_600_RESOLUTION)) bad = T30_ERR_NORESSUPPORT; else set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_600_600); break; default: bad = T30_ERR_NORESSUPPORT; break; } break; case T4_Y_RESOLUTION_SUPERFINE: if (!(s->supported_resolutions & T30_SUPPORT_SUPERFINE_RESOLUTION)) { bad = T30_ERR_NORESSUPPORT; } else { switch (s->x_resolution) { case T4_X_RESOLUTION_R8: set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_200_400); break; case T4_X_RESOLUTION_R16: set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_400_400); break; default: bad = T30_ERR_NORESSUPPORT; break; } } break; case T4_Y_RESOLUTION_300: switch (s->x_resolution) { case T4_X_RESOLUTION_300: if (!(s->supported_resolutions & T30_SUPPORT_300_300_RESOLUTION)) bad = T30_ERR_NORESSUPPORT; else set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_300_300); break; default: bad = T30_ERR_NORESSUPPORT; break; } break; case T4_Y_RESOLUTION_FINE: if (!(s->supported_resolutions & T30_SUPPORT_FINE_RESOLUTION)) { bad = T30_ERR_NORESSUPPORT; } else { switch (s->x_resolution) { case T4_X_RESOLUTION_R8: set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_200_200); break; default: bad = T30_ERR_NORESSUPPORT; break; } } break; default: case T4_Y_RESOLUTION_STANDARD: switch (s->x_resolution) { case T4_X_RESOLUTION_R8: /* No bits to set for this */ break; default: bad = T30_ERR_NORESSUPPORT; break; } break; } if (bad != T30_ERR_OK) { t30_set_status(s, bad); span_log(&s->logging, SPAN_LOG_FLOW, "Image resolution (%d x %d) not acceptable\n", s->x_resolution, s->y_resolution); return -1; } /* Deal with the image width. The X resolution will fall in line with any valid width. */ /* Low (R4) res widths are not supported in recent versions of T.30 */ bad = T30_ERR_OK; /* The following treats a width field of 11 like 10, which does what note 6 of Table 2/T.30 says we should do with the invalid value 11. */ switch (s->image_width) { case T4_WIDTH_R8_A4: case T4_WIDTH_300_A4: case T4_WIDTH_R16_A4: case T4_WIDTH_600_A4: case T4_WIDTH_1200_A4: /* No width related bits need to be set. */ break; case T4_WIDTH_R8_B4: case T4_WIDTH_300_B4: case T4_WIDTH_R16_B4: case T4_WIDTH_600_B4: case T4_WIDTH_1200_B4: if ((s->far_dis_dtc_frame[5] & (DISBIT2 | DISBIT1)) < 1) bad = T30_ERR_NOSIZESUPPORT; else if (!(s->supported_image_sizes & T30_SUPPORT_255MM_WIDTH)) bad = T30_ERR_NOSIZESUPPORT; else set_ctrl_bit(s->dcs_frame, 17); break; case T4_WIDTH_R8_A3: case T4_WIDTH_300_A3: case T4_WIDTH_R16_A3: case T4_WIDTH_600_A3: case T4_WIDTH_1200_A3: if ((s->far_dis_dtc_frame[5] & (DISBIT2 | DISBIT1)) < 2) bad = T30_ERR_NOSIZESUPPORT; else if (!(s->supported_image_sizes & T30_SUPPORT_303MM_WIDTH)) bad = T30_ERR_NOSIZESUPPORT; else set_ctrl_bit(s->dcs_frame, 18); break; default: /* T.30 does not support this width */ bad = T30_ERR_NOSIZESUPPORT; break; } if (bad != T30_ERR_OK) { t30_set_status(s, bad); span_log(&s->logging, SPAN_LOG_FLOW, "Image width (%d pixels) is not an acceptable FAX image width\n", s->image_width); return -1; } switch (s->image_width) { case T4_WIDTH_R8_A4: case T4_WIDTH_R8_B4: case T4_WIDTH_R8_A3: /* These are always OK */ break; case T4_WIDTH_300_A4: case T4_WIDTH_300_B4: case T4_WIDTH_300_A3: if (!test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_300_300_CAPABLE) && !test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_300_600_CAPABLE)) bad = T30_ERR_NOSIZESUPPORT; break; case T4_WIDTH_R16_A4: case T4_WIDTH_R16_B4: case T4_WIDTH_R16_A3: if (!test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_400_400_CAPABLE)) bad = T30_ERR_NOSIZESUPPORT; break; case T4_WIDTH_600_A4: case T4_WIDTH_600_B4: case T4_WIDTH_600_A3: if (!test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_600_600_CAPABLE) && !test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_600_1200_CAPABLE)) bad = T30_ERR_NOSIZESUPPORT; break; case T4_WIDTH_1200_A4: case T4_WIDTH_1200_B4: case T4_WIDTH_1200_A3: if (!test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_1200_1200_CAPABLE)) bad = T30_ERR_NOSIZESUPPORT; break; default: /* T.30 does not support this width */ bad = T30_ERR_NOSIZESUPPORT; break; } if (bad != T30_ERR_OK) { t30_set_status(s, bad); span_log(&s->logging, SPAN_LOG_FLOW, "Image width (%d pixels) is not an acceptable FAX image width\n", s->image_width); return -1; } /* Deal with the image length */ /* If the other end supports unlimited length, then use that. Otherwise, if the other end supports B4 use that, as its longer than the default A4 length. */ if (test_ctrl_bit(s->far_dis_dtc_frame, 20)) set_ctrl_bit(s->dcs_frame, 20); else if (test_ctrl_bit(s->far_dis_dtc_frame, 19)) set_ctrl_bit(s->dcs_frame, 19); if (s->error_correcting_mode) set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_ECM); if ((s->iaf & T30_IAF_MODE_FLOW_CONTROL) && test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_T38_FLOW_CONTROL_CAPABLE)) set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_T38_FLOW_CONTROL_CAPABLE); if ((s->iaf & T30_IAF_MODE_CONTINUOUS_FLOW) && test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_T38_FAX_CAPABLE)) { /* Clear the modem type bits, in accordance with note 77 of Table 2/T.30 */ clr_ctrl_bit(s->local_dis_dtc_frame, 11); clr_ctrl_bit(s->local_dis_dtc_frame, 12); clr_ctrl_bit(s->local_dis_dtc_frame, 13); clr_ctrl_bit(s->local_dis_dtc_frame, 14); set_ctrl_bit(s->dcs_frame, T30_DCS_BIT_T38_FAX_MODE); } s->dcs_len = 19; //t30_decode_dis_dtc_dcs(s, s->dcs_frame, s->dcs_len); return 0; } /*- End of function --------------------------------------------------------*/ static int prune_dcs(t30_state_t *s) { int i; /* Find the last octet that is really needed, set the extension bits, and trim the message length */ for (i = 18; i >= 6; i--) { /* Strip the top bit */ s->dcs_frame[i] &= (DISBIT1 | DISBIT2 | DISBIT3 | DISBIT4 | DISBIT5 | DISBIT6 | DISBIT7); /* Check if there is some real message content here */ if (s->dcs_frame[i]) break; } s->dcs_len = i + 1; /* Fill in any required extension bits */ s->local_dis_dtc_frame[i] &= ~DISBIT8; for (i-- ; i > 4; i--) s->dcs_frame[i] |= DISBIT8; t30_decode_dis_dtc_dcs(s, s->dcs_frame, s->dcs_len); return s->dcs_len; } /*- End of function --------------------------------------------------------*/ static int step_fallback_entry(t30_state_t *s) { int min_row_bits; while (fallback_sequence[++s->current_fallback].which) { if ((fallback_sequence[s->current_fallback].which & s->current_permitted_modems)) break; } if (fallback_sequence[s->current_fallback].which == 0) return -1; /* TODO: This only sets the minimum row time for future pages. It doesn't fix up the current page, though it is benign - fallback will only result in an excessive minimum. */ min_row_bits = set_min_scan_time_code(s); t4_tx_set_min_bits_per_row(&s->t4.tx, min_row_bits); /* We need to rebuild the DCS message we will send. */ build_dcs(s); return s->current_fallback; } /*- End of function --------------------------------------------------------*/ static int find_fallback_entry(int dcs_code) { int i; /* The table is short, and not searched often, so a brain-dead linear scan seems OK */ for (i = 0; fallback_sequence[i].bit_rate; i++) { if (fallback_sequence[i].dcs_code == dcs_code) break; } if (fallback_sequence[i].bit_rate == 0) return -1; return i; } /*- End of function --------------------------------------------------------*/ static void send_dcn(t30_state_t *s) { queue_phase(s, T30_PHASE_D_TX); set_state(s, T30_STATE_C); send_simple_frame(s, T30_DCN); } /*- End of function --------------------------------------------------------*/ static void return_to_phase_b(t30_state_t *s, int with_fallback) { /* This is what we do after things like T30_EOM is exchanged. */ #if 0 if (step_fallback_entry(s) < 0) { /* We have fallen back as far as we can go. Give up. */ s->current_fallback = 0; t30_set_status(s, T30_ERR_CANNOT_TRAIN); send_dcn(s); } else { if (s->calling_party) set_state(s, T30_STATE_T); else set_state(s, T30_STATE_R); } #else if (s->calling_party) set_state(s, T30_STATE_T); else set_state(s, T30_STATE_R); #endif } /*- End of function --------------------------------------------------------*/ static int send_dis_or_dtc_sequence(t30_state_t *s, int start) { /* (NSF) (CSI) DIS */ /* (NSC) (CIG) (PWD) (SEP) (PSA) (CIA) (ISP) DTC */ if (start) { set_dis_or_dtc(s); set_state(s, T30_STATE_R); s->step = 0; } if (!s->dis_received) { /* DIS sequence */ switch (s->step) { case 0: s->step++; if (send_nsf_frame(s)) break; /* Fall through */ case 1: s->step++; if (send_ident_frame(s, T30_CSI)) break; /* Fall through */ case 2: s->step++; prune_dis_dtc(s); send_frame(s, s->local_dis_dtc_frame, s->local_dis_dtc_len); break; case 3: s->step++; shut_down_hdlc_tx(s); break; default: return -1; } } else { /* DTC sequence */ switch (s->step) { case 0: s->step++; if (send_nsc_frame(s)) break; /* Fall through */ case 1: s->step++; if (send_ident_frame(s, T30_CIG)) break; /* Fall through */ case 2: s->step++; if (send_pwd_frame(s)) break; /* Fall through */ case 3: s->step++; if (send_sep_frame(s)) break; /* Fall through */ case 4: s->step++; if (send_psa_frame(s)) break; /* Fall through */ case 5: s->step++; if (send_cia_frame(s)) break; /* Fall through */ case 6: s->step++; if (send_isp_frame(s)) break; /* Fall through */ case 7: s->step++; prune_dis_dtc(s); send_frame(s, s->local_dis_dtc_frame, s->local_dis_dtc_len); break; case 8: s->step++; shut_down_hdlc_tx(s); break; default: return -1; } } return 0; } /*- End of function --------------------------------------------------------*/ static int send_dcs_sequence(t30_state_t *s, int start) { /* (NSS) (TSI) (SUB) (SID) (TSA) (IRA) DCS */ /* Schedule training after the messages */ if (start) { prune_dcs(s); set_state(s, T30_STATE_D); s->step = 0; } switch (s->step) { case 0: s->step++; if (send_nss_frame(s)) break; /* Fall through */ case 1: s->step++; if (send_ident_frame(s, T30_TSI)) break; /* Fall through */ case 2: s->step++; if (send_sub_frame(s)) break; /* Fall through */ case 3: s->step++; if (send_sid_frame(s)) break; /* Fall through */ case 4: s->step++; if (send_tsa_frame(s)) break; /* Fall through */ case 5: s->step++; if (send_ira_frame(s)) break; /* Fall through */ case 6: s->step++; prune_dcs(s); send_frame(s, s->dcs_frame, s->dcs_len); break; case 7: s->step++; shut_down_hdlc_tx(s); break; default: return -1; } return 0; } /*- End of function --------------------------------------------------------*/ static int send_cfr_sequence(t30_state_t *s, int start) { /* (CSA) CFR */ /* CFR is usually a simple frame, but can become a sequence with Internet FAXing. */ if (start) s->step = 0; switch (s->step) { case 0: s->step++; if (send_csa_frame(s)) break; /* Fall through */ case 1: s->step++; send_simple_frame(s, T30_CFR); break; case 2: s->step++; shut_down_hdlc_tx(s); break; default: return -1; } return 0; } /*- End of function --------------------------------------------------------*/ static void terminate_call(t30_state_t *s) { /* Make sure any FAX in progress is tidied up. If the tidying up has already happened, repeating it here is harmless. */ terminate_operation_in_progress(s); s->timer_t0_t1 = 0; s->timer_t2_t4 = 0; s->timer_t3 = 0; s->timer_t5 = 0; if (s->phase_e_handler) s->phase_e_handler(s, s->phase_e_user_data, s->current_status); set_state(s, T30_STATE_CALL_FINISHED); set_phase(s, T30_PHASE_CALL_FINISHED); release_resources(s); span_log(&s->logging, SPAN_LOG_FLOW, "Call completed\n"); } /*- End of function --------------------------------------------------------*/ static void start_final_pause(t30_state_t *s) { /* We need to allow some time for the last part of our FAX signalling to flush through to the far end before we declare the call finished. If we say it is finished too soon, the call disconnect message could cause buffers downstream to be flushed, rather than played out to completion. If that clips the final message, the far end might declare that the call prematrurely terminated. */ span_log(&s->logging, SPAN_LOG_FLOW, "Starting final pause before disconnecting\n"); /* Make sure any FAX in progress is tidied up. If the tidying up has already happened, repeating it here is harmless. */ terminate_operation_in_progress(s); s->timer_t0_t1 = 0; s->timer_t2_t4 = 0; s->timer_t3 = 0; s->timer_t5 = 0; set_phase(s, T30_PHASE_E); set_state(s, T30_STATE_B); } /*- End of function --------------------------------------------------------*/ static int set_min_scan_time_code(t30_state_t *s) { /* Translation between the codes for the minimum scan times the other end needs, and the codes for what we say will be used. We need 0 minimum. */ static const uint8_t translate_min_scan_time[3][8] = { {T30_MIN_SCAN_20MS, T30_MIN_SCAN_5MS, T30_MIN_SCAN_10MS, T30_MIN_SCAN_20MS, T30_MIN_SCAN_40MS, T30_MIN_SCAN_40MS, T30_MIN_SCAN_10MS, T30_MIN_SCAN_0MS}, /* normal */ {T30_MIN_SCAN_20MS, T30_MIN_SCAN_5MS, T30_MIN_SCAN_10MS, T30_MIN_SCAN_10MS, T30_MIN_SCAN_40MS, T30_MIN_SCAN_20MS, T30_MIN_SCAN_5MS, T30_MIN_SCAN_0MS}, /* fine */ {T30_MIN_SCAN_10MS, T30_MIN_SCAN_5MS, T30_MIN_SCAN_5MS, T30_MIN_SCAN_5MS, T30_MIN_SCAN_20MS, T30_MIN_SCAN_10MS, T30_MIN_SCAN_5MS, T30_MIN_SCAN_0MS} /* superfine, when half fine time is selected */ }; /* Translation between the codes for the minimum scan time we will use, and milliseconds. */ static const int min_scan_times[8] = { 20, 5, 10, 0, 40, 0, 0, 0 }; int min_bits_field; /* Set the minimum scan time bits */ if (s->error_correcting_mode) min_bits_field = T30_MIN_SCAN_0MS; else min_bits_field = (s->far_dis_dtc_frame[5] >> 4) & 7; switch (s->y_resolution) { case T4_Y_RESOLUTION_SUPERFINE: if (!test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_200_400_CAPABLE)) { t30_set_status(s, T30_ERR_NORESSUPPORT); span_log(&s->logging, SPAN_LOG_FLOW, "Remote FAX does not support super-fine resolution.\n"); return -1; } s->min_scan_time_code = translate_min_scan_time[(test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_MIN_SCAN_TIME_HALVES)) ? 2 : 1][min_bits_field]; break; case T4_Y_RESOLUTION_FINE: if (!test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_200_200_CAPABLE)) { t30_set_status(s, T30_ERR_NORESSUPPORT); span_log(&s->logging, SPAN_LOG_FLOW, "Remote FAX does not support fine resolution.\n"); return -1; } s->min_scan_time_code = translate_min_scan_time[1][min_bits_field]; break; default: case T4_Y_RESOLUTION_STANDARD: s->min_scan_time_code = translate_min_scan_time[0][min_bits_field]; break; } if (!s->error_correcting_mode && (s->iaf & T30_IAF_MODE_NO_FILL_BITS)) return 0; return fallback_sequence[s->current_fallback].bit_rate*min_scan_times[s->min_scan_time_code]/1000; } /*- End of function --------------------------------------------------------*/ static int start_sending_document(t30_state_t *s) { int min_row_bits; if (s->tx_file[0] == '\0') { /* There is nothing to send */ span_log(&s->logging, SPAN_LOG_FLOW, "No document to send\n"); return -1; } span_log(&s->logging, SPAN_LOG_FLOW, "Start sending document\n"); if (t4_tx_init(&s->t4.tx, s->tx_file, s->tx_start_page, s->tx_stop_page) == NULL) { span_log(&s->logging, SPAN_LOG_WARNING, "Cannot open source TIFF file '%s'\n", s->tx_file); t30_set_status(s, T30_ERR_FILEERROR); return -1; } s->operation_in_progress = OPERATION_IN_PROGRESS_T4_TX; t4_tx_get_pages_in_file(&s->t4.tx); t4_tx_set_tx_encoding(&s->t4.tx, s->line_encoding); t4_tx_set_local_ident(&s->t4.tx, s->tx_info.ident); t4_tx_set_header_info(&s->t4.tx, s->header_info); if (s->use_own_tz) t4_tx_set_header_tz(&s->t4.tx, &s->tz); s->x_resolution = t4_tx_get_x_resolution(&s->t4.tx); s->y_resolution = t4_tx_get_y_resolution(&s->t4.tx); /* The minimum scan time to be used can't be evaluated until we know the Y resolution, and must be evaluated before the minimum scan row bits can be evaluated. */ if ((min_row_bits = set_min_scan_time_code(s)) < 0) { terminate_operation_in_progress(s); return -1; } span_log(&s->logging, SPAN_LOG_FLOW, "Minimum bits per row will be %d\n", min_row_bits); t4_tx_set_min_bits_per_row(&s->t4.tx, min_row_bits); if (tx_start_page(s)) return -1; s->image_width = t4_tx_get_image_width(&s->t4.tx); if (s->error_correcting_mode) { if (get_partial_ecm_page(s) == 0) span_log(&s->logging, SPAN_LOG_WARNING, "No image data to send\n"); } return 0; } /*- End of function --------------------------------------------------------*/ static int restart_sending_document(t30_state_t *s) { t4_tx_restart_page(&s->t4.tx); s->retries = 0; s->ecm_block = 0; send_dcs_sequence(s, true); return 0; } /*- End of function --------------------------------------------------------*/ static int start_receiving_document(t30_state_t *s) { if (s->rx_file[0] == '\0') { /* There is nothing to receive to */ span_log(&s->logging, SPAN_LOG_FLOW, "No document to receive\n"); return -1; } span_log(&s->logging, SPAN_LOG_FLOW, "Start receiving document\n"); queue_phase(s, T30_PHASE_B_TX); s->ecm_block = 0; send_dis_or_dtc_sequence(s, true); return 0; } /*- End of function --------------------------------------------------------*/ static void unexpected_non_final_frame(t30_state_t *s, const uint8_t *msg, int len) { span_log(&s->logging, SPAN_LOG_FLOW, "Unexpected %s frame in state %d\n", t30_frametype(msg[2]), s->state); if (s->current_status == T30_ERR_OK) t30_set_status(s, T30_ERR_UNEXPECTED); } /*- End of function --------------------------------------------------------*/ static void unexpected_final_frame(t30_state_t *s, const uint8_t *msg, int len) { span_log(&s->logging, SPAN_LOG_FLOW, "Unexpected %s frame in state %d\n", t30_frametype(msg[2]), s->state); if (s->current_status == T30_ERR_OK) t30_set_status(s, T30_ERR_UNEXPECTED); send_dcn(s); } /*- End of function --------------------------------------------------------*/ static void unexpected_frame_length(t30_state_t *s, const uint8_t *msg, int len) { span_log(&s->logging, SPAN_LOG_FLOW, "Unexpected %s frame length - %d\n", t30_frametype(msg[0]), len); if (s->current_status == T30_ERR_OK) t30_set_status(s, T30_ERR_UNEXPECTED); send_dcn(s); } /*- End of function --------------------------------------------------------*/ static int process_rx_dis_dtc(t30_state_t *s, const uint8_t *msg, int len) { int new_status; t30_decode_dis_dtc_dcs(s, msg, len); if (len < 6) { span_log(&s->logging, SPAN_LOG_FLOW, "Short DIS/DTC frame\n"); return -1; } if (msg[2] == T30_DIS) s->dis_received = true; /* Make a local copy of the message, padded to the maximum possible length with zeros. This allows us to simply pick out the bits, without worrying about whether they were set from the remote side. */ s->far_dis_dtc_len = (len > T30_MAX_DIS_DTC_DCS_LEN) ? T30_MAX_DIS_DTC_DCS_LEN : len; memcpy(s->far_dis_dtc_frame, msg, s->far_dis_dtc_len); if (s->far_dis_dtc_len < T30_MAX_DIS_DTC_DCS_LEN) memset(s->far_dis_dtc_frame + s->far_dis_dtc_len, 0, T30_MAX_DIS_DTC_DCS_LEN - s->far_dis_dtc_len); s->error_correcting_mode = (s->ecm_allowed && (s->far_dis_dtc_frame[6] & DISBIT3) != 0); /* 256 octets per ECM frame */ s->octets_per_ecm_frame = 256; /* Select the compression to use. */ if (s->error_correcting_mode && (s->supported_compressions & T30_SUPPORT_T85_COMPRESSION) && test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_T85_CAPABLE)) { if (s->supported_compressions & T30_SUPPORT_T85_L0_COMPRESSION && test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_T85_L0_CAPABLE)) { s->line_encoding = T4_COMPRESSION_ITU_T85_L0; } else { s->line_encoding = T4_COMPRESSION_ITU_T85; } } else if (s->error_correcting_mode && (s->supported_compressions & T30_SUPPORT_T6_COMPRESSION) && test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_T6_CAPABLE)) { s->line_encoding = T4_COMPRESSION_ITU_T6; } else if ((s->supported_compressions & T30_SUPPORT_T4_2D_COMPRESSION) && test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_2D_CAPABLE)) { s->line_encoding = T4_COMPRESSION_ITU_T4_2D; } else { s->line_encoding = T4_COMPRESSION_ITU_T4_1D; } span_log(&s->logging, SPAN_LOG_FLOW, "Selected compression %s (%d)\n", t4_encoding_to_str(s->line_encoding), s->line_encoding); switch (s->far_dis_dtc_frame[4] & (DISBIT6 | DISBIT5 | DISBIT4 | DISBIT3)) { case (DISBIT6 | DISBIT4 | DISBIT3): if ((s->supported_modems & T30_SUPPORT_V17)) { s->current_permitted_modems = T30_SUPPORT_V17 | T30_SUPPORT_V29 | T30_SUPPORT_V27TER; s->current_fallback = T30_V17_FALLBACK_START; break; } /* Fall through */ case (DISBIT4 | DISBIT3): if ((s->supported_modems & T30_SUPPORT_V29)) { s->current_permitted_modems = T30_SUPPORT_V29 | T30_SUPPORT_V27TER; s->current_fallback = T30_V29_FALLBACK_START; break; } /* Fall through */ case DISBIT4: s->current_permitted_modems = T30_SUPPORT_V27TER; s->current_fallback = T30_V27TER_FALLBACK_START; break; case 0: s->current_permitted_modems = T30_SUPPORT_V27TER; s->current_fallback = T30_V27TER_FALLBACK_START + 1; break; case DISBIT3: if ((s->supported_modems & T30_SUPPORT_V29)) { /* TODO: this doesn't allow for skipping the V.27ter modes */ s->current_permitted_modems = T30_SUPPORT_V29; s->current_fallback = T30_V29_FALLBACK_START; break; } /* Fall through */ default: span_log(&s->logging, SPAN_LOG_FLOW, "Remote does not support a compatible modem\n"); /* We cannot talk to this machine! */ t30_set_status(s, T30_ERR_INCOMPATIBLE); return -1; } if (s->phase_b_handler) { new_status = s->phase_b_handler(s, s->phase_b_user_data, msg[2]); if (new_status != T30_ERR_OK) { span_log(&s->logging, SPAN_LOG_FLOW, "Application rejected DIS/DTC - '%s'\n", t30_completion_code_to_str(new_status)); t30_set_status(s, new_status); /* TODO: If FNV is allowed, process it here */ send_dcn(s); return -1; } } queue_phase(s, T30_PHASE_B_TX); /* Try to send something */ if (s->tx_file[0]) { span_log(&s->logging, SPAN_LOG_FLOW, "Trying to send file '%s'\n", s->tx_file); if (!test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_READY_TO_RECEIVE_FAX_DOCUMENT)) { span_log(&s->logging, SPAN_LOG_FLOW, "%s far end cannot receive\n", t30_frametype(msg[2])); t30_set_status(s, T30_ERR_RX_INCAPABLE); send_dcn(s); return -1; } if (start_sending_document(s)) { send_dcn(s); return -1; } if (build_dcs(s)) { span_log(&s->logging, SPAN_LOG_FLOW, "The far end is incompatible\n", s->tx_file); send_dcn(s); return -1; } s->retries = 0; send_dcs_sequence(s, true); return 0; } span_log(&s->logging, SPAN_LOG_FLOW, "%s nothing to send\n", t30_frametype(msg[2])); /* ... then try to receive something */ if (s->rx_file[0]) { span_log(&s->logging, SPAN_LOG_FLOW, "Trying to receive file '%s'\n", s->rx_file); if (!test_ctrl_bit(s->far_dis_dtc_frame, T30_DIS_BIT_READY_TO_TRANSMIT_FAX_DOCUMENT)) { span_log(&s->logging, SPAN_LOG_FLOW, "%s far end cannot transmit\n", t30_frametype(msg[2])); t30_set_status(s, T30_ERR_TX_INCAPABLE); send_dcn(s); return -1; } if (start_receiving_document(s)) { send_dcn(s); return -1; } if (set_dis_or_dtc(s)) { t30_set_status(s, T30_ERR_INCOMPATIBLE); send_dcn(s); return -1; } s->retries = 0; send_dis_or_dtc_sequence(s, true); return 0; } span_log(&s->logging, SPAN_LOG_FLOW, "%s nothing to receive\n", t30_frametype(msg[2])); /* There is nothing to do, or nothing we are able to do. */ send_dcn(s); return -1; } /*- End of function --------------------------------------------------------*/ static int process_rx_dcs(t30_state_t *s, const uint8_t *msg, int len) { static const int widths[6][4] = { { T4_WIDTH_R4_A4, T4_WIDTH_R4_B4, T4_WIDTH_R4_A3, -1}, /* R4 resolution - no longer used in recent versions of T.30 */ { T4_WIDTH_R8_A4, T4_WIDTH_R8_B4, T4_WIDTH_R8_A3, -1}, /* R8 resolution */ { T4_WIDTH_300_A4, T4_WIDTH_300_B4, T4_WIDTH_300_A3, -1}, /* 300/inch resolution */ { T4_WIDTH_R16_A4, T4_WIDTH_R16_B4, T4_WIDTH_R16_A3, -1}, /* R16 resolution */ { T4_WIDTH_600_A4, T4_WIDTH_600_B4, T4_WIDTH_600_A3, -1}, /* 600/inch resolution */ {T4_WIDTH_1200_A4, T4_WIDTH_1200_B4, T4_WIDTH_1200_A3, -1} /* 1200/inch resolution */ }; uint8_t dcs_frame[T30_MAX_DIS_DTC_DCS_LEN]; int i; int new_status; t30_decode_dis_dtc_dcs(s, msg, len); /* Check DCS frame from remote */ if (len < 6) { span_log(&s->logging, SPAN_LOG_FLOW, "Short DCS frame\n"); return -1; } /* Make an ASCII string format copy of the message, for logging in the received file. This string does not include the frame header octets. */ sprintf(s->rx_dcs_string, "%02X", bit_reverse8(msg[3])); for (i = 4; i < len; i++) sprintf(s->rx_dcs_string + 3*i - 10, " %02X", bit_reverse8(msg[i])); /* Make a local copy of the message, padded to the maximum possible length with zeros. This allows us to simply pick out the bits, without worrying about whether they were set from the remote side. */ if (len > T30_MAX_DIS_DTC_DCS_LEN) { memcpy(dcs_frame, msg, T30_MAX_DIS_DTC_DCS_LEN); } else { memcpy(dcs_frame, msg, len); if (len < T30_MAX_DIS_DTC_DCS_LEN) memset(dcs_frame + len, 0, T30_MAX_DIS_DTC_DCS_LEN - len); } s->octets_per_ecm_frame = test_ctrl_bit(dcs_frame, T30_DCS_BIT_64_OCTET_ECM_FRAMES) ? 256 : 64; if (test_ctrl_bit(dcs_frame, T30_DCS_BIT_1200_1200)) s->x_resolution = T4_X_RESOLUTION_1200; else if (test_ctrl_bit(dcs_frame, T30_DCS_BIT_600_600) || test_ctrl_bit(dcs_frame, T30_DCS_BIT_600_1200)) s->x_resolution = T4_X_RESOLUTION_600; else if (test_ctrl_bit(dcs_frame, T30_DCS_BIT_400_400) || test_ctrl_bit(dcs_frame, T30_DCS_BIT_400_800)) s->x_resolution = T4_X_RESOLUTION_R16; else if (test_ctrl_bit(dcs_frame, T30_DCS_BIT_300_300) || test_ctrl_bit(dcs_frame, T30_DCS_BIT_300_600)) s->x_resolution = T4_X_RESOLUTION_300; else s->x_resolution = T4_X_RESOLUTION_R8; if (test_ctrl_bit(dcs_frame, T30_DCS_BIT_1200_1200) || test_ctrl_bit(dcs_frame, T30_DCS_BIT_600_1200)) s->y_resolution = T4_Y_RESOLUTION_1200; else if (test_ctrl_bit(dcs_frame, T30_DCS_BIT_400_800)) s->y_resolution = T4_Y_RESOLUTION_800; else if (test_ctrl_bit(dcs_frame, T30_DCS_BIT_600_600) || test_ctrl_bit(dcs_frame, T30_DCS_BIT_300_600)) s->y_resolution = T4_Y_RESOLUTION_600; else if (test_ctrl_bit(dcs_frame, T30_DCS_BIT_200_400) || test_ctrl_bit(dcs_frame, T30_DCS_BIT_400_400)) s->y_resolution = T4_Y_RESOLUTION_SUPERFINE; else if (test_ctrl_bit(dcs_frame, T30_DCS_BIT_300_300)) s->y_resolution = T4_Y_RESOLUTION_300; else if (test_ctrl_bit(dcs_frame, T30_DCS_BIT_200_200)) s->y_resolution = T4_Y_RESOLUTION_FINE; else s->y_resolution = T4_Y_RESOLUTION_STANDARD; if (s->x_resolution == T4_X_RESOLUTION_1200) i = 5; else if (s->x_resolution == T4_X_RESOLUTION_600) i = 4; else if (s->x_resolution == T4_X_RESOLUTION_R16) i = 3; else if (s->x_resolution == T4_X_RESOLUTION_300) i = 2; else if (s->x_resolution == T4_X_RESOLUTION_R4) i = 0; else i = 1; s->image_width = widths[i][dcs_frame[5] & (DISBIT2 | DISBIT1)]; /* Check which compression we will use. */ if (test_ctrl_bit(dcs_frame, T30_DCS_BIT_T85_MODE)) { if (test_ctrl_bit(dcs_frame, T30_DCS_BIT_T85_L0_MODE)) s->line_encoding = T4_COMPRESSION_ITU_T85_L0; else s->line_encoding = T4_COMPRESSION_ITU_T85; } else if (test_ctrl_bit(dcs_frame, T30_DCS_BIT_T6_MODE)) { s->line_encoding = T4_COMPRESSION_ITU_T6; } else if (test_ctrl_bit(dcs_frame, T30_DCS_BIT_2D_MODE)) { s->line_encoding = T4_COMPRESSION_ITU_T4_2D; } else { s->line_encoding = T4_COMPRESSION_ITU_T4_1D; } span_log(&s->logging, SPAN_LOG_FLOW, "Selected compression %s (%d)\n", t4_encoding_to_str(s->line_encoding), s->line_encoding); if (!test_ctrl_bit(dcs_frame, T30_DCS_BIT_RECEIVE_FAX_DOCUMENT)) span_log(&s->logging, SPAN_LOG_PROTOCOL_WARNING, "Remote is not requesting receive in DCS\n"); if ((s->current_fallback = find_fallback_entry(dcs_frame[4] & (DISBIT6 | DISBIT5 | DISBIT4 | DISBIT3))) < 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Remote asked for a modem standard we do not support\n"); return -1; } s->error_correcting_mode = (test_ctrl_bit(dcs_frame, T30_DCS_BIT_ECM) != 0); if (s->phase_b_handler) { new_status = s->phase_b_handler(s, s->phase_b_user_data, msg[2]); if (new_status != T30_ERR_OK) { span_log(&s->logging, SPAN_LOG_FLOW, "Application rejected DCS - '%s'\n", t30_completion_code_to_str(new_status)); t30_set_status(s, new_status); /* TODO: If FNV is allowed, process it here */ send_dcn(s); return -1; } } /* Start document reception */ span_log(&s->logging, SPAN_LOG_FLOW, "Get document at %dbps, modem %d\n", fallback_sequence[s->current_fallback].bit_rate, fallback_sequence[s->current_fallback].modem_type); if (s->rx_file[0] == '\0') { span_log(&s->logging, SPAN_LOG_FLOW, "No document to receive\n"); t30_set_status(s, T30_ERR_FILEERROR); send_dcn(s); return -1; } if (s->operation_in_progress != OPERATION_IN_PROGRESS_T4_RX) { if (t4_rx_init(&s->t4.rx, s->rx_file, s->output_encoding) == NULL) { span_log(&s->logging, SPAN_LOG_WARNING, "Cannot open target TIFF file '%s'\n", s->rx_file); t30_set_status(s, T30_ERR_FILEERROR); send_dcn(s); return -1; } s->operation_in_progress = OPERATION_IN_PROGRESS_T4_RX; } if (!(s->iaf & T30_IAF_MODE_NO_TCF)) { /* TCF is always sent with long training */ s->short_train = false; set_state(s, T30_STATE_F_TCF); queue_phase(s, T30_PHASE_C_NON_ECM_RX); timer_t2_start(s); } return 0; } /*- End of function --------------------------------------------------------*/ static int send_response_to_pps(t30_state_t *s) { queue_phase(s, T30_PHASE_D_TX); if (s->rx_ecm_block_ok) { set_state(s, T30_STATE_F_POST_RCP_MCF); send_simple_frame(s, T30_MCF); return true; } /* We need to send the PPR frame we have created, to try to fill in the missing/bad data. */ set_state(s, T30_STATE_F_POST_RCP_PPR); s->ecm_frame_map[0] = ADDRESS_FIELD; s->ecm_frame_map[1] = CONTROL_FIELD_FINAL_FRAME; s->ecm_frame_map[2] = (uint8_t) (T30_PPR | s->dis_received); send_frame(s, s->ecm_frame_map, 3 + 32); return false; } /*- End of function --------------------------------------------------------*/ static int process_rx_pps(t30_state_t *s, const uint8_t *msg, int len) { int page; int block; int frames; int i; int j; int frame_no; int first_bad_frame; int first; int expected_len; if (len < 7) { span_log(&s->logging, SPAN_LOG_FLOW, "Bad PPS message length %d.\n", len); return -1; } s->last_pps_fcf2 = msg[3] & 0xFE; /* The frames count is not well specified in T.30. In practice it seems it might be the number of frames in the current block, or it might be the number of frames in the current burst of transmission. For a burst of resent frames this would make it smaller than the actual size of the block. If we only accept the number when it exceeds previous values, we should get the real number of frames in the block. */ frames = msg[6] + 1; block = msg[5]; page = msg[4]; if (s->ecm_frames < 0) { /* First time. Take the number and believe in it. */ s->ecm_frames = frames; } else { /* If things have gone wrong, the far end might try to send us zero FCD frames. It can't represent zero in the block count field, so it might put zero there, or it might simplistically insert (blocks - 1), and put 0xFF there. Beware of this. */ if (frames == 0xFF) { /* This is probably zero, erroneously rolled over to the maximum count */ frames = 0; } } span_log(&s->logging, SPAN_LOG_FLOW, "Received PPS + %s - page %d, block %d, %d frames\n", t30_frametype(msg[3]), page, block, frames); /* Check that we have received the page and block we expected. If the far end missed our last response, it might have repeated the previous chunk. */ if ((s->rx_page_number & 0xFF) != page || (s->ecm_block & 0xFF) != block) { span_log(&s->logging, SPAN_LOG_FLOW, "ECM rx page/block mismatch - expected %d/%d, but received %d/%d.\n", (s->rx_page_number & 0xFF), (s->ecm_block & 0xFF), page, block); /* Look for this being a repeat, because the other end missed the last response we sent - which would have been a T30_MCF - If the block is for the previous page, or the previous block of the current page, we can assume we have hit this condition. */ if (((s->rx_page_number & 0xFF) == page && ((s->ecm_block - 1) & 0xFF) == block) || (((s->rx_page_number - 1) & 0xFF) == page && s->ecm_block == 0)) { /* This must be a repeat of the last thing the far end sent, while we are expecting the first transfer of a new block. */ span_log(&s->logging, SPAN_LOG_FLOW, "Looks like a repeat from the previous page/block - send MCF again.\n"); /* Clear the ECM buffer */ for (i = 0; i < 256; i++) s->ecm_len[i] = -1; s->ecm_frames = -1; queue_phase(s, T30_PHASE_D_TX); set_state(s, T30_STATE_F_POST_RCP_MCF); send_simple_frame(s, T30_MCF); } else { /* Give up */ t30_set_status(s, T30_ERR_RX_ECMPHD); send_dcn(s); } return 0; } /* Build a bit map of which frames we now have stored OK */ first_bad_frame = 256; first = true; expected_len = 256; for (i = 0; i < 32; i++) { s->ecm_frame_map[i + 3] = 0; for (j = 0; j < 8; j++) { frame_no = (i << 3) + j; if (s->ecm_len[frame_no] >= 0) { /* The correct pattern of frame lengths is they will all be 64 or 256 octets long, except the last one. The last one might the same length as all the others, or it might be exactly the right length to contain the last chunk of the data. That is, some people pad at the end, and some do not. */ /* Vet the frames which are present, to detect any with inappropriate lengths. This might seem like overkill, as the frames must have had good CRCs to get this far. However, in the real world there are systems, especially T.38 ones, which give bad frame lengths, and which screw up communication unless you apply these checks. From experience, if you find a frame has a suspect length, and demand retransmission, there is a good chance the new copy will be alright. */ if (frame_no < s->ecm_frames - 1) { /* Expect all frames, except the last one, to follow the length of the first one */ if (first) { /* Use the length of the first frame as our model for what the length should be */ if (s->ecm_len[frame_no] == 64) expected_len = 64; first = false; } /* Check the length is consistent with the first frame */ if (s->ecm_len[frame_no] != expected_len) { span_log(&s->logging, SPAN_LOG_FLOW, "Bad length ECM frame - %d\n", s->ecm_len[frame_no]); s->ecm_len[frame_no] = -1; } } } if (s->ecm_len[frame_no] < 0) { s->ecm_frame_map[i + 3] |= (1 << j); if (frame_no < first_bad_frame) first_bad_frame = frame_no; if (frame_no < s->ecm_frames) s->error_correcting_mode_retries++; } } } s->rx_ecm_block_ok = (first_bad_frame >= s->ecm_frames); if (s->rx_ecm_block_ok) { span_log(&s->logging, SPAN_LOG_FLOW, "Partial page OK - committing block %d, %d frames\n", s->ecm_block, s->ecm_frames); for (i = 0; i < s->ecm_frames; i++) { if (t4_rx_put_chunk(&s->t4.rx, s->ecm_data[i], s->ecm_len[i])) { /* This is the end of the document */ break; } } /* Clear the ECM buffer */ for (i = 0; i < 256; i++) s->ecm_len[i] = -1; s->ecm_block++; s->ecm_frames = -1; switch (s->last_pps_fcf2) { case T30_NULL: /* We can accept only this partial page. */ break; default: /* We can accept and confirm the whole page. */ s->next_rx_step = s->last_pps_fcf2; rx_end_page(s); report_rx_ecm_page_result(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, s->last_pps_fcf2); rx_start_page(s); break; } } switch (s->last_pps_fcf2) { case T30_PRI_MPS: case T30_PRI_EOM: case T30_PRI_EOP: if (s->remote_interrupts_allowed) { } /* Fall through */ case T30_NULL: case T30_MPS: case T30_EOM: case T30_EOS: case T30_EOP: if (s->receiver_not_ready_count > 0) { s->receiver_not_ready_count--; queue_phase(s, T30_PHASE_D_TX); set_state(s, T30_STATE_F_POST_RCP_RNR); send_simple_frame(s, T30_RNR); } else { if (send_response_to_pps(s)) { switch (s->last_pps_fcf2) { case T30_PRI_EOP: case T30_EOP: span_log(&s->logging, SPAN_LOG_FLOW, "End of procedure detected\n"); s->end_of_procedure_detected = true; break; } } } break; default: unexpected_final_frame(s, msg, len); break; } return 0; } /*- End of function --------------------------------------------------------*/ static void process_rx_ppr(t30_state_t *s, const uint8_t *msg, int len) { int i; int j; int frame_no; uint8_t frame[5]; if (len != 3 + 32) { span_log(&s->logging, SPAN_LOG_FLOW, "Bad length for PPR bits - %d\n", len); /* This frame didn't get corrupted in transit, because its CRC is OK. It was sent bad and there is little possibility that causing a retransmission will help. It is best to just give up. */ t30_set_status(s, T30_ERR_TX_ECMPHD); terminate_call(s); return; } /* Check which frames are OK, and mark them as OK. */ for (i = 0; i < 32; i++) { for (j = 0; j < 8; j++) { frame_no = (i << 3) + j; /* Tick off the frames they are not complaining about as OK */ if ((msg[i + 3] & (1 << j)) == 0) { if (s->ecm_len[frame_no] >= 0) s->ecm_progress++; s->ecm_len[frame_no] = -1; } else { if (frame_no < s->ecm_frames) { span_log(&s->logging, SPAN_LOG_FLOW, "Frame %d to be resent\n", frame_no); s->error_correcting_mode_retries++; } #if 0 /* Diagnostic: See if the other end is complaining about something we didn't even send this time. */ if (s->ecm_len[frame_no] < 0) span_log(&s->logging, SPAN_LOG_FLOW, "PPR contains complaint about frame %d, which was not sent\n", frame_no); #endif } } } if (++s->ppr_count >= PPR_LIMIT_BEFORE_CTC_OR_EOR) { /* Continue to correct? */ /* Continue only if we have been making progress */ s->ppr_count = 0; if (s->ecm_progress) { s->ecm_progress = 0; queue_phase(s, T30_PHASE_D_TX); set_state(s, T30_STATE_IV_CTC); frame[0] = ADDRESS_FIELD; frame[1] = CONTROL_FIELD_FINAL_FRAME; frame[2] = (uint8_t) (T30_CTC | s->dis_received); frame[3] = 0; frame[4] = fallback_sequence[s->current_fallback].dcs_code; send_frame(s, frame, 5); } else { set_state(s, T30_STATE_IV_EOR); queue_phase(s, T30_PHASE_D_TX); frame[0] = ADDRESS_FIELD; frame[1] = CONTROL_FIELD_FINAL_FRAME; frame[2] = (uint8_t) (T30_EOR | s->dis_received); frame[3] = (s->ecm_at_page_end) ? ((uint8_t) (s->next_tx_step | s->dis_received)) : T30_NULL; span_log(&s->logging, SPAN_LOG_FLOW, "Sending EOR + %s\n", t30_frametype(frame[3])); send_frame(s, frame, 4); } } else { /* Initiate resending of the remainder of the frames. */ set_state(s, T30_STATE_IV); queue_phase(s, T30_PHASE_C_ECM_TX); send_first_ecm_frame(s); } } /*- End of function --------------------------------------------------------*/ static void process_rx_fcd(t30_state_t *s, const uint8_t *msg, int len) { int frame_no; /* Facsimile coded data */ switch (s->state) { case T30_STATE_F_DOC_ECM: if (len > 4 + 256) { /* For other frame types we kill the call on an unexpected frame length. For FCD frames it is better to just ignore the frame, and let retries sort things out. */ span_log(&s->logging, SPAN_LOG_FLOW, "Unexpected %s frame length - %d\n", t30_frametype(msg[0]), len); } else { frame_no = msg[3]; /* Just store the actual image data, and record its length */ span_log(&s->logging, SPAN_LOG_FLOW, "Storing ECM frame %d, length %d\n", frame_no, len - 4); memcpy(&s->ecm_data[frame_no][0], &msg[4], len - 4); s->ecm_len[frame_no] = (int16_t) (len - 4); /* In case we are just after a CTC/CTR exchange, which kicked us back to long training */ s->short_train = true; } /* We have received something, so any missing carrier status is out of date */ if (s->current_status == T30_ERR_RX_NOCARRIER) t30_set_status(s, T30_ERR_OK); break; default: unexpected_non_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_rx_rcp(t30_state_t *s, const uint8_t *msg, int len) { /* Return to control for partial page. These might come through with or without the final frame tag. Here we deal with the "no final frame tag" case. */ switch (s->state) { case T30_STATE_F_DOC_ECM: set_state(s, T30_STATE_F_POST_DOC_ECM); queue_phase(s, T30_PHASE_D_RX); timer_t2_start(s); /* We have received something, so any missing carrier status is out of date */ if (s->current_status == T30_ERR_RX_NOCARRIER) t30_set_status(s, T30_ERR_OK); break; case T30_STATE_F_POST_DOC_ECM: /* Just ignore this. It must be an extra RCP. Several are usually sent, to maximise the chance of receiving a correct one. */ timer_t2_start(s); break; default: unexpected_non_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_rx_fnv(t30_state_t *s, const uint8_t *msg, int len) { logging_state_t *log; const char *x; /* Field not valid */ /* TODO: analyse the message, as per 5.3.6.2.13 */ if (!span_log_test(&s->logging, SPAN_LOG_FLOW)) return; log = &s->logging; if ((msg[3] & 0x01)) span_log(log, SPAN_LOG_FLOW, " Incorrect password (PWD).\n"); if ((msg[3] & 0x02)) span_log(log, SPAN_LOG_FLOW, " Selective polling reference (SEP) not known.\n"); if ((msg[3] & 0x04)) span_log(log, SPAN_LOG_FLOW, " Sub-address (SUB) not known.\n"); if ((msg[3] & 0x08)) span_log(log, SPAN_LOG_FLOW, " Sender identity (SID) not known.\n"); if ((msg[3] & 0x10)) span_log(log, SPAN_LOG_FLOW, " Secure fax error.\n"); if ((msg[3] & 0x20)) span_log(log, SPAN_LOG_FLOW, " Transmitting subscriber identity (TSI) not accepted.\n"); if ((msg[3] & 0x40)) span_log(log, SPAN_LOG_FLOW, " Polled sub-address (PSA) not known.\n"); if (len > 4 && (msg[3] & DISBIT8)) { if ((msg[4] & 0x01)) span_log(log, SPAN_LOG_FLOW, " BFT negotiations request not accepted.\n"); if ((msg[4] & 0x02)) span_log(log, SPAN_LOG_FLOW, " Internet routing address (IRA) not known.\n"); if ((msg[4] & 0x04)) span_log(log, SPAN_LOG_FLOW, " Internet selective polling address (ISP) not known.\n"); } if (len > 5) { span_log(log, SPAN_LOG_FLOW, " FNV sequence number %d.\n", msg[5]); } if (len > 6) { switch (msg[6]) { case T30_PWD: x = "Incorrect password (PWD)"; break; case T30_SEP: x = "Selective polling reference (SEP) not known"; break; case T30_SUB: case T30_SUB | 0x01: x = "Sub-address (SUB) not known"; break; case T30_SID: case T30_SID | 0x01: x = "Sender identity (SID) not known"; break; case T30_SPI: x = "Secure fax error"; break; case T30_TSI: case T30_TSI | 0x01: x = "Transmitting subscriber identity (TSI) not accepted"; break; case T30_PSA: x = "Polled sub-address (PSA) not known"; break; default: x = "???"; break; } span_log(log, SPAN_LOG_FLOW, " FNV diagnostic info type %s.\n", x); } if (len > 7) { span_log(log, SPAN_LOG_FLOW, " FNV length %d.\n", msg[7]); } /* We've decoded it, but we don't yet know how to deal with it, so treat it as unexpected */ unexpected_final_frame(s, msg, len); } /*- End of function --------------------------------------------------------*/ static void process_state_answering(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; /* We should be sending the TCF data right now */ fcf = msg[2] & 0xFE; switch (fcf) { case T30_DIS: /* TODO: This is a fudge to allow for starting up in T.38, where the other end has seen DIS by analogue modem means, and has immediately sent DIS/DTC. We might have missed useful info, like TSI, but just accept things and carry on form now. */ span_log(&s->logging, SPAN_LOG_FLOW, "DIS/DTC before DIS\n"); process_rx_dis_dtc(s, msg, len); break; case T30_DCS: /* TODO: This is a fudge to allow for starting up in T.38, where the other end has seen DIS by analogue modem means, and has immediately sent DCS. We might have missed useful info, like TSI, but just accept things and carry on form now. */ span_log(&s->logging, SPAN_LOG_FLOW, "DCS before DIS\n"); process_rx_dcs(s, msg, len); break; case T30_DCN: t30_set_status(s, T30_ERR_TX_GOTDCN); terminate_call(s); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_b(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_DCN: /* Just ignore any DCN's which appear at this stage. */ break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_c(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_DCN: /* Just ignore any DCN's which appear at this stage. */ break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_d(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; /* We should be sending the DCS sequence right now */ fcf = msg[2] & 0xFE; switch (fcf) { case T30_DCN: t30_set_status(s, T30_ERR_TX_BADDCS); terminate_call(s); break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_d_tcf(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; /* We should be sending the TCF data right now */ fcf = msg[2] & 0xFE; switch (fcf) { case T30_DCN: t30_set_status(s, T30_ERR_TX_BADDCS); terminate_call(s); break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_d_post_tcf(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_CFR: /* Trainability test succeeded. Send the document. */ span_log(&s->logging, SPAN_LOG_FLOW, "Trainability test succeeded\n"); s->retries = 0; s->short_train = true; if (s->error_correcting_mode) { set_state(s, T30_STATE_IV); queue_phase(s, T30_PHASE_C_ECM_TX); send_first_ecm_frame(s); } else { set_state(s, T30_STATE_I); queue_phase(s, T30_PHASE_C_NON_ECM_TX); } break; case T30_FTT: /* Trainability test failed. Try again. */ span_log(&s->logging, SPAN_LOG_FLOW, "Trainability test failed\n"); s->retries = 0; s->short_train = false; if (step_fallback_entry(s) < 0) { /* We have fallen back as far as we can go. Give up. */ s->current_fallback = 0; t30_set_status(s, T30_ERR_CANNOT_TRAIN); send_dcn(s); break; } queue_phase(s, T30_PHASE_B_TX); send_dcs_sequence(s, true); break; case T30_DIS: /* It appears they didn't see what we sent - retry the TCF */ if (++s->retries >= MAX_COMMAND_TRIES) { span_log(&s->logging, SPAN_LOG_FLOW, "Too many retries. Giving up.\n"); t30_set_status(s, T30_ERR_RETRYDCN); send_dcn(s); break; } span_log(&s->logging, SPAN_LOG_FLOW, "Retry number %d\n", s->retries); queue_phase(s, T30_PHASE_B_TX); /* TODO: should we reassess the new DIS message, and possibly adjust the DCS we use? */ send_dcs_sequence(s, true); break; case T30_DCN: t30_set_status(s, T30_ERR_TX_BADDCS); terminate_call(s); break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_f_tcf(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; /* We should be receiving TCF right now, not HDLC messages */ fcf = msg[2] & 0xFE; switch (fcf) { case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_f_cfr(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; /* We're waiting for a response to the CFR we sent */ fcf = msg[2] & 0xFE; switch (fcf) { case T30_DCS: /* If we received another DCS, they must have missed our CFR */ process_rx_dcs(s, msg, len); break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_f_ftt(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; /* We're waiting for a response to the FTT we sent */ fcf = msg[2] & 0xFE; switch (fcf) { case T30_DCS: process_rx_dcs(s, msg, len); break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_f_doc_non_ecm(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; /* If we are getting HDLC messages, and we have not moved to the _POST_DOC_NON_ECM state, it looks like either: - we didn't see the image data carrier properly, or - they didn't see our T30_CFR, and are repeating the DCS/TCF sequence. - they didn't see out T30_MCF, and are repeating the end of page message. */ fcf = msg[2] & 0xFE; switch (fcf) { case T30_DIS: process_rx_dis_dtc(s, msg, len); break; case T30_DCS: process_rx_dcs(s, msg, len); break; case T30_PRI_MPS: if (s->remote_interrupts_allowed) { } /* Fall through */ case T30_MPS: if (s->image_carrier_attempted) { /* Treat this as a bad quality page. */ if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); s->next_rx_step = fcf; s->last_rx_page_result = T30_RTN; queue_phase(s, T30_PHASE_D_TX); set_state(s, T30_STATE_III_Q); send_simple_frame(s, s->last_rx_page_result); } else { /* This appears to be a retry, because the far end didn't see our last response */ repeat_last_command(s); } break; case T30_PRI_EOM: if (s->remote_interrupts_allowed) { } /* Fall through */ case T30_EOM: case T30_EOS: if (s->image_carrier_attempted) { /* Treat this as a bad quality page. */ if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); s->next_rx_step = fcf; s->last_rx_page_result = T30_RTN; /* Return to phase B */ queue_phase(s, T30_PHASE_B_TX); set_state(s, T30_STATE_III_Q); send_simple_frame(s, s->last_rx_page_result); } else { /* This appears to be a retry, because the far end didn't see our last response */ repeat_last_command(s); } break; case T30_PRI_EOP: if (s->remote_interrupts_allowed) { } /* Fall through */ case T30_EOP: if (s->image_carrier_attempted) { /* Treat this as a bad quality page. */ if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); s->next_rx_step = fcf; s->last_rx_page_result = T30_RTN; queue_phase(s, T30_PHASE_D_TX); set_state(s, T30_STATE_III_Q); send_simple_frame(s, s->last_rx_page_result); } else { /* This appears to be a retry, because the far end didn't see our last response */ repeat_last_command(s); } break; case T30_DCN: t30_set_status(s, T30_ERR_RX_DCNDATA); terminate_call(s); break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ t30_set_status(s, T30_ERR_RX_INVALCMD); unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_f_post_doc_non_ecm(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_PRI_MPS: if (s->remote_interrupts_allowed) { } /* Fall through */ case T30_MPS: s->next_rx_step = fcf; queue_phase(s, T30_PHASE_D_TX); switch (copy_quality(s)) { case T30_COPY_QUALITY_PERFECT: case T30_COPY_QUALITY_GOOD: rx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); rx_start_page(s); s->last_rx_page_result = T30_MCF; break; case T30_COPY_QUALITY_POOR: rx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); rx_start_page(s); s->last_rx_page_result = T30_RTP; break; case T30_COPY_QUALITY_BAD: if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); rx_start_page(s); s->last_rx_page_result = T30_RTN; break; } set_state(s, T30_STATE_III_Q); send_simple_frame(s, s->last_rx_page_result); break; case T30_PRI_EOM: if (s->remote_interrupts_allowed) { } /* Fall through */ case T30_EOM: case T30_EOS: s->next_rx_step = fcf; /* Return to phase B */ queue_phase(s, T30_PHASE_B_TX); switch (copy_quality(s)) { case T30_COPY_QUALITY_PERFECT: case T30_COPY_QUALITY_GOOD: rx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); rx_start_page(s); s->last_rx_page_result = T30_MCF; break; case T30_COPY_QUALITY_POOR: rx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); rx_start_page(s); s->last_rx_page_result = T30_RTP; break; case T30_COPY_QUALITY_BAD: if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); rx_start_page(s); s->last_rx_page_result = T30_RTN; break; } set_state(s, T30_STATE_III_Q); send_simple_frame(s, s->last_rx_page_result); break; case T30_PRI_EOP: if (s->remote_interrupts_allowed) { } /* Fall through */ case T30_EOP: span_log(&s->logging, SPAN_LOG_FLOW, "End of procedure detected\n"); s->end_of_procedure_detected = true; s->next_rx_step = fcf; queue_phase(s, T30_PHASE_D_TX); switch (copy_quality(s)) { case T30_COPY_QUALITY_PERFECT: case T30_COPY_QUALITY_GOOD: rx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); terminate_operation_in_progress(s); s->last_rx_page_result = T30_MCF; break; case T30_COPY_QUALITY_POOR: rx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); terminate_operation_in_progress(s); s->last_rx_page_result = T30_RTP; break; case T30_COPY_QUALITY_BAD: if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); terminate_operation_in_progress(s); s->last_rx_page_result = T30_RTN; break; } set_state(s, T30_STATE_III_Q); send_simple_frame(s, s->last_rx_page_result); break; case T30_DCS: span_log(&s->logging, SPAN_LOG_FLOW, "DCS received after CFR\n"); process_rx_dcs(s, msg, len); break; case T30_DCN: t30_set_status(s, T30_ERR_RX_DCNFAX); terminate_call(s); break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ t30_set_status(s, T30_ERR_RX_INVALCMD); unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_f_doc_and_post_doc_ecm(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; uint8_t fcf2; /* This actually handles 2 states - _DOC_ECM and _POST_DOC_ECM - as they are very similar */ fcf = msg[2] & 0xFE; switch (fcf) { case T30_DIS: process_rx_dis_dtc(s, msg, len); break; case T30_DCS: process_rx_dcs(s, msg, len); break; case T4_RCP: /* Return to control for partial page. These might come through with or without the final frame tag. Here we deal with the "final frame tag" case. */ process_rx_rcp(s, msg, len); break; case T30_EOR: if (len != 4) { unexpected_frame_length(s, msg, len); break; } fcf2 = msg[3] & 0xFE; span_log(&s->logging, SPAN_LOG_FLOW, "Received EOR + %s\n", t30_frametype(msg[3])); switch (fcf2) { case T30_PRI_EOP: case T30_PRI_EOM: case T30_PRI_MPS: if (s->remote_interrupts_allowed) { /* TODO: Alert operator */ } /* Fall through */ case T30_NULL: case T30_EOP: case T30_EOM: case T30_EOS: case T30_MPS: s->image_carrier_attempted = false; s->next_rx_step = fcf2; queue_phase(s, T30_PHASE_D_TX); set_state(s, T30_STATE_F_DOC_ECM); send_simple_frame(s, T30_ERR); break; default: unexpected_final_frame(s, msg, len); break; } break; case T30_PPS: process_rx_pps(s, msg, len); break; case T30_CTC: if ((msg[4] & (DISBIT6 | DISBIT5 | DISBIT4 | DISBIT3)) != fallback_sequence[s->current_fallback].dcs_code) { span_log(&s->logging, SPAN_LOG_FLOW, "Modem changed in CTC.\n"); if ((s->current_fallback = find_fallback_entry(msg[4] & (DISBIT6 | DISBIT5 | DISBIT4 | DISBIT3))) < 0) span_log(&s->logging, SPAN_LOG_FLOW, "Remote asked for a modem standard we do not support\n"); } s->image_carrier_attempted = false; /* T.30 says we change back to long training here, whether or not the far end changed the modem type. */ s->short_train = false; queue_phase(s, T30_PHASE_D_TX); set_state(s, T30_STATE_F_DOC_ECM); send_simple_frame(s, T30_CTR); break; case T30_RR: break; case T30_DCN: t30_set_status(s, T30_ERR_RX_DCNDATA); terminate_call(s); break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ t30_set_status(s, T30_ERR_RX_INVALCMD); unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_f_post_rcp_mcf(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; case T30_DCN: terminate_call(s); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_f_post_rcp_ppr(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_f_post_rcp_rnr(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_RR: if (s->receiver_not_ready_count > 0) { s->receiver_not_ready_count--; queue_phase(s, T30_PHASE_D_TX); set_state(s, T30_STATE_F_POST_RCP_RNR); send_simple_frame(s, T30_RNR); } else { /* Now we send the deferred response */ if (send_response_to_pps(s)) { switch (s->last_pps_fcf2) { case T30_PRI_EOP: case T30_EOP: span_log(&s->logging, SPAN_LOG_FLOW, "End of procedure detected\n"); s->end_of_procedure_detected = true; break; } } } break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_r(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_DIS: process_rx_dis_dtc(s, msg, len); break; case T30_DCS: process_rx_dcs(s, msg, len); break; case T30_DCN: /* Received a DCN while waiting for a DIS or DCN */ t30_set_status(s, T30_ERR_RX_DCNWHY); terminate_call(s); break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_t(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_DIS: process_rx_dis_dtc(s, msg, len); break; case T30_DCN: t30_set_status(s, T30_ERR_TX_GOTDCN); terminate_call(s); break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); t30_set_status(s, T30_ERR_TX_NODIS); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_i(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_ii(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_ii_q(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_PIP: if (s->remote_interrupts_allowed) { s->retries = 0; if (s->phase_d_handler) { s->phase_d_handler(s, s->phase_d_user_data, fcf); s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3); } } /* Fall through */ case T30_MCF: switch (s->next_tx_step) { case T30_PRI_MPS: case T30_MPS: tx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); /* Transmit the next page */ if (tx_start_page(s)) { /* TODO: recover */ break; } set_state(s, T30_STATE_I); queue_phase(s, T30_PHASE_C_NON_ECM_TX); break; case T30_PRI_EOM: case T30_EOM: case T30_EOS: tx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); terminate_operation_in_progress(s); report_tx_result(s, true); return_to_phase_b(s, false); break; case T30_PRI_EOP: case T30_EOP: tx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); terminate_operation_in_progress(s); send_dcn(s); report_tx_result(s, true); break; } break; case T30_RTP: s->rtp_events++; switch (s->next_tx_step) { case T30_PRI_MPS: case T30_MPS: tx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); if (tx_start_page(s)) { /* TODO: recover */ break; } /* Send fresh training, and then the next page */ if (step_fallback_entry(s) < 0) { /* We have fallen back as far as we can go. Give up. */ s->current_fallback = 0; t30_set_status(s, T30_ERR_CANNOT_TRAIN); send_dcn(s); break; } queue_phase(s, T30_PHASE_B_TX); restart_sending_document(s); break; case T30_PRI_EOM: case T30_EOM: case T30_EOS: tx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); t4_tx_release(&s->t4.tx); /* TODO: should go back to T, and resend */ return_to_phase_b(s, true); break; case T30_PRI_EOP: case T30_EOP: tx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); t4_tx_release(&s->t4.tx); send_dcn(s); break; } break; case T30_PIN: if (s->remote_interrupts_allowed) { s->retries = 0; if (s->phase_d_handler) { s->phase_d_handler(s, s->phase_d_user_data, fcf); s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3); } } /* Fall through */ case T30_RTN: s->rtn_events++; switch (s->next_tx_step) { case T30_PRI_MPS: case T30_MPS: s->retries = 0; if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); if (!s->retransmit_capable) { /* Send the next page, regardless of the problem with the current one. */ if (tx_start_page(s)) { /* TODO: recover */ break; } } /* Send fresh training */ if (step_fallback_entry(s) < 0) { /* We have fallen back as far as we can go. Give up. */ s->current_fallback = 0; t30_set_status(s, T30_ERR_CANNOT_TRAIN); send_dcn(s); break; } queue_phase(s, T30_PHASE_B_TX); restart_sending_document(s); break; case T30_PRI_EOM: case T30_EOM: case T30_EOS: s->retries = 0; if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); if (s->retransmit_capable) { /* Wait for DIS */ } else { return_to_phase_b(s, true); } break; case T30_PRI_EOP: case T30_EOP: s->retries = 0; if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); if (s->retransmit_capable) { /* Send fresh training, and then repeat the last page */ if (step_fallback_entry(s) < 0) { /* We have fallen back as far as we can go. Give up. */ s->current_fallback = 0; t30_set_status(s, T30_ERR_CANNOT_TRAIN); send_dcn(s); break; } queue_phase(s, T30_PHASE_B_TX); restart_sending_document(s); } else { send_dcn(s); } break; } break; case T30_DCN: switch (s->next_tx_step) { case T30_PRI_MPS: case T30_PRI_EOM: case T30_MPS: case T30_EOM: case T30_EOS: /* Unexpected DCN after EOM, EOS or MPS sequence */ t30_set_status(s, T30_ERR_RX_DCNPHD); break; default: t30_set_status(s, T30_ERR_TX_BADPG); break; } terminate_call(s); break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ t30_set_status(s, T30_ERR_TX_INVALRSP); unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_iii_q(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_EOP: case T30_EOM: case T30_EOS: case T30_MPS: /* Looks like they didn't see our signal. Repeat it */ queue_phase(s, T30_PHASE_D_TX); set_state(s, T30_STATE_III_Q); send_simple_frame(s, s->last_rx_page_result); break; case T30_DIS: if (msg[2] == T30_DTC) process_rx_dis_dtc(s, msg, len); break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; case T30_DCN: if (s->last_rx_page_result == T30_RTN) t30_set_status(s, T30_ERR_RX_DCNNORTN); terminate_call(s); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_iv(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_iv_pps_null(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_MCF: s->retries = 0; s->timer_t5 = 0; /* Is there more of the current page to get, or do we move on? */ span_log(&s->logging, SPAN_LOG_FLOW, "Is there more to send? - %d %d\n", s->ecm_frames, s->ecm_len[255]); if (!s->ecm_at_page_end && get_partial_ecm_page(s) > 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Additional image data to send\n"); s->ecm_block++; set_state(s, T30_STATE_IV); queue_phase(s, T30_PHASE_C_ECM_TX); send_first_ecm_frame(s); } else { span_log(&s->logging, SPAN_LOG_FLOW, "Moving on to the next page\n"); switch (s->next_tx_step) { case T30_PRI_MPS: case T30_MPS: tx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); if (tx_start_page(s)) { /* TODO: recover */ break; } if (get_partial_ecm_page(s) > 0) { set_state(s, T30_STATE_IV); queue_phase(s, T30_PHASE_C_ECM_TX); send_first_ecm_frame(s); } break; case T30_PRI_EOM: case T30_EOM: case T30_EOS: tx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); terminate_operation_in_progress(s); report_tx_result(s, true); return_to_phase_b(s, false); break; case T30_PRI_EOP: case T30_EOP: tx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); terminate_operation_in_progress(s); send_dcn(s); report_tx_result(s, true); break; } } break; case T30_PPR: process_rx_ppr(s, msg, len); break; case T30_RNR: if (s->timer_t5 == 0) s->timer_t5 = ms_to_samples(DEFAULT_TIMER_T5); queue_phase(s, T30_PHASE_D_TX); set_state(s, T30_STATE_IV_PPS_RNR); send_rr(s); break; case T30_DCN: t30_set_status(s, T30_ERR_TX_BADPG); terminate_call(s); break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); t30_set_status(s, T30_ERR_TX_ECMPHD); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_iv_pps_q(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_PIP: if (s->remote_interrupts_allowed) { s->retries = 0; if (s->phase_d_handler) { s->phase_d_handler(s, s->phase_d_user_data, fcf); s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3); } } /* Fall through */ case T30_MCF: s->retries = 0; s->timer_t5 = 0; /* Is there more of the current page to get, or do we move on? */ span_log(&s->logging, SPAN_LOG_FLOW, "Is there more to send? - %d %d\n", s->ecm_frames, s->ecm_len[255]); if (!s->ecm_at_page_end && get_partial_ecm_page(s) > 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Additional image data to send\n"); s->ecm_block++; set_state(s, T30_STATE_IV); queue_phase(s, T30_PHASE_C_ECM_TX); send_first_ecm_frame(s); } else { span_log(&s->logging, SPAN_LOG_FLOW, "Moving on to the next page\n"); switch (s->next_tx_step) { case T30_PRI_MPS: case T30_MPS: tx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); if (tx_start_page(s)) { /* TODO: recover */ break; } if (get_partial_ecm_page(s) > 0) { set_state(s, T30_STATE_IV); queue_phase(s, T30_PHASE_C_ECM_TX); send_first_ecm_frame(s); } break; case T30_PRI_EOM: case T30_EOM: case T30_EOS: tx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); terminate_operation_in_progress(s); report_tx_result(s, true); return_to_phase_b(s, false); break; case T30_PRI_EOP: case T30_EOP: tx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); terminate_operation_in_progress(s); send_dcn(s); report_tx_result(s, true); break; } } break; case T30_RNR: if (s->timer_t5 == 0) s->timer_t5 = ms_to_samples(DEFAULT_TIMER_T5); queue_phase(s, T30_PHASE_D_TX); set_state(s, T30_STATE_IV_PPS_RNR); send_rr(s); break; case T30_PPR: process_rx_ppr(s, msg, len); break; case T30_DCN: t30_set_status(s, T30_ERR_TX_BADPG); terminate_call(s); break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; case T30_PIN: if (s->remote_interrupts_allowed) { s->retries = 0; if (s->phase_d_handler) { s->phase_d_handler(s, s->phase_d_user_data, fcf); s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3); } } /* Fall through */ default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); t30_set_status(s, T30_ERR_TX_ECMPHD); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_iv_pps_rnr(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_PIP: if (s->remote_interrupts_allowed) { s->retries = 0; if (s->phase_d_handler) { s->phase_d_handler(s, s->phase_d_user_data, fcf); s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3); } } /* Fall through */ case T30_MCF: s->retries = 0; s->timer_t5 = 0; /* Is there more of the current page to get, or do we move on? */ span_log(&s->logging, SPAN_LOG_FLOW, "Is there more to send? - %d %d\n", s->ecm_frames, s->ecm_len[255]); if (!s->ecm_at_page_end && get_partial_ecm_page(s) > 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Additional image data to send\n"); s->ecm_block++; set_state(s, T30_STATE_IV); queue_phase(s, T30_PHASE_C_ECM_TX); send_first_ecm_frame(s); } else { span_log(&s->logging, SPAN_LOG_FLOW, "Moving on to the next page\n"); switch (s->next_tx_step) { case T30_PRI_MPS: case T30_MPS: tx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); if (tx_start_page(s)) { /* TODO: recover */ break; } if (get_partial_ecm_page(s) > 0) { set_state(s, T30_STATE_IV); queue_phase(s, T30_PHASE_C_ECM_TX); send_first_ecm_frame(s); } break; case T30_PRI_EOM: case T30_EOM: case T30_EOS: tx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); terminate_operation_in_progress(s); report_tx_result(s, true); return_to_phase_b(s, false); break; case T30_PRI_EOP: case T30_EOP: tx_end_page(s); if (s->phase_d_handler) s->phase_d_handler(s, s->phase_d_user_data, fcf); terminate_operation_in_progress(s); send_dcn(s); report_tx_result(s, true); break; } } break; case T30_RNR: if (s->timer_t5 == 0) s->timer_t5 = ms_to_samples(DEFAULT_TIMER_T5); queue_phase(s, T30_PHASE_D_TX); set_state(s, T30_STATE_IV_PPS_RNR); send_rr(s); break; case T30_DCN: t30_set_status(s, T30_ERR_RX_DCNRRD); terminate_call(s); break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; case T30_PIN: if (s->remote_interrupts_allowed) { s->retries = 0; if (s->phase_d_handler) { s->phase_d_handler(s, s->phase_d_user_data, fcf); s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3); } } /* Fall through */ default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_iv_ctc(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_CTR: /* Valid response to a CTC received */ /* T.30 says we change back to long training here */ s->short_train = false; /* Initiate resending of the remainder of the frames. */ set_state(s, T30_STATE_IV); queue_phase(s, T30_PHASE_C_ECM_TX); send_first_ecm_frame(s); break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_iv_eor(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_RNR: if (s->timer_t5 == 0) s->timer_t5 = ms_to_samples(DEFAULT_TIMER_T5); queue_phase(s, T30_PHASE_D_TX); set_state(s, T30_STATE_IV_EOR_RNR); send_rr(s); break; case T30_ERR: /* TODO: Continue with the next message if MPS or EOM? */ t30_set_status(s, T30_ERR_RETRYDCN); s->timer_t5 = 0; send_dcn(s); break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; case T30_PIN: if (s->remote_interrupts_allowed) { s->retries = 0; if (s->phase_d_handler) { s->phase_d_handler(s, s->phase_d_user_data, fcf); s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3); } } /* Fall through */ default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_iv_eor_rnr(t30_state_t *s, const uint8_t *msg, int len) { uint8_t fcf; fcf = msg[2] & 0xFE; switch (fcf) { case T30_RNR: if (s->timer_t5 == 0) s->timer_t5 = ms_to_samples(DEFAULT_TIMER_T5); queue_phase(s, T30_PHASE_D_TX); set_state(s, T30_STATE_IV_EOR_RNR); send_rr(s); break; case T30_ERR: /* TODO: Continue with the next message if MPS or EOM? */ t30_set_status(s, T30_ERR_RETRYDCN); s->timer_t5 = 0; send_dcn(s); break; case T30_DCN: t30_set_status(s, T30_ERR_RX_DCNRRD); terminate_call(s); break; case T30_CRP: repeat_last_command(s); break; case T30_FNV: process_rx_fnv(s, msg, len); break; case T30_PIN: if (s->remote_interrupts_allowed) { s->retries = 0; if (s->phase_d_handler) { s->phase_d_handler(s, s->phase_d_user_data, fcf); s->timer_t3 = ms_to_samples(DEFAULT_TIMER_T3); } } /* Fall through */ default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } /*- End of function --------------------------------------------------------*/ static void process_state_call_finished(t30_state_t *s, const uint8_t *msg, int len) { /* Simply ignore anything which comes in when we have declared the call to have finished. */ } /*- End of function --------------------------------------------------------*/ static void process_rx_control_msg(t30_state_t *s, const uint8_t *msg, int len) { /* We should only get good frames here. */ print_frame(s, "Rx: ", msg, len); if (s->real_time_frame_handler) s->real_time_frame_handler(s, s->real_time_frame_user_data, true, msg, len); if ((msg[1] & 0x10) == 0) { /* This is not a final frame */ /* It seems we should not restart the command or response timer when exchanging HDLC image data. If the modem looses sync in the middle of the image, we should just wait until the carrier goes away before proceeding. */ if (s->phase != T30_PHASE_C_ECM_RX) { /* Restart the command or response timer, T2 or T4 */ switch (s->timer_t2_t4_is) { case TIMER_IS_T1A: case TIMER_IS_T2: case TIMER_IS_T2A: case TIMER_IS_T2B: timer_t2a_start(s); break; case TIMER_IS_T4: case TIMER_IS_T4A: case TIMER_IS_T4B: timer_t4a_start(s); break; } } /* The following handles all the message types we expect to get without a final frame tag. If we get one that T.30 says we should not expect in a particular context, its pretty harmless, so don't worry. */ switch (msg[2] & 0xFE) { case (T30_CSI & 0xFE): /* Called subscriber identification or Calling subscriber identification (T30_CIG) */ /* OK in (NSF) (CSI) DIS */ /* OK in (NSC) (CIG) DTC */ /* OK in (PWD) (SEP) (CIG) DTC */ decode_20digit_msg(s, s->rx_info.ident, &msg[2], len - 2); break; case (T30_NSF & 0xFE): if (msg[2] == T30_NSF) { /* Non-standard facilities */ /* OK in (NSF) (CSI) DIS */ t35_decode(&msg[3], len - 3, &s->country, &s->vendor, &s->model); if (s->country) span_log(&s->logging, SPAN_LOG_FLOW, "The remote was made in '%s'\n", s->country); if (s->vendor) span_log(&s->logging, SPAN_LOG_FLOW, "The remote was made by '%s'\n", s->vendor); if (s->model) span_log(&s->logging, SPAN_LOG_FLOW, "The remote is a '%s'\n", s->model); s->rx_info.nsf_len = decode_nsf_nss_nsc(s, &s->rx_info.nsf, &msg[2], len - 2); } else { /* NSC - Non-standard facilities command */ /* OK in (NSC) (CIG) DTC */ s->rx_info.nsc_len = decode_nsf_nss_nsc(s, &s->rx_info.nsc, &msg[2], len - 2); } break; case (T30_PWD & 0xFE): if (msg[2] == T30_PWD) { /* Password */ /* OK in (SUB) (SID) (SEP) (PWD) (TSI) DCS */ /* OK in (SUB) (SID) (SEP) (PWD) (CIG) DTC */ decode_20digit_msg(s, s->rx_info.password, &msg[2], len - 2); } else { unexpected_non_final_frame(s, msg, len); } break; case (T30_SEP & 0xFE): if (msg[2] == T30_SEP) { /* Selective polling address */ /* OK in (PWD) (SEP) (CIG) DTC */ decode_20digit_msg(s, s->rx_info.selective_polling_address, &msg[2], len - 2); } else { unexpected_non_final_frame(s, msg, len); } break; case (T30_PSA & 0xFE): if (msg[2] == T30_PSA) { /* Polled sub-address */ decode_20digit_msg(s, s->rx_info.polled_sub_address, &msg[2], len - 2); } else { unexpected_non_final_frame(s, msg, len); } break; case (T30_CIA & 0xFE): if (msg[2] == T30_CIA) { /* Calling subscriber internet address */ decode_url_msg(s, NULL, &msg[2], len - 2); } else { unexpected_non_final_frame(s, msg, len); } break; case (T30_ISP & 0xFE): if (msg[2] == T30_ISP) { /* Internet selective polling address */ decode_url_msg(s, NULL, &msg[2], len - 2); } else { unexpected_non_final_frame(s, msg, len); } break; case (T30_TSI & 0xFE): /* Transmitting subscriber identity */ /* OK in (PWD) (SUB) (TSI) DCS */ decode_20digit_msg(s, s->rx_info.ident, &msg[2], len - 2); break; case (T30_NSS & 0xFE): /* Non-standard facilities set-up */ s->rx_info.nss_len = decode_nsf_nss_nsc(s, &s->rx_info.nss, &msg[2], len - 2); break; case (T30_SUB & 0xFE): /* Sub-address */ /* OK in (PWD) (SUB) (TSI) DCS */ decode_20digit_msg(s, s->rx_info.sub_address, &msg[2], len - 2); break; case (T30_SID & 0xFE): /* Sender Identification */ /* OK in (SUB) (SID) (SEP) (PWD) (TSI) DCS */ /* OK in (SUB) (SID) (SEP) (PWD) (CIG) DTC */ decode_20digit_msg(s, s->rx_info.sender_ident, &msg[2], len - 2); break; case (T30_CSA & 0xFE): /* Calling subscriber internet address */ decode_url_msg(s, NULL, &msg[2], len - 2); break; case (T30_TSA & 0xFE): /* Transmitting subscriber internet address */ decode_url_msg(s, NULL, &msg[2], len - 2); break; case (T30_IRA & 0xFE): /* Internet routing address */ decode_url_msg(s, NULL, &msg[2], len - 2); break; case T4_FCD: process_rx_fcd(s, msg, len); break; case T4_RCP: process_rx_rcp(s, msg, len); break; default: unexpected_non_final_frame(s, msg, len); break; } } else { /* This is a final frame */ /* Once we have any successful message from the far end, we cancel timer T1 */ s->timer_t0_t1 = 0; /* The following handles context sensitive message types, which should occur at the end of message sequences. They should, therefore have the final frame flag set. */ span_log(&s->logging, SPAN_LOG_FLOW, "Rx final frame in state %d\n", s->state); switch (s->state) { case T30_STATE_ANSWERING: process_state_answering(s, msg, len); break; case T30_STATE_B: process_state_b(s, msg, len); break; case T30_STATE_C: process_state_c(s, msg, len); break; case T30_STATE_D: process_state_d(s, msg, len); break; case T30_STATE_D_TCF: process_state_d_tcf(s, msg, len); break; case T30_STATE_D_POST_TCF: process_state_d_post_tcf(s, msg, len); break; case T30_STATE_F_TCF: process_state_f_tcf(s, msg, len); break; case T30_STATE_F_CFR: process_state_f_cfr(s, msg, len); break; case T30_STATE_F_FTT: process_state_f_ftt(s, msg, len); break; case T30_STATE_F_DOC_NON_ECM: process_state_f_doc_non_ecm(s, msg, len); break; case T30_STATE_F_POST_DOC_NON_ECM: process_state_f_post_doc_non_ecm(s, msg, len); break; case T30_STATE_F_DOC_ECM: case T30_STATE_F_POST_DOC_ECM: process_state_f_doc_and_post_doc_ecm(s, msg, len); break; case T30_STATE_F_POST_RCP_MCF: process_state_f_post_rcp_mcf(s, msg, len); break; case T30_STATE_F_POST_RCP_PPR: process_state_f_post_rcp_ppr(s, msg, len); break; case T30_STATE_F_POST_RCP_RNR: process_state_f_post_rcp_rnr(s, msg, len); break; case T30_STATE_R: process_state_r(s, msg, len); break; case T30_STATE_T: process_state_t(s, msg, len); break; case T30_STATE_I: process_state_i(s, msg, len); break; case T30_STATE_II: process_state_ii(s, msg, len); break; case T30_STATE_II_Q: process_state_ii_q(s, msg, len); break; case T30_STATE_III_Q: process_state_iii_q(s, msg, len); break; case T30_STATE_IV: process_state_iv(s, msg, len); break; case T30_STATE_IV_PPS_NULL: process_state_iv_pps_null(s, msg, len); break; case T30_STATE_IV_PPS_Q: process_state_iv_pps_q(s, msg, len); break; case T30_STATE_IV_PPS_RNR: process_state_iv_pps_rnr(s, msg, len); break; case T30_STATE_IV_CTC: process_state_iv_ctc(s, msg, len); break; case T30_STATE_IV_EOR: process_state_iv_eor(s, msg, len); break; case T30_STATE_IV_EOR_RNR: process_state_iv_eor_rnr(s, msg, len); break; case T30_STATE_CALL_FINISHED: process_state_call_finished(s, msg, len); break; default: /* We don't know what to do with this. */ unexpected_final_frame(s, msg, len); break; } } } /*- End of function --------------------------------------------------------*/ static void queue_phase(t30_state_t *s, int phase) { if (s->rx_signal_present) { /* We need to wait for that signal to go away */ if (s->next_phase != T30_PHASE_IDLE) { span_log(&s->logging, SPAN_LOG_FLOW, "Flushing queued phase %s\n", phase_names[s->next_phase]); /* Ensure nothing has been left in the queue that was scheduled to go out in the previous next phase */ if (s->send_hdlc_handler) s->send_hdlc_handler(s->send_hdlc_user_data, NULL, -1); } s->next_phase = phase; } else { /* We don't need to queue the new phase. We can change to it immediately. */ set_phase(s, phase); } } /*- End of function --------------------------------------------------------*/ static void set_phase(t30_state_t *s, int phase) { if (phase != s->next_phase && s->next_phase != T30_PHASE_IDLE) { span_log(&s->logging, SPAN_LOG_FLOW, "Flushing queued phase %s\n", phase_names[s->next_phase]); /* Ensure nothing has been left in the queue that was scheduled to go out in the previous next phase */ if (s->send_hdlc_handler) s->send_hdlc_handler(s->send_hdlc_user_data, NULL, -1); } span_log(&s->logging, SPAN_LOG_FLOW, "Changing from phase %s to %s\n", phase_names[s->phase], phase_names[phase]); /* We may be killing a receiver before it has declared the end of the signal. Force the signal present indicator to off, because the receiver will never be able to. */ if (s->phase != T30_PHASE_A_CED && s->phase != T30_PHASE_A_CNG) s->rx_signal_present = false; s->rx_trained = false; s->rx_frame_received = false; s->phase = phase; s->next_phase = T30_PHASE_IDLE; switch (phase) { case T30_PHASE_A_CED: if (s->set_rx_type_handler) s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_V21, 300, false, true); if (s->set_tx_type_handler) s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_CED, 0, false, false); break; case T30_PHASE_A_CNG: if (s->set_rx_type_handler) s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_V21, 300, false, true); if (s->set_tx_type_handler) s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_CNG, 0, false, false); break; case T30_PHASE_B_RX: case T30_PHASE_D_RX: if (s->set_rx_type_handler) s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_V21, 300, false, true); if (s->set_tx_type_handler) s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_NONE, 0, false, false); break; case T30_PHASE_B_TX: case T30_PHASE_D_TX: if (!s->far_end_detected && s->timer_t0_t1 > 0) { s->timer_t0_t1 = ms_to_samples(DEFAULT_TIMER_T1); s->far_end_detected = true; } if (s->set_rx_type_handler) s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, false, false); if (s->set_tx_type_handler) s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_V21, 300, false, true); break; case T30_PHASE_C_NON_ECM_RX: if (s->set_rx_type_handler) { /* Momentarily stop the receive modem, so the next change is forced to happen. If we don't do this an HDLC message on the slow modem, which has disabled the fast modem, will prevent the same fast modem from restarting. */ s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, false, false); s->set_rx_type_handler(s->set_rx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, false); } if (s->set_tx_type_handler) s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_NONE, 0, false, false); break; case T30_PHASE_C_NON_ECM_TX: /* Pause before switching from anything to phase C */ /* Always prime the training count for 1.5s of data at the current rate. Its harmless if we prime it and are not doing TCF. */ s->tcf_test_bits = (3*fallback_sequence[s->current_fallback].bit_rate)/2; if (s->set_rx_type_handler) { /* Momentarily stop the receive modem, so the next change is forced to happen. If we don't do this an HDLC message on the slow modem, which has disabled the fast modem, will prevent the same fast modem from restarting. */ s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, false, false); s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, false, false); } if (s->set_tx_type_handler) s->set_tx_type_handler(s->set_tx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, false); break; case T30_PHASE_C_ECM_RX: if (s->set_rx_type_handler) s->set_rx_type_handler(s->set_rx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, true); if (s->set_tx_type_handler) s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_NONE, 0, false, false); break; case T30_PHASE_C_ECM_TX: /* Pause before switching from anything to phase C */ if (s->set_rx_type_handler) s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, false, false); if (s->set_tx_type_handler) s->set_tx_type_handler(s->set_tx_type_user_data, fallback_sequence[s->current_fallback].modem_type, fallback_sequence[s->current_fallback].bit_rate, s->short_train, true); break; case T30_PHASE_E: /* Send a little silence before ending things, to ensure the buffers are flushed all they way through to the far end, and the far end has been able to see the last message we sent. */ s->tcf_test_bits = 0; s->tcf_current_zeros = 0; s->tcf_most_zeros = 0; if (s->set_rx_type_handler) s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_NONE, 0, false, false); if (s->set_tx_type_handler) s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_PAUSE, 0, FINAL_FLUSH_TIME, false); break; case T30_PHASE_CALL_FINISHED: if (s->set_rx_type_handler) s->set_rx_type_handler(s->set_rx_type_user_data, T30_MODEM_DONE, 0, false, false); if (s->set_tx_type_handler) s->set_tx_type_handler(s->set_tx_type_user_data, T30_MODEM_DONE, 0, false, false); break; } } /*- End of function --------------------------------------------------------*/ static void set_state(t30_state_t *s, int state) { if (s->state != state) { span_log(&s->logging, SPAN_LOG_FLOW, "Changing from state %d to %d\n", s->state, state); s->state = state; } s->step = 0; } /*- End of function --------------------------------------------------------*/ static void repeat_last_command(t30_state_t *s) { s->step = 0; if (++s->retries >= MAX_COMMAND_TRIES) { span_log(&s->logging, SPAN_LOG_FLOW, "Too many retries. Giving up.\n"); switch (s->state) { case T30_STATE_D_POST_TCF: /* Received no response to DCS or TCF */ t30_set_status(s, T30_ERR_TX_PHBDEAD); break; case T30_STATE_II_Q: case T30_STATE_IV_PPS_NULL: case T30_STATE_IV_PPS_Q: /* No response after sending a page */ t30_set_status(s, T30_ERR_TX_PHDDEAD); break; default: /* Disconnect after permitted retries */ t30_set_status(s, T30_ERR_RETRYDCN); break; } send_dcn(s); return; } span_log(&s->logging, SPAN_LOG_FLOW, "Retry number %d\n", s->retries); switch (s->state) { case T30_STATE_R: s->dis_received = false; queue_phase(s, T30_PHASE_B_TX); send_dis_or_dtc_sequence(s, true); break; case T30_STATE_F_DOC_NON_ECM: case T30_STATE_III_Q: queue_phase(s, T30_PHASE_D_TX); send_simple_frame(s, s->last_rx_page_result); break; case T30_STATE_II_Q: queue_phase(s, T30_PHASE_D_TX); send_simple_frame(s, s->next_tx_step); break; case T30_STATE_IV_PPS_NULL: case T30_STATE_IV_PPS_Q: queue_phase(s, T30_PHASE_D_TX); send_pps_frame(s); break; case T30_STATE_IV_PPS_RNR: case T30_STATE_IV_EOR_RNR: queue_phase(s, T30_PHASE_D_TX); send_rr(s); break; case T30_STATE_D: queue_phase(s, T30_PHASE_B_TX); send_dcs_sequence(s, true); break; case T30_STATE_F_FTT: queue_phase(s, T30_PHASE_B_TX); send_simple_frame(s, T30_FTT); break; case T30_STATE_F_CFR: queue_phase(s, T30_PHASE_B_TX); send_cfr_sequence(s, true); break; case T30_STATE_D_POST_TCF: /* Need to send the whole training thing again */ s->short_train = false; queue_phase(s, T30_PHASE_B_TX); send_dcs_sequence(s, true); break; case T30_STATE_F_POST_RCP_RNR: /* Just ignore */ break; default: span_log(&s->logging, SPAN_LOG_FLOW, "Repeat command called with nothing to repeat - phase %s, state %d\n", phase_names[s->phase], s->state); break; } } /*- End of function --------------------------------------------------------*/ static void timer_t2_start(t30_state_t *s) { span_log(&s->logging, SPAN_LOG_FLOW, "Start T2\n"); s->timer_t2_t4 = ms_to_samples(DEFAULT_TIMER_T2); s->timer_t2_t4_is = TIMER_IS_T2; } /*- End of function --------------------------------------------------------*/ static void timer_t2a_start(t30_state_t *s) { /* T.30 Annex A says timeout T1 should be used in ECM phase C to time out the first frame after the flags start. This seems a strange reuse of the name T1 for a different purpose, but there it is. We distinguish it by calling it T1A. */ if (s->phase == T30_PHASE_C_ECM_RX) { span_log(&s->logging, SPAN_LOG_FLOW, "Start T1A\n"); s->timer_t2_t4 = ms_to_samples(DEFAULT_TIMER_T1A); s->timer_t2_t4_is = TIMER_IS_T1A; } else { span_log(&s->logging, SPAN_LOG_FLOW, "Start T2A\n"); s->timer_t2_t4 = ms_to_samples(DEFAULT_TIMER_T2A); s->timer_t2_t4_is = TIMER_IS_T2A; } } /*- End of function --------------------------------------------------------*/ static void timer_t2b_start(t30_state_t *s) { span_log(&s->logging, SPAN_LOG_FLOW, "Start T2B\n"); s->timer_t2_t4 = ms_to_samples(DEFAULT_TIMER_T2B); s->timer_t2_t4_is = TIMER_IS_T2B; } /*- End of function --------------------------------------------------------*/ static void timer_t4_start(t30_state_t *s) { span_log(&s->logging, SPAN_LOG_FLOW, "Start T4\n"); s->timer_t2_t4 = ms_to_samples(DEFAULT_TIMER_T4); s->timer_t2_t4_is = TIMER_IS_T4; } /*- End of function --------------------------------------------------------*/ static void timer_t4a_start(t30_state_t *s) { span_log(&s->logging, SPAN_LOG_FLOW, "Start T4A\n"); s->timer_t2_t4 = ms_to_samples(DEFAULT_TIMER_T4A); s->timer_t2_t4_is = TIMER_IS_T4A; } /*- End of function --------------------------------------------------------*/ static void timer_t4b_start(t30_state_t *s) { span_log(&s->logging, SPAN_LOG_FLOW, "Start T4B\n"); s->timer_t2_t4 = ms_to_samples(DEFAULT_TIMER_T4B); s->timer_t2_t4_is = TIMER_IS_T4B; } /*- End of function --------------------------------------------------------*/ static void timer_t2_t4_stop(t30_state_t *s) { const char *tag; switch (s->timer_t2_t4_is) { case TIMER_IS_IDLE: tag = "none"; break; case TIMER_IS_T1A: tag = "T1A"; break; case TIMER_IS_T2: tag = "T2"; break; case TIMER_IS_T2A: tag = "T2A"; break; case TIMER_IS_T2B: tag = "T2B"; break; case TIMER_IS_T2C: tag = "T2C"; break; case TIMER_IS_T4: tag = "T4"; break; case TIMER_IS_T4A: tag = "T4A"; break; case TIMER_IS_T4B: tag = "T4B"; break; case TIMER_IS_T4C: tag = "T4C"; break; default: tag = "T2/T4"; break; } span_log(&s->logging, SPAN_LOG_FLOW, "Stop %s (%d remaining)\n", tag, s->timer_t2_t4); s->timer_t2_t4 = 0; s->timer_t2_t4_is = TIMER_IS_IDLE; } /*- End of function --------------------------------------------------------*/ static void timer_t0_expired(t30_state_t *s) { span_log(&s->logging, SPAN_LOG_FLOW, "T0 expired in state %d\n", s->state); t30_set_status(s, T30_ERR_T0_EXPIRED); /* Just end the call */ terminate_call(s); } /*- End of function --------------------------------------------------------*/ static void timer_t1_expired(t30_state_t *s) { span_log(&s->logging, SPAN_LOG_FLOW, "T1 expired in state %d\n", s->state); /* The initial connection establishment has timeout out. In other words, we have been unable to communicate successfully with a remote machine. It is time to abandon the call. */ t30_set_status(s, T30_ERR_T1_EXPIRED); switch (s->state) { case T30_STATE_T: /* Just end the call */ terminate_call(s); break; case T30_STATE_R: /* Send disconnect, and then end the call. Since we have not successfully contacted the far end, it is unclear why we should send a disconnect message at this point. However, it is what T.30 says we should do. */ send_dcn(s); break; } } /*- End of function --------------------------------------------------------*/ static void timer_t1a_expired(t30_state_t *s) { span_log(&s->logging, SPAN_LOG_FLOW, "T1A expired in phase %s, state %d. An HDLC frame lasted too long.\n", phase_names[s->phase], s->state); t30_set_status(s, T30_ERR_HDLC_CARRIER); terminate_call(s); } /*- End of function --------------------------------------------------------*/ static void timer_t2_expired(t30_state_t *s) { if (s->timer_t2_t4_is != TIMER_IS_T2B) span_log(&s->logging, SPAN_LOG_FLOW, "T2 expired in phase %s, state %d\n", phase_names[s->phase], s->state); switch (s->state) { case T30_STATE_III_Q: case T30_STATE_F_POST_RCP_PPR: case T30_STATE_F_POST_RCP_MCF: switch (s->next_rx_step) { case T30_PRI_EOM: case T30_EOM: case T30_EOS: /* We didn't receive a response to our T30_MCF after T30_EOM, so we must be OK to proceed to phase B, and pretty much act like its the beginning of a call. */ span_log(&s->logging, SPAN_LOG_FLOW, "Returning to phase B after %s\n", t30_frametype(s->next_rx_step)); set_phase(s, T30_PHASE_B_TX); timer_t2_start(s); s->dis_received = false; send_dis_or_dtc_sequence(s, true); return; } break; case T30_STATE_F_TCF: span_log(&s->logging, SPAN_LOG_FLOW, "No TCF data received\n"); set_phase(s, T30_PHASE_B_TX); set_state(s, T30_STATE_F_FTT); send_simple_frame(s, T30_FTT); return; case T30_STATE_F_DOC_ECM: case T30_STATE_F_DOC_NON_ECM: /* While waiting for FAX page */ t30_set_status(s, T30_ERR_RX_T2EXPFAX); break; case T30_STATE_F_POST_DOC_ECM: case T30_STATE_F_POST_DOC_NON_ECM: /* While waiting for next FAX page */ /* Figure 5-2b/T.30 and note 7 says we should allow 1 to 3 tries at this point. The way we work now is effectively hard coding a 1 try limit */ t30_set_status(s, T30_ERR_RX_T2EXPMPS); break; #if 0 case ??????: /* While waiting for DCN */ t30_set_status(s, T30_ERR_RX_T2EXPDCN); break; case ??????: /* While waiting for phase D */ t30_set_status(s, T30_ERR_RX_T2EXPD); break; #endif case T30_STATE_IV_PPS_RNR: case T30_STATE_IV_EOR_RNR: /* While waiting for RR command */ t30_set_status(s, T30_ERR_RX_T2EXPRR); break; case T30_STATE_R: /* While waiting for NSS, DCS or MCF */ t30_set_status(s, T30_ERR_RX_T2EXP); break; case T30_STATE_F_FTT: break; } queue_phase(s, T30_PHASE_B_TX); start_receiving_document(s); } /*- End of function --------------------------------------------------------*/ static void timer_t2a_expired(t30_state_t *s) { span_log(&s->logging, SPAN_LOG_FLOW, "T2A expired in phase %s, state %d. An HDLC frame lasted too long.\n", phase_names[s->phase], s->state); t30_set_status(s, T30_ERR_HDLC_CARRIER); terminate_call(s); } /*- End of function --------------------------------------------------------*/ static void timer_t2b_expired(t30_state_t *s) { span_log(&s->logging, SPAN_LOG_FLOW, "T2B expired in phase %s, state %d. The line is now quiet.\n", phase_names[s->phase], s->state); timer_t2_expired(s); } /*- End of function --------------------------------------------------------*/ static void timer_t3_expired(t30_state_t *s) { span_log(&s->logging, SPAN_LOG_FLOW, "T3 expired in phase %s, state %d\n", phase_names[s->phase], s->state); t30_set_status(s, T30_ERR_T3_EXPIRED); terminate_call(s); } /*- End of function --------------------------------------------------------*/ static void timer_t4_expired(t30_state_t *s) { /* There was no response (or only a corrupt response) to a command, within the T4 timeout period. */ span_log(&s->logging, SPAN_LOG_FLOW, "T4 expired in phase %s, state %d\n", phase_names[s->phase], s->state); /* Of course, things might just be a little late, especially if there are T.38 links in the path. There is no point in simply timing out, and resending, if we are currently receiving something from the far end - its a half-duplex path, so the two transmissions will conflict. Our best strategy is to wait until there is nothing being received, or give up after a long backstop timeout. In the meantime, if we get a meaningful, if somewhat delayed, response, we should accept it and carry on. */ repeat_last_command(s); } /*- End of function --------------------------------------------------------*/ static void timer_t4a_expired(t30_state_t *s) { span_log(&s->logging, SPAN_LOG_FLOW, "T4A expired in phase %s, state %d. An HDLC frame lasted too long.\n", phase_names[s->phase], s->state); t30_set_status(s, T30_ERR_HDLC_CARRIER); terminate_call(s); } /*- End of function --------------------------------------------------------*/ static void timer_t4b_expired(t30_state_t *s) { span_log(&s->logging, SPAN_LOG_FLOW, "T4B expired in phase %s, state %d. The line is now quiet.\n", phase_names[s->phase], s->state); timer_t4_expired(s); } /*- End of function --------------------------------------------------------*/ static void timer_t5_expired(t30_state_t *s) { /* Give up waiting for the receiver to become ready in error correction mode */ span_log(&s->logging, SPAN_LOG_FLOW, "T5 expired in phase %s, state %d\n", phase_names[s->phase], s->state); t30_set_status(s, T30_ERR_TX_T5EXP); } /*- End of function --------------------------------------------------------*/ static void decode_20digit_msg(t30_state_t *s, char *msg, const uint8_t *pkt, int len) { int p; int k; char text[T30_MAX_IDENT_LEN + 1]; if (msg == NULL) msg = text; if (len > T30_MAX_IDENT_LEN + 1) { unexpected_frame_length(s, pkt, len); msg[0] = '\0'; return; } p = len; /* Strip trailing spaces */ while (p > 1 && pkt[p - 1] == ' ') p--; /* The string is actually backwards in the message */ k = 0; while (p > 1) msg[k++] = pkt[--p]; msg[k] = '\0'; span_log(&s->logging, SPAN_LOG_FLOW, "Remote gave %s as: \"%s\"\n", t30_frametype(pkt[0]), msg); } /*- End of function --------------------------------------------------------*/ static void decode_url_msg(t30_state_t *s, char *msg, const uint8_t *pkt, int len) { char text[77 + 1]; /* TODO: decode properly, as per T.30 5.3.6.2.12 */ if (msg == NULL) msg = text; if (len < 3 || len > 77 + 3 || len != pkt[2] + 3) { unexpected_frame_length(s, pkt, len); msg[0] = '\0'; return; } /* First octet is the sequence number of the packet. Bit 7 = 1 for more follows, 0 for last packet in the sequence. Bits 6-0 = The sequence number, 0 to 0x7F Second octet is the type of internet address. Bits 7-4 = reserved Bits 3-0 = type: 0 = reserved 1 = e-mail address 2 = URL 3 = TCP/IP V4 4 = TCP/IP V6 5 = international phone number, in the usual +... format 6-15 = reserved Third octet is the length of the internet address Bit 7 = 1 for more follows, 0 for last packet in the sequence. Bits 6-0 = length */ memcpy(msg, &pkt[3], len - 3); msg[len - 3] = '\0'; span_log(&s->logging, SPAN_LOG_FLOW, "Remote fax gave %s as: %d, %d, \"%s\"\n", t30_frametype(pkt[0]), pkt[0], pkt[1], msg); } /*- End of function --------------------------------------------------------*/ static int decode_nsf_nss_nsc(t30_state_t *s, uint8_t *msg[], const uint8_t *pkt, int len) { uint8_t *t; if ((t = malloc(len - 1)) == NULL) return 0; memcpy(t, &pkt[1], len - 1); *msg = t; return len - 1; } /*- End of function --------------------------------------------------------*/ static void t30_non_ecm_rx_status(void *user_data, int status) { t30_state_t *s; int was_trained; s = (t30_state_t *) user_data; span_log(&s->logging, SPAN_LOG_FLOW, "Non-ECM signal status is %s (%d) in state %d\n", signal_status_to_str(status), status, s->state); switch (status) { case SIG_STATUS_TRAINING_IN_PROGRESS: s->image_carrier_attempted = true; break; case SIG_STATUS_TRAINING_FAILED: s->rx_trained = false; break; case SIG_STATUS_TRAINING_SUCCEEDED: /* The modem is now trained */ /* In case we are in trainability test mode... */ s->tcf_test_bits = 0; s->tcf_current_zeros = 0; s->tcf_most_zeros = 0; s->rx_signal_present = true; s->rx_trained = true; timer_t2_t4_stop(s); break; case SIG_STATUS_CARRIER_UP: break; case SIG_STATUS_CARRIER_DOWN: was_trained = s->rx_trained; s->rx_signal_present = false; s->rx_trained = false; switch (s->state) { case T30_STATE_F_TCF: /* Only respond if we managed to actually sync up with the source. We don't want to respond just because we saw a click. These often occur just before the real signal, with many modems. Presumably this is due to switching within the far end modem. We also want to avoid the possibility of responding to the tail end of any slow modem signal. If there was a genuine data signal which we failed to train on it should not matter. If things are that bad, we do not stand much chance of good quality communications. */ if (was_trained) { /* Although T.30 says the training test should be 1.5s of all 0's, some FAX machines send a burst of all 1's before the all 0's. Tolerate this. */ if (s->tcf_current_zeros > s->tcf_most_zeros) s->tcf_most_zeros = s->tcf_current_zeros; span_log(&s->logging, SPAN_LOG_FLOW, "Trainability (TCF) test result - %d total bits. longest run of zeros was %d\n", s->tcf_test_bits, s->tcf_most_zeros); if (s->tcf_most_zeros < fallback_sequence[s->current_fallback].bit_rate) { span_log(&s->logging, SPAN_LOG_FLOW, "Trainability (TCF) test failed - longest run of zeros was %d\n", s->tcf_most_zeros); set_phase(s, T30_PHASE_B_TX); set_state(s, T30_STATE_F_FTT); send_simple_frame(s, T30_FTT); } else { /* The training went OK */ s->short_train = true; rx_start_page(s); set_phase(s, T30_PHASE_B_TX); set_state(s, T30_STATE_F_CFR); send_cfr_sequence(s, true); } } break; case T30_STATE_F_POST_DOC_NON_ECM: /* Page ended cleanly */ if (s->current_status == T30_ERR_RX_NOCARRIER) t30_set_status(s, T30_ERR_OK); break; default: /* We should be receiving a document right now, but it did not end cleanly. */ if (was_trained) { span_log(&s->logging, SPAN_LOG_WARNING, "Page did not end cleanly\n"); /* We trained OK, so we should have some kind of received page, even though it did not end cleanly. */ set_state(s, T30_STATE_F_POST_DOC_NON_ECM); set_phase(s, T30_PHASE_D_RX); timer_t2_start(s); if (s->current_status == T30_ERR_RX_NOCARRIER) t30_set_status(s, T30_ERR_OK); } else { span_log(&s->logging, SPAN_LOG_WARNING, "Non-ECM carrier not found\n"); t30_set_status(s, T30_ERR_RX_NOCARRIER); } break; } if (s->next_phase != T30_PHASE_IDLE) set_phase(s, s->next_phase); break; default: span_log(&s->logging, SPAN_LOG_WARNING, "Unexpected non-ECM rx status - %d!\n", status); break; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(void) t30_non_ecm_put_bit(void *user_data, int bit) { t30_state_t *s; if (bit < 0) { t30_non_ecm_rx_status(user_data, bit); return; } s = (t30_state_t *) user_data; switch (s->state) { case T30_STATE_F_TCF: /* Trainability test */ s->tcf_test_bits++; if (bit) { if (s->tcf_current_zeros > s->tcf_most_zeros) s->tcf_most_zeros = s->tcf_current_zeros; s->tcf_current_zeros = 0; } else { s->tcf_current_zeros++; } break; case T30_STATE_F_DOC_NON_ECM: /* Document transfer */ if (t4_rx_put_bit(&s->t4.rx, bit)) { /* That is the end of the document */ set_state(s, T30_STATE_F_POST_DOC_NON_ECM); queue_phase(s, T30_PHASE_D_RX); timer_t2_start(s); } break; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t30_non_ecm_put_byte(void *user_data, int byte) { t30_state_t *s; if (byte < 0) { t30_non_ecm_rx_status(user_data, byte); return; } s = (t30_state_t *) user_data; switch (s->state) { case T30_STATE_F_TCF: /* Trainability test */ /* This makes counting zeros fast, but approximate. That really doesn't matter */ s->tcf_test_bits += 8; if (byte) { if (s->tcf_current_zeros > s->tcf_most_zeros) s->tcf_most_zeros = s->tcf_current_zeros; s->tcf_current_zeros = 0; } else { s->tcf_current_zeros += 8; } break; case T30_STATE_F_DOC_NON_ECM: /* Document transfer */ if (t4_rx_put_byte(&s->t4.rx, (uint8_t) byte)) { /* That is the end of the document */ set_state(s, T30_STATE_F_POST_DOC_NON_ECM); queue_phase(s, T30_PHASE_D_RX); timer_t2_start(s); } break; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t30_non_ecm_put_chunk(void *user_data, const uint8_t buf[], int len) { t30_state_t *s; int i; s = (t30_state_t *) user_data; switch (s->state) { case T30_STATE_F_TCF: /* Trainability test */ /* This makes counting zeros fast, but approximate. That really doesn't matter */ s->tcf_test_bits += 8*len; for (i = 0; i < len; i++) { if (buf[i]) { if (s->tcf_current_zeros > s->tcf_most_zeros) s->tcf_most_zeros = s->tcf_current_zeros; s->tcf_current_zeros = 0; } else { s->tcf_current_zeros += 8; } } break; case T30_STATE_F_DOC_NON_ECM: /* Document transfer */ if (t4_rx_put_chunk(&s->t4.rx, buf, len)) { /* That is the end of the document */ set_state(s, T30_STATE_F_POST_DOC_NON_ECM); queue_phase(s, T30_PHASE_D_RX); timer_t2_start(s); } break; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) t30_non_ecm_get_bit(void *user_data) { int bit; t30_state_t *s; s = (t30_state_t *) user_data; switch (s->state) { case T30_STATE_D_TCF: /* Trainability test. */ bit = 0; if (s->tcf_test_bits-- < 0) { /* Finished sending training test. */ bit = SIG_STATUS_END_OF_DATA; } break; case T30_STATE_I: /* Transferring real data. */ bit = t4_tx_get_bit(&s->t4.tx); break; case T30_STATE_D_POST_TCF: case T30_STATE_II_Q: /* We should be padding out a block of samples if we are here */ bit = 0; break; default: span_log(&s->logging, SPAN_LOG_WARNING, "t30_non_ecm_get_bit in bad state %d\n", s->state); bit = SIG_STATUS_END_OF_DATA; break; } return bit; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_non_ecm_get_byte(void *user_data) { int byte; t30_state_t *s; s = (t30_state_t *) user_data; switch (s->state) { case T30_STATE_D_TCF: /* Trainability test. */ byte = 0; if ((s->tcf_test_bits -= 8) < 0) { /* Finished sending training test. */ byte = 0x100; } break; case T30_STATE_I: /* Transferring real data. */ byte = t4_tx_get_byte(&s->t4.tx); break; case T30_STATE_D_POST_TCF: case T30_STATE_II_Q: /* We should be padding out a block of samples if we are here */ byte = 0; break; default: span_log(&s->logging, SPAN_LOG_WARNING, "t30_non_ecm_get_byte in bad state %d\n", s->state); byte = 0x100; break; } return byte; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_non_ecm_get_chunk(void *user_data, uint8_t buf[], int max_len) { int len; t30_state_t *s; s = (t30_state_t *) user_data; switch (s->state) { case T30_STATE_D_TCF: /* Trainability test. */ for (len = 0; len < max_len; len++) { buf[len] = 0; if ((s->tcf_test_bits -= 8) < 0) break; } break; case T30_STATE_I: /* Transferring real data. */ len = t4_tx_get_chunk(&s->t4.tx, buf, max_len); break; case T30_STATE_D_POST_TCF: case T30_STATE_II_Q: /* We should be padding out a block of samples if we are here */ len = 0; break; default: span_log(&s->logging, SPAN_LOG_WARNING, "t30_non_ecm_get_chunk in bad state %d\n", s->state); len = 0; break; } return len; } /*- End of function --------------------------------------------------------*/ static void t30_hdlc_rx_status(void *user_data, int status) { t30_state_t *s; int was_trained; s = (t30_state_t *) user_data; span_log(&s->logging, SPAN_LOG_FLOW, "HDLC signal status is %s (%d) in state %d\n", signal_status_to_str(status), status, s->state); switch (status) { case SIG_STATUS_TRAINING_IN_PROGRESS: break; case SIG_STATUS_TRAINING_FAILED: s->rx_trained = false; break; case SIG_STATUS_TRAINING_SUCCEEDED: /* The modem is now trained */ s->rx_signal_present = true; s->rx_trained = true; break; case SIG_STATUS_CARRIER_UP: s->rx_signal_present = true; switch (s->timer_t2_t4_is) { case TIMER_IS_T2B: timer_t2_t4_stop(s); s->timer_t2_t4_is = TIMER_IS_T2C; break; case TIMER_IS_T4B: timer_t2_t4_stop(s); s->timer_t2_t4_is = TIMER_IS_T4C; break; } break; case SIG_STATUS_CARRIER_DOWN: was_trained = s->rx_trained; s->rx_signal_present = false; s->rx_trained = false; /* If a phase change has been queued to occur after the receive signal drops, its time to change. */ if (s->state == T30_STATE_F_DOC_ECM) { /* We should be receiving a document right now, but we haven't seen an RCP at the end of transmission. */ if (was_trained) { /* We trained OK, so we should have some kind of received page, possibly with zero good HDLC frames. It just did'nt end cleanly with an RCP. */ span_log(&s->logging, SPAN_LOG_WARNING, "ECM signal did not end cleanly\n"); /* Fake the existance of an RCP, and proceed */ set_state(s, T30_STATE_F_POST_DOC_ECM); queue_phase(s, T30_PHASE_D_RX); timer_t2_start(s); /* We at least trained, so any missing carrier status is out of date */ if (s->current_status == T30_ERR_RX_NOCARRIER) t30_set_status(s, T30_ERR_OK); } else { /* Either there was no image carrier, or we failed to train to it. */ span_log(&s->logging, SPAN_LOG_WARNING, "ECM carrier not found\n"); t30_set_status(s, T30_ERR_RX_NOCARRIER); } } if (s->next_phase != T30_PHASE_IDLE) { /* The appropriate timer for the next phase should already be in progress */ set_phase(s, s->next_phase); } else { switch (s->timer_t2_t4_is) { case TIMER_IS_T1A: case TIMER_IS_T2A: case TIMER_IS_T2C: timer_t2b_start(s); break; case TIMER_IS_T4A: case TIMER_IS_T4C: timer_t4b_start(s); break; } } break; case SIG_STATUS_FRAMING_OK: if (!s->far_end_detected && s->timer_t0_t1 > 0) { s->timer_t0_t1 = ms_to_samples(DEFAULT_TIMER_T1); s->far_end_detected = true; if (s->phase == T30_PHASE_A_CED || s->phase == T30_PHASE_A_CNG) set_phase(s, T30_PHASE_B_RX); } /* 5.4.3.1 Timer T2 is reset if flag is received. Timer T2A must be started. */ /* Unstated, but implied, is that timer T4 and T4A are handled the same way. */ if (s->timer_t2_t4 > 0) { switch(s->timer_t2_t4_is) { case TIMER_IS_T1A: case TIMER_IS_T2: case TIMER_IS_T2A: timer_t2a_start(s); break; case TIMER_IS_T4: case TIMER_IS_T4A: timer_t4a_start(s); break; } } break; case SIG_STATUS_ABORT: /* Just ignore these */ break; default: span_log(&s->logging, SPAN_LOG_FLOW, "Unexpected HDLC special length - %d!\n", status); break; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(void) t30_hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok) { t30_state_t *s; if (len < 0) { t30_hdlc_rx_status(user_data, len); return; } s = (t30_state_t *) user_data; /* The spec. says a command or response is not valid if: - any of the frames, optional or mandatory, have an FCS error. - any single frame exceeds 3s +- 15% (i.e. no frame should exceed 2.55s) - the final frame is not tagged as a final frame - the final frame is not a recognised one. The first point seems benign. If we accept an optional frame, and a later frame is bad, having accepted the optional frame should be harmless. The 2.55s maximum seems to limit signalling frames to no more than 95 octets, including FCS, and flag octets (assuming the use of V.21). */ if (!ok) { span_log(&s->logging, SPAN_LOG_FLOW, "Bad HDLC CRC received\n"); if (s->phase != T30_PHASE_C_ECM_RX) { /* We either force a resend, or we wait until a resend occurs through a timeout. */ if ((s->supported_t30_features & T30_SUPPORT_COMMAND_REPEAT)) { s->step = 0; if (s->phase == T30_PHASE_B_RX) queue_phase(s, T30_PHASE_B_TX); else queue_phase(s, T30_PHASE_D_TX); send_simple_frame(s, T30_CRP); } else { /* Cancel the command or response timer (if one is running) */ span_log(&s->logging, SPAN_LOG_FLOW, "Bad CRC and timer is %d\n", s->timer_t2_t4_is); if (s->timer_t2_t4_is == TIMER_IS_T2A) timer_t2_t4_stop(s); } } return; } if (len < 3) { span_log(&s->logging, SPAN_LOG_FLOW, "Bad HDLC frame length - %d\n", len); /* Cancel the command or response timer (if one is running) */ timer_t2_t4_stop(s); return; } if (msg[0] != ADDRESS_FIELD || !(msg[1] == CONTROL_FIELD_NON_FINAL_FRAME || msg[1] == CONTROL_FIELD_FINAL_FRAME)) { span_log(&s->logging, SPAN_LOG_FLOW, "Bad HDLC frame header - %02x %02x\n", msg[0], msg[1]); /* Cancel the command or response timer (if one is running) */ timer_t2_t4_stop(s); return; } s->rx_frame_received = true; /* Cancel the command or response timer (if one is running) */ timer_t2_t4_stop(s); process_rx_control_msg(s, msg, len); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t30_front_end_status(void *user_data, int status) { t30_state_t *s; s = (t30_state_t *) user_data; switch (status) { case T30_FRONT_END_SEND_STEP_COMPLETE: span_log(&s->logging, SPAN_LOG_FLOW, "Send complete in phase %s, state %d\n", phase_names[s->phase], s->state); /* We have finished sending our messages, so move on to the next operation. */ switch (s->state) { case T30_STATE_ANSWERING: span_log(&s->logging, SPAN_LOG_FLOW, "Starting answer mode\n"); set_phase(s, T30_PHASE_B_TX); timer_t2_start(s); s->dis_received = false; send_dis_or_dtc_sequence(s, true); break; case T30_STATE_R: if (send_dis_or_dtc_sequence(s, false)) { /* Wait for an acknowledgement. */ set_phase(s, T30_PHASE_B_RX); timer_t4_start(s); } break; case T30_STATE_F_CFR: if (send_cfr_sequence(s, false)) { s->image_carrier_attempted = false; s->last_rx_page_result = -1; if (s->error_correcting_mode) { set_state(s, T30_STATE_F_DOC_ECM); queue_phase(s, T30_PHASE_C_ECM_RX); } else { set_state(s, T30_STATE_F_DOC_NON_ECM); queue_phase(s, T30_PHASE_C_NON_ECM_RX); } timer_t2_start(s); s->next_rx_step = T30_MPS; } break; case T30_STATE_F_FTT: if (s->step == 0) { shut_down_hdlc_tx(s); s->step++; } else { set_phase(s, T30_PHASE_B_RX); timer_t2_start(s); } break; case T30_STATE_F_DOC_NON_ECM: case T30_STATE_III_Q: case T30_STATE_F_POST_RCP_PPR: case T30_STATE_F_POST_RCP_MCF: if (s->step == 0) { shut_down_hdlc_tx(s); s->step++; } else { switch (s->next_rx_step) { case T30_PRI_MPS: case T30_MPS: /* We should now start to get another page */ s->image_carrier_attempted = false; if (s->error_correcting_mode) { set_state(s, T30_STATE_F_DOC_ECM); queue_phase(s, T30_PHASE_C_ECM_RX); } else { set_state(s, T30_STATE_F_DOC_NON_ECM); queue_phase(s, T30_PHASE_C_NON_ECM_RX); } timer_t2_start(s); break; case T30_PRI_EOM: case T30_EOM: case T30_EOS: /* See if we get something back, before moving to phase B. */ set_phase(s, T30_PHASE_D_RX); timer_t2_start(s); break; case T30_PRI_EOP: case T30_EOP: /* Wait for a DCN. */ set_phase(s, T30_PHASE_D_RX); timer_t4_start(s); break; default: span_log(&s->logging, SPAN_LOG_FLOW, "Unknown next rx step - %d\n", s->next_rx_step); terminate_call(s); break; } } break; case T30_STATE_II_Q: case T30_STATE_IV_PPS_NULL: case T30_STATE_IV_PPS_Q: case T30_STATE_IV_PPS_RNR: case T30_STATE_IV_EOR_RNR: case T30_STATE_F_POST_RCP_RNR: case T30_STATE_IV_EOR: case T30_STATE_IV_CTC: if (s->step == 0) { shut_down_hdlc_tx(s); s->step++; } else { /* We have finished sending the post image message. Wait for an acknowledgement. */ set_phase(s, T30_PHASE_D_RX); timer_t4_start(s); } break; case T30_STATE_B: /* We have now allowed time for the last message to flush through the system, so it is safe to report the end of the call. */ terminate_call(s); break; case T30_STATE_C: if (s->step == 0) { shut_down_hdlc_tx(s); s->step++; } else { /* We just sent the disconnect message. Now it is time to clean up and end the call. */ start_final_pause(s); } break; case T30_STATE_D: if (send_dcs_sequence(s, false)) { if ((s->iaf & T30_IAF_MODE_NO_TCF)) { /* Skip the trainability test */ s->retries = 0; s->short_train = true; if (s->error_correcting_mode) { set_state(s, T30_STATE_IV); queue_phase(s, T30_PHASE_C_ECM_TX); } else { set_state(s, T30_STATE_I); queue_phase(s, T30_PHASE_C_NON_ECM_TX); } } else { /* Do the trainability test */ /* TCF is always sent with long training */ s->short_train = false; set_state(s, T30_STATE_D_TCF); set_phase(s, T30_PHASE_C_NON_ECM_TX); } } break; case T30_STATE_D_TCF: /* Finished sending training test. Listen for the response. */ set_phase(s, T30_PHASE_B_RX); timer_t4_start(s); set_state(s, T30_STATE_D_POST_TCF); break; case T30_STATE_I: /* Send the end of page message */ set_phase(s, T30_PHASE_D_TX); set_state(s, T30_STATE_II_Q); /* We might need to resend the page we are on, but we need to check if there are any more pages to send, so we can send the correct signal right now. */ send_simple_frame(s, s->next_tx_step = check_next_tx_step(s)); break; case T30_STATE_IV: /* We have finished sending an FCD frame */ if (s->step == 0) { if (send_next_ecm_frame(s)) { shut_down_hdlc_tx(s); s->step++; } } else { /* Send the end of page or partial page message */ set_phase(s, T30_PHASE_D_TX); s->next_tx_step = check_next_tx_step(s); if (send_pps_frame(s) == T30_NULL) set_state(s, T30_STATE_IV_PPS_NULL); else set_state(s, T30_STATE_IV_PPS_Q); } break; case T30_STATE_F_DOC_ECM: /* This should be the end of a CTR being sent. */ if (s->step == 0) { shut_down_hdlc_tx(s); s->step++; } else { /* We have finished sending the CTR. Wait for image data again. */ queue_phase(s, T30_PHASE_C_ECM_RX); timer_t2_start(s); } break; case T30_STATE_CALL_FINISHED: /* Just ignore anything that happens now. We might get here if a premature disconnect from the far end overlaps something. */ break; default: span_log(&s->logging, SPAN_LOG_FLOW, "Bad state for send complete in t30_front_end_status - %d\n", s->state); break; } break; case T30_FRONT_END_RECEIVE_COMPLETE: span_log(&s->logging, SPAN_LOG_FLOW, "Receive complete in phase %s, state %d\n", phase_names[s->phase], s->state); /* Usually receive complete is notified by a carrier down signal. However, in cases like a T.38 packet stream dying in the middle of reception there needs to be a means to stop things. */ switch (s->phase) { case T30_PHASE_C_NON_ECM_RX: t30_non_ecm_rx_status(s, SIG_STATUS_CARRIER_DOWN); break; default: t30_hdlc_rx_status(s, SIG_STATUS_CARRIER_DOWN); break; } break; case T30_FRONT_END_SIGNAL_PRESENT: span_log(&s->logging, SPAN_LOG_FLOW, "A signal is present\n"); /* The front end is explicitly telling us the signal we expect is present. This might be a premature indication from a T.38 implementation, but we have to believe it. if we don't we can time out improperly. For example, we might get an image modem carrier signal, but the first HDLC frame might only occur several seconds later. Many ECM senders idle on HDLC flags while waiting for the paper or filing system to become ready. T.38 offers no specific indication of correct carrier training, so if we don't kill the timer on the initial carrier starting signal, we will surely time out quite often before the next thing we receive. */ switch (s->phase) { case T30_PHASE_A_CED: case T30_PHASE_A_CNG: case T30_PHASE_B_RX: case T30_PHASE_D_RX: /* We are running a V.21 receive modem, where an explicit training indication will not occur. */ t30_hdlc_rx_status(s, SIG_STATUS_CARRIER_UP); t30_hdlc_rx_status(s, SIG_STATUS_FRAMING_OK); break; default: /* Cancel any receive timeout, and declare that a receive signal is present, since the front end is explicitly telling us we have seen something. */ s->rx_signal_present = true; timer_t2_t4_stop(s); break; } break; case T30_FRONT_END_SIGNAL_ABSENT: span_log(&s->logging, SPAN_LOG_FLOW, "No signal is present\n"); /* TODO: Should we do anything here? */ break; case T30_FRONT_END_CED_PRESENT: span_log(&s->logging, SPAN_LOG_FLOW, "CED tone is present\n"); /* TODO: Should we do anything here? */ break; case T30_FRONT_END_CNG_PRESENT: span_log(&s->logging, SPAN_LOG_FLOW, "CNG tone is present\n"); /* TODO: Should we do anything here? */ break; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t30_timer_update(t30_state_t *s, int samples) { int previous; if (s->timer_t0_t1 > 0) { if ((s->timer_t0_t1 -= samples) <= 0) { s->timer_t0_t1 = 0; if (s->far_end_detected) timer_t1_expired(s); else timer_t0_expired(s); } } if (s->timer_t3 > 0) { if ((s->timer_t3 -= samples) <= 0) { s->timer_t3 = 0; timer_t3_expired(s); } } if (s->timer_t2_t4 > 0) { if ((s->timer_t2_t4 -= samples) <= 0) { previous = s->timer_t2_t4_is; /* Don't allow the count to be left at a small negative number. It looks cosmetically bad in the logs. */ s->timer_t2_t4 = 0; s->timer_t2_t4_is = TIMER_IS_IDLE; switch (previous) { case TIMER_IS_T1A: timer_t1a_expired(s); break; case TIMER_IS_T2: timer_t2_expired(s); break; case TIMER_IS_T2A: timer_t2a_expired(s); break; case TIMER_IS_T2B: timer_t2b_expired(s); break; case TIMER_IS_T4: timer_t4_expired(s); break; case TIMER_IS_T4A: timer_t4a_expired(s); break; case TIMER_IS_T4B: timer_t4b_expired(s); break; } } } if (s->timer_t5 > 0) { if ((s->timer_t5 -= samples) <= 0) { s->timer_t5 = 0; timer_t5_expired(s); } } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t30_terminate(t30_state_t *s) { if (s->phase != T30_PHASE_CALL_FINISHED) { /* The far end disconnected early, but was it just a tiny bit too early, as we were just tidying up, or seriously early as in a failure? */ switch (s->state) { case T30_STATE_C: /* We were sending the final disconnect, so just hussle things along. */ break; case T30_STATE_B: /* We were in the final pause, waiting for everything to flush through, so just hussle things along. */ break; default: /* If we have seen a genuine EOP or PRI_EOP, and that's good enough for us. The far end might not agree, as it might not have seen the MCF we sent in response to EOP or PRI_EOP. This might cause it to say the call did not complete properly. However, if this function has been called we can do no more. */ if (!s->end_of_procedure_detected) { /* The call terminated prematurely. */ t30_set_status(s, T30_ERR_CALLDROPPED); } break; } terminate_call(s); } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t30_get_transfer_statistics(t30_state_t *s, t30_stats_t *t) { t4_stats_t stats; t->bit_rate = fallback_sequence[s->current_fallback].bit_rate; t->error_correcting_mode = s->error_correcting_mode; t->error_correcting_mode_retries = s->error_correcting_mode_retries; switch (s->operation_in_progress) { case OPERATION_IN_PROGRESS_T4_TX: case OPERATION_IN_PROGRESS_POST_T4_TX: t4_tx_get_transfer_statistics(&s->t4.tx, &stats); break; case OPERATION_IN_PROGRESS_T4_RX: case OPERATION_IN_PROGRESS_POST_T4_RX: t4_rx_get_transfer_statistics(&s->t4.rx, &stats); break; default: memset(&stats, 0, sizeof(stats)); break; } t->pages_tx = s->tx_page_number; t->pages_rx = s->rx_page_number; t->pages_in_file = stats.pages_in_file; t->width = stats.width; t->length = stats.length; t->bad_rows = stats.bad_rows; t->longest_bad_row_run = stats.longest_bad_row_run; t->x_resolution = stats.x_resolution; t->y_resolution = stats.y_resolution; t->encoding = stats.encoding; t->image_size = stats.line_image_size; t->current_status = s->current_status; #if 0 t->rtn_events = s->rtn_events; t->rtp_events = s->rtp_events; #endif } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t30_local_interrupt_request(t30_state_t *s, int state) { if (s->timer_t3 > 0) { /* Accept the far end's outstanding request for interrupt. */ /* TODO: */ send_simple_frame(s, (state) ? T30_PIP : T30_PIN); } s->local_interrupt_pending = state; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t30_remote_interrupts_allowed(t30_state_t *s, int state) { s->remote_interrupts_allowed = state; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_restart(t30_state_t *s) { s->phase = T30_PHASE_IDLE; s->next_phase = T30_PHASE_IDLE; s->current_fallback = 0; s->rx_signal_present = false; s->rx_trained = false; s->rx_frame_received = false; s->current_status = T30_ERR_OK; s->ppr_count = 0; s->ecm_progress = 0; s->receiver_not_ready_count = 0; s->far_dis_dtc_len = 0; memset(&s->far_dis_dtc_frame, 0, sizeof(s->far_dis_dtc_frame)); t30_build_dis_or_dtc(s); memset(&s->rx_info, 0, sizeof(s->rx_info)); release_resources(s); /* The page number is only reset at call establishment */ s->rx_page_number = 0; s->tx_page_number = 0; s->rtn_events = 0; s->rtp_events = 0; s->local_interrupt_pending = false; s->far_end_detected = false; s->end_of_procedure_detected = false; s->timer_t0_t1 = ms_to_samples(DEFAULT_TIMER_T0); if (s->calling_party) { set_state(s, T30_STATE_T); set_phase(s, T30_PHASE_A_CNG); } else { set_state(s, T30_STATE_ANSWERING); set_phase(s, T30_PHASE_A_CED); } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(t30_state_t *) t30_init(t30_state_t *s, int calling_party, t30_set_handler_t *set_rx_type_handler, void *set_rx_type_user_data, t30_set_handler_t *set_tx_type_handler, void *set_tx_type_user_data, t30_send_hdlc_handler_t *send_hdlc_handler, void *send_hdlc_user_data) { if (s == NULL) { if ((s = (t30_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); s->calling_party = calling_party; s->set_rx_type_handler = set_rx_type_handler; s->set_rx_type_user_data = set_rx_type_user_data; s->set_tx_type_handler = set_tx_type_handler; s->set_tx_type_user_data = set_tx_type_user_data; s->send_hdlc_handler = send_hdlc_handler; s->send_hdlc_user_data = send_hdlc_user_data; /* Default to the basic modems. */ s->supported_modems = T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17; s->supported_compressions = T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION; s->supported_resolutions = T30_SUPPORT_STANDARD_RESOLUTION | T30_SUPPORT_FINE_RESOLUTION | T30_SUPPORT_SUPERFINE_RESOLUTION | T30_SUPPORT_R8_RESOLUTION; s->supported_image_sizes = T30_SUPPORT_US_LETTER_LENGTH | T30_SUPPORT_US_LEGAL_LENGTH | T30_SUPPORT_UNLIMITED_LENGTH | T30_SUPPORT_215MM_WIDTH; /* Set the output encoding to something safe. Most things get 1D and 2D encoding right. Quite a lot get other things wrong. */ s->output_encoding = T4_COMPRESSION_ITU_T4_2D; s->local_min_scan_time_code = T30_MIN_SCAN_0MS; span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "T.30"); t30_restart(s); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_release(t30_state_t *s) { /* Make sure any FAX in progress is tidied up. If the tidying up has already happened, repeating it here is harmless. */ terminate_operation_in_progress(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_free(t30_state_t *s) { t30_release(s); free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t30_call_active(t30_state_t *s) { return (s->phase != T30_PHASE_CALL_FINISHED); } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/v29tx_constellation_maps.h0000664000175000017500000000700112101023127016005 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v29tx_constellation_maps.h - ITU V.29 modem transmit part. * Constellation mapping. * * Written by Steve Underwood * * Copyright (C) 2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(FP_SCALE) #if defined(SPANDSP_USE_FIXED_POINT) #define FP_SCALE(x) ((int16_t) x) #else #define FP_SCALE(x) (x) #endif #endif #if defined(SPANDSP_USE_FIXED_POINT) static const complexi16_t v29_abab_constellation[6] = #else static const complexf_t v29_abab_constellation[6] = #endif { {FP_SCALE( 3.0f), FP_SCALE(-3.0f)}, /* 315deg high 9600 */ {FP_SCALE(-3.0f), FP_SCALE( 0.0f)}, /* 180deg low */ {FP_SCALE( 1.0f), FP_SCALE(-1.0f)}, /* 315deg low 7200 */ {FP_SCALE(-3.0f), FP_SCALE( 0.0f)}, /* 180deg low */ {FP_SCALE( 0.0f), FP_SCALE(-3.0f)}, /* 270deg low 4800 */ {FP_SCALE(-3.0f), FP_SCALE( 0.0f)} /* 180deg low */ }; #if defined(SPANDSP_USE_FIXED_POINT) static const complexi16_t v29_cdcd_constellation[6] = #else static const complexf_t v29_cdcd_constellation[6] = #endif { {FP_SCALE( 3.0f), FP_SCALE( 0.0f)}, /* 0deg low 9600 */ {FP_SCALE(-3.0f), FP_SCALE( 3.0f)}, /* 135deg high */ {FP_SCALE( 3.0f), FP_SCALE( 0.0f)}, /* 0deg low 7200 */ {FP_SCALE(-1.0f), FP_SCALE( 1.0f)}, /* 135deg low */ {FP_SCALE( 3.0f), FP_SCALE( 0.0f)}, /* 0deg low 4800 */ {FP_SCALE( 0.0f), FP_SCALE( 3.0f)} /* 90deg low */ }; #if defined(SPANDSP_USE_FIXED_POINT) static const complexi16_t v29_9600_constellation[16] = #else static const complexf_t v29_9600_constellation[16] = #endif { {FP_SCALE( 3.0f), FP_SCALE( 0.0f)}, /* 0deg low */ {FP_SCALE( 1.0f), FP_SCALE( 1.0f)}, /* 45deg low */ {FP_SCALE( 0.0f), FP_SCALE( 3.0f)}, /* 90deg low */ {FP_SCALE(-1.0f), FP_SCALE( 1.0f)}, /* 135deg low */ {FP_SCALE(-3.0f), FP_SCALE( 0.0f)}, /* 180deg low */ {FP_SCALE(-1.0f), FP_SCALE(-1.0f)}, /* 225deg low */ {FP_SCALE( 0.0f), FP_SCALE(-3.0f)}, /* 270deg low */ {FP_SCALE( 1.0f), FP_SCALE(-1.0f)}, /* 315deg low */ {FP_SCALE( 5.0f), FP_SCALE( 0.0f)}, /* 0deg high */ {FP_SCALE( 3.0f), FP_SCALE( 3.0f)}, /* 45deg high */ {FP_SCALE( 0.0f), FP_SCALE( 5.0f)}, /* 90deg high */ {FP_SCALE(-3.0f), FP_SCALE( 3.0f)}, /* 135deg high */ {FP_SCALE(-5.0f), FP_SCALE( 0.0f)}, /* 180deg high */ {FP_SCALE(-3.0f), FP_SCALE(-3.0f)}, /* 225deg high */ {FP_SCALE( 0.0f), FP_SCALE(-5.0f)}, /* 270deg high */ {FP_SCALE( 3.0f), FP_SCALE(-3.0f)} /* 315deg high */ }; /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/testcpuid.c0000664000175000017500000001312412101172376013050 00000000000000/* * SpanDSP - a series of DSP components for telephony * * testcpuid.c - Check the CPU type, to identify special features, like SSE. * * Written by Steve Underwood * Stitched together from bits of testing code found here and there * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include /* Make this file just disappear if we are not on an x86 machine */ #if defined(__i386__) // || defined(__x86_64__) enum { X86_EFLAGS_CF = 0x00000001, /* Carry Flag */ X86_EFLAGS_PF = 0x00000004, /* Parity Flag */ X86_EFLAGS_AF = 0x00000010, /* Auxillary carry Flag */ X86_EFLAGS_ZF = 0x00000040, /* Zero Flag */ X86_EFLAGS_SF = 0x00000080, /* Sign Flag */ X86_EFLAGS_TF = 0x00000100, /* Trap Flag */ X86_EFLAGS_IF = 0x00000200, /* Interrupt Flag */ X86_EFLAGS_DF = 0x00000400, /* Direction Flag */ X86_EFLAGS_OF = 0x00000800, /* Overflow Flag */ X86_EFLAGS_IOPL = 0x00003000, /* IOPL mask */ X86_EFLAGS_NT = 0x00004000, /* Nested Task */ X86_EFLAGS_RF = 0x00010000, /* Resume Flag */ X86_EFLAGS_VM = 0x00020000, /* Virtual Mode */ X86_EFLAGS_AC = 0x00040000, /* Alignment Check */ X86_EFLAGS_VIF = 0x00080000, /* Virtual Interrupt Flag */ X86_EFLAGS_VIP = 0x00100000, /* Virtual Interrupt Pending */ X86_EFLAGS_ID = 0x00200000 /* CPUID detection flag */ }; /* Standard macro to see if a specific flag is changeable */ static __inline__ int flag_is_changeable_p(uint32_t flag) { uint32_t f1; uint32_t f2; __asm__ __volatile__ ( " pushfl\n" " pushfl\n" " popl %0\n" " movl %0,%1\n" " xorl %2,%0\n" " pushl %0\n" " popfl\n" " pushfl\n" " popl %0\n" " popfl\n" : "=&r" (f1), "=&r" (f2) : "ir" (flag)); return ((f1^f2) & flag) != 0; } /*- End of function --------------------------------------------------------*/ /* Probe for the CPUID instruction */ static int have_cpuid_p(void) { return flag_is_changeable_p(X86_EFLAGS_ID); } /*- End of function --------------------------------------------------------*/ int has_MMX(void) { int result; if (!have_cpuid_p()) return 0; /*endif*/ __asm__ __volatile__ ( " push %%ebx;\n" " mov $1,%%eax;\n" " cpuid;\n" " xor %%eax,%%eax;\n" " test $0x800000,%%edx;\n" " jz 1f;\n" /* no MMX support */ " inc %%eax;\n" /* MMX support */ "1:\n" " pop %%ebx;\n" : "=a" (result) : : "ecx", "edx"); return result; } /*- End of function --------------------------------------------------------*/ int has_SIMD(void) { int result; if (!have_cpuid_p()) return 0; /*endif*/ __asm__ __volatile__ ( " push %%ebx;\n" " mov $1,%%eax;\n" " cpuid;\n" " xor %%eax,%%eax;\n" " test $0x02000000,%%edx;\n" " jz 1f;\n" /* no SIMD support */ " inc %%eax;\n" /* SIMD support */ "1:\n" " pop %%ebx;\n" : "=a" (result) : : "ecx", "edx"); return result; } /*- End of function --------------------------------------------------------*/ int has_SIMD2(void) { int result; if (!have_cpuid_p()) return 0; /*endif*/ __asm__ __volatile__ ( " push %%ebx;\n" " mov $1,%%eax;\n" " cpuid;\n" " xor %%eax,%%eax;\n" " test $0x04000000,%%edx;\n" " jz 1f;\n" /* no SIMD2 support */ " inc %%eax;\n" /* SIMD2 support */ "1:\n" " pop %%ebx;\n" : "=a" (result) : : "ecx", "edx"); return result; } /*- End of function --------------------------------------------------------*/ int has_3DNow(void) { int result; if (!have_cpuid_p()) return 0; /*endif*/ __asm__ __volatile__ ( " push %%ebx;\n" " mov $0x80000000,%%eax;\n" " cpuid;\n" " xor %%ecx,%%ecx;\n" " cmp $0x80000000,%%eax;\n" " jbe 1f;\n" /* no extended MSR(1), so no 3DNow! */ " mov $0x80000001,%%eax;\n" " cpuid;\n" " xor %%ecx,%%ecx;\n" " test $0x80000000,%%edx;\n" " jz 1f;\n" /* no 3DNow! support */ " inc %%ecx;\n" /* 3DNow! support */ "1:\n" " pop %%ebx;\n" : "=c" (result) : : "eax", "edx"); return result; } /*- End of function --------------------------------------------------------*/ #if defined(TESTBED) int main(int argc, char *argv[]) { int result; result = has_MMX(); printf("MMX is %x\n", result); result = has_SIMD(); printf("SIMD is %x\n", result); result = has_SIMD2(); printf("SIMD2 is %x\n", result); result = has_3DNow(); printf("3DNow is %x\n", result); return 0; } /*- End of function --------------------------------------------------------*/ #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/lpc10_placev.c0000664000175000017500000002677111422612262013327 00000000000000/* * SpanDSP - a series of DSP components for telephony * * lpc10_placev.c - LPC10 low bit rate speech codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * This code is based on the U.S. Department of Defense reference * implementation of the LPC-10 2400 bps Voice Coder. They do not * exert copyright claims on their code, and it may be freely used. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/dc_restore.h" #include "spandsp/lpc10.h" #include "lpc10_encdecs.h" #define subsc(x,y) (((x) << 1) + (y)) void lpc10_placea(int32_t *ipitch, int32_t voibuf[3][2], int32_t *obound, int32_t af, int32_t vwin[3][2], int32_t awin[3][2], int32_t ewin[3][2], int32_t lframe, int32_t maxwin) { int allv; int winv; int32_t i; int32_t j; int32_t k; int32_t l; int32_t hrange; int ephase; int32_t lrange; lrange = (af - 2)*lframe + 1; hrange = af*lframe; /* Place the analysis window based on the voicing window placement, onsets, tentative voicing decision, and pitch. */ /* Case 1: Sustained voiced speech If the five most recent voicing decisions are voiced, then the window is placed phase-synchronously with the previous window, as close to the present voicing window if possible. If onsets bound the voicing window, then preference is given to a phase-synchronous placement which does not overlap these onsets. */ /* Case 2: Voiced transition If at least one voicing decision in AF is voicied, and there are no onsets, then the window is placed as in case 1. */ /* Case 3: Unvoiced speech or onsets If both voicing decisions in AF are unvoiced, or there are onsets then the window is placed coincident with the voicing window. */ /* Note: During phase-synchronous placement of windows, the length is not altered from MAXWIN, since this would defeat the purpose of phase-synchronous placement. */ /* Check for case 1 and case 2 */ allv = voibuf[af - 2][1] == 1 && voibuf[af - 1][0] == 1 && voibuf[af - 1][1] == 1 && voibuf[af][0] == 1 && voibuf[af][1] == 1; winv = voibuf[af][0] == 1 || voibuf[af][1] == 1; if (allv || (winv && *obound == 0)) { /* APHASE: Phase synchronous window placement. */ /* Get minimum lower index of the window. */ i = (lrange + *ipitch - 1 - awin[af - 2][0]) / *ipitch; i *= *ipitch; i += awin[af - 2][0]; /* l = the actual length of this frame's analysis window. */ l = maxwin; /* Calculate the location where a perfectly centered window would start. */ k = (vwin[af - 1][0] + vwin[af - 1][1] + 1 - l)/2; /* Choose the actual location to be the pitch multiple closest to this */ awin[af - 1][0] = i + ((int) floorf((float) (k - i)/(float) *ipitch + 0.5f))*(*ipitch); awin[af - 1][1] = awin[af - 1][0] + l - 1; /* If there is an onset bounding the right of the voicing window and the analysis window overlaps that, then move the analysis window backward to avoid this onset. */ if (*obound >= 2 && awin[af - 1][1] > vwin[af - 1][1]) { awin[af - 1][0] -= *ipitch; awin[af - 1][1] -= *ipitch; } /* Similarly for the left of the voicing window. */ if ((*obound == 1 || *obound == 3) && awin[af - 1][0] < vwin[af - 1][0]) { awin[af - 1][0] += *ipitch; awin[af - 1][1] += *ipitch; } /* If this placement puts the analysis window above HRANGE, then move it backward an integer number of pitch periods. */ while (awin[af - 1][1] > hrange) { awin[af - 1][0] -= *ipitch; awin[af - 1][1] -= *ipitch; } /* Similarly if the placement puts the analysis window below LRANGE. */ while (awin[af - 1][0] < lrange) { awin[af - 1][0] += *ipitch; awin[af - 1][1] += *ipitch; } /* Make energy window be phase-synchronous. */ ephase = TRUE; } else { /* Case 3 */ awin[af - 1][0] = vwin[af - 1][0]; awin[af - 1][1] = vwin[af - 1][1]; ephase = FALSE; } /* RMS is computed over an integer number of pitch periods in the analysis window. When it is not placed phase-synchronously, it is placed as close as possible to onsets. */ j = (awin[af - 1][1] - awin[af - 1][0] + 1) / *ipitch * *ipitch; if (j == 0 || !winv) { ewin[af - 1][0] = vwin[af - 1][0]; ewin[af - 1][1] = vwin[af - 1][1]; } else if (!ephase && *obound == 2) { ewin[af - 1][0] = awin[af - 1][1] - j + 1; ewin[af - 1][1] = awin[af - 1][1]; } else { ewin[af - 1][0] = awin[af - 1][0]; ewin[af - 1][1] = awin[af - 1][0] + j - 1; } } /*- End of function --------------------------------------------------------*/ void lpc10_placev(int32_t *osbuf, int32_t *osptr, int32_t oslen, int32_t *obound, int32_t vwin[3][2], int32_t af, int32_t lframe, int32_t minwin, int32_t maxwin, int32_t dvwinl, int32_t dvwinh) { int32_t i1; int32_t i2; int crit; int32_t q; int32_t osptr1; int32_t hrange; int32_t lrange; int i; /* Voicing window placement */ /* __________________ __________________ ______________ */ /* | | | */ /* | 1F | 2F | 3F ... */ /* |__________________|__________________|______________ */ /* Previous | */ /* Window | */ /* ...________| */ /* | | */ /* ------>| This window's placement range |<------ */ /* | | */ /* There are three cases. Note these are different from those given in the LPC-10e phase 1 report. */ /* 1. If there are no onsets in this range, then the voicing window is centered in the pitch window. If such a placement is not within the window's placement range, then the window is placed in the left-most portion of the placement range. Its length is always MAXWIN. */ /* 2. If the first onset is in 2F and there is sufficient room to place the window immediately before this onset, then the window is placed there, and its length is set to the maximum possible under these constraints. */ /* "Critical Region Exception": If there is another onset in 2F such that a window can be placed between the two onsets, the window is placed there (ie, as in case 3). */ /* 3. Otherwise, the window is placed immediately after the onset. The window's length is the longest length that can fit in the range under these constraints, except that the window may be shortened even further to avoid overlapping other onsets in the placement range. In any case, the window's length is at least MINWIN. */ /* Note that the values of MINWIN and LFRAME must be chosen such that case 2 = false implies case 3 = true. This means that MINWIN <= LFRAME/2. If this were not the case, then a fourth case would have to be added for when the window cannot fit either before or after the onset. */ /* Note also that onsets which weren't in 2F last time may be in 1F this time, due to the filter delays in computing onsets. The result is that occasionally a voicing window will overlap that onset. The only way to circumvent this problem is to add more delay in processing input speech. In the trade-off between delay and window-placement, window placement lost. */ /* Compute the placement range */ /* Computing MAX */ i1 = vwin[af - 2][1] + 1; i2 = (af - 2)*lframe + 1; lrange = max(i1, i2); hrange = af*lframe; /* Compute OSPTR1, so the following code only looks at relevant onsets. */ for (osptr1 = *osptr - 1; osptr1 >= 1; osptr1--) { if (osbuf[osptr1 - 1] <= hrange) break; } osptr1++; /* Check for case 1 first (fast case) */ if (osptr1 <= 1 || osbuf[osptr1 - 2] < lrange) { /* Compute max */ i1 = vwin[af - 2][1] + 1; vwin[af - 1][0] = max(i1, dvwinl); vwin[af - 1][1] = vwin[af - 1][0] + maxwin - 1; *obound = 0; } else { /* Search backward in OSBUF for first onset in range. */ /* This code relies on the above check being performed first. */ for (q = osptr1 - 1; q >= 1; q--) { if (osbuf[q - 1] < lrange) break; } q++; /* Check for case 2 (placement before onset): */ /* Check for critical region exception: */ crit = FALSE; for (i = q + 1; i < osptr1; i++) { if (osbuf[i - 1] - osbuf[q - 1] >= minwin) { crit = TRUE; break; } } /* Compute max */ i1 = (af - 1)*lframe; i2 = lrange + minwin - 1; if (!crit && osbuf[q - 1] > max(i1, i2)) { vwin[af - 1][1] = osbuf[q - 1] - 1; /* Compute max */ i2 = vwin[af - 1][1] - maxwin + 1; vwin[af - 1][0] = max(lrange, i2); *obound = 2; } else { /* Case 3 (placement after onset) */ vwin[af - 1][0] = osbuf[q - 1]; do { if (++q >= osptr1 || osbuf[q - 1] > vwin[af - 1][0] + maxwin) { /* Compute min */ i1 = vwin[af - 1][0] + maxwin - 1; vwin[af - 1][1] = min(i1, hrange); *obound = 1; return; } } while (osbuf[q - 1] < vwin[af - 1][0] + minwin); vwin[af - 1][1] = osbuf[q - 1] - 1; *obound = 3; } } } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/schedule.c0000664000175000017500000001050711422612262012640 00000000000000/* * SpanDSP - a series of DSP components for telephony * * schedule.c * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/schedule.h" #include "spandsp/private/logging.h" #include "spandsp/private/schedule.h" SPAN_DECLARE(int) span_schedule_event(span_sched_state_t *s, int us, span_sched_callback_func_t function, void *user_data) { int i; for (i = 0; i < s->max_to_date; i++) { if (s->sched[i].callback == NULL) break; /*endif*/ } /*endfor*/ if (i >= s->allocated) { s->allocated += 5; s->sched = (span_sched_t *) realloc(s->sched, sizeof(span_sched_t)*s->allocated); } /*endif*/ if (i >= s->max_to_date) s->max_to_date = i + 1; /*endif*/ s->sched[i].when = s->ticker + us; s->sched[i].callback = function; s->sched[i].user_data = user_data; return i; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(uint64_t) span_schedule_next(span_sched_state_t *s) { int i; uint64_t earliest; earliest = ~((uint64_t) 0); for (i = 0; i < s->max_to_date; i++) { if (s->sched[i].callback && earliest > s->sched[i].when) earliest = s->sched[i].when; /*endif*/ } /*endfor*/ return earliest; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(uint64_t) span_schedule_time(span_sched_state_t *s) { return s->ticker; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) span_schedule_update(span_sched_state_t *s, int us) { int i; span_sched_callback_func_t callback; void *user_data; s->ticker += us; for (i = 0; i < s->max_to_date; i++) { if (s->sched[i].callback && s->sched[i].when <= s->ticker) { callback = s->sched[i].callback; user_data = s->sched[i].user_data; s->sched[i].callback = NULL; s->sched[i].user_data = NULL; callback(s, user_data); } /*endif*/ } /*endfor*/ } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) span_schedule_del(span_sched_state_t *s, int i) { if (i >= s->max_to_date || i < 0 || s->sched[i].callback == NULL) { span_log(&s->logging, SPAN_LOG_WARNING, "Requested to delete invalid scheduled ID %d ?\n", i); return; } /*endif*/ s->sched[i].callback = NULL; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(span_sched_state_t *) span_schedule_init(span_sched_state_t *s) { memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "SCHEDULE"); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) span_schedule_release(span_sched_state_t *s) { if (s->sched) { free(s->sched); s->sched = NULL; } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) span_schedule_free(span_sched_state_t *s) { span_schedule_release(s); if (s) free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/t38_terminal.c0000664000175000017500000017111312343637026013366 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t38_terminal.c - T.38 termination, less the packet exchange part * * Written by Steve Underwood * * Copyright (C) 2005, 2006, 2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/bit_operations.h" #include "spandsp/queue.h" #include "spandsp/power_meter.h" #include "spandsp/complex.h" #include "spandsp/tone_generate.h" #include "spandsp/async.h" #include "spandsp/hdlc.h" #include "spandsp/fsk.h" #include "spandsp/v29tx.h" #include "spandsp/v29rx.h" #include "spandsp/v27ter_tx.h" #include "spandsp/v27ter_rx.h" #include "spandsp/v17tx.h" #include "spandsp/v17rx.h" #include "spandsp/timezone.h" #include "spandsp/t4_rx.h" #include "spandsp/t4_tx.h" #if defined(SPANDSP_SUPPORT_T85) #include "spandsp/t81_t82_arith_coding.h" #include "spandsp/t85.h" #endif #include "spandsp/t4_t6_decode.h" #include "spandsp/t4_t6_encode.h" #include "spandsp/t30_fcf.h" #include "spandsp/t35.h" #include "spandsp/t30.h" #include "spandsp/t30_api.h" #include "spandsp/t30_logging.h" #include "spandsp/t38_core.h" #include "spandsp/t38_terminal.h" #include "spandsp/private/logging.h" #include "spandsp/private/timezone.h" #if defined(SPANDSP_SUPPORT_T85) #include "spandsp/private/t81_t82_arith_coding.h" #include "spandsp/private/t85.h" #endif #include "spandsp/private/t4_t6_decode.h" #include "spandsp/private/t4_t6_encode.h" #include "spandsp/private/t4_rx.h" #include "spandsp/private/t4_tx.h" #include "spandsp/private/t30.h" #include "spandsp/private/t38_core.h" #include "spandsp/private/t38_terminal.h" /* Settings suitable for paced transmission over a UDP transport */ #define DEFAULT_US_PER_TX_CHUNK 30000 #define INDICATOR_TX_COUNT 3 #define DATA_TX_COUNT 1 #define DATA_END_TX_COUNT 3 /* Settings suitable for unpaced transmission over a TCP transport */ #define MAX_OCTETS_PER_UNPACED_CHUNK 300 /* Backstop timeout if reception of packets stops in the middle of a burst */ #define MID_RX_TIMEOUT 15000 enum { T38_CHUNKING_MERGE_FCS_WITH_DATA = 0x0001, T38_CHUNKING_WHOLE_FRAMES = 0x0002, T38_CHUNKING_ALLOW_TEP_TIME = 0x0004, T38_CHUNKING_SEND_REGULAR_INDICATORS = 0x0008, T38_CHUNKING_SEND_2S_REGULAR_INDICATORS = 0x0010 }; enum { T38_TIMED_STEP_NONE = 0, T38_TIMED_STEP_NON_ECM_MODEM = 0x10, T38_TIMED_STEP_NON_ECM_MODEM_2 = 0x11, T38_TIMED_STEP_NON_ECM_MODEM_3 = 0x12, T38_TIMED_STEP_NON_ECM_MODEM_4 = 0x13, T38_TIMED_STEP_NON_ECM_MODEM_5 = 0x14, T38_TIMED_STEP_HDLC_MODEM = 0x20, T38_TIMED_STEP_HDLC_MODEM_2 = 0x21, T38_TIMED_STEP_HDLC_MODEM_3 = 0x22, T38_TIMED_STEP_HDLC_MODEM_4 = 0x23, T38_TIMED_STEP_HDLC_MODEM_5 = 0x24, T38_TIMED_STEP_CED = 0x30, T38_TIMED_STEP_CED_2 = 0x31, T38_TIMED_STEP_CED_3 = 0x32, T38_TIMED_STEP_CNG = 0x40, T38_TIMED_STEP_CNG_2 = 0x41, T38_TIMED_STEP_PAUSE = 0x50, T38_TIMED_STEP_NO_SIGNAL = 0x60 }; static __inline__ int front_end_status(t38_terminal_state_t *s, int status) { t30_front_end_status(&s->t30, status); if (s->t38_fe.timed_step == T38_TIMED_STEP_NONE) return -1; return 0; } /*- End of function --------------------------------------------------------*/ static __inline__ void hdlc_accept_frame(t38_terminal_state_t *s, const uint8_t *msg, int len, int ok) { t30_hdlc_accept(&s->t30, msg, len, ok); } /*- End of function --------------------------------------------------------*/ static int extra_bits_in_stuffed_frame(const uint8_t buf[], int len) { int bitstream; int ones; int stuffed; int i; int j; bitstream = 0; ones = 0; stuffed = 0; /* We should really append the CRC, and include the stuffed bits for that, to get the exact number of bits in the frame. */ //len = crc_itu16_append(buf, len); for (i = 0; i < len; i++) { bitstream = buf[i]; for (j = 0; j < 8; j++) { if ((bitstream & 1)) { if (++ones >= 5) { ones = 0; stuffed++; } /*endif*/ } else { ones = 0; } /*endif*/ bitstream >>= 1; } /*endfor*/ } /*endfor*/ /* The total length of the frame is: the number of bits in the body + the number of additional bits in the body due to stuffing + the number of bits in the CRC + the number of additional bits in the CRC due to stuffing + 16 bits for the two terminating flag octets. Lets just allow 3 bits for the CRC, which is the worst case. It avoids calculating the real CRC, and the worst it can do is cause a flag octet's worth of additional output. */ return stuffed + 16 + 3 + 16; } /*- End of function --------------------------------------------------------*/ static int process_rx_missing(t38_core_state_t *t, void *user_data, int rx_seq_no, int expected_seq_no) { t38_terminal_state_t *s; s = (t38_terminal_state_t *) user_data; s->t38_fe.rx_data_missing = TRUE; return 0; } /*- End of function --------------------------------------------------------*/ static int process_rx_indicator(t38_core_state_t *t, void *user_data, int indicator) { t38_terminal_state_t *s; t38_terminal_front_end_state_t *fe; s = (t38_terminal_state_t *) user_data; fe = &s->t38_fe; /* Protect against T.38 stuff arriving after we've actually finished. */ if (fe->current_rx_type == T30_MODEM_DONE) return 0; if (t->current_rx_indicator == indicator) { /* This is probably due to the far end repeating itself, or slipping preamble messages in between HDLC frames. T.38/V.1.3 tells us to ignore it. Its harmless. */ return 0; } /*endif*/ /* In termination mode we don't care very much about indicators telling us training is starting. We only care about V.21 preamble starting, for timeout control, and the actual data. */ switch (indicator) { case T38_IND_NO_SIGNAL: if (t->current_rx_indicator == T38_IND_V21_PREAMBLE && (fe->current_rx_type == T30_MODEM_V21 || fe->current_rx_type == T30_MODEM_CNG)) { hdlc_accept_frame(s, NULL, SIG_STATUS_CARRIER_DOWN, TRUE); } /*endif*/ fe->timeout_rx_samples = 0; front_end_status(s, T30_FRONT_END_SIGNAL_ABSENT); break; case T38_IND_CNG: /* We are completely indifferent to the startup tones. They serve no purpose for us. We can't even assume that the existance of a tone means the far end is achieving proper communication. Some T.38 gateways will just send out a CED or CNG indicator without having seen anything from the far end FAX terminal. Just report them for completeness. */ front_end_status(s, T30_FRONT_END_CNG_PRESENT); break; case T38_IND_CED: front_end_status(s, T30_FRONT_END_CED_PRESENT); break; case T38_IND_V21_PREAMBLE: fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT); front_end_status(s, T30_FRONT_END_SIGNAL_PRESENT); break; case T38_IND_V27TER_2400_TRAINING: case T38_IND_V27TER_4800_TRAINING: case T38_IND_V29_7200_TRAINING: case T38_IND_V29_9600_TRAINING: case T38_IND_V17_7200_SHORT_TRAINING: case T38_IND_V17_7200_LONG_TRAINING: case T38_IND_V17_9600_SHORT_TRAINING: case T38_IND_V17_9600_LONG_TRAINING: case T38_IND_V17_12000_SHORT_TRAINING: case T38_IND_V17_12000_LONG_TRAINING: case T38_IND_V17_14400_SHORT_TRAINING: case T38_IND_V17_14400_LONG_TRAINING: case T38_IND_V34_CNTL_CHANNEL_1200: case T38_IND_V34_PRI_CHANNEL: case T38_IND_V33_12000_TRAINING: case T38_IND_V33_14400_TRAINING: /* We really don't care what kind of modem is delivering the following image data. We only care that some kind of fast modem signal is coming next. */ fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT); front_end_status(s, T30_FRONT_END_SIGNAL_PRESENT); break; case T38_IND_V8_ANSAM: case T38_IND_V8_SIGNAL: case T38_IND_V34_CC_RETRAIN: /* V.34 support is a work in progress. */ break; default: front_end_status(s, T30_FRONT_END_SIGNAL_ABSENT); break; } /*endswitch*/ fe->hdlc_rx.len = 0; fe->rx_data_missing = FALSE; return 0; } /*- End of function --------------------------------------------------------*/ static int fake_rx_indicator(t38_core_state_t *t, t38_terminal_state_t *s, int indicator) { int ret; ret = process_rx_indicator(t, s, indicator); t->current_rx_indicator = indicator; return ret; } /*- End of function --------------------------------------------------------*/ static void process_hdlc_data(t38_terminal_front_end_state_t *fe, const uint8_t *buf, int len) { if (fe->hdlc_rx.len + len <= T38_MAX_HDLC_LEN) { bit_reverse(fe->hdlc_rx.buf + fe->hdlc_rx.len, buf, len); fe->hdlc_rx.len += len; } else { fe->rx_data_missing = TRUE; } /*endif*/ } /*- End of function --------------------------------------------------------*/ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type, int field_type, const uint8_t *buf, int len) { t38_terminal_state_t *s; t38_terminal_front_end_state_t *fe; #if defined(_MSC_VER) uint8_t *buf2 = (uint8_t *) _alloca(len); #else uint8_t buf2[len]; #endif s = (t38_terminal_state_t *) user_data; fe = &s->t38_fe; /* Protect against T.38 stuff arriving after we've actually finished. */ if (fe->current_rx_type == T30_MODEM_DONE) return 0; /* In termination mode we don't care very much what the data type is apart from a couple of special cases. */ switch (data_type) { case T38_DATA_V8: switch (field_type) { case T38_FIELD_CM_MESSAGE: if (len >= 1) span_log(&s->logging, SPAN_LOG_FLOW, "CM profile %d - %s\n", buf[0] - '0', t38_cm_profile_to_str(buf[0])); else span_log(&s->logging, SPAN_LOG_FLOW, "Bad length for CM message - %d\n", len); /*endif*/ //front_end_status(s, T30_FRONT_END_RECEIVE_COMPLETE); break; case T38_FIELD_JM_MESSAGE: if (len >= 2) span_log(&s->logging, SPAN_LOG_FLOW, "JM - %s\n", t38_jm_to_str(buf, len)); else span_log(&s->logging, SPAN_LOG_FLOW, "Bad length for JM message - %d\n", len); /*endif*/ //front_end_status(s, T30_FRONT_END_RECEIVE_COMPLETE); break; case T38_FIELD_CI_MESSAGE: if (len >= 1) span_log(&s->logging, SPAN_LOG_FLOW, "CI 0x%X\n", buf[0]); else span_log(&s->logging, SPAN_LOG_FLOW, "Bad length for CI message - %d\n", len); /*endif*/ //front_end_status(s, T30_FRONT_END_RECEIVE_COMPLETE); break; default: break; } /*endswitch*/ return 0; case T38_DATA_V34_PRI_RATE: switch (field_type) { case T38_FIELD_V34RATE: if (len >= 3) { /* Just get and store the rate. The front end has no real interest in the actual bit rate. */ fe->t38.v34_rate = t38_v34rate_to_bps(buf, len); span_log(&s->logging, SPAN_LOG_FLOW, "V.34 rate %d bps\n", fe->t38.v34_rate); } else { span_log(&s->logging, SPAN_LOG_FLOW, "Bad length for V34rate message - %d\n", len); } /*endif*/ break; default: break; } /*endswitch*/ return 0; default: break; } /*endswitch*/ switch (field_type) { case T38_FIELD_HDLC_DATA: if (fe->timeout_rx_samples == 0) { /* HDLC can just start without any signal indicator on some platforms, even when there is zero packet loss. Nasty, but true. Its a good idea to be tolerant of loss, though, so accepting a sudden start of HDLC data is the right thing to do. */ fake_rx_indicator(t, s, T38_IND_V21_PREAMBLE); /* All real HDLC messages in the FAX world start with 0xFF. If this one is not starting with 0xFF it would appear some octets must have been missed before this one. */ if (len <= 0 || buf[0] != 0xFF) fe->rx_data_missing = TRUE; /*endif*/ } /*endif*/ if (len > 0) { process_hdlc_data(fe, buf, len); } /*endif*/ fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT); break; case T38_FIELD_HDLC_FCS_OK: if (len > 0) { span_log(&s->logging, SPAN_LOG_WARNING, "There is data in a T38_FIELD_HDLC_FCS_OK!\n"); /* The sender has incorrectly included data in this message. Cisco implemented inserting HDLC data here and Commetrex followed for compatibility reasons. We should, too. */ process_hdlc_data(fe, buf, len); } /*endif*/ /* Some T.38 implementations send multiple T38_FIELD_HDLC_FCS_OK messages, in IFP packets with incrementing sequence numbers, which are actually repeats. They get through to this point because of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */ if (fe->hdlc_rx.len > 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Type %s - CRC OK (%s)\n", (fe->hdlc_rx.len >= 3) ? t30_frametype(fe->hdlc_rx.buf[2]) : "???", (fe->rx_data_missing) ? "missing octets" : "clean"); hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, !fe->rx_data_missing); fe->hdlc_rx.len = 0; } /*endif*/ fe->rx_data_missing = FALSE; fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT); break; case T38_FIELD_HDLC_FCS_BAD: if (len > 0) { span_log(&s->logging, SPAN_LOG_WARNING, "There is data in a T38_FIELD_HDLC_FCS_BAD!\n"); /* The sender has incorrectly included data in this message. Cisco implemented inserting HDLC data here and Commetrex followed for compatibility reasons. We should, too. */ process_hdlc_data(fe, buf, len); } /*endif*/ /* Some T.38 implementations send multiple T38_FIELD_HDLC_FCS_BAD messages, in IFP packets with incrementing sequence numbers, which are actually repeats. They get through to this point because of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */ if (fe->hdlc_rx.len > 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Type %s - CRC bad (%s)\n", (fe->hdlc_rx.len >= 3) ? t30_frametype(fe->hdlc_rx.buf[2]) : "???", (fe->rx_data_missing) ? "missing octets" : "clean"); hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, FALSE); fe->hdlc_rx.len = 0; } /*endif*/ fe->rx_data_missing = FALSE; fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT); break; case T38_FIELD_HDLC_FCS_OK_SIG_END: if (len > 0) { span_log(&s->logging, SPAN_LOG_WARNING, "There is data in a T38_FIELD_HDLC_FCS_OK_SIG_END!\n"); /* The sender has incorrectly included data in this message. Cisco implemented inserting HDLC data here and Commetrex followed for compatibility reasons. We should, too. */ process_hdlc_data(fe, buf, len); } /*endif*/ /* Some T.38 implementations send multiple T38_FIELD_HDLC_FCS_OK_SIG_END messages, in IFP packets with incrementing sequence numbers, which are actually repeats. They get through to this point because of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */ if (fe->hdlc_rx.len > 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Type %s - CRC OK, sig end (%s)\n", (fe->hdlc_rx.len >= 3) ? t30_frametype(fe->hdlc_rx.buf[2]) : "???", (fe->rx_data_missing) ? "missing octets" : "clean"); hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, !fe->rx_data_missing); fe->hdlc_rx.len = 0; } /*endif*/ fe->rx_data_missing = FALSE; if (t->current_rx_data_type != data_type || t->current_rx_field_type != field_type) hdlc_accept_frame(s, NULL, SIG_STATUS_CARRIER_DOWN, TRUE); /*endif*/ /* Treat this like a no signal indicator has occurred, so if the no signal indicator is missing, we are still OK */ fake_rx_indicator(t, s, T38_IND_NO_SIGNAL); break; case T38_FIELD_HDLC_FCS_BAD_SIG_END: if (len > 0) { span_log(&s->logging, SPAN_LOG_WARNING, "There is data in a T38_FIELD_HDLC_FCS_BAD_SIG_END!\n"); /* The sender has incorrectly included data in this message. Cisco implemented inserting HDLC data here and Commetrex followed for compatibility reasons. We should, too. */ process_hdlc_data(fe, buf, len); } /*endif*/ /* Some T.38 implementations send multiple T38_FIELD_HDLC_FCS_BAD_SIG_END messages, in IFP packets with incrementing sequence numbers, which are actually repeats. They get through to this point because of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */ if (fe->hdlc_rx.len > 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Type %s - CRC bad, sig end (%s)\n", (fe->hdlc_rx.len >= 3) ? t30_frametype(fe->hdlc_rx.buf[2]) : "???", (fe->rx_data_missing) ? "missing octets" : "clean"); hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, FALSE); fe->hdlc_rx.len = 0; } /*endif*/ fe->rx_data_missing = FALSE; if (t->current_rx_data_type != data_type || t->current_rx_field_type != field_type) hdlc_accept_frame(s, NULL, SIG_STATUS_CARRIER_DOWN, TRUE); /*endif*/ /* Treat this like a no signal indicator has occurred, so if the no signal indicator is missing, we are still OK */ fake_rx_indicator(t, s, T38_IND_NO_SIGNAL); break; case T38_FIELD_HDLC_SIG_END: if (len > 0) { span_log(&s->logging, SPAN_LOG_WARNING, "There is data in a T38_FIELD_HDLC_SIG_END!\n"); /* The sender has incorrectly included data in this message, but there seems nothing meaningful it could be. There could not be an FCS good/bad report beyond this. */ } /*endif*/ /* Some T.38 implementations send multiple T38_FIELD_HDLC_SIG_END messages, in IFP packets with incrementing sequence numbers, which are actually repeats. They get through to this point because of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */ if (t->current_rx_data_type != data_type || t->current_rx_field_type != field_type) { /* WORKAROUND: At least some Mediatrix boxes have a bug, where they can send this message at the end of non-ECM data. We need to tolerate this. We use the generic receive complete indication, rather than the specific HDLC carrier down. */ /* This message is expected under 2 circumstances. One is as an alternative to T38_FIELD_HDLC_FCS_OK_SIG_END - i.e. they send T38_FIELD_HDLC_FCS_OK, and then T38_FIELD_HDLC_SIG_END when the carrier actually drops. The other is because the HDLC signal drops unexpectedly - i.e. not just after a final frame. */ fe->hdlc_rx.len = 0; fe->rx_data_missing = FALSE; front_end_status(s, T30_FRONT_END_RECEIVE_COMPLETE); } /*endif*/ /* Treat this like a no signal indicator has occurred, so if the no signal indicator is missing, we are still OK */ fake_rx_indicator(t, s, T38_IND_NO_SIGNAL); break; case T38_FIELD_T4_NON_ECM_DATA: if (!fe->rx_signal_present) { t30_non_ecm_put_bit(&s->t30, SIG_STATUS_TRAINING_SUCCEEDED); fe->rx_signal_present = TRUE; } /*endif*/ if (len > 0) { bit_reverse(buf2, buf, len); t30_non_ecm_put_chunk(&s->t30, buf2, len); } /*endif*/ fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT); break; case T38_FIELD_T4_NON_ECM_SIG_END: /* Some T.38 implementations send multiple T38_FIELD_T4_NON_ECM_SIG_END messages, in IFP packets with incrementing sequence numbers, which are actually repeats. They get through to this point because of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */ if (t->current_rx_data_type != data_type || t->current_rx_field_type != field_type) { if (len > 0) { if (!fe->rx_signal_present) { t30_non_ecm_put_bit(&s->t30, SIG_STATUS_TRAINING_SUCCEEDED); fe->rx_signal_present = TRUE; } /*endif*/ bit_reverse(buf2, buf, len); t30_non_ecm_put_chunk(&s->t30, buf2, len); } /*endif*/ /* WORKAROUND: At least some Mediatrix boxes have a bug, where they can send HDLC signal end where they should send non-ECM signal end. It is possible they also do the opposite. We need to tolerate this, so we use the generic receive complete indication, rather than the specific non-ECM carrier down. */ front_end_status(s, T30_FRONT_END_RECEIVE_COMPLETE); } /*endif*/ fe->rx_signal_present = FALSE; /* Treat this like a no signal indicator has occurred, so if the no signal indicator is missing, we are still OK */ fake_rx_indicator(t, s, T38_IND_NO_SIGNAL); break; default: break; } /*endswitch*/ return 0; } /*- End of function --------------------------------------------------------*/ static void send_hdlc(void *user_data, const uint8_t *msg, int len) { t38_terminal_state_t *s; s = (t38_terminal_state_t *) user_data; if (len == 0) { /* A length of zero means shut down the HDLC transmission */ s->t38_fe.hdlc_tx.len = -1; return; } /*endif*/ if (len == -1) { /* A length of -1 means flush any buffered HDLC data */ s->t38_fe.hdlc_tx.len = 0; s->t38_fe.hdlc_tx.ptr = 0; return; } /*endif*/ if (s->t38_fe.us_per_tx_chunk) s->t38_fe.hdlc_tx.extra_bits = extra_bits_in_stuffed_frame(msg, len); /*endif*/ bit_reverse(s->t38_fe.hdlc_tx.buf, msg, len); s->t38_fe.hdlc_tx.len = len; s->t38_fe.hdlc_tx.ptr = 0; } /*- End of function --------------------------------------------------------*/ static __inline__ int bits_to_us(t38_terminal_state_t *s, int bits) { if (s->t38_fe.us_per_tx_chunk == 0 || s->t38_fe.tx_bit_rate == 0) return 0; /*endif*/ return bits*1000000/s->t38_fe.tx_bit_rate; } /*- End of function --------------------------------------------------------*/ static void set_octets_per_data_packet(t38_terminal_state_t *s, int bit_rate) { s->t38_fe.tx_bit_rate = bit_rate; if (s->t38_fe.us_per_tx_chunk) { s->t38_fe.octets_per_data_packet = (s->t38_fe.us_per_tx_chunk/1000)*bit_rate/(8*1000); /* Make sure we have a positive number (i.e. we didn't truncate to zero). */ if (s->t38_fe.octets_per_data_packet < 1) s->t38_fe.octets_per_data_packet = 1; /*endif*/ } else { s->t38_fe.octets_per_data_packet = MAX_OCTETS_PER_UNPACED_CHUNK; } /*endif*/ } /*- End of function --------------------------------------------------------*/ static int set_no_signal(t38_terminal_state_t *s) { int delay; if ((s->t38_fe.chunking_modes & T38_CHUNKING_SEND_REGULAR_INDICATORS)) { if ((delay = t38_core_send_indicator(&s->t38_fe.t38, 0x100 | T38_IND_NO_SIGNAL)) < 0) return delay; /*endif*/ s->t38_fe.timed_step = T38_TIMED_STEP_NO_SIGNAL; if ((s->t38_fe.chunking_modes & T38_CHUNKING_SEND_2S_REGULAR_INDICATORS)) s->t38_fe.timeout_tx_samples = s->t38_fe.next_tx_samples + us_to_samples(2000000); else s->t38_fe.timeout_tx_samples = 0; /*endif*/ return s->t38_fe.us_per_tx_chunk; } /*endif*/ if ((delay = t38_core_send_indicator(&s->t38_fe.t38, T38_IND_NO_SIGNAL)) < 0) return delay; /*endif*/ s->t38_fe.timed_step = T38_TIMED_STEP_NONE; return delay; } /*- End of function --------------------------------------------------------*/ static int stream_no_signal(t38_terminal_state_t *s) { int delay; if ((delay = t38_core_send_indicator(&s->t38_fe.t38, 0x100 | T38_IND_NO_SIGNAL)) < 0) return delay; /*endif*/ if (s->t38_fe.timeout_tx_samples && s->t38_fe.next_tx_samples >= s->t38_fe.timeout_tx_samples) s->t38_fe.timed_step = T38_TIMED_STEP_NONE; /*endif*/ return s->t38_fe.us_per_tx_chunk; } /*- End of function --------------------------------------------------------*/ static int stream_non_ecm(t38_terminal_state_t *s) { t38_terminal_front_end_state_t *fe; uint8_t buf[MAX_OCTETS_PER_UNPACED_CHUNK + 50]; int res; int delay; int len; fe = &s->t38_fe; for (delay = 0; delay == 0; ) { switch (fe->timed_step) { case T38_TIMED_STEP_NON_ECM_MODEM: /* Create a 75ms silence */ if (fe->t38.current_tx_indicator != T38_IND_NO_SIGNAL) { if ((delay = t38_core_send_indicator(&fe->t38, T38_IND_NO_SIGNAL)) < 0) return delay; /*endif*/ } else { if (fe->us_per_tx_chunk) delay = 75000; /*endif*/ } /*endif*/ fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_2; fe->timeout_tx_samples = fe->next_tx_samples + us_to_samples(t38_core_send_training_delay(&fe->t38, fe->next_tx_indicator)); fe->next_tx_samples = fe->samples; break; case T38_TIMED_STEP_NON_ECM_MODEM_2: /* Switch on a fast modem, and give the training time to complete */ if ((fe->chunking_modes & T38_CHUNKING_SEND_REGULAR_INDICATORS)) { if ((delay = t38_core_send_indicator(&fe->t38, 0x100 | fe->next_tx_indicator)) < 0) return delay; /*endif*/ if (fe->next_tx_samples >= fe->timeout_tx_samples) fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_3; /*endif*/ return fe->us_per_tx_chunk; } /*endif*/ if ((delay = t38_core_send_indicator(&fe->t38, fe->next_tx_indicator)) < 0) return delay; /*endif*/ fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_3; break; case T38_TIMED_STEP_NON_ECM_MODEM_3: /* Send a chunk of non-ECM image data */ /* T.38 says it is OK to send the last of the non-ECM data in the signal end message. However, I think the early versions of T.38 said the signal end message should not contain data. Hopefully, following the current spec will not cause compatibility issues. */ len = t30_non_ecm_get_chunk(&s->t30, buf, fe->octets_per_data_packet); if (len < 0) return -1; /*endif*/ if (len > 0) bit_reverse(buf, buf, len); /*endif*/ if (len < fe->octets_per_data_packet) { /* That's the end of the image data. */ if (fe->us_per_tx_chunk) { /* Pad the end of the data with some zeros. If we just stop abruptly at the end of the EOLs, some ATAs fail to clean up properly before shutting down their transmit modem, and the last few rows of the image are lost or corrupted. Simply delaying the no-signal message does not help for all implentations. It is usually ignored, which is probably the right thing to do after receiving a message saying the signal has ended. */ memset(buf + len, 0, fe->octets_per_data_packet - len); fe->non_ecm_trailer_bytes = 3*fe->octets_per_data_packet + len; len = fe->octets_per_data_packet; fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_4; } else { /* If we are sending quickly there seems no point in doing any padding */ if ((res = t38_core_send_data(&fe->t38, fe->current_tx_data_type, T38_FIELD_T4_NON_ECM_SIG_END, buf, len, T38_PACKET_CATEGORY_IMAGE_DATA_END)) < 0) return res; /*endif*/ fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_5; if (front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE) < 0) return -1; /*endif*/ break; } /*endif*/ } /*endif*/ if ((res = t38_core_send_data(&fe->t38, fe->current_tx_data_type, T38_FIELD_T4_NON_ECM_DATA, buf, len, T38_PACKET_CATEGORY_IMAGE_DATA)) < 0) return res; /*endif*/ if (fe->us_per_tx_chunk) delay = bits_to_us(s, 8*len); /*endif*/ break; case T38_TIMED_STEP_NON_ECM_MODEM_4: /* Send padding */ len = fe->octets_per_data_packet; fe->non_ecm_trailer_bytes -= fe->octets_per_data_packet; if (fe->non_ecm_trailer_bytes <= 0) { len += fe->non_ecm_trailer_bytes; memset(buf, 0, len); if ((res = t38_core_send_data(&fe->t38, fe->current_tx_data_type, T38_FIELD_T4_NON_ECM_SIG_END, buf, len, T38_PACKET_CATEGORY_IMAGE_DATA_END)) < 0) return res; /*endif*/ fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_5; /* Allow a bit more time than the data will take to play out, to ensure the far ATA does not cut things short. */ if (fe->us_per_tx_chunk) delay = bits_to_us(s, 8*len) + 60000; /*endif*/ if (front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE) < 0) return -1; /*endif*/ break; } /*endif*/ memset(buf, 0, len); if ((res = t38_core_send_data(&fe->t38, fe->current_tx_data_type, T38_FIELD_T4_NON_ECM_DATA, buf, len, T38_PACKET_CATEGORY_IMAGE_DATA)) < 0) return res; /*endif*/ if (fe->us_per_tx_chunk) delay = bits_to_us(s, 8*len); /*endif*/ break; case T38_TIMED_STEP_NON_ECM_MODEM_5: /* This should not be needed, since the message above indicates the end of the signal, but it seems like it can improve compatibility with quirky implementations. */ delay = set_no_signal(s); if (fe->queued_timed_step != T38_TIMED_STEP_NONE) { fe->timed_step = fe->queued_timed_step; fe->queued_timed_step = T38_TIMED_STEP_NONE; } /*endif*/ return delay; } /*endswitch*/ } /*endfor*/ return delay; } /*- End of function --------------------------------------------------------*/ static int stream_hdlc(t38_terminal_state_t *s) { t38_terminal_front_end_state_t *fe; uint8_t buf[MAX_OCTETS_PER_UNPACED_CHUNK + 50]; t38_data_field_t data_fields[2]; int category; int previous; int res; int delay; int i; fe = &s->t38_fe; for (delay = 0; delay == 0; ) { switch (fe->timed_step) { case T38_TIMED_STEP_HDLC_MODEM: /* Create a 75ms silence */ if (fe->t38.current_tx_indicator != T38_IND_NO_SIGNAL) { if ((delay = t38_core_send_indicator(&fe->t38, T38_IND_NO_SIGNAL)) < 0) return delay; /*endif*/ } else { delay = (fe->us_per_tx_chunk) ? 75000 : 0; } /*endif*/ fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_2; fe->timeout_tx_samples = fe->next_tx_samples + us_to_samples(t38_core_send_training_delay(&fe->t38, fe->next_tx_indicator)) + us_to_samples(t38_core_send_flags_delay(&fe->t38, fe->next_tx_indicator)) + us_to_samples(delay); fe->next_tx_samples = fe->samples; break; case T38_TIMED_STEP_HDLC_MODEM_2: /* Send HDLC preambling */ if ((fe->chunking_modes & T38_CHUNKING_SEND_REGULAR_INDICATORS)) { if ((delay = t38_core_send_indicator(&fe->t38, 0x100 | fe->next_tx_indicator)) < 0) return delay; /*endif*/ if (fe->next_tx_samples >= fe->timeout_tx_samples) fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_3; /*endif*/ return fe->us_per_tx_chunk; } /*endif*/ if ((delay = t38_core_send_indicator(&fe->t38, fe->next_tx_indicator)) < 0) return delay; /*endif*/ delay += t38_core_send_flags_delay(&fe->t38, fe->next_tx_indicator); fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_3; break; case T38_TIMED_STEP_HDLC_MODEM_3: /* Send a chunk of HDLC data */ i = fe->hdlc_tx.len - fe->hdlc_tx.ptr; if (fe->octets_per_data_packet >= i) { /* The last part of an HDLC frame */ if ((fe->chunking_modes & T38_CHUNKING_MERGE_FCS_WITH_DATA)) { /* Copy the data, as we might be about to refill the buffer it is in */ memcpy(buf, &fe->hdlc_tx.buf[fe->hdlc_tx.ptr], i); data_fields[0].field_type = T38_FIELD_HDLC_DATA; data_fields[0].field = buf; data_fields[0].field_len = i; /* Now see about the next HDLC frame. This will tell us whether to send FCS_OK or FCS_OK_SIG_END */ previous = fe->current_tx_data_type; fe->hdlc_tx.ptr = 0; fe->hdlc_tx.len = 0; if (front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE) < 0) return -1; /*endif*/ /* The above step should have got the next HDLC step ready - either another frame, or an instruction to stop transmission. */ if (fe->hdlc_tx.len >= 0) { data_fields[1].field_type = T38_FIELD_HDLC_FCS_OK; data_fields[1].field = NULL; data_fields[1].field_len = 0; category = (fe->current_tx_data_type == T38_DATA_V21) ? T38_PACKET_CATEGORY_CONTROL_DATA : T38_PACKET_CATEGORY_IMAGE_DATA; if ((res = t38_core_send_data_multi_field(&fe->t38, fe->current_tx_data_type, data_fields, 2, category)) < 0) return res; /*endif*/ fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_3; delay = bits_to_us(s, i*8 + fe->hdlc_tx.extra_bits); } else { data_fields[1].field_type = T38_FIELD_HDLC_FCS_OK_SIG_END; data_fields[1].field = NULL; data_fields[1].field_len = 0; category = (fe->current_tx_data_type == T38_DATA_V21) ? T38_PACKET_CATEGORY_CONTROL_DATA_END : T38_PACKET_CATEGORY_IMAGE_DATA_END; if ((res = t38_core_send_data_multi_field(&fe->t38, fe->current_tx_data_type, data_fields, 2, category)) < 0) return res; /*endif*/ fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_5; /* We add a bit of extra time here, as with some implementations the carrier falling too abruptly causes data loss. */ delay = bits_to_us(s, i*8 + fe->hdlc_tx.extra_bits); if (fe->us_per_tx_chunk) delay += 100000; /*endif*/ if (front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE) < 0) return -1; /*endif*/ } /*endif*/ break; } /*endif*/ category = (fe->current_tx_data_type == T38_DATA_V21) ? T38_PACKET_CATEGORY_CONTROL_DATA : T38_PACKET_CATEGORY_IMAGE_DATA; if ((res = t38_core_send_data(&fe->t38, fe->current_tx_data_type, T38_FIELD_HDLC_DATA, &fe->hdlc_tx.buf[fe->hdlc_tx.ptr], i, category)) < 0) return res; /*endif*/ fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_4; } else { i = fe->octets_per_data_packet; category = (fe->current_tx_data_type == T38_DATA_V21) ? T38_PACKET_CATEGORY_CONTROL_DATA : T38_PACKET_CATEGORY_IMAGE_DATA; if ((res = t38_core_send_data(&fe->t38, fe->current_tx_data_type, T38_FIELD_HDLC_DATA, &fe->hdlc_tx.buf[fe->hdlc_tx.ptr], i, category)) < 0) return res; /*endif*/ fe->hdlc_tx.ptr += i; } /*endif*/ delay = bits_to_us(s, i*8); break; case T38_TIMED_STEP_HDLC_MODEM_4: /* End of HDLC frame */ previous = fe->current_tx_data_type; fe->hdlc_tx.ptr = 0; fe->hdlc_tx.len = 0; if (front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE) < 0) return -1; /*endif*/ /* The above step should have got the next HDLC step ready - either another frame, or an instruction to stop transmission. */ if (fe->hdlc_tx.len >= 0) { if (fe->hdlc_tx.len == 0) { /* Now, how did we get here? We have finished a frame, but have no new frame to send, and no end of transmission condition. */ span_log(&s->logging, SPAN_LOG_FLOW, "No new frame or end transmission condition.\n"); } /*endif*/ /* Finish the current frame off, and prepare for the next one. */ category = (fe->current_tx_data_type == T38_DATA_V21) ? T38_PACKET_CATEGORY_CONTROL_DATA : T38_PACKET_CATEGORY_IMAGE_DATA; if ((res = t38_core_send_data(&fe->t38, previous, T38_FIELD_HDLC_FCS_OK, NULL, 0, category)) < 0) return res; /*endif*/ fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_3; /* We should now wait enough time for everything to clear through an analogue modem at the far end. */ delay = bits_to_us(s, fe->hdlc_tx.extra_bits); } else { /* End of transmission */ category = (fe->current_tx_data_type == T38_DATA_V21) ? T38_PACKET_CATEGORY_CONTROL_DATA_END : T38_PACKET_CATEGORY_IMAGE_DATA_END; if ((res = t38_core_send_data(&fe->t38, previous, T38_FIELD_HDLC_FCS_OK_SIG_END, NULL, 0, category)) < 0) return res; /*endif*/ fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_5; /* We add a bit of extra time here, as with some implementations the carrier falling too abruptly causes data loss. */ delay = bits_to_us(s, fe->hdlc_tx.extra_bits); if (fe->us_per_tx_chunk) delay += 100000; /*endif*/ if (front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE) < 0) return -1; /*endif*/ } /*endif*/ break; case T38_TIMED_STEP_HDLC_MODEM_5: /* Note that some boxes do not like us sending a T38_FIELD_HDLC_SIG_END at this point. A T38_IND_NO_SIGNAL should always be OK. */ delay = set_no_signal(s); if (fe->queued_timed_step != T38_TIMED_STEP_NONE) { fe->timed_step = fe->queued_timed_step; fe->queued_timed_step = T38_TIMED_STEP_NONE; } /*endif*/ return delay; } /*endswitch*/ } /*endfor*/ return delay; } /*- End of function --------------------------------------------------------*/ static int stream_ced(t38_terminal_state_t *s) { t38_terminal_front_end_state_t *fe; int delay; fe = &s->t38_fe; for (delay = 0; delay == 0; ) { switch (fe->timed_step) { case T38_TIMED_STEP_CED: /* It seems common practice to start with a no signal indicator, though this is not a specified requirement. Since we should be sending 200ms of silence, starting the delay with a no signal indication makes sense. We do need a 200ms delay, as that is a specification requirement. */ fe->timed_step = T38_TIMED_STEP_CED_2; if ((delay = t38_core_send_indicator(&fe->t38, T38_IND_NO_SIGNAL)) < 0) return delay; /*endif*/ delay = (fe->us_per_tx_chunk) ? 200000 : 0; fe->next_tx_samples = fe->samples; break; case T38_TIMED_STEP_CED_2: /* Initial 200ms delay over. Send the CED indicator */ fe->timed_step = T38_TIMED_STEP_CED_3; if ((delay = t38_core_send_indicator(&fe->t38, T38_IND_CED)) < 0) return delay; /*endif*/ fe->current_tx_data_type = T38_DATA_NONE; break; case T38_TIMED_STEP_CED_3: /* End of CED */ fe->timed_step = fe->queued_timed_step; if (front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE) < 0) return -1; /*endif*/ return 0; } /*endswitch*/ } /*endfor*/ return delay; } /*- End of function --------------------------------------------------------*/ static int stream_cng(t38_terminal_state_t *s) { t38_terminal_front_end_state_t *fe; int delay; fe = &s->t38_fe; for (delay = 0; delay == 0; ) { switch (fe->timed_step) { case T38_TIMED_STEP_CNG: /* It seems common practice to start with a no signal indicator, though this is not a specified requirement of the T.38 spec. Since we should be sending 200ms of silence, according to T.30, starting that delay with a no signal indication makes sense. */ fe->timed_step = T38_TIMED_STEP_CNG_2; if ((delay = t38_core_send_indicator(&fe->t38, T38_IND_NO_SIGNAL)) < 0) return delay; /*endif*/ delay = (fe->us_per_tx_chunk) ? 200000 : 0; fe->next_tx_samples = fe->samples; break; case T38_TIMED_STEP_CNG_2: /* Initial short delay over. Send the CNG indicator. CNG persists until something coming the other way interrupts it, or a long timeout controlled by the T.30 engine expires. */ delay = t38_core_send_indicator(&fe->t38, T38_IND_CNG); fe->timed_step = fe->queued_timed_step; fe->current_tx_data_type = T38_DATA_NONE; return delay; } /*endswitch*/ } /*endfor*/ return delay; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t38_terminal_send_timeout(t38_terminal_state_t *s, int samples) { t38_terminal_front_end_state_t *fe; int delay; fe = &s->t38_fe; if (fe->current_rx_type == T30_MODEM_DONE || fe->current_tx_type == T30_MODEM_DONE) return TRUE; /*endif*/ fe->samples += samples; t30_timer_update(&s->t30, samples); if (fe->timeout_rx_samples && fe->samples > fe->timeout_rx_samples) { span_log(&s->logging, SPAN_LOG_FLOW, "Timeout mid-receive\n"); fe->timeout_rx_samples = 0; front_end_status(s, T30_FRONT_END_RECEIVE_COMPLETE); } /*endif*/ if (fe->timed_step == T38_TIMED_STEP_NONE) return FALSE; /*endif*/ /* Wait until the right time comes along, unless we are working in "no delays" mode, while talking to an IAF terminal. */ if (fe->us_per_tx_chunk && fe->samples < fe->next_tx_samples) return FALSE; /*endif*/ /* Its time to send something */ delay = 0; switch ((fe->timed_step & 0xFFF0)) { case T38_TIMED_STEP_NON_ECM_MODEM: delay = stream_non_ecm(s); break; case T38_TIMED_STEP_HDLC_MODEM: delay = stream_hdlc(s); break; case T38_TIMED_STEP_CED: delay = stream_ced(s); break; case T38_TIMED_STEP_CNG: delay = stream_cng(s); break; case T38_TIMED_STEP_PAUSE: /* End of timed pause */ fe->timed_step = T38_TIMED_STEP_NONE; front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE); break; case T38_TIMED_STEP_NO_SIGNAL: delay = stream_no_signal(s); break; } /*endswitch*/ if (delay < 0) { t30_terminate(&s->t30); return TRUE; } /*endif*/ fe->next_tx_samples += us_to_samples(delay); return FALSE; } /*- End of function --------------------------------------------------------*/ static void set_rx_type(void *user_data, int type, int bit_rate, int short_train, int use_hdlc) { t38_terminal_state_t *s; s = (t38_terminal_state_t *) user_data; span_log(&s->logging, SPAN_LOG_FLOW, "Set rx type %d\n", type); s->t38_fe.current_rx_type = type; } /*- End of function --------------------------------------------------------*/ static void start_tx(t38_terminal_front_end_state_t *fe, int use_hdlc) { int step; /* The actual transmission process depends on whether we are sending at a paced manner, for interaction with a traditional FAX machine, or streaming as fast as we can, normally over a TCP connection to a machine directly connected to the internet. */ step = (use_hdlc) ? T38_TIMED_STEP_HDLC_MODEM : T38_TIMED_STEP_NON_ECM_MODEM; if (fe->timed_step == T38_TIMED_STEP_NONE) { fe->queued_timed_step = T38_TIMED_STEP_NONE; fe->timed_step = step; } else { fe->queued_timed_step = step; } /*endif*/ if (fe->next_tx_samples < fe->samples) fe->next_tx_samples = fe->samples; /*endif*/ } /*- End of function --------------------------------------------------------*/ static void set_tx_type(void *user_data, int type, int bit_rate, int short_train, int use_hdlc) { t38_terminal_state_t *s; t38_terminal_front_end_state_t *fe; s = (t38_terminal_state_t *) user_data; fe = &s->t38_fe; span_log(&s->logging, SPAN_LOG_FLOW, "Set tx type %d\n", type); if (fe->current_tx_type == type) return; /*endif*/ set_octets_per_data_packet(s, bit_rate); switch (type) { case T30_MODEM_NONE: /* If a "no signal" indicator is waiting to be played out, don't disturb it. */ if (fe->timed_step != T38_TIMED_STEP_NON_ECM_MODEM_5 && fe->timed_step != T38_TIMED_STEP_HDLC_MODEM_5) fe->timed_step = T38_TIMED_STEP_NONE; /*endif*/ fe->current_tx_data_type = T38_DATA_NONE; break; case T30_MODEM_PAUSE: if (fe->us_per_tx_chunk) fe->next_tx_samples = fe->samples + ms_to_samples(short_train); else fe->next_tx_samples = fe->samples; /*endif*/ if (fe->timed_step == T38_TIMED_STEP_NONE) { fe->queued_timed_step = T38_TIMED_STEP_NONE; fe->timed_step = T38_TIMED_STEP_PAUSE; } else { fe->queued_timed_step = T38_TIMED_STEP_PAUSE; } /*endif*/ fe->current_tx_data_type = T38_DATA_NONE; break; case T30_MODEM_CED: fe->next_tx_samples = fe->samples; fe->timed_step = T38_TIMED_STEP_CED; fe->current_tx_data_type = T38_DATA_NONE; break; case T30_MODEM_CNG: fe->next_tx_samples = fe->samples; fe->timed_step = T38_TIMED_STEP_CNG; fe->current_tx_data_type = T38_DATA_NONE; break; case T30_MODEM_V21: fe->next_tx_indicator = T38_IND_V21_PREAMBLE; fe->current_tx_data_type = T38_DATA_V21; start_tx(fe, use_hdlc); break; case T30_MODEM_V27TER: switch (bit_rate) { case 2400: fe->next_tx_indicator = T38_IND_V27TER_2400_TRAINING; fe->current_tx_data_type = T38_DATA_V27TER_2400; break; case 4800: fe->next_tx_indicator = T38_IND_V27TER_4800_TRAINING; fe->current_tx_data_type = T38_DATA_V27TER_4800; break; } /*endswitch*/ start_tx(fe, use_hdlc); break; case T30_MODEM_V29: switch (bit_rate) { case 7200: fe->next_tx_indicator = T38_IND_V29_7200_TRAINING; fe->current_tx_data_type = T38_DATA_V29_7200; break; case 9600: fe->next_tx_indicator = T38_IND_V29_9600_TRAINING; fe->current_tx_data_type = T38_DATA_V29_9600; break; } /*endswitch*/ start_tx(fe, use_hdlc); break; case T30_MODEM_V17: switch (bit_rate) { case 7200: fe->next_tx_indicator = (short_train) ? T38_IND_V17_7200_SHORT_TRAINING : T38_IND_V17_7200_LONG_TRAINING; fe->current_tx_data_type = T38_DATA_V17_7200; break; case 9600: fe->next_tx_indicator = (short_train) ? T38_IND_V17_9600_SHORT_TRAINING : T38_IND_V17_9600_LONG_TRAINING; fe->current_tx_data_type = T38_DATA_V17_9600; break; case 12000: fe->next_tx_indicator = (short_train) ? T38_IND_V17_12000_SHORT_TRAINING : T38_IND_V17_12000_LONG_TRAINING; fe->current_tx_data_type = T38_DATA_V17_12000; break; case 14400: fe->next_tx_indicator = (short_train) ? T38_IND_V17_14400_SHORT_TRAINING : T38_IND_V17_14400_LONG_TRAINING; fe->current_tx_data_type = T38_DATA_V17_14400; break; } /*endswitch*/ start_tx(fe, use_hdlc); break; case T30_MODEM_DONE: span_log(&s->logging, SPAN_LOG_FLOW, "FAX exchange complete\n"); fe->timed_step = T38_TIMED_STEP_NONE; fe->current_tx_data_type = T38_DATA_NONE; break; } /*endswitch*/ fe->current_tx_type = type; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_terminal_set_config(t38_terminal_state_t *s, int config) { if ((config & T38_TERMINAL_OPTION_NO_PACING)) { /* Continuous streaming mode, as used for TPKT over TCP transport */ t38_set_pace_transmission(&s->t38_fe.t38, FALSE); s->t38_fe.hdlc_tx.extra_bits = 0; if ((config & T38_TERMINAL_OPTION_NO_INDICATORS)) t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_INDICATOR, 0); else t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_INDICATOR, 1); /*endif*/ t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_CONTROL_DATA, 1); t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_CONTROL_DATA_END, 1); t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_IMAGE_DATA, 1); t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_IMAGE_DATA_END, 1); s->t38_fe.us_per_tx_chunk = 0; s->t38_fe.chunking_modes &= ~T38_CHUNKING_SEND_REGULAR_INDICATORS; s->t38_fe.chunking_modes |= T38_CHUNKING_MERGE_FCS_WITH_DATA; } else { /* Paced streaming mode, as used for UDP transports */ t38_set_pace_transmission(&s->t38_fe.t38, TRUE); s->t38_fe.hdlc_tx.extra_bits = 0; if ((config & T38_TERMINAL_OPTION_NO_INDICATORS)) t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_INDICATOR, 0); else t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_INDICATOR, INDICATOR_TX_COUNT); /*endif*/ t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_CONTROL_DATA, DATA_TX_COUNT); t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_CONTROL_DATA_END, DATA_END_TX_COUNT); t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_IMAGE_DATA, DATA_TX_COUNT); t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_IMAGE_DATA_END, DATA_END_TX_COUNT); s->t38_fe.us_per_tx_chunk = DEFAULT_US_PER_TX_CHUNK; if ((config & (T38_TERMINAL_OPTION_REGULAR_INDICATORS | T38_TERMINAL_OPTION_2S_REPEATING_INDICATORS))) s->t38_fe.chunking_modes |= T38_CHUNKING_SEND_REGULAR_INDICATORS; else s->t38_fe.chunking_modes &= ~T38_CHUNKING_SEND_REGULAR_INDICATORS; /*endif*/ if ((config & T38_TERMINAL_OPTION_2S_REPEATING_INDICATORS)) s->t38_fe.chunking_modes |= T38_CHUNKING_SEND_2S_REGULAR_INDICATORS; else s->t38_fe.chunking_modes &= ~T38_CHUNKING_SEND_2S_REGULAR_INDICATORS; /*endif*/ } /*endif*/ set_octets_per_data_packet(s, 300); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_terminal_set_tep_mode(t38_terminal_state_t *s, int use_tep) { if (use_tep) s->t38_fe.chunking_modes |= T38_CHUNKING_ALLOW_TEP_TIME; else s->t38_fe.chunking_modes &= ~T38_CHUNKING_ALLOW_TEP_TIME; /*endif*/ t38_set_tep_handling(&s->t38_fe.t38, use_tep); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t38_terminal_set_fill_bit_removal(t38_terminal_state_t *s, int remove) { if (remove) s->t38_fe.iaf |= T30_IAF_MODE_NO_FILL_BITS; else s->t38_fe.iaf &= ~T30_IAF_MODE_NO_FILL_BITS; /*endif*/ t30_set_iaf_mode(&s->t30, s->t38_fe.iaf); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(t30_state_t *) t38_terminal_get_t30_state(t38_terminal_state_t *s) { return &s->t30; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(t38_core_state_t *) t38_terminal_get_t38_core_state(t38_terminal_state_t *s) { return &s->t38_fe.t38; } /*- End of function --------------------------------------------------------*/ static int t38_terminal_t38_fe_restart(t38_terminal_state_t *t) { t38_terminal_front_end_state_t *s; s = &t->t38_fe; t38_core_restart(&s->t38); s->rx_signal_present = FALSE; s->timed_step = T38_TIMED_STEP_NONE; //s->iaf = T30_IAF_MODE_T37 | T30_IAF_MODE_T38; s->iaf = T30_IAF_MODE_T38; s->current_tx_data_type = T38_DATA_NONE; s->next_tx_samples = 0; s->hdlc_tx.ptr = 0; s->hdlc_tx.extra_bits = 0; return 0; } /*- End of function --------------------------------------------------------*/ static int t38_terminal_t38_fe_init(t38_terminal_state_t *t, t38_tx_packet_handler_t *tx_packet_handler, void *tx_packet_user_data) { t38_terminal_front_end_state_t *s; s = &t->t38_fe; t38_core_init(&s->t38, process_rx_indicator, process_rx_data, process_rx_missing, (void *) t, tx_packet_handler, tx_packet_user_data); t38_set_fastest_image_data_rate(&s->t38, 14400); s->rx_signal_present = FALSE; s->timed_step = T38_TIMED_STEP_NONE; s->queued_timed_step = T38_TIMED_STEP_NONE; //s->iaf = T30_IAF_MODE_T37 | T30_IAF_MODE_T38; s->iaf = T30_IAF_MODE_T38; s->current_tx_data_type = T38_DATA_NONE; s->next_tx_samples = 0; s->chunking_modes = T38_CHUNKING_ALLOW_TEP_TIME; s->hdlc_tx.ptr = 0; s->hdlc_tx.extra_bits = 0; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) t38_terminal_get_logging_state(t38_terminal_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t38_terminal_restart(t38_terminal_state_t *s, int calling_party) { t38_terminal_t38_fe_restart(s); t30_restart(&s->t30); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(t38_terminal_state_t *) t38_terminal_init(t38_terminal_state_t *s, int calling_party, t38_tx_packet_handler_t *tx_packet_handler, void *tx_packet_user_data) { if (tx_packet_handler == NULL) return NULL; /*endif*/ if (s == NULL) { if ((s = (t38_terminal_state_t *) malloc(sizeof(*s))) == NULL) return NULL; /*endif*/ } /*endif*/ memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "T.38T"); t38_terminal_t38_fe_init(s, tx_packet_handler, tx_packet_user_data); t38_terminal_set_config(s, 0); t30_init(&s->t30, calling_party, set_rx_type, (void *) s, set_tx_type, (void *) s, send_hdlc, (void *) s); t30_set_iaf_mode(&s->t30, s->t38_fe.iaf); t30_set_supported_modems(&s->t30, T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17 | T30_SUPPORT_IAF); t30_restart(&s->t30); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t38_terminal_release(t38_terminal_state_t *s) { t30_release(&s->t30); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t38_terminal_free(t38_terminal_state_t *s) { t38_terminal_release(s); free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/at_interpreter.c0000664000175000017500000047772112100744615014114 00000000000000/* * SpanDSP - a series of DSP components for telephony * * at_interpreter.c - AT command interpreter to V.251, V.252, V.253, T.31 and the 3GPP specs. * * Written by Steve Underwood * * Special thanks to Lee Howard * for his great work debugging and polishing this code. * * Copyright (C) 2004, 2005, 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #if defined(__sun) #define __EXTENSIONS__ #endif #include #include #include #include #include #include #include #include #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/queue.h" #include "spandsp/power_meter.h" #include "spandsp/complex.h" #include "spandsp/tone_generate.h" #include "spandsp/async.h" #include "spandsp/hdlc.h" #include "spandsp/fsk.h" #include "spandsp/super_tone_rx.h" #include "spandsp/fax_modems.h" #include "spandsp/at_interpreter.h" #include "spandsp/private/logging.h" #include "spandsp/private/at_interpreter.h" #define MANUFACTURER "www.soft-switch.org" #define SERIAL_NUMBER "42" #define GLOBAL_OBJECT_IDENTITY "42" enum { ASCII_RESULT_CODES = 1, NUMERIC_RESULT_CODES, NO_RESULT_CODES }; static at_profile_t profiles[3] = { { #if defined(_MSC_VER) || defined(__sunos) || defined(__solaris) || defined(__sun) /*.echo =*/ TRUE, /*.verbose =*/ TRUE, /*.result_code_format =*/ ASCII_RESULT_CODES, /*.pulse_dial =*/ FALSE, /*.double_escape =*/ FALSE, /*.adaptive_receive =*/ FALSE, /*.s_regs[100] =*/ {0, 0, 0, '\r', '\n', '\b', 1, 60, 5, 0, 0} #else .echo = TRUE, .verbose = TRUE, .result_code_format = ASCII_RESULT_CODES, .pulse_dial = FALSE, .double_escape = FALSE, .adaptive_receive = FALSE, .s_regs[0] = 0, .s_regs[3] = '\r', .s_regs[4] = '\n', .s_regs[5] = '\b', .s_regs[6] = 1, .s_regs[7] = 60, .s_regs[8] = 5, .s_regs[10] = 0 #endif } }; typedef const char *(*at_cmd_service_t)(at_state_t *s, const char *cmd); static const char *manufacturer = MANUFACTURER; static const char *model = PACKAGE; static const char *revision = VERSION; #define ETX 0x03 #define DLE 0x10 #define SUB 0x1A static const char *at_response_codes[] = { "OK", "CONNECT", "RING", "NO CARRIER", "ERROR", "???", "NO DIALTONE", "BUSY", "NO ANSWER", "+FCERROR", "+FRH:3" }; SPAN_DECLARE(void) at_set_at_rx_mode(at_state_t *s, int new_mode) { /* The use of a DTE timeout is mode dependent. Set the timeout appropriately in the modem. */ switch (new_mode) { case AT_MODE_HDLC: case AT_MODE_STUFFED: at_modem_control(s, s->dte_inactivity_timeout*1000, (void *) (intptr_t) s->dte_inactivity_timeout); break; default: at_modem_control(s, AT_MODEM_CONTROL_DTE_TIMEOUT, NULL); break; } s->at_rx_mode = new_mode; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) at_put_response(at_state_t *s, const char *t) { uint8_t buf[3]; buf[0] = s->p.s_regs[3]; buf[1] = s->p.s_regs[4]; buf[2] = '\0'; if (s->p.result_code_format == ASCII_RESULT_CODES) s->at_tx_handler(s, s->at_tx_user_data, buf, 2); s->at_tx_handler(s, s->at_tx_user_data, (uint8_t *) t, strlen(t)); s->at_tx_handler(s, s->at_tx_user_data, buf, 2); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) at_put_numeric_response(at_state_t *s, int val) { char buf[20]; snprintf(buf, sizeof(buf), "%d", val); at_put_response(s, buf); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) at_put_response_code(at_state_t *s, int code) { uint8_t buf[20]; span_log(&s->logging, SPAN_LOG_FLOW, "Sending AT response code %s\n", at_response_codes[code]); switch (s->p.result_code_format) { case ASCII_RESULT_CODES: at_put_response(s, at_response_codes[code]); break; case NUMERIC_RESULT_CODES: snprintf((char *) buf, sizeof(buf), "%d%c", code, s->p.s_regs[3]); s->at_tx_handler(s, s->at_tx_user_data, buf, strlen((char *) buf)); break; default: /* No result codes */ break; } } /*- End of function --------------------------------------------------------*/ static int answer_call(at_state_t *s) { if (at_modem_control(s, AT_MODEM_CONTROL_ANSWER, NULL) < 0) return FALSE; /* Answering should now be in progress. No AT response should be issued at this point. */ s->do_hangup = FALSE; return TRUE; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) at_call_event(at_state_t *s, int event) { span_log(&s->logging, SPAN_LOG_FLOW, "Call event %d received\n", event); switch (event) { case AT_CALL_EVENT_ALERTING: at_modem_control(s, AT_MODEM_CONTROL_RNG, (void *) 1); if (s->display_call_info && !s->call_info_displayed) at_display_call_info(s); at_put_response_code(s, AT_RESPONSE_CODE_RING); if ((++s->rings_indicated) >= s->p.s_regs[0] && s->p.s_regs[0]) { /* The modem is set to auto-answer now */ answer_call(s); } break; case AT_CALL_EVENT_ANSWERED: at_modem_control(s, AT_MODEM_CONTROL_RNG, (void *) 0); if (s->fclass_mode == 0) { /* Normal data modem connection */ at_set_at_rx_mode(s, AT_MODE_CONNECTED); /* TODO: */ } else { /* FAX modem connection */ at_set_at_rx_mode(s, AT_MODE_DELIVERY); at_modem_control(s, AT_MODEM_CONTROL_RESTART, (void *) FAX_MODEM_CED_TONE); } break; case AT_CALL_EVENT_CONNECTED: span_log(&s->logging, SPAN_LOG_FLOW, "Dial call - connected. FCLASS=%d\n", s->fclass_mode); at_modem_control(s, AT_MODEM_CONTROL_RNG, (void *) 0); if (s->fclass_mode == 0) { /* Normal data modem connection */ at_set_at_rx_mode(s, AT_MODE_CONNECTED); /* TODO: */ } else { if (s->command_dial) { at_put_response_code(s, AT_RESPONSE_CODE_OK); at_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND); } else { /* FAX modem connection */ at_set_at_rx_mode(s, AT_MODE_DELIVERY); if (s->silent_dial) at_modem_control(s, AT_MODEM_CONTROL_RESTART, (void *) FAX_MODEM_NOCNG_TONE); else at_modem_control(s, AT_MODEM_CONTROL_RESTART, (void *) FAX_MODEM_CNG_TONE); s->dte_is_waiting = TRUE; } } break; case AT_CALL_EVENT_BUSY: at_set_at_rx_mode(s, AT_MODE_ONHOOK_COMMAND); at_put_response_code(s, AT_RESPONSE_CODE_BUSY); break; case AT_CALL_EVENT_NO_DIALTONE: at_set_at_rx_mode(s, AT_MODE_ONHOOK_COMMAND); at_put_response_code(s, AT_RESPONSE_CODE_NO_DIALTONE); break; case AT_CALL_EVENT_NO_ANSWER: at_set_at_rx_mode(s, AT_MODE_ONHOOK_COMMAND); at_put_response_code(s, AT_RESPONSE_CODE_NO_ANSWER); break; case AT_CALL_EVENT_HANGUP: span_log(&s->logging, SPAN_LOG_FLOW, "Hangup... at_rx_mode %d\n", s->at_rx_mode); at_modem_control(s, AT_MODEM_CONTROL_ONHOOK, NULL); if (s->dte_is_waiting) { if (s->ok_is_pending) { at_put_response_code(s, AT_RESPONSE_CODE_OK); s->ok_is_pending = FALSE; } else { at_put_response_code(s, AT_RESPONSE_CODE_NO_CARRIER); } s->dte_is_waiting = FALSE; at_set_at_rx_mode(s, AT_MODE_ONHOOK_COMMAND); } else if (s->fclass_mode && s->rx_signal_present) { s->rx_data[s->rx_data_bytes++] = DLE; s->rx_data[s->rx_data_bytes++] = ETX; s->at_tx_handler(s, s->at_tx_user_data, s->rx_data, s->rx_data_bytes); s->rx_data_bytes = 0; } if (s->at_rx_mode != AT_MODE_OFFHOOK_COMMAND && s->at_rx_mode != AT_MODE_ONHOOK_COMMAND) at_put_response_code(s, AT_RESPONSE_CODE_NO_CARRIER); s->rx_signal_present = FALSE; at_modem_control(s, AT_MODEM_CONTROL_RNG, (void *) 0); at_set_at_rx_mode(s, AT_MODE_ONHOOK_COMMAND); break; default: span_log(&s->logging, SPAN_LOG_WARNING, "Invalid call event %d received.\n", event); break; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) at_reset_call_info(at_state_t *s) { at_call_id_t *call_id; at_call_id_t *next; for (call_id = s->call_id; call_id; call_id = next) { next = call_id->next; free(call_id); } s->call_id = NULL; s->rings_indicated = 0; s->call_info_displayed = FALSE; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) at_set_call_info(at_state_t *s, char const *id, char const *value) { at_call_id_t *new_call_id; at_call_id_t *call_id; /* TODO: We should really not merely ignore a failure to malloc */ if ((new_call_id = (at_call_id_t *) malloc(sizeof(*new_call_id))) == NULL) return; call_id = s->call_id; /* If these strdups fail its pretty harmless. We just appear to not have the relevant field. */ new_call_id->id = (id) ? strdup(id) : NULL; new_call_id->value = (value) ? strdup(value) : NULL; new_call_id->next = NULL; if (call_id) { while (call_id->next) call_id = call_id->next; call_id->next = new_call_id; } else { s->call_id = new_call_id; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) at_display_call_info(at_state_t *s) { char buf[132 + 1]; at_call_id_t *call_id = s->call_id; while (call_id) { snprintf(buf, sizeof(buf), "%s=%s", (call_id->id) ? call_id->id : "NULL", (call_id->value) ? call_id->value : ""); at_put_response(s, buf); call_id = call_id->next; } s->call_info_displayed = TRUE; } /*- End of function --------------------------------------------------------*/ static int parse_num(const char **s, int max_value) { int i; /* The spec. says no digits is valid, and should be treated as zero. */ i = 0; while (isdigit((int) **s)) { i = i*10 + ((**s) - '0'); (*s)++; } if (i > max_value) i = -1; return i; } /*- End of function --------------------------------------------------------*/ static int parse_hex_num(const char **s, int max_value) { int i; /* The spec. says a hex value is always 2 digits, and the alpha digits are upper case. */ i = 0; if (isdigit((int) **s)) i = **s - '0'; else if (**s >= 'A' && **s <= 'F') i = **s - 'A'; else return -1; (*s)++; if (isdigit((int) **s)) i = (i << 4) | (**s - '0'); else if (**s >= 'A' && **s <= 'F') i = (i << 4) | (**s - 'A'); else return -1; (*s)++; if (i > max_value) i = -1; return i; } /*- End of function --------------------------------------------------------*/ static int match_element(const char **variant, const char *variants) { int i; size_t len; char const *s; char const *t; s = variants; for (i = 0; *s; i++) { if ((t = strchr(s, ','))) len = t - s; else len = strlen(s); if (len == (int) strlen(*variant) && memcmp(*variant, s, len) == 0) { *variant += len; return i; } s += len; if (*s == ',') s++; } return -1; } /*- End of function --------------------------------------------------------*/ static int parse_out(at_state_t *s, const char **t, int *target, int max_value, const char *prefix, const char *def) { char buf[100]; int val; switch (*(*t)++) { case '=': switch (**t) { case '?': /* Show possible values */ (*t)++; snprintf(buf, sizeof(buf), "%s%s", (prefix) ? prefix : "", def); at_put_response(s, buf); break; default: /* Set value */ if ((val = parse_num(t, max_value)) < 0) return FALSE; if (target) *target = val; break; } break; case '?': /* Show current value */ val = (target) ? *target : 0; snprintf(buf, sizeof(buf), "%s%d", (prefix) ? prefix : "", val); at_put_response(s, buf); break; default: return FALSE; } return TRUE; } /*- End of function --------------------------------------------------------*/ static int parse_2_out(at_state_t *s, const char **t, int *target1, int max_value1, int *target2, int max_value2, const char *prefix, const char *def) { char buf[100]; int val1; int val2; switch (*(*t)++) { case '=': switch (**t) { case '?': /* Show possible values */ (*t)++; snprintf(buf, sizeof(buf), "%s%s", (prefix) ? prefix : "", def); at_put_response(s, buf); break; default: /* Set value */ if ((val1 = parse_num(t, max_value1)) < 0) return FALSE; if (target1) *target1 = val1; if (**t == ',') { (*t)++; if ((val2 = parse_num(t, max_value2)) < 0) return FALSE; if (target2) *target2 = val2; } break; } break; case '?': /* Show current value */ val1 = (target1) ? *target1 : 0; val2 = (target2) ? *target2 : 0; snprintf(buf, sizeof(buf), "%s%d,%d", (prefix) ? prefix : "", val1, val2); at_put_response(s, buf); break; default: return FALSE; } return TRUE; } /*- End of function --------------------------------------------------------*/ static int parse_n_out(at_state_t *s, const char **t, int *targets[], const int max_values[], int entries, const char *prefix, const char *def) { char buf[100]; int val; int len; int i; switch (*(*t)++) { case '=': switch (**t) { case '?': /* Show possible values */ (*t)++; snprintf(buf, sizeof(buf), "%s%s", (prefix) ? prefix : "", def); at_put_response(s, buf); break; default: /* Set value */ for (i = 0; i < entries; i++) { if ((val = parse_num(t, max_values[i])) < 0) return FALSE; if (targets[i]) *targets[i] = val; if (**t != ',') break; (*t)++; } break; } break; case '?': /* Show current value */ len = snprintf(buf, sizeof(buf), "%s", (prefix) ? prefix : ""); for (i = 0; i < entries; i++) { if (i > 0) len += snprintf(&buf[len], sizeof(buf) - len, ","); val = (targets[i]) ? *targets[i] : 0; len += snprintf(&buf[len], sizeof(buf) - len, "%d", val); } at_put_response(s, buf); break; default: return FALSE; } return TRUE; } /*- End of function --------------------------------------------------------*/ static int parse_hex_out(at_state_t *s, const char **t, int *target, int max_value, const char *prefix, const char *def) { char buf[100]; int val; switch (*(*t)++) { case '=': switch (**t) { case '?': /* Show possible values */ (*t)++; snprintf(buf, sizeof(buf), "%s%s", (prefix) ? prefix : "", def); at_put_response(s, buf); break; default: /* Set value */ if ((val = parse_hex_num(t, max_value)) < 0) return FALSE; if (target) *target = val; break; } break; case '?': /* Show current value */ val = (target) ? *target : 0; snprintf(buf, sizeof(buf), "%s%02X", (prefix) ? prefix : "", val); at_put_response(s, buf); break; default: return FALSE; } return TRUE; } /*- End of function --------------------------------------------------------*/ static int parse_string_list_out(at_state_t *s, const char **t, int *target, int max_value, const char *prefix, const char *def) { char buf[100]; int val; size_t len; char *tmp; switch (*(*t)++) { case '=': switch (**t) { case '?': /* Show possible values */ (*t)++; snprintf(buf, sizeof(buf), "%s%s", (prefix) ? prefix : "", def); at_put_response(s, buf); break; default: /* Set value */ if ((val = match_element(t, def)) < 0) return FALSE; if (target) *target = val; break; } break; case '?': /* Show current index value from def */ val = (target) ? *target : 0; while (val-- && (def = strchr(def, ','))) def++; if ((tmp = strchr(def, ','))) len = tmp - def; else len = strlen(def); snprintf(buf, sizeof(buf), "%s%.*s", (prefix) ? prefix : "", (int) len, def); at_put_response(s, buf); break; default: return FALSE; } return TRUE; } /*- End of function --------------------------------------------------------*/ static int parse_string_out(at_state_t *s, const char **t, char **target, const char *prefix) { char buf[100]; switch (*(*t)++) { case '=': switch (**t) { case '?': /* Show possible values */ (*t)++; snprintf(buf, sizeof(buf), "%s", (prefix) ? prefix : ""); at_put_response(s, buf); break; default: /* Set value */ if (*target) free(*target); /* If this strdup fails, it should be harmless */ *target = strdup(*t); break; } break; case '?': /* Show current index value */ at_put_response(s, (*target) ? *target : ""); break; default: return FALSE; } while (*t) t++; return TRUE; } /*- End of function --------------------------------------------------------*/ static const char *s_reg_handler(at_state_t *s, const char *t, int reg) { int val; int b; char buf[4]; /* Set or get an S register */ switch (*t++) { case '=': switch (*t) { case '?': t++; snprintf(buf, sizeof(buf), "%3.3d", 0); at_put_response(s, buf); break; default: if ((val = parse_num(&t, 255)) < 0) return NULL; s->p.s_regs[reg] = (uint8_t) val; break; } break; case '?': snprintf(buf, sizeof(buf), "%3.3d", s->p.s_regs[reg]); at_put_response(s, buf); break; case '.': if ((b = parse_num(&t, 7)) < 0) return NULL; switch (*t++) { case '=': switch (*t) { case '?': t++; at_put_numeric_response(s, 0); break; default: if ((val = parse_num(&t, 1)) < 0) return NULL; if (val) s->p.s_regs[reg] |= (1 << b); else s->p.s_regs[reg] &= ~(1 << b); break; } break; case '?': at_put_numeric_response(s, (int) ((s->p.s_regs[reg] >> b) & 1)); break; default: return NULL; } break; default: return NULL; } return t; } /*- End of function --------------------------------------------------------*/ static int process_class1_cmd(at_state_t *s, const char **t) { int val; int operation; int direction; int result; const char *allowed; direction = (*(*t + 2) == 'T'); operation = *(*t + 3); /* Step past the "+Fxx" */ *t += 4; switch (operation) { case 'S': allowed = "0-255"; break; case 'H': allowed = "3"; break; default: allowed = "24,48,72,73,74,96,97,98,121,122,145,146"; break; } val = -1; if (!parse_out(s, t, &val, 255, NULL, allowed)) return TRUE; if (val < 0) { /* It was just a query */ return TRUE; } /* All class 1 FAX commands are supposed to give an ERROR response, if the phone is on-hook. */ if (s->at_rx_mode == AT_MODE_ONHOOK_COMMAND) return FALSE; result = TRUE; if (s->class1_handler) result = s->class1_handler(s, s->class1_user_data, direction, operation, val); switch (result) { case 0: /* Inhibit an immediate response. (These commands should not be part of a multi-command entry.) */ *t = (const char *) -1; return TRUE; case -1: return FALSE; } return TRUE; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_dummy(at_state_t *s, const char *t) { /* Dummy routine to absorb delimiting characters from a command string */ return t + 1; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_A(at_state_t *s, const char *t) { /* V.250 6.3.5 - Answer (abortable) */ t += 1; if (!answer_call(s)) return NULL; return (const char *) -1; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_D(at_state_t *s, const char *t) { int ok; char *u; char num[100 + 1]; char ch; /* V.250 6.3.1 - Dial (abortable) */ at_reset_call_info(s); s->do_hangup = FALSE; s->silent_dial = FALSE; s->command_dial = FALSE; t += 1; ok = FALSE; /* There are a numbers of options in a dial command string. Many are completely irrelevant in this application. */ u = num; for ( ; (ch = *t); t++) { if (isdigit((int) ch)) { /* V.250 6.3.1.1 Basic digit set */ *u++ = ch; } else { switch (ch) { case 'A': case 'B': case 'C': case 'D': case '*': case '#': /* V.250 6.3.1.1 Full DTMF repertoire */ if (!s->p.pulse_dial) *u++ = ch; break; case ' ': case '-': /* Ignore spaces and dashes */ /* This is not a standards based thing. It just improves compatibility with some other modems. */ break; case '+': /* V.250 6.3.1.1 International access code */ /* TODO: */ break; case ',': /* V.250 6.3.1.2 Pause */ /* Pass these through to the application to handle. */ *u++ = ch; break; case 'T': /* V.250 6.3.1.3 Tone dial */ s->p.pulse_dial = FALSE; break; case 'P': /* V.250 6.3.1.4 Pulse dial */ s->p.pulse_dial = TRUE; break; case '!': /* V.250 6.3.1.5 Hook flash, register recall */ /* TODO: */ break; case 'W': /* V.250 6.3.1.6 Wait for dial tone */ /* TODO: */ break; case '@': /* V.250 6.3.1.7 Wait for quiet answer */ s->silent_dial = TRUE; break; case 'S': /* V.250 6.3.1.8 Invoke stored string */ /* S= */ /* TODO: */ break; case 'G': case 'g': /* GSM07.07 6.2 - Control the CUG supplementary service for this call */ /* Uses index and info values set with command +CCUG. See +CCUG */ /* TODO: */ break; case 'I': case 'i': /* GSM07.07 6.2 - Override Calling Line Identification Restriction (CLIR) */ /* I=invocation (restrict CLI presentation), i=suppression (allow CLI presentation). See +CLIR */ /* TODO: */ break; case ';': /* V.250 6.3.1 - Dial string terminator - make voice call and remain in command mode */ s->command_dial = TRUE; break; case '>': /* GSM07.07 6.2 - Direct dialling from phone book supplementary service subscription default value for this call */ /* TODO: */ break; default: return NULL; } } } *u = '\0'; if ((ok = at_modem_control(s, AT_MODEM_CONTROL_CALL, num)) < 0) return NULL; /* Dialing should now be in progress. No AT response should be issued at this point. */ return (const char *) -1; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_E(at_state_t *s, const char *t) { int val; /* V.250 6.2.4 - Command echo */ t += 1; if ((val = parse_num(&t, 1)) < 0) return NULL; s->p.echo = val; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_H(at_state_t *s, const char *t) { int val; /* V.250 6.3.6 - Hook control */ t += 1; if ((val = parse_num(&t, 1)) < 0) return NULL; if (val) { /* Take the receiver off-hook, effectively busying-out the modem. */ if (s->at_rx_mode != AT_MODE_ONHOOK_COMMAND && s->at_rx_mode != AT_MODE_OFFHOOK_COMMAND) return NULL; at_modem_control(s, AT_MODEM_CONTROL_OFFHOOK, NULL); at_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND); return t; } at_reset_call_info(s); if (s->at_rx_mode != AT_MODE_ONHOOK_COMMAND && s->at_rx_mode != AT_MODE_OFFHOOK_COMMAND) { /* Push out the last of the audio (probably by sending a short silence). */ at_modem_control(s, AT_MODEM_CONTROL_RESTART, (void *) FAX_MODEM_FLUSH); s->do_hangup = TRUE; at_set_at_rx_mode(s, AT_MODE_CONNECTED); return (const char *) -1; } at_modem_control(s, AT_MODEM_CONTROL_HANGUP, NULL); at_set_at_rx_mode(s, AT_MODE_ONHOOK_COMMAND); return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_I(at_state_t *s, const char *t) { int val; /* V.250 6.1.3 - Request identification information */ /* N.B. The information supplied in response to an ATIx command is very variable. It was widely used in different ways before the AT command set was standardised by the ITU. */ t += 1; switch (val = parse_num(&t, 255)) { case 0: at_put_response(s, model); break; case 3: at_put_response(s, manufacturer); break; default: return NULL; } return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_L(at_state_t *s, const char *t) { int val; /* V.250 6.3.13 - Monitor speaker loudness */ /* Just absorb this command, as we have no speaker */ t += 1; if ((val = parse_num(&t, 255)) < 0) return NULL; s->speaker_volume = val; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_M(at_state_t *s, const char *t) { int val; /* V.250 6.3.14 - Monitor speaker mode */ /* Just absorb this command, as we have no speaker */ t += 1; if ((val = parse_num(&t, 255)) < 0) return NULL; s->speaker_mode = val; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_O(at_state_t *s, const char *t) { int val; /* V.250 6.3.7 - Return to online data state */ t += 1; if ((val = parse_num(&t, 1)) < 0) return NULL; if (val == 0) { at_set_at_rx_mode(s, AT_MODE_CONNECTED); at_put_response_code(s, AT_RESPONSE_CODE_CONNECT); } return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_P(at_state_t *s, const char *t) { /* V.250 6.3.3 - Select pulse dialling (command) */ t += 1; s->p.pulse_dial = TRUE; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_Q(at_state_t *s, const char *t) { int val; /* V.250 6.2.5 - Result code suppression */ t += 1; if ((val = parse_num(&t, 1)) < 0) return NULL; switch (val) { case 0: s->p.result_code_format = (s->p.verbose) ? ASCII_RESULT_CODES : NUMERIC_RESULT_CODES; break; case 1: s->p.result_code_format = NO_RESULT_CODES; break; } return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_S0(at_state_t *s, const char *t) { /* V.250 6.3.8 - Automatic answer */ t += 2; return s_reg_handler(s, t, 0); } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_S10(at_state_t *s, const char *t) { /* V.250 6.3.12 - Automatic disconnect delay */ t += 3; return s_reg_handler(s, t, 10); } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_S3(at_state_t *s, const char *t) { /* V.250 6.2.1 - Command line termination character */ t += 2; return s_reg_handler(s, t, 3); } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_S4(at_state_t *s, const char *t) { /* V.250 6.2.2 - Response formatting character */ t += 2; return s_reg_handler(s, t, 4); } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_S5(at_state_t *s, const char *t) { /* V.250 6.2.3 - Command line editing character */ t += 2; return s_reg_handler(s, t, 5); } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_S6(at_state_t *s, const char *t) { /* V.250 6.3.9 - Pause before blind dialling */ t += 2; return s_reg_handler(s, t, 6); } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_S7(at_state_t *s, const char *t) { /* V.250 6.3.10 - Connection completion timeout */ t += 2; return s_reg_handler(s, t, 7); } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_S8(at_state_t *s, const char *t) { /* V.250 6.3.11 - Comma dial modifier time */ t += 2; return s_reg_handler(s, t, 8); } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_T(at_state_t *s, const char *t) { /* V.250 6.3.2 - Select tone dialling (command) */ t += 1; s->p.pulse_dial = FALSE; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_V(at_state_t *s, const char *t) { int val; /* V.250 6.2.6 - DCE response format */ t += 1; if ((val = parse_num(&t, 1)) < 0) return NULL; s->p.verbose = val; if (s->p.result_code_format != NO_RESULT_CODES) s->p.result_code_format = (s->p.verbose) ? ASCII_RESULT_CODES : NUMERIC_RESULT_CODES; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_X(at_state_t *s, const char *t) { int val; /* V.250 6.2.7 - Result code selection and call progress monitoring control */ /* 0 CONNECT result code is given upon entering online data state. Dial tone and busy detection are disabled. 1 CONNECT result code is given upon entering online data state. Dial tone and busy detection are disabled. 2 CONNECT result code is given upon entering online data state. Dial tone detection is enabled, and busy detection is disabled. 3 CONNECT result code is given upon entering online data state. Dial tone detection is disabled, and busy detection is enabled. 4 CONNECT result code is given upon entering online data state. Dial tone and busy detection are both enabled. */ t += 1; if ((val = parse_num(&t, 4)) < 0) return NULL; s->result_code_mode = val; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_Z(at_state_t *s, const char *t) { int val; /* V.250 6.1.1 - Reset to default configuration */ t += 1; if ((val = parse_num(&t, sizeof(profiles)/sizeof(profiles[0]) - 1)) < 0) return NULL; /* Just make sure we are on hook */ at_modem_control(s, AT_MODEM_CONTROL_HANGUP, NULL); at_set_at_rx_mode(s, AT_MODE_ONHOOK_COMMAND); s->p = profiles[val]; at_reset_call_info(s); return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_amp_C(at_state_t *s, const char *t) { int val; /* V.250 6.2.8 - Circuit 109 (received line signal detector) behaviour */ /* We have no RLSD pin, so just absorb this. */ t += 2; if ((val = parse_num(&t, 1)) < 0) return NULL; s->rlsd_behaviour = val; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_amp_D(at_state_t *s, const char *t) { int val; /* V.250 6.2.9 - Circuit 108 (data terminal ready) behaviour */ t += 2; if ((val = parse_num(&t, 2)) < 0) return NULL; /* TODO: We have no DTR pin, but we need this to get into online command state. */ s->dtr_behaviour = val; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_amp_F(at_state_t *s, const char *t) { t += 2; /* V.250 6.1.2 - Set to factory-defined configuration */ /* Just make sure we are on hook */ at_modem_control(s, AT_MODEM_CONTROL_HANGUP, NULL); at_set_at_rx_mode(s, AT_MODE_ONHOOK_COMMAND); s->p = profiles[0]; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_A8A(at_state_t *s, const char *t) { /* V.251 6.3 - V.8 calling tone indication */ return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_A8C(at_state_t *s, const char *t) { /* V.251 6.2 - V.8 answer signal indication */ return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_A8E(at_state_t *s, const char *t) { int val; /* V.251 5.1 - V.8 and V.8bis operation controls */ /* Syntax: +A8E=,,[,][,][,] */ /* =0 Disable V.8 origination negotiation =1 Enable DCE-controlled V.8 origination negotiation =2 Enable DTE-controlled V.8 origination negotiation, send V.8 CI only =3 Enable DTE-controlled V.8 origination negotiation, send 1100Hz CNG only =4 Enable DTE-controlled V.8 origination negotiation, send 1300Hz CT only =5 Enable DTE-controlled V.8 origination negotiation, send no tones =6 Enable DCE-controlled V.8 origination negotiation, issue +A8x indications =0 Disable V.8 answer negotiation =1 Enable DCE-controlled V.8 answer negotiation =2 Enable DTE-controlled V.8 answer negotiation, send ANSam =3 Enable DTE-controlled V.8 answer negotiation, send no signal =4 Disable DTE-controlled V.8 answer negotiation, send ANS =5 Enable DCE-controlled V.8 answer negotiation, issue +A8x indications =X..Y Set the V.8 CI signal call function to the hexadecimal octet value X..Y =0 Disable V.8bis negotiation =1 Enable DCE-controlled V.8bis negotiation =2 Enable DTE-controlled V.8bis negotiation ="" Set to alternative list of call function "option bit" values that the answering DCE shall accept from the caller ="" Set to alternative list of protocol "option bit" values that the answering DCE shall accept from the caller */ /* TODO: */ t += 4; if (!parse_out(s, &t, &val, 6, "+A8E:", "(0-6),(0-5),(00-FF)")) return NULL; if (*t != ',') return t; if ((val = parse_num(&t, 5)) < 0) return NULL; if (*t != ',') return t; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_A8I(at_state_t *s, const char *t) { /* V.251 6.1 - V.8 CI signal indication */ return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_A8J(at_state_t *s, const char *t) { /* V.251 6.4 - V.8 negotiation complete */ return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_A8M(at_state_t *s, const char *t) { /* V.251 5.2 - Send V.8 menu signals */ /* Syntax: +A8M= */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_A8R(at_state_t *s, const char *t) { /* V.251 6.6 - V.8bis signal and message reporting */ return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_A8T(at_state_t *s, const char *t) { int val; /* V.251 5.3 - Send V.8bis signal and/or message(s) */ /* Syntax: +A8T=[,<1st message>][,<2nd message>][,][,][,] */ /* =0 None =1 Initiating Mre =2 Initiating MRd =3 Initiating CRe, low power =4 Initiating CRe, high power =5 Initiating CRd =6 Initiating Esi =7 Responding MRd, low power =8 Responding MRd, high power =9 Responding CRd =10 Responding Esr */ /* TODO: */ t += 4; if (!parse_out(s, &t, &val, 10, "+A8T:", "(0-10)")) return NULL; s->v8bis_signal = val; if (*t != ',') return t; if ((val = parse_num(&t, 255)) < 0) return NULL; s->v8bis_1st_message = val; if (*t != ',') return t; if ((val = parse_num(&t, 255)) < 0) return NULL; s->v8bis_2nd_message = val; if (*t != ',') return t; if ((val = parse_num(&t, 255)) < 0) return NULL; s->v8bis_sig_en = val; if (*t != ',') return t; if ((val = parse_num(&t, 255)) < 0) return NULL; s->v8bis_msg_en = val; if (*t != ',') return t; if ((val = parse_num(&t, 255)) < 0) return NULL; s->v8bis_supp_delay = val; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_ASTO(at_state_t *s, const char *t) { /* V.250 6.3.15 - Store telephone number */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+ASTO:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CAAP(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.25 - Automatic answer for eMLPP Service */ /* TODO: */ t += 5; if (!parse_2_out(s, &t, NULL, 65535, NULL, 65535, "+CAAP:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CACM(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.25 - Accumulated call meter */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CACM:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CACSP(at_state_t *s, const char *t) { /* 3GPP TS 27.007 11.1.7 - Voice Group or Voice Broadcast Call State Attribute Presentation */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+CACSP:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CAD(at_state_t *s, const char *t) { /* IS-99 5.6.3 - Query analogue or digital service */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CAEMLPP(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.22 - eMLPP Priority Registration and Interrogation */ /* TODO: */ t += 8; if (!parse_out(s, &t, NULL, 1, "+CAEMLPP:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CAHLD(at_state_t *s, const char *t) { /* 3GPP TS 27.007 11.1.3 - Leave an ongoing Voice Group or Voice Broadcast Call */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+CAHLD:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CAJOIN(at_state_t *s, const char *t) { /* 3GPP TS 27.007 11.1.1 - Accept an incoming Voice Group or Voice Broadcast Call */ /* TODO: */ t += 7; if (!parse_out(s, &t, NULL, 1, "+CAJOIN:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CALA(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.16 - Alarm */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CALA:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CALCC(at_state_t *s, const char *t) { /* 3GPP TS 27.007 11.1.6 - List current Voice Group and Voice Broadcast Calls */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+CALCC:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CALD(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.38 - Delete alarm */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CALD:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CALM(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.20 - Alert sound mode */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CALM:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CAMM(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.26 - Accumulated call meter maximum */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CAMM:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CANCHEV(at_state_t *s, const char *t) { /* 3GPP TS 27.007 11.1.8 - NCH Support Indication */ /* TODO: */ t += 8; if (!parse_out(s, &t, NULL, 1, "+CANCHEV:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CAOC(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.16 - Advice of Charge */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CAOC:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CAPD(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.39 - Postpone or dismiss an alarm */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CAPD:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CAPTT(at_state_t *s, const char *t) { /* 3GPP TS 27.007 11.1.4 - Talker Access for Voice Group Call */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+CAPTT:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CAREJ(at_state_t *s, const char *t) { /* 3GPP TS 27.007 11.1.2 - Reject an incoming Voice Group or Voice Broadcast Call */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+CAREJ:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CAULEV(at_state_t *s, const char *t) { /* 3GPP TS 27.007 11.1.5 - Voice Group Call Uplink Status Presentation */ /* TODO: */ t += 7; if (!parse_out(s, &t, NULL, 1, "+CAULEV:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CBC(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.4 - Battery charge */ /* TODO: */ t += 4; if (!parse_out(s, &t, NULL, 1, "+CBC:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CBCS(at_state_t *s, const char *t) { /* 3GPP TS 27.007 11.3.2 - VBS subscriptions and GId status */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CBCS:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CBIP(at_state_t *s, const char *t) { /* IS-99 5.6 - Base station IP address */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CBST(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.7 - Select bearer service type */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CBST:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CCFC(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.11 - Call forwarding number and conditions */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CCFC:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CCLK(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.15 - Clock */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CCLK:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CCS(at_state_t *s, const char *t) { /* IS-135 4.1.22 - Compression status */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CCUG(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.10 - Closed user group */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CCUG:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CCWA(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.12 - Call waiting */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CCWA:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CCWE(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.28 - Call Meter maximum event */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CCWE:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CDIP(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.9 - Called line identification presentation */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CDIP:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CDIS(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.8 - Display control */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CDIS:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CDV(at_state_t *s, const char *t) { /* IS-99 5.6 - Dial command for voice call */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CEER(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.10 - Extended error report */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CEER:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CESP(at_state_t *s, const char *t) { /* GSM07.05 3.2.4 - Enter SMS block mode protocol */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CFCS(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.24 - Fast call setup conditions */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CFCS:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CFG(at_state_t *s, const char *t) { /* IS-99 5.6 - Configuration string */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CFUN(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.2 - Set phone functionality */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CFUN:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGACT(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.10 - PDP context activate or deactivate */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+CGACT:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGANS(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.16 - Manual response to a network request for PDP context activation */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+CGANS:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGATT(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.9 - PS attach or detach */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+CGATT:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGAUTO(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.15 - Automatic response to a network request for PDP context activation */ /* TODO: */ t += 7; if (!parse_out(s, &t, NULL, 1, "+CGAUTO:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGCAP(at_state_t *s, const char *t) { /* IS-99 5.6 - Request complete capabilities list */ /* TODO: */ t += 6; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGCLASS(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.17 - GPRS mobile station class (GPRS only) */ /* TODO: */ t += 8; if (!parse_out(s, &t, NULL, 1, "+CGCLASS:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGCLOSP(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.13 - Configure local Octet Stream PAD parameters (Obsolete) */ /* TODO: */ t += 8; if (!parse_out(s, &t, NULL, 1, "+CGCLOSP:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGCLPAD(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.12 - Configure local triple-X PAD parameters (GPRS only) (Obsolete) */ /* TODO: */ t += 8; if (!parse_out(s, &t, NULL, 1, "+CGCLPAD:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGCMOD(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.11 - PDP Context Modify */ /* TODO: */ t += 7; if (!parse_out(s, &t, NULL, 1, "+CGCMOD:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGCS(at_state_t *s, const char *t) { /* 3GPP TS 27.007 11.3.1 - VGCS subscriptions and GId status */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CGCS:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGDATA(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.12 - Enter data state */ /* TODO: */ t += 7; if (!parse_out(s, &t, NULL, 1, "+CGDATA:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGDCONT(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.1 - Define PDP Context */ /* TODO: */ t += 8; if (!parse_out(s, &t, NULL, 1, "+CGDCONT:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGDSCONT(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.2 - Define Secondary PDP Context */ /* TODO: */ t += 9; if (!parse_out(s, &t, NULL, 1, "+CGDSCONT:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGEQMIN(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.7 - 3G Quality of Service Profile (Minimum acceptable) */ /* TODO: */ t += 8; if (!parse_out(s, &t, NULL, 1, "+CGEQMIN:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGEQNEG(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.8 - 3G Quality of Service Profile (Negotiated) */ /* TODO: */ t += 8; if (!parse_out(s, &t, NULL, 1, "+CGEQNEG:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGEQREQ(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.6 - 3G Quality of Service Profile (Requested) */ /* TODO: */ t += 8; if (!parse_out(s, &t, NULL, 1, "+CGEQREQ:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGEREP(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.18 - Packet Domain event reporting */ /* TODO: */ t += 7; if (!parse_out(s, &t, NULL, 1, "+CGEREP:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGMI(at_state_t *s, const char *t) { /* 3GPP TS 27.007 5.1 - Request manufacturer identification */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CGMI:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGMM(at_state_t *s, const char *t) { /* 3GPP TS 27.007 5.2 - Request model identification */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CGMM:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGMR(at_state_t *s, const char *t) { /* 3GPP TS 27.007 5.3 - Request revision identification */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CGMR:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGOI(at_state_t *s, const char *t) { /* IS-99 5.6 - Request global object identification */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGPADDR(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.14 - Show PDP address */ /* TODO: */ t += 8; if (!parse_out(s, &t, NULL, 1, "+CGPADDR:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGQMIN(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.5 - Quality of Service Profile (Minimum acceptable) */ /* TODO: */ t += 7; if (!parse_out(s, &t, NULL, 1, "+CGQMIN:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGQREQ(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.4 - Quality of Service Profile (Requested) */ /* TODO: */ t += 7; if (!parse_out(s, &t, NULL, 1, "+CGQREQ:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGREG(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.19 - GPRS network registration status */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+CGREG:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGSMS(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.20 - Select service for MO SMS messages */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+CGSMS:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGSN(at_state_t *s, const char *t) { /* 3GPP TS 27.007 5.4 - Request product serial number identification */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CGSN:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CGTFT(at_state_t *s, const char *t) { /* 3GPP TS 27.007 10.1.3 - Traffic Flow Template */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+CGTFT:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CHLD(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.13 - Call related supplementary services */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CHLD:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CHSA(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.18 - HSCSD non-transparent asymmetry configuration */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CHSA:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CHSC(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.15 - HSCSD current call parameters */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CHSC:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CHSD(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.12 - HSCSD device parameters */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CHSD:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CHSN(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.14 - HSCSD non-transparent call configuration */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CHSN:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CHSR(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.16 - HSCSD parameters report */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CHSR:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CHST(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.13 - HSCSD transparent call configuration */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CHST:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CHSU(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.17 - HSCSD automatic user initiated upgrading */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CHSU:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CHUP(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.5 - Hangup call */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CHUP:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CHV(at_state_t *s, const char *t) { /* IS-99 5.6 - Hang-up voice */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CIMI(at_state_t *s, const char *t) { /* 3GPP TS 27.007 5.6 - Request international mobile subscriber identity */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CIMI:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CIND(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.9 - Indicator control */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CIND:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CIT(at_state_t *s, const char *t) { /* IS-99 5.6 - Command state inactivity timer */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CKPD(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.7 - Keypad control */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CKPD:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CLAC(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.37 - List all available AT commands */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CLAC:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CLAE(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.31 - Language Event */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CLAE:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CLAN(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.30 - Set Language */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CLAN:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CLCC(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.18 - List current calls */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CLCC:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CLCK(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.4 - Facility lock */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CLCK:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CLIP(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.6 - Calling line identification presentation */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CLIP:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CLIR(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.7 - Calling line identification restriction */ /* TODO: */ /* Parameter sets the adjustment for outgoing calls: 0 presentation indicator is used according to the subscription of the CLIR service 1 CLIR invocation 2 CLIR suppression */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CLIR:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CLVL(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.23 - Loudspeaker volume level */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CLVL:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CMAR(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.36 - Master Reset */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CMAR:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CMEC(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.6 - Mobile Termination control mode */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CMEC:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CMEE(at_state_t *s, const char *t) { /* GSM07.07 9.1 - Report mobile equipment error */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CMER(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.10 - Mobile Termination event reporting */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CMER:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CMGC(at_state_t *s, const char *t) { /* GSM07.05 3.5.5/4.5 - Send command */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CMGD(at_state_t *s, const char *t) { /* GSM07.05 3.5.4 - Delete message */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CMGF(at_state_t *s, const char *t) { /* GSM07.05 3.2.3 - Message Format */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CMGL(at_state_t *s, const char *t) { /* GSM07.05 3.4.2/4.1 - List messages */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CMGR(at_state_t *s, const char *t) { /* GSM07.05 3.4.3/4.2 - Read message */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CMGS(at_state_t *s, const char *t) { /* GSM07.05 3.5.1/4.3 - Send message */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CMGW(at_state_t *s, const char *t) { /* GSM07.05 3.5.3/4.4 - Write message to memory */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CMIP(at_state_t *s, const char *t) { /* IS-99 5.6 - Mobile station IP address */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CMM(at_state_t *s, const char *t) { /* IS-135 4.1.23 - Menu map */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CMMS(at_state_t *s, const char *t) { /* GSM07.05 3.5.6 - More messages to send */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CMOD(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.4 - Call mode */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CMOD:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CMSS(at_state_t *s, const char *t) { /* GSM07.05 3.5.2/4.7 - Send message from storage */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CMUT(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.24 - Mute control */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CMUT:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CNMA(at_state_t *s, const char *t) { /* GSM07.05 3.4.4/4.6 - New message acknowledgement to terminal adapter */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CNMI(at_state_t *s, const char *t) { /* GSM07.05 3.4.1 - New message indications to terminal equipment */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CMUX(at_state_t *s, const char *t) { /* 3GPP TS 27.007 5.7 - Multiplexing mode */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CMUX:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CNUM(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.1 - Subscriber number */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CNUM:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_COLP(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.8 - Connected line identification presentation */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+COLP:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_COPN(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.21 - Read operator names */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+COPN:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_COPS(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.3 - PLMN selection */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+COPS:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_COS(at_state_t *s, const char *t) { /* IS-135 4.1.24 - Originating service */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_COTDI(at_state_t *s, const char *t) { /* 3GPP TS 27.007 11.1.9 - Originator to Dispatcher Information */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+COTDI:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CPAS(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.1 - Phone activity status */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CPAS:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CPBF(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.13 - Find phonebook entries */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CPBF:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CPBR(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.12 - Read phonebook entries */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CPBR:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CPBS(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.11 - Select phonebook memory storage */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CPBS:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CPBW(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.14 - Write phonebook entry */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CPBW:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CPIN(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.3 - Enter PIN */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CPIN:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CPLS(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.20 - Selection of preferred PLMN list */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CPLS:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CPMS(at_state_t *s, const char *t) { /* GSM07.05 3.2.2 - Preferred message storage */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CPOL(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.19 - Preferred PLMN list */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CPOL:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CPPS(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.23 - eMLPP subscriptions */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CPPS:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CPROT(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.42 - Enter protocol mode */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+CPROT:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CPUC(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.27 - Price per unit and currency table */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CPUC:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CPWC(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.29 - Power class */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CPWC:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CPWD(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.5 - Change password */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CPWD:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CQD(at_state_t *s, const char *t) { /* IS-135 4.1.25 - Query disconnect timer */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CR(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.9 - Service reporting control */ /* TODO: */ t += 3; if (!parse_out(s, &t, NULL, 1, "+CR:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CRC(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.11 - Cellular result codes */ /* TODO: */ t += 4; if (!parse_out(s, &t, NULL, 1, "+CRC:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CREG(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.2 - Network registration */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CREG:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CRES(at_state_t *s, const char *t) { /* GSM07.05 3.3.6 - Restore Settings */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CRLP:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CRLP(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.8 - Radio link protocol */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CRLP:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CRM(at_state_t *s, const char *t) { /* IS-99 5.6 - Set rm interface protocol */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CRMC(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.34 - Ring Melody Control */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CRMC:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CRMP(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.35 - Ring Melody Playback */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CRMP:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CRSL(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.21 - Ringer sound level */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CRSL:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CRSM(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.18 - Restricted SIM access */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CRSM:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CSAS(at_state_t *s, const char *t) { /* GSM07.05 3.3.5 - Save settings */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CSCA(at_state_t *s, const char *t) { /* GSM07.05 3.3.1 - Service centre address */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CSCB(at_state_t *s, const char *t) { /* GSM07.05 3.3.4 - Select cell broadcast message types */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CSCC(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.19 - Secure control command */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CSCC:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CSCS(at_state_t *s, const char *t) { /* 3GPP TS 27.007 5.5 - Select TE character set */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CSCS:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CSDF(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.22 - Settings date format */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CSDF:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CSDH(at_state_t *s, const char *t) { /* GSM07.05 3.3.3 - Show text mode parameters */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CSGT(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.32 - Set Greeting Text */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CSGT:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CSIL(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.23 - Silence Command */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CSIL:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CSIM(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.17 - Generic SIM access */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CSIM:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CSMP(at_state_t *s, const char *t) { /* GSM07.05 3.3.2 - Set text mode parameters */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CSMS(at_state_t *s, const char *t) { /* GSM07.05 3.2.1 - Select Message Service */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CSNS(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.19 - Single numbering scheme */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CSNS:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CSQ(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.5 - Signal quality */ /* TODO: */ t += 4; if (!parse_out(s, &t, NULL, 1, "+CSQ:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CSS(at_state_t *s, const char *t) { /* IS-135 4.1.28 - Serving system identification */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CSSN(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.17 - Supplementary service notifications */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CSSN:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CSTA(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.1 - Select type of address */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CSTA:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CSTF(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.24 - Settings time format */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CSTF:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CSVM(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.33 - Set Voice Mail Number */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CSVM:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CTA(at_state_t *s, const char *t) { /* IS-135 4.1.29 - MT-Terminated async. Data calls */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CTF(at_state_t *s, const char *t) { /* IS-135 4.1.30 - MT-Terminated FAX calls */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CTFR(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.14 - Call deflection */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CTFR:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CTZR(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.41 - Time Zone Reporting */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CTZR:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CTZU(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.40 - Automatic Time Zone Update */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CTZU:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CUSD(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.15 - Unstructured supplementary service data */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CUSD:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CUUS1(at_state_t *s, const char *t) { /* 3GPP TS 27.007 7.26 - User to User Signalling Service 1 */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+CUUS1:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CV120(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.21 - V.120 rate adaption protocol */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+CV120:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CVHU(at_state_t *s, const char *t) { /* 3GPP TS 27.007 6.20 - Voice Hangup Control */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CVHU:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CVIB(at_state_t *s, const char *t) { /* 3GPP TS 27.007 8.22 - Vibrator mode */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+CVIB:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_CXT(at_state_t *s, const char *t) { /* IS-99 5.6 - Cellular extension */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_DR(at_state_t *s, const char *t) { /* V.250 6.6.2 - Data compression reporting */ /* TODO: */ t += 3; if (!parse_out(s, &t, NULL, 1, "+DR:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_DS(at_state_t *s, const char *t) { /* V.250 6.6.1 - Data compression */ /* TODO: */ t += 3; if (!parse_out(s, &t, NULL, 1, "+DS:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_DS44(at_state_t *s, const char *t) { /* V.250 6.6.2 - V.44 data compression */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_EB(at_state_t *s, const char *t) { /* V.250 6.5.2 - Break handling in error control operation */ /* TODO: */ t += 3; if (!parse_out(s, &t, NULL, 1, "+EB:", "")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_EFCS(at_state_t *s, const char *t) { /* V.250 6.5.4 - 32-bit frame check sequence */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 2, "+EFCS:", "(0-2)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_EFRAM(at_state_t *s, const char *t) { /* V.250 6.5.8 - Frame length */ /* TODO: */ t += 6; if (!parse_2_out(s, &t, NULL, 65535, NULL, 65535, "+EFRAM:", "(1-65535),(1-65535)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_ER(at_state_t *s, const char *t) { /* V.250 6.5.5 - Error control reporting */ /* 0 Error control reporting disabled (no +ER intermediate result code transmitted) 1 Error control reporting enabled (+ER intermediate result code transmitted) */ /* TODO: */ t += 3; if (!parse_out(s, &t, NULL, 1, "+ER:", "(0,1)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_ES(at_state_t *s, const char *t) { static const int maxes[3] = { 7, 4, 9 }; int *locations[3]; /* V.250 6.5.1 - Error control selection */ /* orig_rqst 0: Direct mode 1: Initiate call with Buffered mode only 2: Initiate V.42 without Detection Phase. If Rec. V.8 is in use, this is a request to disable V.42 Detection Phase 3: Initiate V.42 with Detection Phase 4: Initiate Altemative Protocol 5: Initiate Synchronous Mode when connection is completed, immediately after the entire CONNECT result code is delivered. V.24 circuits 113 and 115 are activated when Data State is entered 6: Initiate Synchronous Access Mode when connection is completed, and Data State is entered 7: Initiate Frame Tunnelling Mode when connection is completed, and Data State is entered orig_fbk 0: Error control optional (either LAPM or Alternative acceptable); if error control not established, maintain DTE-DCE data rate and use V.14 buffered mode with flow control during non-error-control operation 1: Error control optional (either LAPM or Alternative acceptable); if error control not established, change DTE-DCE data rate to match line rate and use Direct mode 2: Error control required (either LAPM or Alternative acceptable); if error control not established, disconnect 3: Error control required (only LAPM acceptable); if error control not established, disconnect 4: Error control required (only Altemative protocol acceptable); if error control not established, disconnect ans_fbk 0: Direct mode 1: Error control disabled, use Buffered mode 2: Error control optional (either LAPM or Alternative acceptable); if error control not established, maintain DTE-DCE data rate and use local buffering and flow control during non-error-control operation 3: Error control optional (either LAPM or Alternative acceptable); if error control not established, change DTE-DCE data rate to match line rate and use Direct mode 4: Error control required (either LAPM or Alternative acceptable); if error control not established, disconnect 5: Error control required (only LAPM acceptable); if error control not established, disconnect 6: Error control required (only Alternative protocol acceptable); if error control not established, disconnect 7: Initiate Synchronous Mode when connection is completed, immediately after the entire CONNECT result code is delivered. V.24 cicuits 113 and 115 are activated when Data State is entered 8: Initiate Synchronous Access Mode when connection is completed, and Data State is entered 9: Initiate Frame Tunnelling Mode when connection is completed, and Data State is entered */ /* TODO: */ t += 3; locations[0] = NULL; locations[1] = NULL; locations[2] = NULL; if (!parse_n_out(s, &t, locations, maxes, 3, "+ES:", "(0-7),(0-4),(0-9)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_ESA(at_state_t *s, const char *t) { static const int maxes[8] = { 2, 1, 1, 1, 2, 1, 255, 255 }; int *locations[8]; int i; /* V.80 8.2 - Synchronous access mode configuration */ /* TODO: */ t += 4; for (i = 0; i < 8; i++) locations[i] = NULL; if (!parse_n_out(s, &t, locations, maxes, 8, "+ESA:", "(0-2),(0-1),(0-1),(0-1),(0-2),(0-1),(0-255),(0-255)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_ESR(at_state_t *s, const char *t) { /* V.250 6.5.3 - Selective repeat */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_ETBM(at_state_t *s, const char *t) { /* V.250 6.5.6 - Call termination buffer management */ /* TODO: */ t += 5; if (!parse_2_out(s, &t, NULL, 2, NULL, 2, "+ETBM:", "(0-2),(0-2),(0-30)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_EWIND(at_state_t *s, const char *t) { /* V.250 6.5.7 - Window size */ /* TODO: */ t += 6; if (!parse_2_out(s, &t, &s->rx_window, 127, &s->tx_window, 127, "+EWIND:", "(1-127),(1-127)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_F34(at_state_t *s, const char *t) { static const int maxes[5] = { 14, 14, 2, 14, 14 }; int *locations[5]; int i; /* T.31 B.6.1 - Initial V.34 rate controls for FAX */ /* Syntax: +F34=[][,[][,][,][,p.adaptive_receive, 1, NULL, "0,1")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FBO(at_state_t *s, const char *t) { /* T.32 8.5.3.4 - Phase C data bit order */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FBS(at_state_t *s, const char *t) { /* T.32 8.5.3.2 - Buffer Size, read only parameter */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FBU(at_state_t *s, const char *t) { /* T.32 8.5.1.10 - HDLC Frame Reporting parameter */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FCC(at_state_t *s, const char *t) { /* T.32 8.5.1.1 - DCE capabilities parameters */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FCL(at_state_t *s, const char *t) { /* T.31 8.5.2 - Carrier loss timeout */ t += 4; if (!parse_out(s, &t, &s->carrier_loss_timeout, 255, NULL, "(0-255)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FCLASS(at_state_t *s, const char *t) { /* T.31 8.2 - Capabilities identification and control */ t += 7; /* T.31 says the reply string should be "0,1.0", however making it "0,1,1.0" makes things compatible with a lot more software that may be expecting a pre-T.31 modem. */ if (!parse_string_list_out(s, &t, &s->fclass_mode, 1, NULL, "0,1,1.0")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FCQ(at_state_t *s, const char *t) { /* T.32 8.5.2.3 - Copy quality checking parameter */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FCR(at_state_t *s, const char *t) { /* T.32 8.5.1.9 - Capability to receive parameter */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FCS(at_state_t *s, const char *t) { /* T.32 8.5.1.3 - Current Session Results parameters */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FCT(at_state_t *s, const char *t) { /* T.32 8.5.2.6 - DTE phase C timeout parameter */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FDD(at_state_t *s, const char *t) { /* T.31 8.5.3 - Double escape character replacement */ t += 4; if (!parse_out(s, &t, &s->p.double_escape, 1, NULL, "(0,1)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FDR(at_state_t *s, const char *t) { /* T.32 8.3.4 - Data reception command */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FDT(at_state_t *s, const char *t) { /* T.32 8.3.3 - Data transmission command */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FEA(at_state_t *s, const char *t) { /* T.32 8.5.3.5 - Phase C received EOL alignment parameter */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FFC(at_state_t *s, const char *t) { /* T.32 8.5.3.6 - Format conversion parameter */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FFD(at_state_t *s, const char *t) { /* T.32 8.5.1.14 - File diagnostic message parameter */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FHS(at_state_t *s, const char *t) { /* T.32 8.5.2.7 - Call termination status parameter */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FIE(at_state_t *s, const char *t) { /* T.32 8.5.2.1 - Procedure interrupt enable parameter */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FIP(at_state_t *s, const char *t) { /* T.32 8.3.6 - Initialize Facsimile Parameters */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FIS(at_state_t *s, const char *t) { /* T.32 8.5.1.2 - Current session parameters */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FIT(at_state_t *s, const char *t) { /* T.31 8.5.4 - DTE inactivity timeout */ t += 4; if (!parse_2_out(s, &t, &s->dte_inactivity_timeout, 255, &s->dte_inactivity_action, 1, "+FIT:", "(0-255),(0-1)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FKS(at_state_t *s, const char *t) { /* T.32 8.3.5 - Session termination command */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FLI(at_state_t *s, const char *t) { /* T.32 8.5.1.5 - Local ID string parameter, TSI or CSI */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FLO(at_state_t *s, const char *t) { /* T.31 Annex A */ /* Implement something similar to the V.250 +IFC command */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FLP(at_state_t *s, const char *t) { /* T.32 8.5.1.7 - Indicate document to poll parameter */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FMI(at_state_t *s, const char *t) { /* T.31 says to duplicate +GMI */ t += 4; if (t[0] == '?') { at_put_response(s, manufacturer); t += 1; } return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FMM(at_state_t *s, const char *t) { /* T.31 says to duplicate +GMM */ t += 4; if (t[0] == '?') { at_put_response(s, model); t += 1; } return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FMR(at_state_t *s, const char *t) { /* T.31 says to duplicate +GMR */ t += 4; if (t[0] == '?') { at_put_response(s, revision); t += 1; } return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FMS(at_state_t *s, const char *t) { /* T.32 8.5.2.9 - Minimum phase C speed parameter */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FND(at_state_t *s, const char *t) { /* T.32 8.5.2.10 - Non-Standard Message Data Indication parameter */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FNR(at_state_t *s, const char *t) { /* T.32 8.5.1.11 - Negotiation message reporting control parameters */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FNS(at_state_t *s, const char *t) { /* T.32 8.5.1.6 - Non-Standard Frame FIF parameter */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FPA(at_state_t *s, const char *t) { /* T.32 8.5.1.13 - Selective polling address parameter */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FPI(at_state_t *s, const char *t) { /* T.32 8.5.1.5 - Local Polling ID String parameter */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FPP(at_state_t *s, const char *t) { /* T.32 8.5.3 - Facsimile packet protocol */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FPR(at_state_t *s, const char *t) { /* T.31 Annex A */ /* Implement something similar to the V.250 +IPR command */ t += 4; if (!parse_out(s, &t, &s->dte_rate, 115200, NULL, "115200")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FPS(at_state_t *s, const char *t) { /* T.32 8.5.2.2 - Page Status parameter */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FPW(at_state_t *s, const char *t) { /* T.32 8.5.1.13 - PassWord parameter (Sending or Polling) */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FRH(at_state_t *s, const char *t) { /* T.31 8.3.6 - HDLC receive */ if (!process_class1_cmd(s, &t)) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FRM(at_state_t *s, const char *t) { /* T.31 8.3.4 - Facsimile receive */ if (!process_class1_cmd(s, &t)) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FRQ(at_state_t *s, const char *t) { /* T.32 8.5.2.4 - Receive Quality Thresholds parameters */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FRS(at_state_t *s, const char *t) { /* T.31 8.3.2 - Receive silence */ if (!process_class1_cmd(s, &t)) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FRY(at_state_t *s, const char *t) { /* T.32 8.5.2.8 - ECM Retry Value parameter */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FSA(at_state_t *s, const char *t) { /* T.32 8.5.1.13 - Subaddress parameter */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FSP(at_state_t *s, const char *t) { /* T.32 8.5.1.8 - Request to poll parameter */ /* TODO */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FTH(at_state_t *s, const char *t) { /* T.31 8.3.5 - HDLC transmit */ if (!process_class1_cmd(s, &t)) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FTM(at_state_t *s, const char *t) { /* T.31 8.3.3 - Facsimile transmit */ if (!process_class1_cmd(s, &t)) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_FTS(at_state_t *s, const char *t) { /* T.31 8.3.1 - Transmit silence */ if (!process_class1_cmd(s, &t)) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_GCAP(at_state_t *s, const char *t) { /* V.250 6.1.9 - Request complete capabilities list */ t += 5; /* Response elements +FCLASS +F (FAX) commands +MS +M (modulation control) commands +MS and +MR +MV18S +M (modulation control) commands +MV18S and +MV18R +ES +E (error control) commands +ES, +EB, +ER, +EFCS, and +ETBM +DS +D (data compression) commands +DS and +DR */ /* TODO: make this adapt to the configuration we really have. */ if (t[0] == '?') { at_put_response(s, "+GCAP:+FCLASS"); t += 1; } return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_GCI(at_state_t *s, const char *t) { /* V.250 6.1.10 - Country of installation, */ t += 4; if (!parse_hex_out(s, &t, &s->country_of_installation, 255, "+GCI:", "(00-FF)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_GMI(at_state_t *s, const char *t) { /* V.250 6.1.4 - Request manufacturer identification */ t += 4; if (t[0] == '?') { at_put_response(s, manufacturer); t += 1; } return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_GMM(at_state_t *s, const char *t) { /* V.250 6.1.5 - Request model identification */ t += 4; if (t[0] == '?') { at_put_response(s, model); t += 1; } return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_GMR(at_state_t *s, const char *t) { /* V.250 6.1.6 - Request revision identification */ t += 4; if (t[0] == '?') { at_put_response(s, revision); t += 1; } return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_GOI(at_state_t *s, const char *t) { /* V.250 6.1.8 - Request global object identification */ /* TODO: */ t += 4; if (t[0] == '?') { at_put_response(s, GLOBAL_OBJECT_IDENTITY); t += 1; } return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_GSN(at_state_t *s, const char *t) { /* V.250 6.1.7 - Request product serial number identification */ /* TODO: */ t += 4; if (t[0] == '?') { at_put_response(s, SERIAL_NUMBER); t += 1; } return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_IBC(at_state_t *s, const char *t) { static const int maxes[13] = { 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; int *locations[13]; int i; /* V.80 7.9 - Control of in-band control */ /* TODO: */ t += 4; /* 0: In-band control service disabled 1: In-band control service enabled, 7-bit codes allowed, and top bit insignificant 2; In-band control service enabled, 7-bit codes allowed, and 8-bit codes available Circuits 105, 106, 107, 108, 109, 110, 125, 132, 133, 135, 142 in that order. For each one: 0: disabled 1: enabled DCE line connect status reports: 0: disabled 1: enabled */ for (i = 0; i < 13; i++) locations[i] = NULL; if (!parse_n_out(s, &t, locations, maxes, 13, "+IBC:", "(0-2),(0,1),(0,1),(0,1),(0,1),(0,1),(0,1),(0,1),(0,1),(0,1),(0,1),(0.1),(0,1)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_IBM(at_state_t *s, const char *t) { static const int maxes[3] = { 7, 255, 255 }; int *locations[3]; /* V.80 7.10 - In-band MARK idle reporting control */ /* TODO: */ t += 4; /* Report control 0: No reports 1: Report only once when expires 2: Report each time expires 3: Report once when expires, and then each time expires 4: Report only when the Mark-ldle Period ends; T3 = the entire interval 5: Report the first time when is exceeded, and then once more when the mark idle period ends 6: Report each time when is exceeded, and then once more when the mark idle period ends; T3 = entire interval -- N*T2 7: report the first time when is exceeded, and then each time is exceeded, and then once more when the mark idle period ends; T3 = entire mark idle period -- N*T2 - T1 T1 in units of 10ms T2 in units of 10ms */ locations[0] = NULL; locations[1] = NULL; locations[2] = NULL; if (!parse_n_out(s, &t, locations, maxes, 3, "+IBM:", "(0-7),(0-255),(0-255)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_ICF(at_state_t *s, const char *t) { /* V.250 6.2.11 - DTE-DCE character framing */ t += 4; /* Character format 0: auto detect 1: 8 data 2 stop 2: 8 data 1 parity 1 stop 3: 8 data 1 stop 4: 7 data 2 stop 5: 7 data 1 parity 1 stop 6: 7 data 1 stop Parity 0: Odd 1: Even 2: Mark 3: Space */ if (!parse_2_out(s, &t, &s->dte_char_format, 6, &s->dte_parity, 3, "+ICF:", "(0-6),(0-3)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_ICLOK(at_state_t *s, const char *t) { /* V.250 6.2.14 - Select sync transmit clock source */ t += 6; if (!parse_out(s, &t, &s->sync_tx_clock_source, 2, "+ICLOK:", "(0-2)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_IDSR(at_state_t *s, const char *t) { /* V.250 6.2.16 - Select data set ready option */ t += 5; if (!parse_out(s, &t, &s->dsr_option, 2, "+IDSR:", "(0-2)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_IFC(at_state_t *s, const char *t) { /* V.250 6.2.12 - DTE-DCE local flow control */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_ILRR(at_state_t *s, const char *t) { /* V.250 6.2.13 - DTE-DCE local rate reporting */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_ILSD(at_state_t *s, const char *t) { /* V.250 6.2.15 - Select long space disconnect option */ t += 5; if (!parse_out(s, &t, &s->long_space_disconnect_option, 2, "+ILSD:", "(0,1)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_IPR(at_state_t *s, const char *t) { /* V.250 6.2.10 - Fixed DTE rate */ /* TODO: */ t += 4; if (!parse_out(s, &t, &s->dte_rate, 115200, "+IPR:", "(115200),(115200)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_IRTS(at_state_t *s, const char *t) { /* V.250 6.2.17 - Select synchronous mode RTS option */ t += 5; if (!parse_out(s, &t, NULL, 1, "+IRTS:", "(0,1)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_ITF(at_state_t *s, const char *t) { /* V.80 8.4 - Transmit flow control thresholds */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_MA(at_state_t *s, const char *t) { /* V.250 6.4.2 - Modulation automode control */ /* TODO: */ t += 3; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_MR(at_state_t *s, const char *t) { /* V.250 6.4.3 - Modulation reporting control */ /* 0 Disables reporting of modulation connection (+MCR: and +MRR: are not transmitted) 1 Enables reporting of modulation connection (+MCR: and +MRR: are transmitted) */ /* TODO: */ t += 3; if (!parse_out(s, &t, NULL, 1, "+MR:", "(0,1)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_MS(at_state_t *s, const char *t) { /* V.250 6.4.1 - Modulation selection */ /* TODO: */ t += 3; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_MSC(at_state_t *s, const char *t) { /* V.250 6.4.8 - Seamless rate change enable */ /* 0 Disables V.34 seamless rate change 1 Enables V.34 seamless rate change */ /* TODO: */ t += 4; if (!parse_out(s, &t, NULL, 1, "+MSC:", "(0,1)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_MV18AM(at_state_t *s, const char *t) { /* V.250 6.4.6 - V.18 answering message editing */ /* TODO: */ t += 7; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_MV18P(at_state_t *s, const char *t) { /* V.250 6.4.7 - Order of probes */ /* 2 Send probe message in 5-bit (Baudot) mode 3 Send probe message in DTMF mode 4 Send probe message in EDT mode 5 Send Rec. V.21 carrier as a probe 6 Send Rec. V.23 carrier as a probe 7 Send Bell 103 carrier as a probe */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 7, "+MV18P:", "(2-7)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_MV18R(at_state_t *s, const char *t) { /* V.250 6.4.5 - V.18 reporting control */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+MV18R:", "(0,1)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_MV18S(at_state_t *s, const char *t) { /* V.250 6.4.4 - V.18 selection */ /* mode: 0 Disables V.18 operation 1 V.18 operation, auto detect mode 2 V.18 operation, connect in 5-bit (Baudot) mode 3 V.18 operation, connect in DTMF mode 4 V.18 operation, connect in EDT mode 5 V.18 operation, connect in V.21 mode 6 V.18 operation, connect in V.23 mode 7 V.18 operation, connect in Bell 103-type mode dflt_ans_mode: 0 Disables V.18 answer operation 1 No default specified (auto detect) 2 V.18 operation connect in 5-bit (Baudot) mode 3 V.18 operation connect in DTMF mode 4 V.18 operation connect in EDT mode fbk_time_enable: 0 Disable 1 Enable ans_msg_enable 0 Disable 1 Enable probing_en 0 Disable probing 1 Enable probing 2 Initiate probing */ /* TODO: */ t += 6; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_PCW(at_state_t *s, const char *t) { /* V.250 6.8.1 - Call waiting enable (V.92 DCE) */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_PIG(at_state_t *s, const char *t) { /* V.250 6.8.5 - PCM upstream ignore */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_PMH(at_state_t *s, const char *t) { /* V.250 6.8.2 - Modem on hold enable */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_PMHF(at_state_t *s, const char *t) { /* V.250 6.8.6 - V.92 Modem on hold hook flash */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_PMHR(at_state_t *s, const char *t) { /* V.250 6.8.4 - Initiate modem on hold */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_PMHT(at_state_t *s, const char *t) { /* V.250 6.8.3 - Modem on hold timer */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_PQC(at_state_t *s, const char *t) { /* V.250 6.8.7 - V.92 Phase 1 and Phase 2 Control */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_PSS(at_state_t *s, const char *t) { /* V.250 6.8.8 - V.92 Use Short Sequence */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_SAC(at_state_t *s, const char *t) { /* V.252 3.4 - Audio transmit configuration */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_SAM(at_state_t *s, const char *t) { /* V.252 3.5 - Audio receive mode */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_SAR(at_state_t *s, const char *t) { /* V.252 5.3 - Audio receive channel indication */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_SARR(at_state_t *s, const char *t) { /* V.252 3.9 - Audio indication reporting */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_SAT(at_state_t *s, const char *t) { /* V.252 5.4 - Audio transmit channel indication */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_SCRR(at_state_t *s, const char *t) { /* V.252 3.11 - Capabilities indication reporting */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_SDC(at_state_t *s, const char *t) { /* V.252 3.3 - Data configuration */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_SDI(at_state_t *s, const char *t) { /* V.252 5.2 - Data channel identification */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_SDR(at_state_t *s, const char *t) { /* V.252 3.8 - Data indication reporting */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_SRSC(at_state_t *s, const char *t) { /* V.252 5.1.2 - Remote terminal simultaneous capability indication */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_STC(at_state_t *s, const char *t) { /* V.252 3.1 - Terminal configuration */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_STH(at_state_t *s, const char *t) { /* V.252 3.2 - Close logical channel */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_SVC(at_state_t *s, const char *t) { /* V.252 3.6 - Video transmit configuration */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_SVM(at_state_t *s, const char *t) { /* V.252 3.7 - Video receive mode */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_SVR(at_state_t *s, const char *t) { /* V.252 5.5 - Video receive channel indication */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_SVRR(at_state_t *s, const char *t) { /* V.252 3.10 - Video indication reporting */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_SVT(at_state_t *s, const char *t) { /* V.252 5.6 - Video transmit channel indication */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_TADR(at_state_t *s, const char *t) { /* V.250 6.7.2.9 - Local V.54 address */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_TAL(at_state_t *s, const char *t) { /* V.250 6.7.2.15 - Local analogue loop */ /* Action 0 Disable analogue loop 1 Enable analogue loop Band 0 Low frequency band 1 High frequency band */ /* TODO: */ t += 4; if (!parse_2_out(s, &t, NULL, 1, NULL, 1, "+TAL:", "(0,1),(0,1)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_TALS(at_state_t *s, const char *t) { /* V.250 6.7.2.6 - Analogue loop status */ /* 0 Inactive 1 V.24 circuit 141 invoked 2 Front panel invoked 3 Network management system invoked */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 3, "+TALS:", "(0-3)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_TDLS(at_state_t *s, const char *t) { /* V.250 6.7.2.7 - Local digital loop status */ /* 0 Disabled 1 Enabled, inactive 2 Front panel invoked 3 Network management system invoked 4 Remote invoked */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 3, "+TDLS:", "(0-4)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_TE140(at_state_t *s, const char *t) { /* V.250 6.7.2.1 - Enable ckt 140 */ /* 0 Disabled 1 Enabled */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+TE140:", "(0,1)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_TE141(at_state_t *s, const char *t) { /* V.250 6.7.2.2 - Enable ckt 141 */ /* 0 Response is disabled 1 Response is enabled */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+TE141:", "(0,1)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_TEPAL(at_state_t *s, const char *t) { /* V.250 6.7.2.5 - Enable front panel analogue loop */ /* 0 Disabled 1 Enabled */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+TEPAL:", "(0,1)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_TEPDL(at_state_t *s, const char *t) { /* V.250 6.7.2.4 - Enable front panel RDL */ /* 0 Disabled 1 Enabled */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+TEPDL:", "(0,1)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_TERDL(at_state_t *s, const char *t) { /* V.250 6.7.2.3 - Enable RDL from remote */ /* 0 Local DCE will ignore command from remote 1 Local DCE will obey command from remote */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+TERDL:", "(0,1)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_TLDL(at_state_t *s, const char *t) { /* V.250 6.7.2.13 - Local digital loop */ /* 0 Stop test 1 Start test */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+TLDL:", "(0,1)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_TMO(at_state_t *s, const char *t) { /* V.250 6.9 - V.59 command */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_TMODE(at_state_t *s, const char *t) { /* V.250 6.7.2.10 - Set V.54 mode */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+TMODE:", "(0,1)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_TNUM(at_state_t *s, const char *t) { /* V.250 6.7.2.12 - Errored bit and block counts */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_TRDL(at_state_t *s, const char *t) { /* V.250 6.7.2.14 - Request remote digital loop */ /* 0 Stop RDL 1 Start RDL */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+TRDL:", "(0,1)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_TRDLS(at_state_t *s, const char *t) { /* V.250 6.7.2.8 - Remote digital loop status */ /* TODO: */ t += 6; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_TRES(at_state_t *s, const char *t) { /* V.250 6.7.2.17 - Self test result */ /* 0 No test 1 Pass 2 Fail */ /* TODO: */ t += 5; if (!parse_out(s, &t, NULL, 1, "+TRES:", "(0-2)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_TSELF(at_state_t *s, const char *t) { /* V.250 6.7.2.16 - Self test */ /* 0 Intrusive full test 1 Safe partial test */ /* TODO: */ t += 6; if (!parse_out(s, &t, NULL, 1, "+TSELF:", "(0,1)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_TTER(at_state_t *s, const char *t) { /* V.250 6.7.2.11 - Test error rate */ /* TODO: */ t += 5; if (!parse_2_out(s, &t, NULL, 65535, NULL, 65535, "+TTER:", "(0-65535),(0-65535)")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VAC(at_state_t *s, const char *t) { /* V.252 4.1 - Set audio code */ return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VACR(at_state_t *s, const char *t) { /* V.252 6.1 - Audio code report */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VBT(at_state_t *s, const char *t) { /* 3GPP TS 27.007 C.2.2 - Buffer threshold setting */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VCID(at_state_t *s, const char *t) { /* 3GPP TS 27.007 C.2.3 - Calling number ID presentation */ /* TODO: */ t += 5; if (!parse_out(s, &t, &s->display_call_info, 1, NULL, "0,1")) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VCIDR(at_state_t *s, const char *t) { /* V.252 6.2 - Caller ID report */ /* TODO: */ t += 6; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VDID(at_state_t *s, const char *t) { /* V.253 9.2.4 - DID service */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VDIDR(at_state_t *s, const char *t) { /* V.252 6.2 - DID report */ /* TODO: */ t += 6; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VDR(at_state_t *s, const char *t) { /* V.253 10.3.1 - Distinctive ring (ring cadence reporting) */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VDT(at_state_t *s, const char *t) { /* V.253 10.3.2 - Control tone cadence reporting */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VDX(at_state_t *s, const char *t) { /* V.253 10.5.6 - Speakerphone duplex mode */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VEM(at_state_t *s, const char *t) { /* V.253 10.5.7 - Deliver event reports */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VGM(at_state_t *s, const char *t) { /* V.253 10.5.2 - Microphone gain */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VGR(at_state_t *s, const char *t) { /* V.253 10.2.1 - Receive gain selection */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VGS(at_state_t *s, const char *t) { /* V.253 10.5.3 - Speaker gain */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VGT(at_state_t *s, const char *t) { /* V.253 10.2.2 - Volume selection */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VHC(at_state_t *s, const char *t) { /* V.252 4.12 - Telephony port hook control */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VIP(at_state_t *s, const char *t) { /* V.253 10.1.1 - Initialize voice parameters */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VIT(at_state_t *s, const char *t) { /* V.253 10.2.3 - DTE/DCE inactivity timer */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VLS(at_state_t *s, const char *t) { /* V.253 10.2.4 - Analogue source/destination selection */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VNH(at_state_t *s, const char *t) { /* V.253 9.2.5 - Automatic hangup control */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VPH(at_state_t *s, const char *t) { /* V.252 4.11 - Phone hookswitch status */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VPP(at_state_t *s, const char *t) { /* V.253 10.4.2 - Voice packet protocol */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VPR(at_state_t *s, const char *t) { /* IS-101 10.4.3 - Select DTE/DCE interface rate */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VRA(at_state_t *s, const char *t) { /* V.253 10.2.5 - Ringing tone goes away timer */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VRID(at_state_t *s, const char *t) { int val; /* Extension of V.253 +VCID, Calling number ID report/repeat */ t += 5; val = 0; if (!parse_out(s, &t, &val, 1, NULL, "0,1")) return NULL; if (val == 1) at_display_call_info(s); return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VRL(at_state_t *s, const char *t) { /* V.253 10.1.2 - Ring local phone */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VRN(at_state_t *s, const char *t) { /* V.253 10.2.6 - Ringing tone never appeared timer */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VRX(at_state_t *s, const char *t) { /* V.253 10.1.3 - Voice receive state */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VSD(at_state_t *s, const char *t) { /* V.253 10.2.7 - Silence detection (QUIET and SILENCE) */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VSID(at_state_t *s, const char *t) { /* Extension of V.253 +VCID, Set calling number ID */ t += 5; if (!parse_string_out(s, &t, &s->local_id, NULL)) return NULL; if (at_modem_control(s, AT_MODEM_CONTROL_SETID, s->local_id) < 0) return NULL; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VSM(at_state_t *s, const char *t) { /* V.253 10.2.8 - Compression method selection */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VSP(at_state_t *s, const char *t) { /* V.253 10.5.1 - Voice speakerphone state */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VTA(at_state_t *s, const char *t) { /* V.253 10.5.4 - Train acoustic echo-canceller */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VTD(at_state_t *s, const char *t) { /* V.253 10.2.9 - Beep tone duration timer */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VTER(at_state_t *s, const char *t) { /* V.252 6.4 - Simple telephony event report */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VTH(at_state_t *s, const char *t) { /* V.253 10.5.5 - Train line echo-canceller */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VTR(at_state_t *s, const char *t) { /* V.253 10.1.4 - Voice duplex state */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VTS(at_state_t *s, const char *t) { /* V.253 10.1.5 - DTMF and tone generation in voice */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VTX(at_state_t *s, const char *t) { /* V.253 10.1.6 - Transmit data state */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_VXT(at_state_t *s, const char *t) { /* IS-101 10.1.5 - Translate voice data */ /* TODO: */ t += 4; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_W(at_state_t *s, const char *t) { /* TIA-678 5.2.4.1 - Compliance indication */ /* TODO: */ t += 2; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WBAG(at_state_t *s, const char *t) { /* TIA-678 C.5.6 Bias Modem Audio Gain */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WCDA(at_state_t *s, const char *t) { /* TIA-678 B.3.2.5 Display Data Link Address */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WCHG(at_state_t *s, const char *t) { /* TIA-678 B.3.2.4 Display Battery Charging Status */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WCID(at_state_t *s, const char *t) { /* TIA-678 B.3.2.1 Display System ID (operator) */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WCLK(at_state_t *s, const char *t) { /* TIA-678 B.3.2.3 Lock/Unlock DCE */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WCPN(at_state_t *s, const char *t) { /* TIA-678 B.3.2.2 Set Personal Identification Number */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WCXF(at_state_t *s, const char *t) { /* TIA-678 B.3.2.6 Display Supported Annex B commands */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WDAC(at_state_t *s, const char *t) { /* TIA-678 C.5.1 Data over Analogue Cellular Command Query */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WDIR(at_state_t *s, const char *t) { /* TIA-678 C.5.8 Phone Number Directory Selection */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WECR(at_state_t *s, const char *t) { /* TIA-678 C.5.3 Enable Cellular Result Codes */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WFON(at_state_t *s, const char *t) { /* TIA-678 C.5.5 Phone Specification */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WKPD(at_state_t *s, const char *t) { /* TIA-678 C.5.7 Keypad Emulation */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WPBA(at_state_t *s, const char *t) { /* TIA-678 C.5.9 Phone Battery Query */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WPTH(at_state_t *s, const char *t) { /* TIA-678 C.5.10 Call Path */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WRLK(at_state_t *s, const char *t) { /* TIA-678 C.5.4 Roam Lockout */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WS45(at_state_t *s, const char *t) { /* TIA-678 5.2.4.2 DTE-side stack selection */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WS46(at_state_t *s, const char *t) { /* 3GPP TS 27.007 5.9 - PCCA STD-101 [17] select wireless network */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WS50(at_state_t *s, const char *t) { /* TIA-678 B.3.1.1 Normalized Signal Strength */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WS51(at_state_t *s, const char *t) { /* TIA-678 B.3.1.2 Carrier Detect Signal Threshold */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WS52(at_state_t *s, const char *t) { /* TIA-678 B.3.1.3 Normalized Battery Level */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WS53(at_state_t *s, const char *t) { /* TIA-678 B.3.1.4 Normalized Channel Quality */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WS54(at_state_t *s, const char *t) { /* TIA-678 B.3.1.5 Carrier Detect Channel Quality Threshold */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WS57(at_state_t *s, const char *t) { /* TIA-678 B.3.1.7 Antenna Preference */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WS58(at_state_t *s, const char *t) { /* TIA-678 B.3.1.8 Idle Time-out Value */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ static const char *at_cmd_plus_WSTL(at_state_t *s, const char *t) { /* TIA-678 C.5.2 Call Session Time Limit */ /* TODO: */ t += 5; return t; } /*- End of function --------------------------------------------------------*/ /* AT command group prefixes: +A Call control (network addressing) issues, common, PSTN, ISDN, Rec. X.25, switched digital +C Digital cellular extensions +D Data compression, Rec. V.42bis +E Error control, Rec. V.42 +F Facsimile, Rec. T.30, etc. +G Generic issues such as identity and capabilities +I DTE-DCE interface issues, Rec. V.24, etc. +M Modulation, Rec. V.32bis, etc. +S Switched or simultaneous data types +T Test issues +V Voice extensions +W Wireless extensions */ #include "at_interpreter_dictionary.h" static int command_search(const char *u, int *matched) { int i; int index; int first; int last; int entry; int ptr; entry = 0; /* Loop over the length of the string to search the trie... */ for (i = 0, ptr = 0; ptr < COMMAND_TRIE_LEN; i++) { /* The character in u we are processing... */ /* V.250 5.4.1 says upper and lower case are equivalent in commands */ index = toupper((int) u[i]); /* Is there a child node for this character? */ /* Note: First and last could have been packed into one uint16_t, but space is not that critical, so the other packing is good enough to make the table reasonable. */ first = command_trie[ptr++]; last = command_trie[ptr++]; entry = command_trie[ptr++]; if (index < first || index > last) break; if ((ptr = command_trie[ptr + index - first]) == 0) break; ptr--; } *matched = i; return entry; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) at_modem_control(at_state_t *s, int op, const char *num) { switch (op) { case AT_MODEM_CONTROL_ANSWER: break; case AT_MODEM_CONTROL_CALL: break; case AT_MODEM_CONTROL_HANGUP: break; case AT_MODEM_CONTROL_OFFHOOK: break; case AT_MODEM_CONTROL_DTR: break; case AT_MODEM_CONTROL_RTS: break; case AT_MODEM_CONTROL_CTS: break; case AT_MODEM_CONTROL_CAR: break; case AT_MODEM_CONTROL_RNG: break; case AT_MODEM_CONTROL_DSR: break; case AT_MODEM_CONTROL_RESTART: break; default: break; } /*endswitch*/ return s->modem_control_handler(s, s->modem_control_user_data, op, num); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) at_interpreter(at_state_t *s, const char *cmd, int len) { int i; int c; int entry; int matched; const char *t; if (s->p.echo) s->at_tx_handler(s, s->at_tx_user_data, (uint8_t *) cmd, len); for (i = 0; i < len; i++) { /* The spec says the top bit should be ignored */ c = *cmd++ & 0x7F; /* Handle incoming character */ if (s->line_ptr < 2) { /* Look for the initial "at", "AT", "a/" or "A/", and ignore anything before it */ /* V.250 5.2.1 only shows "at" and "AT" as command prefixes. "At" and "aT" are not specified, despite 5.4.1 saying upper and lower case are equivalent in commands. Let's be tolerant and accept them. */ if (tolower(c) == 'a') { s->line_ptr = 0; s->line[s->line_ptr++] = (char) toupper(c); } else if (s->line_ptr == 1) { if (tolower(c) == 't') { /* We have an "AT" command */ s->line[s->line_ptr++] = (char) toupper(c); } else if (c == '/') { /* We have an "A/" command */ /* TODO: implement "A/" command repeat */ s->line[s->line_ptr++] = (char) c; } else { s->line_ptr = 0; } } } else { /* We are beyond the initial AT */ if (c >= 0x20 && c <= 0x7E) { /* Add a new char */ if (s->line_ptr < (int) (sizeof(s->line) - 1)) s->line[s->line_ptr++] = (char) toupper(c); } else if (c == s->p.s_regs[3]) { /* End of command line. Do line validation */ s->line[s->line_ptr] = '\0'; if (s->line_ptr > 2) { /* The spec says the commands within a command line are executed in order, until an error is found, or the end of the command line is reached. */ t = s->line + 2; while (t && *t) { if ((entry = command_search(t, &matched)) <= 0) break; if ((t = at_commands[entry - 1](s, t)) == NULL) break; if (t == (const char *) -1) break; } if (t != (const char *) -1) { if (t == NULL) at_put_response_code(s, AT_RESPONSE_CODE_ERROR); else at_put_response_code(s, AT_RESPONSE_CODE_OK); } } else if (s->line_ptr == 2) { /* It's just an empty "AT" command, return OK. */ at_put_response_code(s, AT_RESPONSE_CODE_OK); } s->line_ptr = 0; } else if (c == s->p.s_regs[5]) { /* Command line editing character (backspace) */ if (s->line_ptr > 0) s->line_ptr--; } else { /* The spec says control characters, other than those explicitly handled, should be ignored, and so this invalid character causes everything buffered before it to also be ignored. */ s->line_ptr = 0; } } } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) at_set_class1_handler(at_state_t *s, at_class1_handler_t handler, void *user_data) { s->class1_handler = handler; s->class1_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(at_state_t *) at_init(at_state_t *s, at_tx_handler_t *at_tx_handler, void *at_tx_user_data, at_modem_control_handler_t *modem_control_handler, void *modem_control_user_data) { if (s == NULL) { if ((s = (at_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, '\0', sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "AT"); s->modem_control_handler = modem_control_handler; s->modem_control_user_data = modem_control_user_data; s->at_tx_handler = at_tx_handler; s->at_tx_user_data = at_tx_user_data; s->call_id = NULL; s->local_id = NULL; s->display_call_info = 0; at_set_at_rx_mode(s, AT_MODE_ONHOOK_COMMAND); s->p = profiles[0]; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) at_release(at_state_t *s) { at_reset_call_info(s); if (s->local_id) free(s->local_id); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) at_free(at_state_t *s) { int ret; ret = at_release(s); free(s); return ret; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/lpc10_encdecs.h0000664000175000017500000000576411422612262013465 00000000000000/* * SpanDSP - a series of DSP components for telephony * * lpc10_encdecs.h - LPC10 low bit rate speech codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define LPC10_ORDER 10 #if !defined(min) #define min(a,b) ((a) <= (b) ? (a) : (b)) #endif #if !defined(max) #define max(a,b) ((a) >= (b) ? (a) : (b)) #endif void lpc10_placea(int32_t *ipitch, int32_t voibuf[4][2], int32_t *obound, int32_t af, int32_t vwin[3][2], int32_t awin[3][2], int32_t ewin[3][2], int32_t lframe, int32_t maxwin); void lpc10_placev(int32_t *osbuf, int32_t *osptr, int32_t oslen, int32_t *obound, int32_t vwin[3][2], int32_t af, int32_t lframe, int32_t minwin, int32_t maxwin, int32_t dvwinl, int32_t dvwinh); void lpc10_voicing(lpc10_encode_state_t *st, int32_t *vwin, float *inbuf, float *lpbuf, const int32_t buflim[], int32_t half, float *minamd, float *maxamd, int32_t *mintau, float *ivrc, int32_t *obound); void lpc10_analyse(lpc10_encode_state_t *st, float *speech, int32_t *voice, int32_t *pitch, float *rms, float rc[]); static __inline__ int32_t pow_ii(int32_t x, int32_t n) { int32_t pow; uint32_t u; if (n <= 0) { if (n == 0 || x == 1) return 1; if (x != -1) return (x == 0) ? 1/x : 0; n = -n; } u = n; for (pow = 1; ; ) { if ((u & 1)) pow *= x; if ((u >>= 1) == 0) break; x *= x; } return pow; } /*- End of function --------------------------------------------------------*/ static __inline__ float r_sign(float a, float b) { float x; x = fabsf(a); return (b >= 0.0f) ? x : -x; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/gsm0610_long_term.c0000664000175000017500000003242711422612262014214 00000000000000/* * SpanDSP - a series of DSP components for telephony * * gsm0610_long_term.c - GSM 06.10 full rate speech codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * This code is based on the widely used GSM 06.10 code available from * http://kbs.cs.tu-berlin.de/~jutta/toast.html */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/bitstream.h" #include "spandsp/saturated.h" #include "spandsp/gsm0610.h" #include "gsm0610_local.h" /* Table 4.3a Decision level of the LTP gain quantizer */ static const int16_t gsm_DLB[4] = { 6554, 16384, 26214, 32767 }; /* Table 4.3b Quantization levels of the LTP gain quantizer */ static const int16_t gsm_QLB[4] = { 3277, 11469, 21299, 32767 }; /* 4.2.11 .. 4.2.12 LONG TERM PREDICTOR (LTP) SECTION */ static int32_t gsm0610_max_cross_corr(const int16_t *wt, const int16_t *dp, int16_t *index_out) { int32_t max; int32_t index; int32_t res; int i; max = 0; index = 40; /* index for the maximum cross-correlation */ for (i = 40; i <= 120; i++) { #if defined(__GNUC__) && defined(SPANDSP_USE_MMX) && defined(__x86_64__) __asm__ __volatile__( " emms;\n" " .p2align 2;\n" " movq (%%rdi),%%mm0;\n" " movq (%%rsi),%%mm2;\n" " pmaddwd %%mm2,%%mm0;\n" " movq 8(%%rdi),%%mm1;\n" " movq 8(%%rsi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 16(%%rdi),%%mm1;\n" " movq 16(%%rsi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 24(%%rdi),%%mm1;\n" " movq 24(%%rsi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 32(%%rdi),%%mm1;\n" " movq 32(%%rsi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 40(%%rdi),%%mm1;\n" " movq 40(%%rsi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 48(%%rdi),%%mm1;\n" " movq 48(%%rsi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 56(%%rdi),%%mm1;\n" " movq 56(%%rsi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 64(%%rdi),%%mm1;\n" " movq 64(%%rsi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 72(%%rdi),%%mm1;\n" " movq 72(%%rsi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq %%mm0,%%mm1;\n" " punpckhdq %%mm0,%%mm1;\n" /* mm1 has high int32 of mm0 dup'd */ " paddd %%mm1,%%mm0;\n" " movd %%mm0,%[res];\n" " emms;\n" : [res] "=r" (res) : "D" (wt), "S" (&dp[-i]) ); #elif defined(__GNUC__) && defined(SPANDSP_USE_MMX) && defined(__i386__) __asm__ __volatile__( " emms;\n" " .p2align 2;\n" " movq (%%edi),%%mm0;\n" " movq (%%esi),%%mm2;\n" " pmaddwd %%mm2,%%mm0;\n" " movq 8(%%edi),%%mm1;\n" " movq 8(%%esi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 16(%%edi),%%mm1;\n" " movq 16(%%esi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 24(%%edi),%%mm1;\n" " movq 24(%%esi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 32(%%edi),%%mm1;\n" " movq 32(%%esi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 40(%%edi),%%mm1;\n" " movq 40(%%esi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 48(%%edi),%%mm1;\n" " movq 48(%%esi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 56(%%edi),%%mm1;\n" " movq 56(%%esi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 64(%%edi),%%mm1;\n" " movq 64(%%esi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 72(%%edi),%%mm1;\n" " movq 72(%%esi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq %%mm0,%%mm1;\n" " punpckhdq %%mm0,%%mm1;\n" /* mm1 has high int32 of mm0 dup'd */ " paddd %%mm1,%%mm0;\n" " movd %%mm0,%[res];\n" " emms;\n" : [res] "=r" (res) : "D" (wt), "S" (&dp[-i]) ); #else res = (wt[0]*dp[0 - i]) + (wt[1]*dp[1 - i]) + (wt[2]*dp[2 - i]) + (wt[3]*dp[3 - i]) + (wt[4]*dp[4 - i]) + (wt[5]*dp[5 - i]) + (wt[6]*dp[6 - i]) + (wt[7]*dp[7 - i]) + (wt[8]*dp[8 - i]) + (wt[9]*dp[9 - i]) + (wt[10]*dp[10 - i]) + (wt[11]*dp[11 - i]) + (wt[12]*dp[12 - i]) + (wt[13]*dp[13 - i]) + (wt[14]*dp[14 - i]) + (wt[15]*dp[15 - i]) + (wt[16]*dp[16 - i]) + (wt[17]*dp[17 - i]) + (wt[18]*dp[18 - i]) + (wt[19]*dp[19 - i]) + (wt[20]*dp[20 - i]) + (wt[21]*dp[21 - i]) + (wt[22]*dp[22 - i]) + (wt[23]*dp[23 - i]) + (wt[24]*dp[24 - i]) + (wt[25]*dp[25 - i]) + (wt[26]*dp[26 - i]) + (wt[27]*dp[27 - i]) + (wt[28]*dp[28 - i]) + (wt[29]*dp[29 - i]) + (wt[30]*dp[30 - i]) + (wt[31]*dp[31 - i]) + (wt[32]*dp[32 - i]) + (wt[33]*dp[33 - i]) + (wt[34]*dp[34 - i]) + (wt[35]*dp[35 - i]) + (wt[36]*dp[36 - i]) + (wt[37]*dp[37 - i]) + (wt[38]*dp[38 - i]) + (wt[39]*dp[39 - i]); #endif if (res > max) { max = res; index = i; } /*endif*/ } /*endfor*/ *index_out = index; return max; } /*- End of function --------------------------------------------------------*/ /* This procedure computes the LTP gain (bc) and the LTP lag (Nc) for the long term analysis filter. This is done by calculating a maximum of the cross-correlation function between the current sub-segment short term residual signal d[0..39] (output of the short term analysis filter; for simplification the index of this array begins at 0 and ends at 39 for each sub-segment of the RPE-LTP analysis) and the previous reconstructed short term residual signal dp[ -120 .. -1 ]. A dynamic scaling must be performed to avoid overflow. */ /* This procedure exists in three versions. First, the integer version; then, the two floating point versions (as another function), with or without scaling. */ static int16_t evaluate_ltp_parameters(int16_t d[40], int16_t *dp, // [-120..-1] IN int16_t *Nc_out) { int k; int16_t bc; int16_t wt[40]; int32_t L_max; int32_t L_power; int16_t R; int16_t S; int16_t dmax; int16_t scale; int16_t temp; int32_t L_temp; /* Search of the optimum scaling of d[0..39]. */ dmax = 0; for (k = 0; k < 40; k++) { temp = d[k]; temp = saturated_abs16(temp); if (temp > dmax) dmax = temp; /*endif*/ } /*endfor*/ if (dmax == 0) { temp = 0; } else { assert(dmax > 0); temp = gsm0610_norm((int32_t) dmax << 16); } /*endif*/ if (temp > 6) scale = 0; else scale = (int16_t) (6 - temp); /*endif*/ assert(scale >= 0); /* Initialization of a working array wt */ for (k = 0; k < 40; k++) wt[k] = d[k] >> scale; /*endfor*/ /* Search for the maximum cross-correlation and coding of the LTP lag */ L_max = gsm0610_max_cross_corr(wt, dp, Nc_out); L_max <<= 1; /* Rescaling of L_max */ assert(scale <= 100 && scale >= -100); L_max = L_max >> (6 - scale); assert(*Nc_out <= 120 && *Nc_out >= 40); /* Compute the power of the reconstructed short term residual signal dp[..] */ L_power = 0; for (k = 0; k < 40; k++) { L_temp = dp[k - *Nc_out] >> 3; L_power += L_temp*L_temp; } /*endfor*/ L_power <<= 1; /* from L_MULT */ /* Normalization of L_max and L_power */ if (L_max <= 0) return 0; /*endif*/ if (L_max >= L_power) return 3; /*endif*/ temp = gsm0610_norm(L_power); R = (int16_t) ((L_max << temp) >> 16); S = (int16_t) ((L_power << temp) >> 16); /* Coding of the LTP gain */ /* Table 4.3a must be used to obtain the level DLB[i] for the quantization of the LTP gain b to get the coded version bc. */ for (bc = 0; bc <= 2; bc++) { if (R <= saturated_mul16(S, gsm_DLB[bc])) break; /*endif*/ } /*endfor*/ return bc; } /*- End of function --------------------------------------------------------*/ /* 4.2.12 */ static void long_term_analysis_filtering(int16_t bc, int16_t Nc, int16_t *dp, // previous d [-120..-1] IN int16_t d[40], int16_t dpp[40], int16_t e[40]) { int k; /* In this part, we have to decode the bc parameter to compute the samples of the estimate dpp[0..39]. The decoding of bc needs the use of table 4.3b. The long term residual signal e[0..39] is then calculated to be fed to the RPE encoding section. */ for (k = 0; k < 40; k++) { dpp[k] = gsm_mult_r(gsm_QLB[bc], dp[k - Nc]); e[k] = saturated_sub16(d[k], dpp[k]); } /*endfor*/ } /*- End of function --------------------------------------------------------*/ /* 4x for 160 samples */ void gsm0610_long_term_predictor(gsm0610_state_t *s, int16_t d[40], int16_t *dp, // [-120..-1] d' IN int16_t e[40], int16_t dpp[40], int16_t *Nc, int16_t *bc) { #if 0 assert(d); assert(dp); assert(e); assert(dpp); assert(Nc); assert(bc); #endif *bc = evaluate_ltp_parameters(d, dp, Nc); long_term_analysis_filtering(*bc, *Nc, dp, d, dpp, e); } /*- End of function --------------------------------------------------------*/ /* 4.3.2 */ void gsm0610_long_term_synthesis_filtering(gsm0610_state_t *s, int16_t Ncr, int16_t bcr, int16_t erp[40], int16_t *drp) // [-120..-1] IN, [0..40] OUT { int k; int16_t brp; int16_t drpp; int16_t Nr; /* This procedure uses the bcr and Ncr parameters to realize the long term synthesis filter. The decoding of bcr needs table 4.3b. */ /* Check the limits of Nr. */ Nr = (Ncr < 40 || Ncr > 120) ? s->nrp : Ncr; s->nrp = Nr; assert (Nr >= 40 && Nr <= 120); /* Decode the LTP gain, bcr */ brp = gsm_QLB[bcr]; /* Compute the reconstructed short term residual signal, drp[0..39] */ assert(brp != INT16_MIN); for (k = 0; k < 40; k++) { drpp = gsm_mult_r(brp, drp[k - Nr]); drp[k] = saturated_add16(erp[k], drpp); } /*endfor*/ /* Update the reconstructed short term residual signal, drp[-1..-120] */ for (k = 0; k < 120; k++) drp[k - 120] = drp[k - 80]; /*endfor*/ } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/v42.c0000664000175000017500000012556212100753017011465 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v42.c * * Written by Steve Underwood * * Copyright (C) 2004, 2011 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* THIS IS A WORK IN PROGRESS. IT IS NOT FINISHED. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #include #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/bit_operations.h" #include "spandsp/async.h" #include "spandsp/hdlc.h" #include "spandsp/v42.h" #include "spandsp/private/logging.h" #include "spandsp/private/hdlc.h" #include "spandsp/private/v42.h" #define FALSE 0 #define TRUE (!FALSE) /* Detection phase timer */ #define T_400 750 /* Acknowledgement timer - 1 second between SABME's */ #define T_401 1000 /* Replay delay timer (optional) */ #define T_402 1000 /* Inactivity timer (optional). No default - use 10 seconds with no packets */ #define T_403 10000 #define LAPM_DLCI_DTE_TO_DTE 0 #define LAPM_DLCI_LAYER2_MANAGEMENT 63 #define elements(a) (sizeof(a)/sizeof((a)[0])) /* LAPM definitions */ #define LAPM_FRAMETYPE_MASK 0x03 enum { LAPM_FRAMETYPE_I = 0x00, LAPM_FRAMETYPE_I_ALT = 0x02, LAPM_FRAMETYPE_S = 0x01, LAPM_FRAMETYPE_U = 0x03 }; /* Supervisory headers */ enum { LAPM_S_RR = 0x00, /* cr */ LAPM_S_RNR = 0x04, /* cr */ LAPM_S_REJ = 0x08, /* cr */ LAPM_S_SREJ = 0x0C /* cr */ }; #define LAPM_S_PF 0x01 /* Unnumbered headers */ enum { LAPM_U_UI = 0x00, /* cr */ LAPM_U_DM = 0x0C, /* r */ LAPM_U_DISC = 0x40, /* c */ LAPM_U_UA = 0x60, /* r */ LAPM_U_SABME = 0x6C, /* c */ LAPM_U_FRMR = 0x84, /* r */ LAPM_U_XID = 0xAC, /* cr */ LAPM_U_TEST = 0xE0 /* c */ }; #define LAPM_U_PF 0x10 /* XID sub-field definitions */ #define FI_GENERAL 0x82 #define GI_PARAM_NEGOTIATION 0x80 #define GI_PRIVATE_NEGOTIATION 0xF0 #define GI_USER_DATA 0xFF /* Param negotiation (Table 11a/V.42) */ enum { PI_HDLC_OPTIONAL_FUNCTIONS = 0x03, PI_TX_INFO_MAXSIZE = 0x05, PI_RX_INFO_MAXSIZE = 0x06, PI_TX_WINDOW_SIZE = 0x07, PI_RX_WINDOW_SIZE = 0x08 }; /* Private param negotiation (Table 11b/V.42) */ enum { PI_PARAMETER_SET_ID = 0x00, PI_V42BIS_COMPRESSION_REQUEST = 0x01, PI_V42BIS_NUM_CODEWORDS = 0x02, PI_V42BIS_MAX_STRING_LENGTH = 0x03 }; #define LAPM_DLCI_DTE_TO_DTE 0 #define LAPM_DLCI_LAYER2_MANAGEMENT 63 /* Type definitions */ enum { LAPM_DETECT = 0, LAPM_IDLE = 1, LAPM_ESTABLISH = 2, LAPM_DATA = 3, LAPM_RELEASE = 4, LAPM_SIGNAL = 5, LAPM_SETPARM = 6, LAPM_TEST = 7, LAPM_V42_UNSUPPORTED = 8 }; /* Prototypes */ static int lapm_connect(v42_state_t *ss); static int lapm_disconnect(v42_state_t *s); static void reset_lapm(v42_state_t *s); static void lapm_hdlc_underflow(void *user_data); static int lapm_config(v42_state_t *ss); SPAN_DECLARE(const char *) lapm_status_to_str(int status) { switch (status) { case LAPM_DETECT: return "LAPM_DETECT"; case LAPM_IDLE: return "LAPM_IDLE"; case LAPM_ESTABLISH: return "LAPM_ESTABLISH"; case LAPM_DATA: return "LAPM_DATA"; case LAPM_RELEASE: return "LAPM_RELEASE"; case LAPM_SIGNAL: return "LAPM_SIGNAL"; case LAPM_SETPARM: return "LAPM_SETPARM"; case LAPM_TEST: return "LAPM_TEST"; case LAPM_V42_UNSUPPORTED: return "LAPM_V42_UNSUPPORTED"; } /*endswitch*/ return "???"; } /*- End of function --------------------------------------------------------*/ static void report_rx_status_change(v42_state_t *s, int status) { if (s->lapm.status_handler) s->lapm.status_handler(s->lapm.status_user_data, status); else if (s->lapm.iframe_put) s->lapm.iframe_put(s->lapm.iframe_put_user_data, NULL, status); } /*- End of function --------------------------------------------------------*/ static inline uint32_t pack_value(const uint8_t *buf, int len) { uint32_t val; val = 0; while (len--) { val <<= 8; val |= *buf++; } return val; } /*- End of function --------------------------------------------------------*/ static inline v42_frame_t *get_next_free_ctrl_frame(lapm_state_t *s) { v42_frame_t *f; int ctrl_put_next; if ((ctrl_put_next = s->ctrl_put + 1) >= V42_CTRL_FRAMES) ctrl_put_next = 0; if (ctrl_put_next == s->ctrl_get) return NULL; f = &s->ctrl_buf[s->ctrl_put]; s->ctrl_put = ctrl_put_next; return f; } /*- End of function --------------------------------------------------------*/ static int tx_unnumbered_frame(lapm_state_t *s, uint8_t addr, uint8_t ctrl, uint8_t *info, int len) { v42_frame_t *f; uint8_t *buf; if ((f = get_next_free_ctrl_frame(s)) == NULL) return -1; buf = f->buf; buf[0] = addr; buf[1] = LAPM_FRAMETYPE_U | ctrl; f->len = 2; if (info && len) { memcpy(buf + f->len, info, len); f->len += len; } return 0; } /*- End of function --------------------------------------------------------*/ static int tx_supervisory_frame(lapm_state_t *s, uint8_t addr, uint8_t ctrl, uint8_t pf_mask) { v42_frame_t *f; uint8_t *buf; if ((f = get_next_free_ctrl_frame(s)) == NULL) return -1; buf = f->buf; buf[0] = addr; buf[1] = LAPM_FRAMETYPE_S | ctrl; buf[2] = (s->vr << 1) | pf_mask; f->len = 3; return 0; } /*- End of function --------------------------------------------------------*/ static __inline__ int set_param(int param, int value, int def) { if ((value < def && param >= def) || (value >= def && param < def)) return def; if ((value < def && param < value) || (value >= def && param > value)) return value; return param; } /*- End of function --------------------------------------------------------*/ static int receive_xid(v42_state_t *ss, const uint8_t *frame, int len) { lapm_state_t *s; v42_config_parameters_t config; const uint8_t *buf; uint8_t group_id; uint16_t group_len; uint32_t param_val; uint8_t param_id; uint8_t param_len; s = &ss->lapm; if (frame[2] != FI_GENERAL) return -1; memset(&config, 0, sizeof(config)); /* Skip the header octets */ frame += 3; len -= 3; while (len > 0) { group_id = frame[0]; group_len = frame[1]; group_len = (group_len << 8) | frame[2]; frame += 3; len -= (3 + group_len); if (len < 0) break; buf = frame; frame += group_len; switch (group_id) { case GI_PARAM_NEGOTIATION: while (group_len > 0) { param_id = buf[0]; param_len = buf[1]; buf += 2; group_len -= (2 + param_len); if (group_len < 0) break; switch (param_id) { case PI_HDLC_OPTIONAL_FUNCTIONS: param_val = pack_value(buf, param_len); break; case PI_TX_INFO_MAXSIZE: param_val = pack_value(buf, param_len); param_val >>= 3; config.v42_tx_n401 = s->tx_n401 = set_param(s->tx_n401, param_val, ss->config.v42_tx_n401); break; case PI_RX_INFO_MAXSIZE: param_val = pack_value(buf, param_len); param_val >>= 3; config.v42_rx_n401 = s->rx_n401 = set_param(s->rx_n401, param_val, ss->config.v42_rx_n401); break; case PI_TX_WINDOW_SIZE: param_val = pack_value(buf, param_len); config.v42_tx_window_size_k = s->tx_window_size_k = set_param(s->tx_window_size_k, param_val, ss->config.v42_tx_window_size_k); break; case PI_RX_WINDOW_SIZE: param_val = pack_value(buf, param_len); config.v42_rx_window_size_k = s->rx_window_size_k = set_param(s->rx_window_size_k, param_val, ss->config.v42_rx_window_size_k); break; default: break; } buf += param_len; } break; case GI_PRIVATE_NEGOTIATION: while (group_len > 0) { param_id = buf[0]; param_len = buf[1]; buf += 2; group_len -= (2 + param_len); if (group_len < 0) break; switch (param_id) { case PI_PARAMETER_SET_ID: /* This might be worth monitoring, but it doesn't serve mnuch other purpose */ break; case PI_V42BIS_COMPRESSION_REQUEST: config.comp = pack_value(buf, param_len); break; case PI_V42BIS_NUM_CODEWORDS: config.comp_dict_size = pack_value(buf, param_len); break; case PI_V42BIS_MAX_STRING_LENGTH: config.comp_max_string = pack_value(buf, param_len); break; default: break; } buf += param_len; } break; default: break; } } //v42_update_config(ss, &config); return 0; } /*- End of function --------------------------------------------------------*/ static void transmit_xid(v42_state_t *ss, uint8_t addr) { lapm_state_t *s; uint8_t *buf; int len; int group_len; uint32_t param_val; v42_frame_t *f; s = &ss->lapm; if ((f = get_next_free_ctrl_frame(s)) == NULL) return; buf = f->buf; len = 0; /* Figure 11/V.42 */ *buf++ = addr; *buf++ = LAPM_U_XID | LAPM_FRAMETYPE_U; /* Format identifier subfield */ *buf++ = FI_GENERAL; len += 3; /* Parameter negotiation group */ group_len = 20; *buf++ = GI_PARAM_NEGOTIATION; *buf++ = (group_len >> 8) & 0xFF; *buf++ = group_len & 0xFF; len += 3; /* For conformance with the encoding rules in ISO/IEC 8885, the transmitter of an XID command frame shall set bit positions 2, 4, 8, 9, 12 and 16 to 1. (Table 11a/V.42) Optional bits are: 3 Selective retransmission procedure (SREJ frame) single I frame request 14 Loop-back test procedure (TEST frame) 17 Extended FCS procedure (32-bit FCS) 24 Selective retransmission procedure (SREJ frame) multiple I frame request with span list capability. */ *buf++ = PI_HDLC_OPTIONAL_FUNCTIONS; *buf++ = 4; *buf++ = 0x8A; /* Bits 2, 4, and 8 set */ *buf++ = 0x89; /* Bits 9, 12, and 16 set */ *buf++ = 0x00; *buf++ = 0x00; /* Send the maximum as a number of bits, rather than octets */ param_val = ss->config.v42_tx_n401 << 3; *buf++ = PI_TX_INFO_MAXSIZE; *buf++ = 2; *buf++ = (param_val >> 8) & 0xFF; *buf++ = (param_val & 0xFF); /* Send the maximum as a number of bits, rather than octets */ param_val = ss->config.v42_rx_n401 << 3; *buf++ = PI_RX_INFO_MAXSIZE; *buf++ = 2; *buf++ = (param_val >> 8) & 0xFF; *buf++ = (param_val & 0xFF); *buf++ = PI_TX_WINDOW_SIZE; *buf++ = 1; *buf++ = ss->config.v42_tx_window_size_k; *buf++ = PI_RX_WINDOW_SIZE; *buf++ = 1; *buf++ = ss->config.v42_rx_window_size_k; len += group_len; if (ss->config.comp) { /* Private parameter negotiation group */ group_len = 15; *buf++ = GI_PRIVATE_NEGOTIATION; *buf++ = (group_len >> 8) & 0xFF; *buf++ = group_len & 0xFF; len += 3; /* Private parameter for V.42 (ASCII for V42). V.42 says ".42", but V.42bis says "V42", and that seems to be what should be used. */ *buf++ = PI_PARAMETER_SET_ID; *buf++ = 3; *buf++ = 'V'; *buf++ = '4'; *buf++ = '2'; /* V.42bis P0 00 Compression in neither direction (default); 01 Negotiation initiator-responder direction only; 10 Negotiation responder-initiator direction only; 11 Both directions. */ *buf++ = PI_V42BIS_COMPRESSION_REQUEST; *buf++ = 1; *buf++ = ss->config.comp; /* V.42bis P1 */ param_val = ss->config.comp_dict_size; *buf++ = PI_V42BIS_NUM_CODEWORDS; *buf++ = 2; *buf++ = (param_val >> 8) & 0xFF; *buf++ = param_val & 0xFF; /* V.42bis P2 */ *buf++ = PI_V42BIS_MAX_STRING_LENGTH; *buf++ = 1; *buf++ = ss->config.comp_max_string; len += group_len; } f->len = len; } /*- End of function --------------------------------------------------------*/ static int ms_to_bits(v42_state_t *s, int time) { return ((time*s->tx_bit_rate)/1000); } /*- End of function --------------------------------------------------------*/ static void t400_expired(v42_state_t *ss) { /* Give up trying to detect a V.42 capable peer. */ ss->bit_timer = 0; ss->lapm.state = LAPM_V42_UNSUPPORTED; report_rx_status_change(ss, ss->lapm.state); } /*- End of function --------------------------------------------------------*/ static __inline__ void t400_start(v42_state_t *s) { s->bit_timer = ms_to_bits(s, T_400); s->bit_timer_func = t400_expired; } /*- End of function --------------------------------------------------------*/ static __inline__ void t400_stop(v42_state_t *s) { s->bit_timer = 0; } /*- End of function --------------------------------------------------------*/ static void t401_expired(v42_state_t *ss) { lapm_state_t *s; span_log(&ss->logging, SPAN_LOG_FLOW, "T.401 expired\n"); s = &ss->lapm; if (s->retry_count > V42_DEFAULT_N_400) { s->retry_count = 0; switch (s->state) { case LAPM_ESTABLISH: case LAPM_RELEASE: s->state = LAPM_IDLE; report_rx_status_change(ss, SIG_STATUS_LINK_DISCONNECTED); break; case LAPM_DATA: lapm_disconnect(ss); break; } return ; } s->retry_count++; if (s->configuring) { transmit_xid(ss, s->cmd_addr); } else { switch (s->state) { case LAPM_ESTABLISH: tx_unnumbered_frame(s, s->cmd_addr, LAPM_U_SABME | LAPM_U_PF, NULL, 0); break; case LAPM_RELEASE: tx_unnumbered_frame(s, s->cmd_addr, LAPM_U_DISC | LAPM_U_PF, NULL, 0); break; case LAPM_DATA: tx_supervisory_frame(s, s->cmd_addr, (s->local_busy) ? LAPM_S_RNR : LAPM_S_RR, 1); break; } } ss->bit_timer = ms_to_bits(ss, T_401); ss->bit_timer_func = t401_expired; } /*- End of function --------------------------------------------------------*/ static __inline__ void t401_start(v42_state_t *s) { s->bit_timer = ms_to_bits(s, T_401); s->bit_timer_func = t401_expired; s->lapm.retry_count = 0; } /*- End of function --------------------------------------------------------*/ static __inline__ void t401_stop(v42_state_t *s) { s->bit_timer = 0; s->lapm.retry_count = 0; } /*- End of function --------------------------------------------------------*/ static void t403_expired(v42_state_t *ss) { lapm_state_t *s; span_log(&ss->logging, SPAN_LOG_FLOW, "T.403 expired\n"); if (ss->lapm.state != LAPM_DATA) return; s = &ss->lapm; tx_supervisory_frame(s, s->cmd_addr, (ss->lapm.local_busy) ? LAPM_S_RNR : LAPM_S_RR, 1); t401_start(ss); ss->lapm.retry_count = 1; } /*- End of function --------------------------------------------------------*/ static __inline__ void t401_stop_t403_start(v42_state_t *s) { s->bit_timer = ms_to_bits(s, T_403); s->bit_timer_func = t403_expired; s->lapm.retry_count = 0; } /*- End of function --------------------------------------------------------*/ static void initiate_negotiation_expired(v42_state_t *s) { /* Timer service routine */ span_log(&s->logging, SPAN_LOG_FLOW, "Start negotiation\n"); lapm_config(s); lapm_hdlc_underflow(s); } /*- End of function --------------------------------------------------------*/ static int tx_information_frame(v42_state_t *ss) { lapm_state_t *s; v42_frame_t *f; uint8_t *buf; int n; int info_put_next; s = &ss->lapm; if (s->far_busy || ((s->vs - s->va) & 0x7F) >= s->tx_window_size_k) return FALSE; if (s->info_get != s->info_put) return TRUE; if ((info_put_next = s->info_put + 1) >= V42_INFO_FRAMES) info_put_next = 0; if (info_put_next == s->info_get || info_put_next == s->info_acked) return FALSE; f = &s->info_buf[s->info_put]; buf = f->buf; if (s->iframe_get == NULL) return FALSE; n = s->iframe_get(s->iframe_get_user_data, buf + 3, s->tx_n401); if (n < 0) { /* Error */ report_rx_status_change(ss, SIG_STATUS_LINK_ERROR); return FALSE; } if (n == 0) return FALSE; f->len = n + 3; s->info_put = info_put_next; return TRUE; } /*- End of function --------------------------------------------------------*/ static void tx_information_rr_rnr_response(v42_state_t *ss, const uint8_t *frame, int len) { lapm_state_t *s; s = &ss->lapm; /* Respond with information frame, RR, or RNR, as appropriate */ /* p = 1 may be used for status checking */ if ((frame[2] & 0x1) || !tx_information_frame(ss)) tx_supervisory_frame(s, frame[0], (s->local_busy) ? LAPM_S_RNR : LAPM_S_RR, 1); } /*- End of function --------------------------------------------------------*/ static int reject_info(lapm_state_t *s) { uint8_t n; /* Reject all non-acked frames */ if (s->state != LAPM_DATA) return 0; n = (s->vs - s->va) & 0x7F; s->vs = s->va; s->info_get = s->info_acked; return n; } /*- End of function --------------------------------------------------------*/ static int ack_info(v42_state_t *ss, uint8_t nr) { lapm_state_t *s; int n; s = &ss->lapm; /* Check that NR is valid - i.e. VA <= NR <= VS && VS-VA <= k */ if (!((((nr - s->va) & 0x7F) + ((s->vs - nr) & 0x7F)) <= s->tx_window_size_k && ((s->vs - s->va) & 0x7F) <= s->tx_window_size_k)) { lapm_disconnect(ss); return -1; } n = 0; while (s->va != nr && s->info_acked != s->info_get) { if (++s->info_acked >= V42_INFO_FRAMES) s->info_acked = 0; s->va = (s->va + 1) & 0x7F; n++; } if (n > 0 && s->retry_count == 0) { t401_stop_t403_start(ss); /* 8.4.8 */ if (((s->vs - s->va) & 0x7F)) t401_start(ss); } return n; } /*- End of function --------------------------------------------------------*/ static int valid_data_state(v42_state_t *ss) { lapm_state_t *s; s = &ss->lapm; switch (s->state) { case LAPM_DETECT: case LAPM_IDLE: break; case LAPM_ESTABLISH: reset_lapm(ss); s->state = LAPM_DATA; report_rx_status_change(ss, SIG_STATUS_LINK_CONNECTED); return 1; case LAPM_DATA: return 1; case LAPM_RELEASE: reset_lapm(ss); s->state = LAPM_IDLE; report_rx_status_change(ss, SIG_STATUS_LINK_DISCONNECTED); break; case LAPM_SIGNAL: case LAPM_SETPARM: case LAPM_TEST: case LAPM_V42_UNSUPPORTED: break; } return 0; } /*- End of function --------------------------------------------------------*/ static void receive_information_frame(v42_state_t *ss, const uint8_t *frame, int len) { lapm_state_t *s; s = &ss->lapm; if (!valid_data_state(ss)) return; if (len > s->rx_n401 + 3) return; /* Ack I frames: NR - 1 */ ack_info(ss, frame[2] >> 1); if (s->local_busy) { /* 8.4.7 */ if ((frame[2] & 0x1)) tx_supervisory_frame(s, s->rsp_addr, LAPM_S_RNR, 1); return; } /* NS sequence error */ if ((frame[1] >> 1) != s->vr) { if (!s->rejected) { tx_supervisory_frame(s, s->rsp_addr, LAPM_S_REJ, (frame[2] & 0x1)); s->rejected = TRUE; } return; } s->rejected = FALSE; s->iframe_put(s->iframe_put_user_data, frame + 3, len - 3); /* Increment vr */ s->vr = (s->vr + 1) & 0x7F; tx_information_rr_rnr_response(ss, frame, len); } /*- End of function --------------------------------------------------------*/ static void rx_supervisory_cmd_frame(v42_state_t *ss, const uint8_t *frame, int len) { lapm_state_t *s; s = &ss->lapm; /* If l->local_busy each RR,RNR,REJ with p=1 should be replied by RNR with f=1 (8.4.7) */ switch (frame[1] & 0x0C) { case LAPM_S_RR: s->far_busy = FALSE; ack_info(ss, frame[2] >> 1); /* If p = 1 may be used for status checking? */ tx_information_rr_rnr_response(ss, frame, len); break; case LAPM_S_RNR: s->far_busy = TRUE; ack_info(ss, frame[2] >> 1); /* If p = 1 may be used for status checking? */ if ((frame[2] & 0x1)) tx_supervisory_frame(s, s->rsp_addr, (s->local_busy) ? LAPM_S_RNR : LAPM_S_RR, 1); break; case LAPM_S_REJ: s->far_busy = FALSE; ack_info(ss, frame[2] >> 1); if (s->retry_count == 0) { t401_stop_t403_start(ss); reject_info(s); } tx_information_rr_rnr_response(ss, frame, len); break; case LAPM_S_SREJ: /* TODO: */ return; default: return; } } /*- End of function --------------------------------------------------------*/ static void rx_supervisory_rsp_frame(v42_state_t *ss, const uint8_t *frame, int len) { lapm_state_t *s; s = &ss->lapm; if (s->retry_count == 0 && (frame[2] & 0x1)) return; /* Ack I frames <= NR - 1 */ switch (frame[1] & 0x0C) { case LAPM_S_RR: s->far_busy = FALSE; ack_info(ss, frame[2] >> 1); if (s->retry_count && (frame[2] & 0x1)) { reject_info(s); t401_stop_t403_start(ss); } break; case LAPM_S_RNR: s->far_busy = TRUE; ack_info(ss, frame[2] >> 1); if (s->retry_count && (frame[2] & 0x1)) { reject_info(s); t401_stop_t403_start(ss); } if (s->retry_count == 0) t401_start(ss); break; case LAPM_S_REJ: s->far_busy = FALSE; ack_info(ss, frame[2] >> 1); if (s->retry_count == 0 || (frame[2] & 0x1)) { reject_info(s); t401_stop_t403_start(ss); } break; case LAPM_S_SREJ: /* TODO: */ return; default: return; } } /*- End of function --------------------------------------------------------*/ static int rx_unnumbered_cmd_frame(v42_state_t *ss, const uint8_t *frame, int len) { lapm_state_t *s; s = &ss->lapm; switch (frame[1] & 0xEC) { case LAPM_U_SABME: /* Discard un-acked I frames. Reset vs, vr, and va. Clear exceptions */ reset_lapm(ss); /* Going to connected state */ s->state = LAPM_DATA; /* Respond UA (or DM on error) */ // fixme: why may be error and LAPM_U_DM ?? tx_unnumbered_frame(s, s->rsp_addr, LAPM_U_UA | (frame[1] & 0x10), NULL, 0); t401_stop_t403_start(ss); report_rx_status_change(ss, SIG_STATUS_LINK_CONNECTED); break; case LAPM_U_UI: /* Break signal */ /* TODO: */ break; case LAPM_U_DISC: /* Respond UA (or DM) */ if (s->state == LAPM_IDLE) { tx_unnumbered_frame(s, s->rsp_addr, LAPM_U_DM | LAPM_U_PF, NULL, 0); } else { /* Going to disconnected state, discard unacked I frames, reset all. */ s->state = LAPM_IDLE; reset_lapm(ss); tx_unnumbered_frame(s, s->rsp_addr, LAPM_U_UA | (frame[1] & 0x10), NULL, 0); t401_stop(ss); /* TODO: notify CF */ report_rx_status_change(ss, SIG_STATUS_LINK_DISCONNECTED); } break; case LAPM_U_XID: /* Exchange general ID info */ receive_xid(ss, frame, len); transmit_xid(ss, s->rsp_addr); break; case LAPM_U_TEST: /* TODO: */ break; default: return -1; } return 0; } /*- End of function --------------------------------------------------------*/ static int rx_unnumbered_rsp_frame(v42_state_t *ss, const uint8_t *frame, int len) { lapm_state_t *s; s = &ss->lapm; switch (frame[1] & 0xEC) { case LAPM_U_DM: switch (s->state) { case LAPM_IDLE: if (!(frame[1] & 0x10)) { /* TODO: notify CF */ report_rx_status_change(ss, SIG_STATUS_LINK_CONNECTED); } break; case LAPM_ESTABLISH: case LAPM_RELEASE: if ((frame[1] & 0x10)) { s->state = LAPM_IDLE; reset_lapm(ss); t401_stop(ss); /* TODO: notify CF */ report_rx_status_change(ss, SIG_STATUS_LINK_DISCONNECTED); } break; case LAPM_DATA: if (s->retry_count || !(frame[1] & 0x10)) { s->state = LAPM_IDLE; reset_lapm(ss); /* TODO: notify CF */ report_rx_status_change(ss, SIG_STATUS_LINK_DISCONNECTED); } break; default: break; } break; case LAPM_U_UI: /* TODO: */ break; case LAPM_U_UA: switch (s->state) { case LAPM_ESTABLISH: s->state = LAPM_DATA; reset_lapm(ss); t401_stop_t403_start(ss); report_rx_status_change(ss, SIG_STATUS_LINK_CONNECTED); break; case LAPM_RELEASE: s->state = LAPM_IDLE; reset_lapm(ss); t401_stop(ss); report_rx_status_change(ss, SIG_STATUS_LINK_DISCONNECTED); break; default: /* Unsolicited UA */ /* TODO: */ break; } /* Clear all exceptions, busy states (self and peer) */ /* Reset vars */ break; case LAPM_U_FRMR: /* Non-recoverable error */ /* TODO: */ break; case LAPM_U_XID: if (s->configuring) { receive_xid(ss, frame, len); s->configuring = FALSE; t401_stop(ss); switch (s->state) { case LAPM_IDLE: lapm_connect(ss); break; case LAPM_DATA: s->local_busy = FALSE; tx_supervisory_frame(s, s->cmd_addr, LAPM_S_RR, 0); break; } } break; default: break; } return 0; } /*- End of function --------------------------------------------------------*/ static void lapm_hdlc_underflow(void *user_data) { lapm_state_t *s; v42_state_t *ss; v42_frame_t *f; ss = (v42_state_t *) user_data; s = &ss->lapm; if (s->ctrl_get != s->ctrl_put) { /* Send control frame */ f = &s->ctrl_buf[s->ctrl_get]; if (++s->ctrl_get >= V42_CTRL_FRAMES) s->ctrl_get = 0; } else { if (s->far_busy || s->configuring || s->state != LAPM_DATA) { hdlc_tx_flags(&s->hdlc_tx, 10); return; } if (s->info_get == s->info_put && !tx_information_frame(ss)) { hdlc_tx_flags(&s->hdlc_tx, 10); return; } /* Send info frame */ f = &s->info_buf[s->info_get]; if (++s->info_get >= V42_INFO_FRAMES) s->info_get = 0; f->buf[0] = s->cmd_addr; f->buf[1] = s->vs << 1; f->buf[2] = s->vr << 1; s->vs = (s->vs + 1) & 0x7F; if (ss->bit_timer == 0) t401_start(ss); } hdlc_tx_frame(&s->hdlc_tx, f->buf, f->len); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(void) lapm_receive(void *user_data, const uint8_t *frame, int len, int ok) { lapm_state_t *s; v42_state_t *ss; ss = (v42_state_t *) user_data; s = &ss->lapm; if (len < 0) { span_log(&ss->logging, SPAN_LOG_DEBUG, "V.42 rx status is %s (%d)\n", signal_status_to_str(len), len); return; } if (!ok) return; switch ((frame[1] & LAPM_FRAMETYPE_MASK)) { case LAPM_FRAMETYPE_I: case LAPM_FRAMETYPE_I_ALT: receive_information_frame(ss, frame, len); break; case LAPM_FRAMETYPE_S: if (!valid_data_state(ss)) return; if (frame[0] == s->rsp_addr) rx_supervisory_cmd_frame(ss, frame, len); else rx_supervisory_rsp_frame(ss, frame, len); break; case LAPM_FRAMETYPE_U: if (frame[0] == s->rsp_addr) rx_unnumbered_cmd_frame(ss, frame, len); else rx_unnumbered_rsp_frame(ss, frame, len); break; default: break; } } /*- End of function --------------------------------------------------------*/ static int lapm_connect(v42_state_t *ss) { lapm_state_t *s; s = &ss->lapm; if (s->state != LAPM_IDLE) return -1; /* Negotiate params */ //transmit_xid(s, s->cmd_addr); reset_lapm(ss); /* Connect */ s->state = LAPM_ESTABLISH; tx_unnumbered_frame(s, s->cmd_addr, LAPM_U_SABME | LAPM_U_PF, NULL, 0); /* Start T401 (and not T403) */ t401_start(ss); return 0; } /*- End of function --------------------------------------------------------*/ static int lapm_disconnect(v42_state_t *ss) { lapm_state_t *s; s = &ss->lapm; s->state = LAPM_RELEASE; tx_unnumbered_frame(s, s->cmd_addr, LAPM_U_DISC | LAPM_U_PF, NULL, 0); t401_start(ss); return 0; } /*- End of function --------------------------------------------------------*/ static int lapm_config(v42_state_t *ss) { lapm_state_t *s; s = &ss->lapm; s->configuring = TRUE; if (s->state == LAPM_DATA) { s->local_busy = TRUE; tx_supervisory_frame(s, s->cmd_addr, LAPM_S_RNR, 1); } transmit_xid(ss, s->cmd_addr); t401_start(ss); return 0; } /*- End of function --------------------------------------------------------*/ static void reset_lapm(v42_state_t *ss) { lapm_state_t *s; s = &ss->lapm; /* Reset the LAP.M state */ s->local_busy = FALSE; s->far_busy = FALSE; s->vs = 0; s->va = 0; s->vr = 0; /* Discard any info frames still queued for transmission */ s->info_put = 0; s->info_acked = 0; s->info_get = 0; /* Discard any control frames */ s->ctrl_put = 0; s->ctrl_get = 0; s->tx_window_size_k = ss->config.v42_tx_window_size_k; s->rx_window_size_k = ss->config.v42_rx_window_size_k; s->tx_n401 = ss->config.v42_tx_n401; s->rx_n401 = ss->config.v42_rx_n401; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v42_stop(v42_state_t *ss) { lapm_state_t *s; s = &ss->lapm; ss->bit_timer = 0; s->packer_process = NULL; lapm_disconnect(ss); } /*- End of function --------------------------------------------------------*/ static void restart_lapm(v42_state_t *s) { if (s->calling_party) { s->bit_timer = 48*8; s->bit_timer_func = initiate_negotiation_expired; } else { lapm_hdlc_underflow(s); } s->lapm.packer_process = NULL; s->lapm.state = LAPM_IDLE; } /*- End of function --------------------------------------------------------*/ static void negotiation_rx_bit(v42_state_t *s, int new_bit) { /* DC1 with even parity, 8-16 ones, DC1 with odd parity, 8-16 ones */ /* uint8_t odp = "0100010001 11111111 0100010011 11111111"; */ /* V.42 OK E , 8-16 ones, C, 8-16 ones */ /* uint8_t adp_v42 = "0101000101 11111111 0110000101 11111111"; */ /* V.42 disabled E, 8-16 ones, NULL, 8-16 ones */ /* uint8_t adp_nov42 = "0101000101 11111111 0000000001 11111111"; */ /* There may be no negotiation, so we need to process this data through the HDLC receiver as well */ if (new_bit < 0) { /* Special conditions */ span_log(&s->logging, SPAN_LOG_DEBUG, "V.42 rx status is %s (%d)\n", signal_status_to_str(new_bit), new_bit); return; } /*endif*/ new_bit &= 1; s->neg.rxstream = (s->neg.rxstream << 1) | new_bit; switch (s->neg.rx_negotiation_step) { case 0: /* Look for some ones */ if (new_bit) break; /*endif*/ s->neg.rx_negotiation_step = 1; s->neg.rxbits = 0; s->neg.rxstream = ~1; s->neg.rxoks = 0; break; case 1: /* Look for the first character */ if (++s->neg.rxbits < 9) break; /*endif*/ s->neg.rxstream &= 0x3FF; if (s->calling_party && s->neg.rxstream == 0x145) { s->neg.rx_negotiation_step++; } else if (!s->calling_party && s->neg.rxstream == 0x111) { s->neg.rx_negotiation_step++; } else { s->neg.rx_negotiation_step = 0; } /*endif*/ s->neg.rxbits = 0; s->neg.rxstream = ~0; break; case 2: /* Look for 8 to 16 ones */ s->neg.rxbits++; if (new_bit) break; /*endif*/ if (s->neg.rxbits >= 8 && s->neg.rxbits <= 16) s->neg.rx_negotiation_step++; else s->neg.rx_negotiation_step = 0; /*endif*/ s->neg.rxbits = 0; s->neg.rxstream = ~1; break; case 3: /* Look for the second character */ if (++s->neg.rxbits < 9) break; /*endif*/ s->neg.rxstream &= 0x3FF; if (s->calling_party && s->neg.rxstream == 0x185) { s->neg.rx_negotiation_step++; } else if (s->calling_party && s->neg.rxstream == 0x001) { s->neg.rx_negotiation_step++; } else if (!s->calling_party && s->neg.rxstream == 0x113) { s->neg.rx_negotiation_step++; } else { s->neg.rx_negotiation_step = 0; } /*endif*/ s->neg.rxbits = 0; s->neg.rxstream = ~0; break; case 4: /* Look for 8 to 16 ones */ s->neg.rxbits++; if (new_bit) break; /*endif*/ if (s->neg.rxbits >= 8 && s->neg.rxbits <= 16) { if (++s->neg.rxoks >= 2) { /* HIT - we have found the "V.42 supported" pattern. */ s->neg.rx_negotiation_step++; if (s->calling_party) { t400_stop(s); s->lapm.state = LAPM_IDLE; report_rx_status_change(s, s->lapm.state); restart_lapm(s); } else { s->neg.odp_seen = TRUE; } /*endif*/ break; } /*endif*/ s->neg.rx_negotiation_step = 1; s->neg.rxbits = 0; s->neg.rxstream = ~1; } else { s->neg.rx_negotiation_step = 0; s->neg.rxbits = 0; s->neg.rxstream = ~0; } /*endif*/ break; case 5: /* Parked */ break; } /*endswitch*/ } /*- End of function --------------------------------------------------------*/ static int v42_support_negotiation_tx_bit(v42_state_t *s) { int bit; if (s->calling_party) { if (s->neg.txbits <= 0) { s->neg.txstream = 0x3FE22; s->neg.txbits = 36; } else if (s->neg.txbits == 18) { s->neg.txstream = 0x3FF22; } /*endif*/ bit = s->neg.txstream & 1; s->neg.txstream >>= 1; s->neg.txbits--; } else { if (s->neg.odp_seen && s->neg.txadps < 10) { if (s->neg.txbits <= 0) { if (++s->neg.txadps >= 10) { t400_stop(s); s->lapm.state = LAPM_IDLE; report_rx_status_change(s, s->lapm.state); s->neg.txstream = 1; restart_lapm(s); } else { s->neg.txstream = 0x3FE8A; s->neg.txbits = 36; } /*endif*/ } else if (s->neg.txbits == 18) { s->neg.txstream = 0x3FE86; } /*endif*/ bit = s->neg.txstream & 1; s->neg.txstream >>= 1; s->neg.txbits--; } else { bit = 1; } /*endif*/ } /*endif*/ return bit; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v42_rx_bit(void *user_data, int bit) { v42_state_t *s; s = (v42_state_t *) user_data; if (s->lapm.state == LAPM_DETECT) negotiation_rx_bit(s, bit); else hdlc_rx_put_bit(&s->lapm.hdlc_rx, bit); /*endif*/ } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v42_tx_bit(void *user_data) { v42_state_t *s; int bit; s = (v42_state_t *) user_data; if (s->bit_timer && (--s->bit_timer) <= 0) { s->bit_timer = 0; s->bit_timer_func(s); } if (s->lapm.state == LAPM_DETECT) bit = v42_support_negotiation_tx_bit(s); else bit = hdlc_tx_get_bit(&s->lapm.hdlc_tx); /*endif*/ return bit; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v42_set_local_busy_status(v42_state_t *s, int busy) { int previous_busy; previous_busy = s->lapm.local_busy; s->lapm.local_busy = busy; return previous_busy; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v42_get_far_busy_status(v42_state_t *s) { return s->lapm.far_busy; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v42_set_status_callback(v42_state_t *s, modem_status_func_t status_handler, void *user_data) { s->lapm.status_handler = status_handler; s->lapm.status_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v42_restart(v42_state_t *s) { hdlc_tx_init(&s->lapm.hdlc_tx, FALSE, 1, TRUE, lapm_hdlc_underflow, s); hdlc_rx_init(&s->lapm.hdlc_rx, FALSE, FALSE, 1, lapm_receive, s); if (s->detect) { /* We need to do the V.42 support detection sequence */ s->neg.txstream = ~0; s->neg.txbits = 0; s->neg.rxstream = ~0; s->neg.rxbits = 0; s->neg.rxoks = 0; s->neg.txadps = 0; s->neg.rx_negotiation_step = 0; s->neg.odp_seen = FALSE; t400_start(s); s->lapm.state = LAPM_DETECT; } else { /* Go directly to LAP.M mode */ s->lapm.state = LAPM_IDLE; restart_lapm(s); } /*endif*/ } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(v42_state_t *) v42_init(v42_state_t *ss, int calling_party, int detect, get_msg_func_t iframe_get, put_msg_func_t iframe_put, void *user_data) { lapm_state_t *s; if (ss == NULL) { if ((ss = (v42_state_t *) malloc(sizeof(*ss))) == NULL) return NULL; } memset(ss, 0, sizeof(*ss)); s = &ss->lapm; ss->calling_party = calling_party; ss->detect = detect; s->iframe_get = iframe_get; s->iframe_get_user_data = user_data; s->iframe_put = iframe_put; s->iframe_put_user_data = user_data; s->state = (ss->detect) ? LAPM_DETECT : LAPM_IDLE; s->local_busy = FALSE; s->far_busy = FALSE; /* The address octet is: Data link connection identifier (0) Command/response (0 if answerer, 1 if originator) Extended address (1) */ s->cmd_addr = (LAPM_DLCI_DTE_TO_DTE << 2) | ((ss->calling_party) ? 0x02 : 0x00) | 0x01; s->rsp_addr = (LAPM_DLCI_DTE_TO_DTE << 2) | ((ss->calling_party) ? 0x00 : 0x02) | 0x01; /* Set default values for the LAP.M parameters. These can be modified later. */ ss->config.v42_tx_window_size_k = V42_DEFAULT_WINDOW_SIZE_K; ss->config.v42_rx_window_size_k = V42_DEFAULT_WINDOW_SIZE_K; ss->config.v42_tx_n401 = V42_DEFAULT_N_401; ss->config.v42_rx_n401 = V42_DEFAULT_N_401; /* TODO: This should be part of the V.42bis startup */ ss->config.comp = 1; ss->config.comp_dict_size = 512; ss->config.comp_max_string = 6; ss->tx_bit_rate = 28800; reset_lapm(ss); span_log_init(&ss->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&ss->logging, "V.42"); return ss; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v42_release(v42_state_t *s) { reset_lapm(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v42_free(v42_state_t *s) { v42_release(s); free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/fax_modems.c0000664000175000017500000003401112343632654013174 00000000000000/* * SpanDSP - a series of DSP components for telephony * * fax_modems.c - the analogue modem set for fax processing * * Written by Steve Underwood * * Copyright (C) 2003, 2005, 2006, 2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include #if defined(LOG_FAX_AUDIO) #include #endif #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/bit_operations.h" #include "spandsp/dc_restore.h" #include "spandsp/queue.h" #include "spandsp/power_meter.h" #include "spandsp/complex.h" #include "spandsp/tone_detect.h" #include "spandsp/tone_generate.h" #include "spandsp/async.h" #include "spandsp/crc.h" #include "spandsp/hdlc.h" #include "spandsp/silence_gen.h" #include "spandsp/fsk.h" #include "spandsp/v29tx.h" #include "spandsp/v29rx.h" #include "spandsp/v27ter_tx.h" #include "spandsp/v27ter_rx.h" #include "spandsp/v17tx.h" #include "spandsp/v17rx.h" #include "spandsp/super_tone_rx.h" #include "spandsp/modem_connect_tones.h" #include "spandsp/fax_modems.h" #include "spandsp/private/logging.h" #include "spandsp/private/silence_gen.h" #include "spandsp/private/fsk.h" #include "spandsp/private/v17tx.h" #include "spandsp/private/v17rx.h" #include "spandsp/private/v27ter_tx.h" #include "spandsp/private/v27ter_rx.h" #include "spandsp/private/v29tx.h" #include "spandsp/private/v29rx.h" #include "spandsp/private/modem_connect_tones.h" #include "spandsp/private/hdlc.h" #include "spandsp/private/fax_modems.h" #define HDLC_FRAMING_OK_THRESHOLD 5 SPAN_DECLARE(const char *) fax_modem_to_str(int modem) { switch (modem) { case FAX_MODEM_NONE: return "None"; case FAX_MODEM_FLUSH: return "Flush"; case FAX_MODEM_SILENCE_TX: return "Silence Tx"; case FAX_MODEM_SILENCE_RX: return "Silence Rx"; case FAX_MODEM_V21_TX: return "V.21 Tx"; case FAX_MODEM_V17_TX: return "V.17 Tx"; case FAX_MODEM_V27TER_TX: return "V.27ter Tx"; case FAX_MODEM_V29_TX: return "V.29 Tx"; case FAX_MODEM_V21_RX: return "V.21 Rx"; case FAX_MODEM_V17_RX: return "V.17 Rx"; case FAX_MODEM_V27TER_RX: return "V.27ter Rx"; case FAX_MODEM_V29_RX: return "V.29 Rx"; #if defined(SPANDSP_SUPPORT_V34) case FAX_MODEM_V34_TX: return "V.34 HDX Tx"; case FAX_MODEM_V34_RX: return "V.34 HDX Rx"; #endif } /*endswitch*/ return "???"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(void) fax_modems_hdlc_tx_frame(void *user_data, const uint8_t *msg, int len) { fax_modems_state_t *s; s = (fax_modems_state_t *) user_data; if (len == -1) hdlc_tx_restart(&s->hdlc_tx); else hdlc_tx_frame(&s->hdlc_tx, msg, len); } /*- End of function --------------------------------------------------------*/ static void fax_modems_set_rx_handler(fax_modems_state_t *s, span_rx_handler_t rx_handler, void *rx_user_data, span_rx_fillin_handler_t fillin_handler, void *rx_fillin_user_data) { s->rx_handler = rx_handler; s->rx_user_data = rx_user_data; s->rx_fillin_handler = fillin_handler; //s->rx_fillin_user_data = rx_fillin_user_data; } /*- End of function --------------------------------------------------------*/ static void v17_rx_status_handler(void *user_data, int status) { fax_modems_state_t *s; s = (fax_modems_state_t *) user_data; switch (status) { case SIG_STATUS_TRAINING_SUCCEEDED: span_log(&s->logging, SPAN_LOG_FLOW, "Switching from V.17 + V.21 to V.17 (%.2fdBm0)\n", v17_rx_signal_power(&s->fast_modems.v17_rx)); fax_modems_set_rx_handler(s, (span_rx_handler_t *) &v17_rx, &s->fast_modems.v17_rx, (span_rx_fillin_handler_t *) &v17_rx_fillin, &s->fast_modems.v17_rx); break; } /*endswitch*/ } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) fax_modems_v17_v21_rx(void *user_data, const int16_t amp[], int len) { fax_modems_state_t *s; s = (fax_modems_state_t *) user_data; v17_rx(&s->fast_modems.v17_rx, amp, len); fsk_rx(&s->v21_rx, amp, len); if (s->rx_frame_received) { /* We have received something, and the fast modem has not trained. We must be receiving valid V.21 */ span_log(&s->logging, SPAN_LOG_FLOW, "Switching from V.17 + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx)); fax_modems_set_rx_handler(s, (span_rx_handler_t *) &fsk_rx, &s->v21_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &s->v21_rx); } /*endif*/ return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) fax_modems_v17_v21_rx_fillin(void *user_data, int len) { fax_modems_state_t *s; s = (fax_modems_state_t *) user_data; v17_rx_fillin(&s->fast_modems.v17_rx, len); fsk_rx_fillin(&s->v21_rx, len); return 0; } /*- End of function --------------------------------------------------------*/ static void v27ter_rx_status_handler(void *user_data, int status) { fax_modems_state_t *s; s = (fax_modems_state_t *) user_data; switch (status) { case SIG_STATUS_TRAINING_SUCCEEDED: span_log(&s->logging, SPAN_LOG_FLOW, "Switching from V.27ter + V.21 to V.27ter (%.2fdBm0)\n", v27ter_rx_signal_power(&s->fast_modems.v27ter_rx)); fax_modems_set_rx_handler(s, (span_rx_handler_t *) &v27ter_rx, &s->fast_modems.v27ter_rx, (span_rx_fillin_handler_t *) &v27ter_rx_fillin, &s->fast_modems.v27ter_rx); break; } /*endswitch*/ } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) fax_modems_v27ter_v21_rx(void *user_data, const int16_t amp[], int len) { fax_modems_state_t *s; s = (fax_modems_state_t *) user_data; v27ter_rx(&s->fast_modems.v27ter_rx, amp, len); fsk_rx(&s->v21_rx, amp, len); if (s->rx_frame_received) { /* We have received something, and the fast modem has not trained. We must be receiving valid V.21 */ span_log(&s->logging, SPAN_LOG_FLOW, "Switching from V.27ter + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx)); fax_modems_set_rx_handler(s, (span_rx_handler_t *) &fsk_rx, &s->v21_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &s->v21_rx); } /*endif*/ return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) fax_modems_v27ter_v21_rx_fillin(void *user_data, int len) { fax_modems_state_t *s; s = (fax_modems_state_t *) user_data; v27ter_rx_fillin(&s->fast_modems.v27ter_rx, len); fsk_rx_fillin(&s->v21_rx, len); return 0; } /*- End of function --------------------------------------------------------*/ static void v29_rx_status_handler(void *user_data, int status) { fax_modems_state_t *s; s = (fax_modems_state_t *) user_data; switch (status) { case SIG_STATUS_TRAINING_SUCCEEDED: span_log(&s->logging, SPAN_LOG_FLOW, "Switching from V.29 + V.21 to V.29 (%.2fdBm0)\n", v29_rx_signal_power(&s->fast_modems.v29_rx)); fax_modems_set_rx_handler(s, (span_rx_handler_t *) &v29_rx, &s->fast_modems.v29_rx, (span_rx_fillin_handler_t *) &v29_rx_fillin, &s->fast_modems.v29_rx); break; } /*endswitch*/ } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) fax_modems_v29_v21_rx(void *user_data, const int16_t amp[], int len) { fax_modems_state_t *s; s = (fax_modems_state_t *) user_data; v29_rx(&s->fast_modems.v29_rx, amp, len); fsk_rx(&s->v21_rx, amp, len); if (s->rx_frame_received) { /* We have received something, and the fast modem has not trained. We must be receiving valid V.21 */ span_log(&s->logging, SPAN_LOG_FLOW, "Switching from V.29 + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx)); fax_modems_set_rx_handler(s, (span_rx_handler_t *) &fsk_rx, &s->v21_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &s->v21_rx); } /*endif*/ return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) fax_modems_v29_v21_rx_fillin(void *user_data, int len) { fax_modems_state_t *s; s = (fax_modems_state_t *) user_data; v29_rx_fillin(&s->fast_modems.v29_rx, len); fsk_rx_fillin(&s->v21_rx, len); return 0; } /*- End of function --------------------------------------------------------*/ static void v21_rx_status_handler(void *user_data, int status) { } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) fax_modems_start_rx_modem(fax_modems_state_t *s, int which) { switch (which) { case FAX_MODEM_V17_RX: v17_rx_set_modem_status_handler(&s->fast_modems.v17_rx, v17_rx_status_handler, s); break; case FAX_MODEM_V27TER_RX: v27ter_rx_set_modem_status_handler(&s->fast_modems.v27ter_rx, v27ter_rx_status_handler, s); break; case FAX_MODEM_V29_RX: v29_rx_set_modem_status_handler(&s->fast_modems.v29_rx, v29_rx_status_handler, s); break; } /*endswitch*/ fsk_rx_set_modem_status_handler(&s->v21_rx, v21_rx_status_handler, s); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) fax_modems_set_tep_mode(fax_modems_state_t *s, int use_tep) { s->use_tep = use_tep; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) fax_modems_get_logging_state(fax_modems_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) fax_modems_restart(fax_modems_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(fax_modems_state_t *) fax_modems_init(fax_modems_state_t *s, int use_tep, hdlc_frame_handler_t hdlc_accept, hdlc_underflow_handler_t hdlc_tx_underflow, put_bit_func_t non_ecm_put_bit, get_bit_func_t non_ecm_get_bit, tone_report_func_t tone_callback, void *user_data) { if (s == NULL) { if ((s = (fax_modems_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } /*endif*/ memset(s, 0, sizeof(*s)); s->use_tep = use_tep; modem_connect_tones_tx_init(&s->connect_tx, MODEM_CONNECT_TONES_FAX_CNG); if (tone_callback) { modem_connect_tones_rx_init(&s->connect_rx, MODEM_CONNECT_TONES_FAX_CNG, tone_callback, user_data); } /*endif*/ span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "FAX modems"); dc_restore_init(&s->dc_restore); hdlc_rx_init(&s->hdlc_rx, FALSE, FALSE, HDLC_FRAMING_OK_THRESHOLD, hdlc_accept, user_data); hdlc_tx_init(&s->hdlc_tx, FALSE, 2, FALSE, hdlc_tx_underflow, user_data); fsk_rx_init(&s->v21_rx, &preset_fsk_specs[FSK_V21CH2], FSK_FRAME_MODE_SYNC, (put_bit_func_t) hdlc_rx_put_bit, &s->hdlc_rx); fsk_rx_signal_cutoff(&s->v21_rx, -39.09f); fsk_tx_init(&s->v21_tx, &preset_fsk_specs[FSK_V21CH2], (get_bit_func_t) hdlc_tx_get_bit, &s->hdlc_tx); v17_rx_init(&s->fast_modems.v17_rx, 14400, non_ecm_put_bit, user_data); v17_tx_init(&s->fast_modems.v17_tx, 14400, s->use_tep, non_ecm_get_bit, user_data); v29_rx_init(&s->fast_modems.v29_rx, 9600, non_ecm_put_bit, user_data); v29_rx_signal_cutoff(&s->fast_modems.v29_rx, -45.5f); v29_tx_init(&s->fast_modems.v29_tx, 9600, s->use_tep, non_ecm_get_bit, user_data); v27ter_rx_init(&s->fast_modems.v27ter_rx, 4800, non_ecm_put_bit, user_data); v27ter_tx_init(&s->fast_modems.v27ter_tx, 4800, s->use_tep, non_ecm_get_bit, user_data); silence_gen_init(&s->silence_gen, 0); s->rx_signal_present = FALSE; s->rx_handler = (span_rx_handler_t *) &span_dummy_rx; s->rx_fillin_handler = (span_rx_fillin_handler_t *) &span_dummy_rx; s->rx_user_data = NULL; s->tx_handler = (span_tx_handler_t *) &silence_gen; s->tx_user_data = &s->silence_gen; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) fax_modems_release(fax_modems_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) fax_modems_free(fax_modems_state_t *s) { if (s) free(s); /*endif*/ return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/t31.c0000664000175000017500000031541312101165364011460 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t31.c - A T.31 compatible class 1 FAX modem interface. * * Written by Steve Underwood * * Special thanks to Lee Howard * for his great work debugging and polishing this code. * * Copyright (C) 2004, 2005, 2006, 2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/bit_operations.h" #include "spandsp/bitstream.h" #include "spandsp/dc_restore.h" #include "spandsp/queue.h" #include "spandsp/power_meter.h" #include "spandsp/complex.h" #include "spandsp/tone_detect.h" #include "spandsp/tone_generate.h" #include "spandsp/async.h" #include "spandsp/crc.h" #include "spandsp/hdlc.h" #include "spandsp/silence_gen.h" #include "spandsp/super_tone_rx.h" #include "spandsp/fsk.h" #include "spandsp/modem_connect_tones.h" #include "spandsp/v8.h" #include "spandsp/v29tx.h" #include "spandsp/v29rx.h" #include "spandsp/v27ter_tx.h" #include "spandsp/v27ter_rx.h" #include "spandsp/v17tx.h" #include "spandsp/v17rx.h" #if defined(SPANDSP_SUPPORT_V34) #include "spandsp/v34.h" #endif #include "spandsp/timezone.h" #include "spandsp/t4_rx.h" #include "spandsp/t4_tx.h" #include "spandsp/t30.h" #include "spandsp/t30_logging.h" #include "spandsp/t38_core.h" #include "spandsp/at_interpreter.h" #include "spandsp/fax_modems.h" #include "spandsp/t31.h" #include "spandsp/t30_fcf.h" #include "spandsp/private/logging.h" #include "spandsp/private/bitstream.h" #include "spandsp/private/t38_core.h" #include "spandsp/private/silence_gen.h" #include "spandsp/private/fsk.h" #include "spandsp/private/modem_connect_tones.h" #include "spandsp/private/v8.h" #if defined(SPANDSP_SUPPORT_V34) #include "spandsp/private/v34.h" #endif #include "spandsp/private/v17tx.h" #include "spandsp/private/v17rx.h" #include "spandsp/private/v27ter_tx.h" #include "spandsp/private/v27ter_rx.h" #include "spandsp/private/v29tx.h" #include "spandsp/private/v29rx.h" #include "spandsp/private/hdlc.h" #include "spandsp/private/fax_modems.h" #include "spandsp/private/at_interpreter.h" #include "spandsp/private/t31.h" /* Settings suitable for paced transmission over a UDP transport */ /*! The default number of milliseconds per transmitted IFP when sending bulk T.38 data */ #define MS_PER_TX_CHUNK 30 /*! The number of transmissions of indicator IFP packets */ #define INDICATOR_TX_COUNT 3 /*! The number of transmissions of data IFP packets */ #define DATA_TX_COUNT 1 /*! The number of transmissions of terminating data IFP packets */ #define DATA_END_TX_COUNT 3 /*! The default DTE timeout, in seconds */ #define DEFAULT_DTE_TIMEOUT 5 /* Settings suitable for unpaced transmission over a TCP transport */ #define MAX_OCTETS_PER_UNPACED_CHUNK 300 /* Backstop timeout if reception of packets stops in the middle of a burst */ #define MID_RX_TIMEOUT 15000 #define HDLC_FRAMING_OK_THRESHOLD 5 typedef const char *(*at_cmd_service_t)(t31_state_t *s, const char *cmd); enum { ETX = 0x03, DLE = 0x10, SUB = 0x1A }; enum { DISBIT1 = 0x01, DISBIT2 = 0x02, DISBIT3 = 0x04, DISBIT4 = 0x08, DISBIT5 = 0x10, DISBIT6 = 0x20, DISBIT7 = 0x40, DISBIT8 = 0x80 }; enum { T38_CHUNKING_MERGE_FCS_WITH_DATA = 0x0001, T38_CHUNKING_WHOLE_FRAMES = 0x0002, T38_CHUNKING_ALLOW_TEP_TIME = 0x0004 }; enum { T38_TIMED_STEP_NONE = 0, T38_TIMED_STEP_NON_ECM_MODEM = 0x10, T38_TIMED_STEP_NON_ECM_MODEM_2 = 0x11, T38_TIMED_STEP_NON_ECM_MODEM_3 = 0x12, T38_TIMED_STEP_NON_ECM_MODEM_4 = 0x13, T38_TIMED_STEP_NON_ECM_MODEM_5 = 0x14, T38_TIMED_STEP_HDLC_MODEM = 0x20, T38_TIMED_STEP_HDLC_MODEM_2 = 0x21, T38_TIMED_STEP_HDLC_MODEM_3 = 0x22, T38_TIMED_STEP_HDLC_MODEM_4 = 0x23, T38_TIMED_STEP_HDLC_MODEM_5 = 0x24, T38_TIMED_STEP_FAKE_HDLC_MODEM = 0x30, T38_TIMED_STEP_FAKE_HDLC_MODEM_2 = 0x31, T38_TIMED_STEP_FAKE_HDLC_MODEM_3 = 0x32, T38_TIMED_STEP_FAKE_HDLC_MODEM_4 = 0x33, T38_TIMED_STEP_FAKE_HDLC_MODEM_5 = 0x34, T38_TIMED_STEP_CED = 0x40, T38_TIMED_STEP_CED_2 = 0x41, T38_TIMED_STEP_CED_3 = 0x42, T38_TIMED_STEP_CNG = 0x50, T38_TIMED_STEP_CNG_2 = 0x51, T38_TIMED_STEP_PAUSE = 0x60 }; static int restart_modem(t31_state_t *s, int new_modem); static void hdlc_accept_frame(void *user_data, const uint8_t *msg, int len, int ok); static void set_rx_handler(t31_state_t *s, span_rx_handler_t *rx_handler, span_rx_fillin_handler_t *fillin_handler, void *user_data); static void set_tx_handler(t31_state_t *s, span_tx_handler_t *handler, void *user_data); static void set_next_tx_handler(t31_state_t *s, span_tx_handler_t *handler, void *user_data); static int v17_v21_rx(void *user_data, const int16_t amp[], int len); static int v17_v21_rx_fillin(void *user_data, int len); static int v27ter_v21_rx(void *user_data, const int16_t amp[], int len); static int v27ter_v21_rx_fillin(void *user_data, int len); static int v29_v21_rx(void *user_data, const int16_t amp[], int len); static int v29_v21_rx_fillin(void *user_data, int len); static int silence_rx(void *user_data, const int16_t amp[], int len); static int cng_rx(void *user_data, const int16_t amp[], int len); static void non_ecm_put_bit(void *user_data, int bit); static void non_ecm_put_chunk(void *user_data, const uint8_t buf[], int len); static int non_ecm_get_chunk(void *user_data, uint8_t buf[], int len); static void non_ecm_rx_status(void *user_data, int status); static void hdlc_rx_status(void *user_data, int status); static __inline__ void t31_set_at_rx_mode(t31_state_t *s, int new_mode) { s->at_state.at_rx_mode = new_mode; } /*- End of function --------------------------------------------------------*/ #if 0 static void monitor_control_messages(t31_state_t *s, const uint8_t *buf, int len) { /* Monitor the control messages, at the point where we have the whole message, so we can see what is happening to things like training success/failure. */ span_log(&s->logging, SPAN_LOG_FLOW, "Monitoring %s\n", t30_frametype(buf[2])); if (len < 3) return; /*endif*/ switch (buf[2]) { case T30_DCS: case T30_DCS | 1: /* We need to know if ECM is about to be used, so we can fake HDLC stuff. */ s->t38_fe.ecm_mode = (len >= 7) && (buf[6] & DISBIT3); break; default: break; } /*endswitch*/ } /*- End of function --------------------------------------------------------*/ #endif static void front_end_status(t31_state_t *s, int status) { span_log(&s->logging, SPAN_LOG_FLOW, "Front end status %d\n", status); switch (status) { case T30_FRONT_END_SEND_STEP_COMPLETE: switch (s->modem) { case FAX_MODEM_SILENCE_TX: s->modem = FAX_MODEM_NONE; at_put_response_code(&s->at_state, AT_RESPONSE_CODE_OK); if (s->at_state.do_hangup) { at_modem_control(&s->at_state, AT_MODEM_CONTROL_HANGUP, NULL); t31_set_at_rx_mode(s, AT_MODE_ONHOOK_COMMAND); s->at_state.do_hangup = FALSE; } else { t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND); } break; case FAX_MODEM_CED_TONE: /* Go directly to V.21/HDLC transmit. */ s->modem = FAX_MODEM_NONE; restart_modem(s, FAX_MODEM_V21_TX); t31_set_at_rx_mode(s, AT_MODE_HDLC); break; case FAX_MODEM_V21_TX: case FAX_MODEM_V17_TX: case FAX_MODEM_V27TER_TX: case FAX_MODEM_V29_TX: s->modem = FAX_MODEM_NONE; at_put_response_code(&s->at_state, AT_RESPONSE_CODE_OK); t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND); restart_modem(s, FAX_MODEM_SILENCE_TX); break; } break; case T30_FRONT_END_RECEIVE_COMPLETE: break; } } /*- End of function --------------------------------------------------------*/ static int extra_bits_in_stuffed_frame(const uint8_t buf[], int len) { int bitstream; int ones; int stuffed; int i; int j; bitstream = 0; ones = 0; stuffed = 0; /* We should really append the CRC, and include the stuffed bits for that, to get the exact number of bits in the frame. */ //len = crc_itu16_append(buf, len); for (i = 0; i < len; i++) { bitstream = buf[i]; for (j = 0; j < 8; j++) { if ((bitstream & 1)) { if (++ones >= 5) { ones = 0; stuffed++; } } else { ones = 0; } bitstream >>= 1; } } /* The total length of the frame is: the number of bits in the body + the number of additional bits in the body due to stuffing + the number of bits in the CRC + the number of additional bits in the CRC due to stuffing + 16 bits for the two terminating flag octets. Lets just allow 3 bits for the CRC, which is the worst case. It avoids calculating the real CRC, and the worst it can do is cause a flag octet's worth of additional output. */ return stuffed + 16 + 3 + 16; } /*- End of function --------------------------------------------------------*/ static int process_rx_missing(t38_core_state_t *t, void *user_data, int rx_seq_no, int expected_seq_no) { t31_state_t *s; s = (t31_state_t *) user_data; s->t38_fe.rx_data_missing = TRUE; return 0; } /*- End of function --------------------------------------------------------*/ static int process_rx_indicator(t38_core_state_t *t, void *user_data, int indicator) { t31_state_t *s; t31_t38_front_end_state_t *fe; s = (t31_state_t *) user_data; fe = &s->t38_fe; if (t->current_rx_indicator == indicator) { /* This is probably due to the far end repeating itself, or slipping preamble messages in between HDLC frames. T.38/V.1.3 tells us to ignore it. Its harmless. */ return 0; } /* In termination mode we don't care very much about indicators telling us training is starting. We only care about V.21 preamble starting, for timeout control, and the actual data. */ switch (indicator) { case T38_IND_NO_SIGNAL: if (t->current_rx_indicator == T38_IND_V21_PREAMBLE && (fe->current_rx_type == T30_MODEM_V21 || fe->current_rx_type == T30_MODEM_CNG)) { hdlc_rx_status(s, SIG_STATUS_CARRIER_DOWN); } fe->timeout_rx_samples = 0; front_end_status(s, T30_FRONT_END_SIGNAL_ABSENT); break; case T38_IND_CNG: front_end_status(s, T30_FRONT_END_CNG_PRESENT); break; case T38_IND_CED: front_end_status(s, T30_FRONT_END_CED_PRESENT); break; case T38_IND_V21_PREAMBLE: /* Some T.38 implementations insert these preamble indicators between HDLC frames, so we need to be tolerant of that. */ fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT); front_end_status(s, T30_FRONT_END_SIGNAL_PRESENT); break; case T38_IND_V27TER_2400_TRAINING: case T38_IND_V27TER_4800_TRAINING: case T38_IND_V29_7200_TRAINING: case T38_IND_V29_9600_TRAINING: case T38_IND_V17_7200_SHORT_TRAINING: case T38_IND_V17_7200_LONG_TRAINING: case T38_IND_V17_9600_SHORT_TRAINING: case T38_IND_V17_9600_LONG_TRAINING: case T38_IND_V17_12000_SHORT_TRAINING: case T38_IND_V17_12000_LONG_TRAINING: case T38_IND_V17_14400_SHORT_TRAINING: case T38_IND_V17_14400_LONG_TRAINING: case T38_IND_V33_12000_TRAINING: case T38_IND_V33_14400_TRAINING: /* We really don't care what kind of modem is delivering the following image data. We only care that some kind of fast modem signal is coming next. */ fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT); front_end_status(s, T30_FRONT_END_SIGNAL_PRESENT); break; case T38_IND_V8_ANSAM: case T38_IND_V8_SIGNAL: case T38_IND_V34_CNTL_CHANNEL_1200: case T38_IND_V34_PRI_CHANNEL: case T38_IND_V34_CC_RETRAIN: /* V.34 support is a work in progress. */ front_end_status(s, T30_FRONT_END_SIGNAL_PRESENT); break; default: front_end_status(s, T30_FRONT_END_SIGNAL_ABSENT); break; } fe->hdlc_rx.len = 0; fe->rx_data_missing = FALSE; return 0; } /*- End of function --------------------------------------------------------*/ static void process_hdlc_data(t31_t38_front_end_state_t *fe, const uint8_t *buf, int len) { if (fe->hdlc_rx.len + len <= T31_T38_MAX_HDLC_LEN) { bit_reverse(fe->hdlc_rx.buf + fe->hdlc_rx.len, buf, len); fe->hdlc_rx.len += len; } else { fe->rx_data_missing = TRUE; } /*endif*/ } /*- End of function --------------------------------------------------------*/ static int process_rx_data(t38_core_state_t *t, void *user_data, int data_type, int field_type, const uint8_t *buf, int len) { t31_state_t *s; t31_t38_front_end_state_t *fe; #if defined(_MSC_VER) uint8_t *buf2 = (uint8_t *) _alloca(len); #else uint8_t buf2[len]; #endif s = (t31_state_t *) user_data; fe = &s->t38_fe; #if 0 /* In termination mode we don't care very much what the data type is. */ switch (data_type) { case T38_DATA_V21: case T38_DATA_V27TER_2400: case T38_DATA_V27TER_4800: case T38_DATA_V29_7200: case T38_DATA_V29_9600: case T38_DATA_V17_7200: case T38_DATA_V17_9600: case T38_DATA_V17_12000: case T38_DATA_V17_14400: case T38_DATA_V8: case T38_DATA_V34_PRI_RATE: case T38_DATA_V34_CC_1200: case T38_DATA_V34_PRI_CH: case T38_DATA_V33_12000: case T38_DATA_V33_14400: default: break; } #endif switch (field_type) { case T38_FIELD_HDLC_DATA: if (fe->timeout_rx_samples == 0) { /* HDLC can just start without any signal indicator on some platforms, even when there is zero packet lost. Nasty, but true. Its a good idea to be tolerant of loss, though, so accepting a sudden start of HDLC data is the right thing to do. */ fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT); front_end_status(s, T30_FRONT_END_SIGNAL_PRESENT); /* All real HDLC messages in the FAX world start with 0xFF. If this one is not starting with 0xFF it would appear some octets must have been missed before this one. */ if (len <= 0 || buf[0] != 0xFF) fe->rx_data_missing = TRUE; /*endif*/ } /*endif*/ if (len > 0) { process_hdlc_data(fe, buf, len); } /*endif*/ fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT); break; case T38_FIELD_HDLC_FCS_OK: if (len > 0) { span_log(&s->logging, SPAN_LOG_WARNING, "There is data in a T38_FIELD_HDLC_FCS_OK!\n"); /* The sender has incorrectly included data in this message. Cisco implemented inserting HDLC data here and Commetrex followed for compatibility reasons. We should, too. */ process_hdlc_data(fe, buf, len); } /*endif*/ /* Some T.38 implementations send multiple T38_FIELD_HDLC_FCS_OK messages, in IFP packets with incrementing sequence numbers, which are actually repeats. They get through to this point because of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */ if (fe->hdlc_rx.len > 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Type %s - CRC OK (%s)\n", (fe->hdlc_rx.len >= 3) ? t30_frametype(fe->hdlc_rx.buf[2]) : "???", (fe->rx_data_missing) ? "missing octets" : "clean"); crc_itu16_append(fe->hdlc_rx.buf, fe->hdlc_rx.len); hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, !fe->rx_data_missing); fe->hdlc_rx.len = 0; } /*endif*/ fe->rx_data_missing = FALSE; fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT); break; case T38_FIELD_HDLC_FCS_BAD: if (len > 0) { span_log(&s->logging, SPAN_LOG_WARNING, "There is data in a T38_FIELD_HDLC_FCS_BAD!\n"); /* The sender has incorrectly included data in this message. Cisco implemented inserting HDLC data here and Commetrex followed for compatibility reasons. We should, too. */ process_hdlc_data(fe, buf, len); } /*endif*/ /* Some T.38 implementations send multiple T38_FIELD_HDLC_FCS_BAD messages, in IFP packets with incrementing sequence numbers, which are actually repeats. They get through to this point because of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */ if (fe->hdlc_rx.len > 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Type %s - CRC bad (%s)\n", (fe->hdlc_rx.len >= 3) ? t30_frametype(fe->hdlc_rx.buf[2]) : "???", (fe->rx_data_missing) ? "missing octets" : "clean"); hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, FALSE); fe->hdlc_rx.len = 0; } /*endif*/ fe->rx_data_missing = FALSE; fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT); break; case T38_FIELD_HDLC_FCS_OK_SIG_END: if (len > 0) { span_log(&s->logging, SPAN_LOG_WARNING, "There is data in a T38_FIELD_HDLC_FCS_OK_SIG_END!\n"); /* The sender has incorrectly included data in this message. Cisco implemented inserting HDLC data here and Commetrex followed for compatibility reasons. We should, too. */ process_hdlc_data(fe, buf, len); } /* Some T.38 implementations send multiple T38_FIELD_HDLC_FCS_OK_SIG_END messages, in IFP packets with incrementing sequence numbers, which are actually repeats. They get through to this point because of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */ if (fe->hdlc_rx.len > 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Type %s - CRC OK, sig end (%s)\n", (fe->hdlc_rx.len >= 3) ? t30_frametype(fe->hdlc_rx.buf[2]) : "???", (fe->rx_data_missing) ? "missing octets" : "clean"); crc_itu16_append(fe->hdlc_rx.buf, fe->hdlc_rx.len); hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, !fe->rx_data_missing); fe->hdlc_rx.len = 0; } fe->rx_data_missing = FALSE; if (t->current_rx_data_type != data_type || t->current_rx_field_type != field_type) hdlc_rx_status(s, SIG_STATUS_CARRIER_DOWN); fe->timeout_rx_samples = 0; break; case T38_FIELD_HDLC_FCS_BAD_SIG_END: if (len > 0) { span_log(&s->logging, SPAN_LOG_WARNING, "There is data in a T38_FIELD_HDLC_FCS_BAD_SIG_END!\n"); /* The sender has incorrectly included data in this message. Cisco implemented inserting HDLC data here and Commetrex followed for compatibility reasons. We should, too. */ process_hdlc_data(fe, buf, len); } /* Some T.38 implementations send multiple T38_FIELD_HDLC_FCS_BAD_SIG_END messages, in IFP packets with incrementing sequence numbers, which are actually repeats. They get through to this point because of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */ if (fe->hdlc_rx.len > 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Type %s - CRC bad, sig end (%s)\n", (fe->hdlc_rx.len >= 3) ? t30_frametype(fe->hdlc_rx.buf[2]) : "???", (fe->rx_data_missing) ? "missing octets" : "clean"); hdlc_accept_frame(s, fe->hdlc_rx.buf, fe->hdlc_rx.len, FALSE); fe->hdlc_rx.len = 0; } fe->rx_data_missing = FALSE; if (t->current_rx_data_type != data_type || t->current_rx_field_type != field_type) hdlc_rx_status(s, SIG_STATUS_CARRIER_DOWN); fe->timeout_rx_samples = 0; break; case T38_FIELD_HDLC_SIG_END: if (len > 0) { span_log(&s->logging, SPAN_LOG_WARNING, "There is data in a T38_FIELD_HDLC_SIG_END!\n"); /* The sender has incorrectly included data in this message, but there seems nothing meaningful it could be. There could not be an FCS good/bad report beyond this. */ } /* Some T.38 implementations send multiple T38_FIELD_HDLC_SIG_END messages, in IFP packets with incrementing sequence numbers, which are actually repeats. They get through to this point because of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */ if (t->current_rx_data_type != data_type || t->current_rx_field_type != field_type) { /* WORKAROUND: At least some Mediatrix boxes have a bug, where they can send this message at the end of non-ECM data. We need to tolerate this. We use the generic receive complete indication, rather than the specific HDLC carrier down. */ /* This message is expected under 2 circumstances. One is as an alternative to T38_FIELD_HDLC_FCS_OK_SIG_END - i.e. they send T38_FIELD_HDLC_FCS_OK, and then T38_FIELD_HDLC_SIG_END when the carrier actually drops. The other is because the HDLC signal drops unexpectedly - i.e. not just after a final frame. */ fe->hdlc_rx.len = 0; fe->rx_data_missing = FALSE; fe->timeout_rx_samples = 0; hdlc_rx_status(s, SIG_STATUS_CARRIER_DOWN); } break; case T38_FIELD_T4_NON_ECM_DATA: if (!s->at_state.rx_signal_present) { non_ecm_rx_status(s, SIG_STATUS_TRAINING_SUCCEEDED); s->at_state.rx_signal_present = TRUE; } if (len > 0) { bit_reverse(buf2, buf, len); non_ecm_put_chunk(s, buf, len); } fe->timeout_rx_samples = fe->samples + ms_to_samples(MID_RX_TIMEOUT); break; case T38_FIELD_T4_NON_ECM_SIG_END: /* Some T.38 implementations send multiple T38_FIELD_T4_NON_ECM_SIG_END messages, in IFP packets with incrementing sequence numbers, which are actually repeats. They get through to this point because of the incrementing sequence numbers. We need to filter them here in a context sensitive manner. */ if (t->current_rx_data_type != data_type || t->current_rx_field_type != field_type) { if (len > 0) { if (!s->at_state.rx_signal_present) { non_ecm_rx_status(s, SIG_STATUS_TRAINING_SUCCEEDED); s->at_state.rx_signal_present = TRUE; } bit_reverse(buf2, buf, len); non_ecm_put_chunk(s, buf, len); } /* WORKAROUND: At least some Mediatrix boxes have a bug, where they can send HDLC signal end where they should send non-ECM signal end. It is possible they also do the opposite. We need to tolerate this, so we use the generic receive complete indication, rather than the specific non-ECM carrier down. */ non_ecm_rx_status(s, SIG_STATUS_CARRIER_DOWN); } s->at_state.rx_signal_present = FALSE; fe->timeout_rx_samples = 0; break; case T38_FIELD_CM_MESSAGE: if (len >= 1) span_log(&s->logging, SPAN_LOG_FLOW, "CM profile %d - %s\n", buf[0] - '0', t38_cm_profile_to_str(buf[0])); else span_log(&s->logging, SPAN_LOG_FLOW, "Bad length for CM message - %d\n", len); break; case T38_FIELD_JM_MESSAGE: if (len >= 2) span_log(&s->logging, SPAN_LOG_FLOW, "JM - %s\n", t38_jm_to_str(buf, len)); else span_log(&s->logging, SPAN_LOG_FLOW, "Bad length for JM message - %d\n", len); break; case T38_FIELD_CI_MESSAGE: if (len >= 1) span_log(&s->logging, SPAN_LOG_FLOW, "CI 0x%X\n", buf[0]); else span_log(&s->logging, SPAN_LOG_FLOW, "Bad length for CI message - %d\n", len); break; case T38_FIELD_V34RATE: if (len >= 3) { fe->t38.v34_rate = t38_v34rate_to_bps(buf, len); span_log(&s->logging, SPAN_LOG_FLOW, "V.34 rate %d bps\n", fe->t38.v34_rate); } else { span_log(&s->logging, SPAN_LOG_FLOW, "Bad length for V34rate message - %d\n", len); } break; default: break; } return 0; } /*- End of function --------------------------------------------------------*/ static void send_hdlc(void *user_data, const uint8_t *msg, int len) { t31_state_t *s; s = (t31_state_t *) user_data; if (len <= 0) { s->hdlc_tx.len = -1; } else { s->t38_fe.hdlc_tx.extra_bits = extra_bits_in_stuffed_frame(msg, len); bit_reverse(s->hdlc_tx.buf, msg, len); s->hdlc_tx.len = len; s->hdlc_tx.ptr = 0; } } /*- End of function --------------------------------------------------------*/ static __inline__ int bits_to_us(t31_state_t *s, int bits) { if (s->t38_fe.ms_per_tx_chunk == 0 || s->t38_fe.tx_bit_rate == 0) return 0; return bits*1000000/s->t38_fe.tx_bit_rate; } /*- End of function --------------------------------------------------------*/ static void set_octets_per_data_packet(t31_state_t *s, int bit_rate) { s->t38_fe.tx_bit_rate = bit_rate; if (s->t38_fe.ms_per_tx_chunk) { s->t38_fe.octets_per_data_packet = s->t38_fe.ms_per_tx_chunk*bit_rate/(8*1000); /* Make sure we have a positive number (i.e. we didn't truncate to zero). */ if (s->t38_fe.octets_per_data_packet < 1) s->t38_fe.octets_per_data_packet = 1; } else { s->t38_fe.octets_per_data_packet = MAX_OCTETS_PER_UNPACED_CHUNK; } } /*- End of function --------------------------------------------------------*/ static int stream_non_ecm(t31_state_t *s) { t31_t38_front_end_state_t *fe; uint8_t buf[MAX_OCTETS_PER_UNPACED_CHUNK + 50]; int delay; int len; fe = &s->t38_fe; for (delay = 0; delay == 0; ) { switch (fe->timed_step) { case T38_TIMED_STEP_NON_ECM_MODEM: /* Create a 75ms silence */ if (fe->t38.current_tx_indicator != T38_IND_NO_SIGNAL) delay = t38_core_send_indicator(&fe->t38, T38_IND_NO_SIGNAL); fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_2; fe->next_tx_samples = fe->samples; break; case T38_TIMED_STEP_NON_ECM_MODEM_2: /* Switch on a fast modem, and give the training time to complete */ delay = t38_core_send_indicator(&fe->t38, fe->next_tx_indicator); fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_3; break; case T38_TIMED_STEP_NON_ECM_MODEM_3: /* Send a chunk of non-ECM image data */ /* T.38 says it is OK to send the last of the non-ECM data in the signal end message. However, I think the early versions of T.38 said the signal end message should not contain data. Hopefully, following the current spec will not cause compatibility issues. */ len = non_ecm_get_chunk(s, buf, fe->octets_per_data_packet); if (len > 0) bit_reverse(buf, buf, len); if (len < fe->octets_per_data_packet) { /* That's the end of the image data. */ if (s->t38_fe.ms_per_tx_chunk) { /* Pad the end of the data with some zeros. If we just stop abruptly at the end of the EOLs, some ATAs fail to clean up properly before shutting down their transmit modem, and the last few rows of the image are lost or corrupted. Simply delaying the no-signal message does not help for all implentations. It is usually ignored, which is probably the right thing to do after receiving a message saying the signal has ended. */ memset(buf + len, 0, fe->octets_per_data_packet - len); fe->non_ecm_trailer_bytes = 3*fe->octets_per_data_packet + len; len = fe->octets_per_data_packet; fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_4; } else { /* If we are sending quickly there seems no point in doing any padding */ t38_core_send_data(&fe->t38, fe->current_tx_data_type, T38_FIELD_T4_NON_ECM_SIG_END, buf, len, T38_PACKET_CATEGORY_IMAGE_DATA_END); fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_5; delay = 0; } } t38_core_send_data(&fe->t38, fe->current_tx_data_type, T38_FIELD_T4_NON_ECM_DATA, buf, len, T38_PACKET_CATEGORY_IMAGE_DATA); delay = bits_to_us(s, 8*len); break; case T38_TIMED_STEP_NON_ECM_MODEM_4: /* Send padding */ len = fe->octets_per_data_packet; fe->non_ecm_trailer_bytes -= len; if (fe->non_ecm_trailer_bytes <= 0) { len += fe->non_ecm_trailer_bytes; memset(buf, 0, len); t38_core_send_data(&fe->t38, fe->current_tx_data_type, T38_FIELD_T4_NON_ECM_SIG_END, buf, len, T38_PACKET_CATEGORY_IMAGE_DATA_END); fe->timed_step = T38_TIMED_STEP_NON_ECM_MODEM_5; /* Allow a bit more time than the data will take to play out, to ensure the far ATA does not cut things short. */ delay = bits_to_us(s, 8*len); if (s->t38_fe.ms_per_tx_chunk) delay += 60000; front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE); break; } memset(buf, 0, len); t38_core_send_data(&fe->t38, fe->current_tx_data_type, T38_FIELD_T4_NON_ECM_DATA, buf, len, T38_PACKET_CATEGORY_IMAGE_DATA); delay = bits_to_us(s, 8*len); break; case T38_TIMED_STEP_NON_ECM_MODEM_5: /* This should not be needed, since the message above indicates the end of the signal, but it seems like it can improve compatibility with quirky implementations. */ delay = t38_core_send_indicator(&fe->t38, T38_IND_NO_SIGNAL); fe->timed_step = T38_TIMED_STEP_NONE; return delay; } } return delay; } /*- End of function --------------------------------------------------------*/ static int stream_hdlc(t31_state_t *s) { t31_t38_front_end_state_t *fe; uint8_t buf[MAX_OCTETS_PER_UNPACED_CHUNK + 50]; t38_data_field_t data_fields[2]; int previous; int delay; int i; int category; fe = &s->t38_fe; for (delay = 0; delay == 0; ) { switch (fe->timed_step) { case T38_TIMED_STEP_HDLC_MODEM: /* Create a 75ms silence */ if (fe->t38.current_tx_indicator != T38_IND_NO_SIGNAL) delay = t38_core_send_indicator(&fe->t38, T38_IND_NO_SIGNAL); fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_2; fe->next_tx_samples = fe->samples + ms_to_samples(75); break; case T38_TIMED_STEP_HDLC_MODEM_2: /* Send HDLC preambling */ delay = t38_core_send_indicator(&fe->t38, fe->next_tx_indicator); delay += t38_core_send_flags_delay(&fe->t38, fe->next_tx_indicator); at_put_response_code(&s->at_state, AT_RESPONSE_CODE_CONNECT); fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_3; break; case T38_TIMED_STEP_HDLC_MODEM_3: /* Send a chunk of HDLC data */ if (s->hdlc_tx.len == 0) { /* We don't have a frame ready yet, so wait a little */ delay = MS_PER_TX_CHUNK*1000; break; } i = s->hdlc_tx.len - s->hdlc_tx.ptr; if (fe->octets_per_data_packet >= i) { /* The last part of an HDLC frame */ if (fe->chunking_modes & T38_CHUNKING_MERGE_FCS_WITH_DATA) { /* Copy the data, as we might be about to refill the buffer it is in */ memcpy(buf, &s->hdlc_tx.buf[s->hdlc_tx.ptr], i); data_fields[0].field_type = T38_FIELD_HDLC_DATA; data_fields[0].field = buf; data_fields[0].field_len = i; /* Now see about the next HDLC frame. This will tell us whether to send FCS_OK or FCS_OK_SIG_END */ previous = fe->current_tx_data_type; s->hdlc_tx.ptr = 0; s->hdlc_tx.len = 0; front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE); if (s->hdlc_tx.final) { data_fields[1].field_type = T38_FIELD_HDLC_FCS_OK_SIG_END; data_fields[1].field = NULL; data_fields[1].field_len = 0; category = (s->t38_fe.current_tx_data_type == T38_DATA_V21) ? T38_PACKET_CATEGORY_CONTROL_DATA_END : T38_PACKET_CATEGORY_IMAGE_DATA_END; t38_core_send_data_multi_field(&fe->t38, fe->current_tx_data_type, data_fields, 2, category); fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_5; /* We add a bit of extra time here, as with some implementations the carrier falling too abruptly causes data loss. */ delay = bits_to_us(s, i*8 + fe->hdlc_tx.extra_bits); if (s->t38_fe.ms_per_tx_chunk) delay += 100000; at_put_response_code(&s->at_state, AT_RESPONSE_CODE_OK); t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND); } else { data_fields[1].field_type = T38_FIELD_HDLC_FCS_OK; data_fields[1].field = NULL; data_fields[1].field_len = 0; category = (s->t38_fe.current_tx_data_type == T38_DATA_V21) ? T38_PACKET_CATEGORY_CONTROL_DATA : T38_PACKET_CATEGORY_IMAGE_DATA; t38_core_send_data_multi_field(&fe->t38, fe->current_tx_data_type, data_fields, 2, category); fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_3; delay = bits_to_us(s, i*8 + fe->hdlc_tx.extra_bits); at_put_response_code(&s->at_state, AT_RESPONSE_CODE_CONNECT); } break; } category = (s->t38_fe.current_tx_data_type == T38_DATA_V21) ? T38_PACKET_CATEGORY_CONTROL_DATA : T38_PACKET_CATEGORY_IMAGE_DATA; t38_core_send_data(&fe->t38, fe->current_tx_data_type, T38_FIELD_HDLC_DATA, &s->hdlc_tx.buf[s->hdlc_tx.ptr], i, category); fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_4; } else { i = fe->octets_per_data_packet; category = (s->t38_fe.current_tx_data_type == T38_DATA_V21) ? T38_PACKET_CATEGORY_CONTROL_DATA : T38_PACKET_CATEGORY_IMAGE_DATA; t38_core_send_data(&fe->t38, fe->current_tx_data_type, T38_FIELD_HDLC_DATA, &s->hdlc_tx.buf[s->hdlc_tx.ptr], i, category); s->hdlc_tx.ptr += i; } delay = bits_to_us(s, i*8); break; case T38_TIMED_STEP_HDLC_MODEM_4: /* End of HDLC frame */ previous = fe->current_tx_data_type; s->hdlc_tx.ptr = 0; s->hdlc_tx.len = 0; if (s->hdlc_tx.final) { /* End of transmission */ s->hdlc_tx.len = 0; s->hdlc_tx.final = FALSE; category = (s->t38_fe.current_tx_data_type == T38_DATA_V21) ? T38_PACKET_CATEGORY_CONTROL_DATA : T38_PACKET_CATEGORY_IMAGE_DATA; t38_core_send_data(&fe->t38, previous, T38_FIELD_HDLC_FCS_OK, NULL, 0, category); fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_5; /* We add a bit of extra time here, as with some implementations the carrier falling too abruptly causes data loss. */ delay = bits_to_us(s, fe->hdlc_tx.extra_bits); if (s->t38_fe.ms_per_tx_chunk) delay += 100000; front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE); break; } /* Finish the current frame off, and prepare for the next one. */ category = (s->t38_fe.current_tx_data_type == T38_DATA_V21) ? T38_PACKET_CATEGORY_CONTROL_DATA : T38_PACKET_CATEGORY_IMAGE_DATA; t38_core_send_data(&fe->t38, previous, T38_FIELD_HDLC_FCS_OK, NULL, 0, category); fe->timed_step = T38_TIMED_STEP_HDLC_MODEM_3; at_put_response_code(&s->at_state, AT_RESPONSE_CODE_CONNECT); /* We should now wait enough time for everything to clear through an analogue modem at the far end. */ delay = bits_to_us(s, fe->hdlc_tx.extra_bits); if (s->hdlc_tx.len == 0) span_log(&s->logging, SPAN_LOG_FLOW, "No new frame or end transmission condition.\n"); break; case T38_TIMED_STEP_HDLC_MODEM_5: /* Note that some boxes do not like us sending a T38_FIELD_HDLC_SIG_END at this point. A T38_IND_NO_SIGNAL should always be OK. */ category = (s->t38_fe.current_tx_data_type == T38_DATA_V21) ? T38_PACKET_CATEGORY_CONTROL_DATA_END : T38_PACKET_CATEGORY_IMAGE_DATA_END; t38_core_send_data(&fe->t38, fe->current_tx_data_type, T38_FIELD_HDLC_SIG_END, NULL, 0, category); delay = t38_core_send_indicator(&fe->t38, T38_IND_NO_SIGNAL); fe->timed_step = T38_TIMED_STEP_NONE; at_put_response_code(&s->at_state, AT_RESPONSE_CODE_OK); t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND); return 0; } } return delay; } /*- End of function --------------------------------------------------------*/ static int stream_ced(t31_state_t *s) { t31_t38_front_end_state_t *fe; int delay; fe = &s->t38_fe; for (delay = 0; delay == 0; ) { switch (fe->timed_step) { case T38_TIMED_STEP_CED: /* It seems common practice to start with a no signal indicator, though this is not a specified requirement. Since we should be sending 200ms of silence, starting the delay with a no signal indication makes sense. We do need a 200ms delay, as that is a specification requirement. */ fe->timed_step = T38_TIMED_STEP_CED_2; delay = t38_core_send_indicator(&fe->t38, T38_IND_NO_SIGNAL); delay = 200000; fe->next_tx_samples = fe->samples; break; case T38_TIMED_STEP_CED_2: /* Initial 200ms delay over. Send the CED indicator */ fe->timed_step = T38_TIMED_STEP_CED_3; delay = t38_core_send_indicator(&fe->t38, T38_IND_CED); fe->current_tx_data_type = T38_DATA_NONE; break; case T38_TIMED_STEP_CED_3: /* End of CED */ fe->timed_step = T38_TIMED_STEP_NONE; front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE); return 0; } } return delay; } /*- End of function --------------------------------------------------------*/ static int stream_cng(t31_state_t *s) { t31_t38_front_end_state_t *fe; int delay; fe = &s->t38_fe; for (delay = 0; delay == 0; ) { switch (fe->timed_step) { case T38_TIMED_STEP_CNG: /* It seems common practice to start with a no signal indicator, though this is not a specified requirement of the T.38 spec. Since we should be sending 200ms of silence, according to T.30, starting that delay with a no signal indication makes sense. */ fe->timed_step = T38_TIMED_STEP_CNG_2; delay = t38_core_send_indicator(&fe->t38, T38_IND_NO_SIGNAL); delay = 200000; fe->next_tx_samples = fe->samples; break; case T38_TIMED_STEP_CNG_2: /* Initial short delay over. Send the CNG indicator. CNG persists until something coming the other way interrupts it, or a long timeout controlled by the T.30 engine expires. */ fe->timed_step = T38_TIMED_STEP_NONE; delay = t38_core_send_indicator(&fe->t38, T38_IND_CNG); fe->current_tx_data_type = T38_DATA_NONE; return delay; } } return delay; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t31_t38_send_timeout(t31_state_t *s, int samples) { t31_t38_front_end_state_t *fe; int delay; fe = &s->t38_fe; if (fe->current_rx_type == T30_MODEM_DONE || fe->current_tx_type == T30_MODEM_DONE) return TRUE; fe->samples += samples; if (fe->timeout_rx_samples && fe->samples > fe->timeout_rx_samples) { span_log(&s->logging, SPAN_LOG_FLOW, "Timeout mid-receive\n"); fe->timeout_rx_samples = 0; front_end_status(s, T30_FRONT_END_RECEIVE_COMPLETE); } if (fe->timed_step == T38_TIMED_STEP_NONE) return FALSE; /* Wait until the right time comes along, unless we are working in "no delays" mode, while talking to an IAF terminal. */ if (fe->ms_per_tx_chunk && fe->samples < fe->next_tx_samples) return FALSE; /* Its time to send something */ delay = 0; switch (fe->timed_step & 0xFFF0) { case T38_TIMED_STEP_NON_ECM_MODEM: delay = stream_non_ecm(s); break; case T38_TIMED_STEP_HDLC_MODEM: delay = stream_hdlc(s); break; //case T38_TIMED_STEP_FAKE_HDLC_MODEM: // delay = stream_fake_hdlc(s); // break; case T38_TIMED_STEP_CED: delay = stream_ced(s); break; case T38_TIMED_STEP_CNG: delay = stream_cng(s); break; case T38_TIMED_STEP_PAUSE: /* End of timed pause */ fe->timed_step = T38_TIMED_STEP_NONE; front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE); break; } fe->next_tx_samples += us_to_samples(delay); return FALSE; } /*- End of function --------------------------------------------------------*/ static int t31_modem_control_handler(at_state_t *s, void *user_data, int op, const char *num) { t31_state_t *t; t = (t31_state_t *) user_data; switch (op) { case AT_MODEM_CONTROL_CALL: t->call_samples = 0; break; case AT_MODEM_CONTROL_ANSWER: t->call_samples = 0; break; case AT_MODEM_CONTROL_ONHOOK: if (t->tx.holding) { t->tx.holding = FALSE; /* Tell the application to release further data */ at_modem_control(&t->at_state, AT_MODEM_CONTROL_CTS, (void *) 1); } if (t->at_state.rx_signal_present) { t->at_state.rx_data[t->at_state.rx_data_bytes++] = DLE; t->at_state.rx_data[t->at_state.rx_data_bytes++] = ETX; t->at_state.at_tx_handler(&t->at_state, t->at_state.at_tx_user_data, t->at_state.rx_data, t->at_state.rx_data_bytes); t->at_state.rx_data_bytes = 0; } restart_modem(t, FAX_MODEM_SILENCE_TX); break; case AT_MODEM_CONTROL_RESTART: restart_modem(t, (int) (intptr_t) num); return 0; case AT_MODEM_CONTROL_DTE_TIMEOUT: if (num) t->dte_data_timeout = t->call_samples + ms_to_samples((intptr_t) num); else t->dte_data_timeout = 0; return 0; } return t->modem_control_handler(t, t->modem_control_user_data, op, num); } /*- End of function --------------------------------------------------------*/ static void non_ecm_rx_status(void *user_data, int status) { t31_state_t *s; s = (t31_state_t *) user_data; switch (status) { case SIG_STATUS_TRAINING_IN_PROGRESS: break; case SIG_STATUS_TRAINING_FAILED: s->at_state.rx_trained = FALSE; break; case SIG_STATUS_TRAINING_SUCCEEDED: /* The modem is now trained */ at_put_response_code(&s->at_state, AT_RESPONSE_CODE_CONNECT); s->at_state.rx_signal_present = TRUE; s->at_state.rx_trained = TRUE; break; case SIG_STATUS_CARRIER_UP: break; case SIG_STATUS_CARRIER_DOWN: if (s->at_state.rx_signal_present) { s->at_state.rx_data[s->at_state.rx_data_bytes++] = DLE; s->at_state.rx_data[s->at_state.rx_data_bytes++] = ETX; s->at_state.at_tx_handler(&s->at_state, s->at_state.at_tx_user_data, s->at_state.rx_data, s->at_state.rx_data_bytes); s->at_state.rx_data_bytes = 0; at_put_response_code(&s->at_state, AT_RESPONSE_CODE_NO_CARRIER); t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND); } s->at_state.rx_signal_present = FALSE; s->at_state.rx_trained = FALSE; break; default: if (s->at_state.p.result_code_format) span_log(&s->logging, SPAN_LOG_FLOW, "Eh!\n"); break; } } /*- End of function --------------------------------------------------------*/ static void non_ecm_put_bit(void *user_data, int bit) { t31_state_t *s; if (bit < 0) { non_ecm_rx_status(user_data, bit); return; } s = (t31_state_t *) user_data; s->audio.current_byte = (s->audio.current_byte >> 1) | (bit << 7); if (++s->audio.bit_no >= 8) { if (s->audio.current_byte == DLE) s->at_state.rx_data[s->at_state.rx_data_bytes++] = DLE; s->at_state.rx_data[s->at_state.rx_data_bytes++] = (uint8_t) s->audio.current_byte; if (s->at_state.rx_data_bytes >= 250) { s->at_state.at_tx_handler(&s->at_state, s->at_state.at_tx_user_data, s->at_state.rx_data, s->at_state.rx_data_bytes); s->at_state.rx_data_bytes = 0; } s->audio.bit_no = 0; s->audio.current_byte = 0; } } /*- End of function --------------------------------------------------------*/ static void non_ecm_put_chunk(void *user_data, const uint8_t buf[], int len) { t31_state_t *s; int i; s = (t31_state_t *) user_data; /* Ignore any fractional bytes which may have accumulated */ for (i = 0; i < len; i++) { if (buf[i] == DLE) s->at_state.rx_data[s->at_state.rx_data_bytes++] = DLE; s->at_state.rx_data[s->at_state.rx_data_bytes++] = buf[i]; if (s->at_state.rx_data_bytes >= 250) { s->at_state.at_tx_handler(&s->at_state, s->at_state.at_tx_user_data, s->at_state.rx_data, s->at_state.rx_data_bytes); s->at_state.rx_data_bytes = 0; } } s->audio.bit_no = 0; s->audio.current_byte = 0; } /*- End of function --------------------------------------------------------*/ static int non_ecm_get_bit(void *user_data) { t31_state_t *s; int bit; s = (t31_state_t *) user_data; if (s->audio.bit_no <= 0) { if (s->tx.out_bytes != s->tx.in_bytes) { /* There is real data available to send */ s->audio.current_byte = s->tx.data[s->tx.out_bytes++]; if (s->tx.out_bytes > T31_TX_BUF_LEN - 1) { s->tx.out_bytes = T31_TX_BUF_LEN - 1; span_log(&s->logging, SPAN_LOG_FLOW, "End of transmit buffer reached!\n"); } if (s->tx.holding) { /* See if the buffer is approaching empty. It might be time to release flow control. */ if (s->tx.out_bytes > T31_TX_BUF_LOW_TIDE) { s->tx.holding = FALSE; /* Tell the application to release further data */ at_modem_control(&s->at_state, AT_MODEM_CONTROL_CTS, (void *) 1); } } s->tx.data_started = TRUE; } else { if (s->tx.final) { s->tx.final = FALSE; /* This will put the modem into its shutdown sequence. When it has finally shut down, an OK response will be sent. */ return SIG_STATUS_END_OF_DATA; } /* Fill with 0xFF bytes at the start of transmission, or 0x00 if we are in the middle of transmission. This follows T.31 and T.30 practice. */ s->audio.current_byte = (s->tx.data_started) ? 0x00 : 0xFF; } s->audio.bit_no = 8; } s->audio.bit_no--; bit = s->audio.current_byte & 1; s->audio.current_byte >>= 1; return bit; } /*- End of function --------------------------------------------------------*/ static int non_ecm_get_chunk(void *user_data, uint8_t buf[], int len) { t31_state_t *s; int i; s = (t31_state_t *) user_data; for (i = 0; i < len; i++) { if (s->tx.out_bytes != s->tx.in_bytes) { /* There is real data available to send */ buf[i] = s->tx.data[s->tx.out_bytes++]; if (s->tx.out_bytes > T31_TX_BUF_LEN - 1) { s->tx.out_bytes = T31_TX_BUF_LEN - 1; span_log(&s->logging, SPAN_LOG_FLOW, "End of transmit buffer reached!\n"); } if (s->tx.holding) { /* See if the buffer is approaching empty. It might be time to release flow control. */ if (s->tx.out_bytes > T31_TX_BUF_LOW_TIDE) { s->tx.holding = FALSE; /* Tell the application to release further data */ at_modem_control(&s->at_state, AT_MODEM_CONTROL_CTS, (void *) 1); } } s->tx.data_started = TRUE; } else { if (s->tx.final) { s->tx.final = FALSE; /* This will put the modem into its shutdown sequence. When it has finally shut down, an OK response will be sent. */ //return SIG_STATUS_END_OF_DATA; return i; } /* Fill with 0xFF bytes at the start of transmission, or 0x00 if we are in the middle of transmission. This follows T.31 and T.30 practice. */ buf[i] = (s->tx.data_started) ? 0x00 : 0xFF; } } s->audio.bit_no = 0; s->audio.current_byte = 0; return len; } /*- End of function --------------------------------------------------------*/ static void tone_detected(void *user_data, int tone, int level, int delay) { t31_state_t *s; s = (t31_state_t *) user_data; span_log(&s->logging, SPAN_LOG_FLOW, "%s detected (%ddBm0)\n", modem_connect_tone_to_str(tone), level); } /*- End of function --------------------------------------------------------*/ #if 0 static void v8_handler(void *user_data, v8_parms_t *result) { t31_state_t *s; s = (t31_state_t *) user_data; span_log(&s->logging, SPAN_LOG_FLOW, "V.8 report received\n"); } /*- End of function --------------------------------------------------------*/ #endif static void hdlc_tx_underflow(void *user_data) { t31_state_t *s; s = (t31_state_t *) user_data; if (s->hdlc_tx.final) { s->hdlc_tx.final = FALSE; /* Schedule an orderly shutdown of the modem */ hdlc_tx_frame(&s->audio.modems.hdlc_tx, NULL, 0); } else { at_put_response_code(&s->at_state, AT_RESPONSE_CODE_CONNECT); } } /*- End of function --------------------------------------------------------*/ static void hdlc_rx_status(void *user_data, int status) { t31_state_t *s; uint8_t buf[2]; s = (t31_state_t *) user_data; switch (status) { case SIG_STATUS_TRAINING_IN_PROGRESS: break; case SIG_STATUS_TRAINING_FAILED: s->at_state.rx_trained = FALSE; break; case SIG_STATUS_TRAINING_SUCCEEDED: /* The modem is now trained */ s->at_state.rx_signal_present = TRUE; s->at_state.rx_trained = TRUE; break; case SIG_STATUS_CARRIER_UP: if (s->modem == FAX_MODEM_CNG_TONE || s->modem == FAX_MODEM_NOCNG_TONE || s->modem == FAX_MODEM_V21_RX) { s->at_state.rx_signal_present = TRUE; s->rx_frame_received = FALSE; } break; case SIG_STATUS_CARRIER_DOWN: if (s->rx_frame_received) { if (s->at_state.dte_is_waiting) { if (s->at_state.ok_is_pending) { at_put_response_code(&s->at_state, AT_RESPONSE_CODE_OK); s->at_state.ok_is_pending = FALSE; } else { at_put_response_code(&s->at_state, AT_RESPONSE_CODE_NO_CARRIER); } s->at_state.dte_is_waiting = FALSE; t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND); } else { buf[0] = AT_RESPONSE_CODE_NO_CARRIER; queue_write_msg(s->rx_queue, buf, 1); } } s->at_state.rx_signal_present = FALSE; s->at_state.rx_trained = FALSE; break; case SIG_STATUS_FRAMING_OK: if (s->modem == FAX_MODEM_CNG_TONE || s->modem == FAX_MODEM_NOCNG_TONE) { /* Once we get any valid HDLC the CNG tone stops, and we drop to the V.21 receive modem on its own. */ s->modem = FAX_MODEM_V21_RX; s->at_state.transmit = FALSE; } if (s->modem == FAX_MODEM_V17_RX || s->modem == FAX_MODEM_V27TER_RX || s->modem == FAX_MODEM_V29_RX) { /* V.21 has been detected while expecting a different carrier. If +FAR=0 then result +FCERROR and return to command-mode. If +FAR=1 then report +FRH:3 and CONNECT, switching to V.21 receive mode. */ if (s->at_state.p.adaptive_receive) { s->at_state.rx_signal_present = TRUE; s->rx_frame_received = TRUE; s->modem = FAX_MODEM_V21_RX; s->at_state.transmit = FALSE; s->at_state.dte_is_waiting = TRUE; at_put_response_code(&s->at_state, AT_RESPONSE_CODE_FRH3); at_put_response_code(&s->at_state, AT_RESPONSE_CODE_CONNECT); } else { s->modem = FAX_MODEM_SILENCE_TX; t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND); s->rx_frame_received = FALSE; at_put_response_code(&s->at_state, AT_RESPONSE_CODE_FCERROR); } } else { if (!s->rx_frame_received) { if (s->at_state.dte_is_waiting) { /* Report CONNECT as soon as possible to avoid a timeout. */ at_put_response_code(&s->at_state, AT_RESPONSE_CODE_CONNECT); s->rx_frame_received = TRUE; } else { buf[0] = AT_RESPONSE_CODE_CONNECT; queue_write_msg(s->rx_queue, buf, 1); } } } break; case SIG_STATUS_ABORT: /* Just ignore these */ break; default: span_log(&s->logging, SPAN_LOG_WARNING, "Unexpected HDLC rx status - %d!\n", status); break; } } /*- End of function --------------------------------------------------------*/ static void hdlc_accept_frame(void *user_data, const uint8_t *msg, int len, int ok) { t31_state_t *s; uint8_t buf[256]; int i; if (len < 0) { hdlc_rx_status(user_data, len); return; } s = (t31_state_t *) user_data; if (!s->rx_frame_received) { if (s->at_state.dte_is_waiting) { /* Report CONNECT as soon as possible to avoid a timeout. */ at_put_response_code(&s->at_state, AT_RESPONSE_CODE_CONNECT); s->rx_frame_received = TRUE; } else { buf[0] = AT_RESPONSE_CODE_CONNECT; queue_write_msg(s->rx_queue, buf, 1); } } /* If OK is pending then we just ignore whatever comes in */ if (!s->at_state.ok_is_pending) { if (s->at_state.dte_is_waiting) { /* Send straight away */ /* It is safe to look at the two bytes beyond the length of the message, and expect to find the FCS there. */ for (i = 0; i < len + 2; i++) { if (msg[i] == DLE) s->at_state.rx_data[s->at_state.rx_data_bytes++] = DLE; s->at_state.rx_data[s->at_state.rx_data_bytes++] = msg[i]; } s->at_state.rx_data[s->at_state.rx_data_bytes++] = DLE; s->at_state.rx_data[s->at_state.rx_data_bytes++] = ETX; s->at_state.at_tx_handler(&s->at_state, s->at_state.at_tx_user_data, s->at_state.rx_data, s->at_state.rx_data_bytes); s->at_state.rx_data_bytes = 0; if (msg[1] == 0x13 && ok) { /* This is the last frame. We don't send OK until the carrier drops to avoid redetecting it later. */ s->at_state.ok_is_pending = TRUE; } else { at_put_response_code(&s->at_state, (ok) ? AT_RESPONSE_CODE_OK : AT_RESPONSE_CODE_ERROR); s->at_state.dte_is_waiting = FALSE; s->rx_frame_received = FALSE; } } else { /* Queue it */ buf[0] = (ok) ? AT_RESPONSE_CODE_OK : AT_RESPONSE_CODE_ERROR; /* It is safe to look at the two bytes beyond the length of the message, and expect to find the FCS there. */ memcpy(buf + 1, msg, len + 2); queue_write_msg(s->rx_queue, buf, len + 3); } } t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND); } /*- End of function --------------------------------------------------------*/ static void t31_v21_rx(t31_state_t *s) { s->at_state.ok_is_pending = FALSE; s->hdlc_tx.final = FALSE; s->hdlc_tx.len = 0; s->dled = FALSE; hdlc_rx_init(&s->audio.modems.hdlc_rx, FALSE, TRUE, HDLC_FRAMING_OK_THRESHOLD, hdlc_accept_frame, s); fsk_rx_init(&s->audio.modems.v21_rx, &preset_fsk_specs[FSK_V21CH2], FSK_FRAME_MODE_SYNC, (put_bit_func_t) hdlc_rx_put_bit, &s->audio.modems.hdlc_rx); fsk_rx_signal_cutoff(&s->audio.modems.v21_rx, -39.09f); s->at_state.transmit = TRUE; } /*- End of function --------------------------------------------------------*/ static int restart_modem(t31_state_t *s, int new_modem) { int use_hdlc; fax_modems_state_t *t; t = &s->audio.modems; span_log(&s->logging, SPAN_LOG_FLOW, "Restart modem %d\n", new_modem); if (s->modem == new_modem) return 0; queue_flush(s->rx_queue); s->modem = new_modem; s->tx.final = FALSE; s->at_state.rx_signal_present = FALSE; s->at_state.rx_trained = FALSE; s->rx_frame_received = FALSE; set_rx_handler(s, (span_rx_handler_t *) &span_dummy_rx, (span_rx_fillin_handler_t *) &span_dummy_rx_fillin, NULL); use_hdlc = FALSE; switch (s->modem) { case FAX_MODEM_CNG_TONE: if (s->t38_mode) { s->t38_fe.next_tx_samples = s->t38_fe.samples; s->t38_fe.timed_step = T38_TIMED_STEP_CNG; s->t38_fe.current_tx_data_type = T38_DATA_NONE; } else { modem_connect_tones_tx_init(&t->connect_tx, MODEM_CONNECT_TONES_FAX_CNG); /* CNG is special, since we need to receive V.21 HDLC messages while sending the tone. Everything else in FAX processing sends only one way at a time. */ /* Do V.21/HDLC receive in parallel. The other end may send its first message at any time. The CNG tone will continue until we get a valid preamble. */ set_rx_handler(s, (span_rx_handler_t *) &cng_rx, (span_rx_fillin_handler_t *) &span_dummy_rx_fillin, s); t31_v21_rx(s); set_tx_handler(s, (span_tx_handler_t *) &modem_connect_tones_tx, &t->connect_tx); set_next_tx_handler(s, (span_tx_handler_t *) NULL, NULL); } s->at_state.transmit = TRUE; break; case FAX_MODEM_NOCNG_TONE: if (s->t38_mode) { } else { set_rx_handler(s, (span_rx_handler_t *) &cng_rx, (span_rx_fillin_handler_t *) &span_dummy_rx_fillin, s); t31_v21_rx(s); silence_gen_set(&t->silence_gen, 0); set_tx_handler(s, (span_tx_handler_t *) &silence_gen, &t->silence_gen); } s->at_state.transmit = FALSE; break; case FAX_MODEM_CED_TONE: if (s->t38_mode) { s->t38_fe.next_tx_samples = s->t38_fe.samples; s->t38_fe.timed_step = T38_TIMED_STEP_CED; s->t38_fe.current_tx_data_type = T38_DATA_NONE; } else { modem_connect_tones_tx_init(&t->connect_tx, MODEM_CONNECT_TONES_FAX_CED); set_tx_handler(s, (span_tx_handler_t *) &modem_connect_tones_tx, &t->connect_tx); set_next_tx_handler(s, (span_tx_handler_t *) NULL, NULL); } s->at_state.transmit = TRUE; break; case FAX_MODEM_V21_TX: if (s->t38_mode) { s->t38_fe.next_tx_indicator = T38_IND_V21_PREAMBLE; s->t38_fe.current_tx_data_type = T38_DATA_V21; use_hdlc = TRUE; s->t38_fe.timed_step = (use_hdlc) ? T38_TIMED_STEP_HDLC_MODEM : T38_TIMED_STEP_NON_ECM_MODEM; set_octets_per_data_packet(s, 300); } else { hdlc_tx_init(&t->hdlc_tx, FALSE, 2, FALSE, hdlc_tx_underflow, s); /* The spec says 1s +-15% of preamble. So, the minimum is 32 octets. */ hdlc_tx_flags(&t->hdlc_tx, 32); fsk_tx_init(&t->v21_tx, &preset_fsk_specs[FSK_V21CH2], (get_bit_func_t) hdlc_tx_get_bit, &t->hdlc_tx); set_tx_handler(s, (span_tx_handler_t *) &fsk_tx, &t->v21_tx); set_next_tx_handler(s, (span_tx_handler_t *) NULL, NULL); } s->hdlc_tx.final = FALSE; s->hdlc_tx.len = 0; s->dled = FALSE; s->at_state.transmit = TRUE; break; case FAX_MODEM_V21_RX: if (s->t38_mode) { } else { set_rx_handler(s, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &t->v21_rx); t31_v21_rx(s); } break; case FAX_MODEM_V17_TX: if (s->t38_mode) { switch (s->bit_rate) { case 7200: s->t38_fe.next_tx_indicator = (s->short_train) ? T38_IND_V17_7200_SHORT_TRAINING : T38_IND_V17_7200_LONG_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V17_7200; break; case 9600: s->t38_fe.next_tx_indicator = (s->short_train) ? T38_IND_V17_9600_SHORT_TRAINING : T38_IND_V17_9600_LONG_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V17_9600; break; case 12000: s->t38_fe.next_tx_indicator = (s->short_train) ? T38_IND_V17_12000_SHORT_TRAINING : T38_IND_V17_12000_LONG_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V17_12000; break; case 14400: s->t38_fe.next_tx_indicator = (s->short_train) ? T38_IND_V17_14400_SHORT_TRAINING : T38_IND_V17_14400_LONG_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V17_14400; break; } set_octets_per_data_packet(s, s->bit_rate); s->t38_fe.timed_step = (use_hdlc) ? T38_TIMED_STEP_HDLC_MODEM : T38_TIMED_STEP_NON_ECM_MODEM; } else { v17_tx_restart(&t->fast_modems.v17_tx, s->bit_rate, FALSE, s->short_train); set_tx_handler(s, (span_tx_handler_t *) &v17_tx, &t->fast_modems.v17_tx); set_next_tx_handler(s, (span_tx_handler_t *) NULL, NULL); } s->tx.out_bytes = 0; s->tx.data_started = FALSE; s->at_state.transmit = TRUE; break; case FAX_MODEM_V17_RX: if (!s->t38_mode) { set_rx_handler(s, (span_rx_handler_t *) &v17_v21_rx, (span_rx_fillin_handler_t *) &v17_v21_rx_fillin, s); v17_rx_restart(&t->fast_modems.v17_rx, s->bit_rate, s->short_train); /* Allow for +FCERROR/+FRH:3 */ t31_v21_rx(s); } s->at_state.transmit = FALSE; break; case FAX_MODEM_V27TER_TX: if (s->t38_mode) { switch (s->bit_rate) { case 2400: s->t38_fe.next_tx_indicator = T38_IND_V27TER_2400_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V27TER_2400; break; case 4800: s->t38_fe.next_tx_indicator = T38_IND_V27TER_4800_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V27TER_4800; break; } set_octets_per_data_packet(s, s->bit_rate); s->t38_fe.timed_step = (use_hdlc) ? T38_TIMED_STEP_HDLC_MODEM : T38_TIMED_STEP_NON_ECM_MODEM; } else { v27ter_tx_restart(&t->fast_modems.v27ter_tx, s->bit_rate, FALSE); set_tx_handler(s, (span_tx_handler_t *) &v27ter_tx, &t->fast_modems.v27ter_tx); set_next_tx_handler(s, (span_tx_handler_t *) NULL, NULL); } s->tx.out_bytes = 0; s->tx.data_started = FALSE; s->at_state.transmit = TRUE; break; case FAX_MODEM_V27TER_RX: if (!s->t38_mode) { set_rx_handler(s, (span_rx_handler_t *) &v27ter_v21_rx, (span_rx_fillin_handler_t *) &v27ter_v21_rx_fillin, s); v27ter_rx_restart(&t->fast_modems.v27ter_rx, s->bit_rate, FALSE); /* Allow for +FCERROR/+FRH:3 */ t31_v21_rx(s); } s->at_state.transmit = FALSE; break; case FAX_MODEM_V29_TX: if (s->t38_mode) { switch (s->bit_rate) { case 7200: s->t38_fe.next_tx_indicator = T38_IND_V29_7200_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V29_7200; break; case 9600: s->t38_fe.next_tx_indicator = T38_IND_V29_9600_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V29_9600; break; } set_octets_per_data_packet(s, s->bit_rate); s->t38_fe.timed_step = (use_hdlc) ? T38_TIMED_STEP_HDLC_MODEM : T38_TIMED_STEP_NON_ECM_MODEM; } else { v29_tx_restart(&t->fast_modems.v29_tx, s->bit_rate, FALSE); set_tx_handler(s, (span_tx_handler_t *) &v29_tx, &t->fast_modems.v29_tx); set_next_tx_handler(s, (span_tx_handler_t *) NULL, NULL); } s->tx.out_bytes = 0; s->tx.data_started = FALSE; s->at_state.transmit = TRUE; break; case FAX_MODEM_V29_RX: if (!s->t38_mode) { set_rx_handler(s, (span_rx_handler_t *) &v29_v21_rx, (span_rx_fillin_handler_t *) &v29_v21_rx_fillin, s); v29_rx_restart(&t->fast_modems.v29_rx, s->bit_rate, FALSE); /* Allow for +FCERROR/+FRH:3 */ t31_v21_rx(s); } s->at_state.transmit = FALSE; break; case FAX_MODEM_SILENCE_TX: if (s->t38_mode) { t38_core_send_indicator(&s->t38_fe.t38, T38_IND_NO_SIGNAL); s->t38_fe.next_tx_samples = s->t38_fe.samples + ms_to_samples(700); s->t38_fe.timed_step = T38_TIMED_STEP_PAUSE; s->t38_fe.current_tx_data_type = T38_DATA_NONE; } else { silence_gen_set(&t->silence_gen, 0); set_tx_handler(s, (span_tx_handler_t *) &silence_gen, &t->silence_gen); set_next_tx_handler(s, (span_tx_handler_t *) NULL, NULL); } s->at_state.transmit = FALSE; break; case FAX_MODEM_SILENCE_RX: if (!s->t38_mode) { set_rx_handler(s, (span_rx_handler_t *) &silence_rx, (span_rx_fillin_handler_t *) &span_dummy_rx_fillin, s); silence_gen_set(&t->silence_gen, 0); set_tx_handler(s, (span_tx_handler_t *) &silence_gen, &t->silence_gen); set_next_tx_handler(s, (span_tx_handler_t *) NULL, NULL); } s->at_state.transmit = FALSE; break; case FAX_MODEM_FLUSH: /* Send 200ms of silence to "push" the last audio out */ if (s->t38_mode) { t38_core_send_indicator(&s->t38_fe.t38, T38_IND_NO_SIGNAL); } else { s->modem = FAX_MODEM_SILENCE_TX; silence_gen_alter(&t->silence_gen, ms_to_samples(200)); set_tx_handler(s, (span_tx_handler_t *) &silence_gen, &t->silence_gen); set_next_tx_handler(s, (span_tx_handler_t *) NULL, NULL); s->at_state.transmit = TRUE; } break; } s->audio.bit_no = 0; s->audio.current_byte = 0xFF; s->tx.in_bytes = 0; s->tx.out_bytes = 0; return 0; } /*- End of function --------------------------------------------------------*/ static __inline__ void dle_unstuff_hdlc(t31_state_t *s, const char *stuffed, int len) { int i; for (i = 0; i < len; i++) { if (s->dled) { s->dled = FALSE; if (stuffed[i] == ETX) { s->hdlc_tx.final = (s->hdlc_tx.buf[1] & 0x10); if (s->t38_mode) { send_hdlc(s, s->hdlc_tx.buf, s->hdlc_tx.len); } else { hdlc_tx_frame(&s->audio.modems.hdlc_tx, s->hdlc_tx.buf, s->hdlc_tx.len); s->hdlc_tx.len = 0; } } else if (stuffed[i] == SUB) { s->hdlc_tx.buf[s->hdlc_tx.len++] = DLE; s->hdlc_tx.buf[s->hdlc_tx.len++] = DLE; } else { s->hdlc_tx.buf[s->hdlc_tx.len++] = stuffed[i]; } } else { if (stuffed[i] == DLE) s->dled = TRUE; else s->hdlc_tx.buf[s->hdlc_tx.len++] = stuffed[i]; } } } /*- End of function --------------------------------------------------------*/ static __inline__ void dle_unstuff(t31_state_t *s, const char *stuffed, int len) { int i; for (i = 0; i < len; i++) { if (s->dled) { s->dled = FALSE; if (stuffed[i] == ETX) { s->tx.final = TRUE; t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND); return; } } else if (stuffed[i] == DLE) { s->dled = TRUE; continue; } s->tx.data[s->tx.in_bytes++] = stuffed[i]; if (s->tx.in_bytes > T31_TX_BUF_LEN - 1) { /* Oops. We hit the end of the buffer. Give up. Loose stuff. :-( */ span_log(&s->logging, SPAN_LOG_FLOW, "No room in buffer for new data!\n"); return; } } if (!s->tx.holding) { /* See if the buffer is approaching full. We might need to apply flow control. */ if (s->tx.in_bytes > T31_TX_BUF_HIGH_TIDE) { s->tx.holding = TRUE; /* Tell the application to hold further data */ at_modem_control(&s->at_state, AT_MODEM_CONTROL_CTS, (void *) 0); } } } /*- End of function --------------------------------------------------------*/ static int process_class1_cmd(at_state_t *t, void *user_data, int direction, int operation, int val) { int new_modem; int new_transmit; int i; int len; int immediate_response; t31_state_t *s; uint8_t msg[256]; s = (t31_state_t *) user_data; new_transmit = direction; immediate_response = TRUE; switch (operation) { case 'S': s->at_state.transmit = new_transmit; if (new_transmit) { /* Send a specified period of silence, to space transmissions. */ restart_modem(s, FAX_MODEM_SILENCE_TX); if (s->t38_mode) s->t38_fe.next_tx_samples = s->t38_fe.samples + ms_to_samples(val*10); else silence_gen_alter(&s->audio.modems.silence_gen, ms_to_samples(val*10)); s->at_state.transmit = TRUE; } else { /* Wait until we have received a specified period of silence. */ queue_flush(s->rx_queue); s->silence_awaited = ms_to_samples(val*10); t31_set_at_rx_mode(s, AT_MODE_DELIVERY); if (s->t38_mode) { at_put_response_code(&s->at_state, AT_RESPONSE_CODE_OK); t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND); } else { restart_modem(s, FAX_MODEM_SILENCE_RX); } } immediate_response = FALSE; span_log(&s->logging, SPAN_LOG_FLOW, "Silence %dms\n", val*10); break; case 'H': switch (val) { case 3: new_modem = (new_transmit) ? FAX_MODEM_V21_TX : FAX_MODEM_V21_RX; s->short_train = FALSE; s->bit_rate = 300; break; default: return -1; } span_log(&s->logging, SPAN_LOG_FLOW, "HDLC\n"); if (new_modem != s->modem) { restart_modem(s, new_modem); immediate_response = FALSE; } s->at_state.transmit = new_transmit; if (new_transmit) { t31_set_at_rx_mode(s, AT_MODE_HDLC); if (!s->t38_mode) at_put_response_code(&s->at_state, AT_RESPONSE_CODE_CONNECT); } else { /* Send straight away, if there is something queued. */ t31_set_at_rx_mode(s, AT_MODE_DELIVERY); s->rx_frame_received = FALSE; do { if (!queue_empty(s->rx_queue)) { len = queue_read_msg(s->rx_queue, msg, 256); if (len > 1) { if (msg[0] == AT_RESPONSE_CODE_OK) at_put_response_code(&s->at_state, AT_RESPONSE_CODE_CONNECT); for (i = 1; i < len; i++) { if (msg[i] == DLE) s->at_state.rx_data[s->at_state.rx_data_bytes++] = DLE; s->at_state.rx_data[s->at_state.rx_data_bytes++] = msg[i]; } s->at_state.rx_data[s->at_state.rx_data_bytes++] = DLE; s->at_state.rx_data[s->at_state.rx_data_bytes++] = ETX; s->at_state.at_tx_handler(&s->at_state, s->at_state.at_tx_user_data, s->at_state.rx_data, s->at_state.rx_data_bytes); s->at_state.rx_data_bytes = 0; } at_put_response_code(&s->at_state, msg[0]); } else { s->at_state.dte_is_waiting = TRUE; break; } } while (msg[0] == AT_RESPONSE_CODE_CONNECT); } immediate_response = FALSE; break; default: switch (val) { case 24: s->t38_fe.next_tx_indicator = T38_IND_V27TER_2400_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V27TER_2400; new_modem = (new_transmit) ? FAX_MODEM_V27TER_TX : FAX_MODEM_V27TER_RX; s->short_train = FALSE; s->bit_rate = 2400; break; case 48: s->t38_fe.next_tx_indicator = T38_IND_V27TER_4800_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V27TER_4800; new_modem = (new_transmit) ? FAX_MODEM_V27TER_TX : FAX_MODEM_V27TER_RX; s->short_train = FALSE; s->bit_rate = 4800; break; case 72: s->t38_fe.next_tx_indicator = T38_IND_V29_7200_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V29_7200; new_modem = (new_transmit) ? FAX_MODEM_V29_TX : FAX_MODEM_V29_RX; s->short_train = FALSE; s->bit_rate = 7200; break; case 96: s->t38_fe.next_tx_indicator = T38_IND_V29_9600_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V29_9600; new_modem = (new_transmit) ? FAX_MODEM_V29_TX : FAX_MODEM_V29_RX; s->short_train = FALSE; s->bit_rate = 9600; break; case 73: s->t38_fe.next_tx_indicator = T38_IND_V17_7200_LONG_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V17_7200; new_modem = (new_transmit) ? FAX_MODEM_V17_TX : FAX_MODEM_V17_RX; s->short_train = FALSE; s->bit_rate = 7200; break; case 74: s->t38_fe.next_tx_indicator = T38_IND_V17_7200_SHORT_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V17_7200; new_modem = (new_transmit) ? FAX_MODEM_V17_TX : FAX_MODEM_V17_RX; s->short_train = TRUE; s->bit_rate = 7200; break; case 97: s->t38_fe.next_tx_indicator = T38_IND_V17_9600_LONG_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V17_9600; new_modem = (new_transmit) ? FAX_MODEM_V17_TX : FAX_MODEM_V17_RX; s->short_train = FALSE; s->bit_rate = 9600; break; case 98: s->t38_fe.next_tx_indicator = T38_IND_V17_9600_SHORT_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V17_9600; new_modem = (new_transmit) ? FAX_MODEM_V17_TX : FAX_MODEM_V17_RX; s->short_train = TRUE; s->bit_rate = 9600; break; case 121: s->t38_fe.next_tx_indicator = T38_IND_V17_12000_LONG_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V17_12000; new_modem = (new_transmit) ? FAX_MODEM_V17_TX : FAX_MODEM_V17_RX; s->short_train = FALSE; s->bit_rate = 12000; break; case 122: s->t38_fe.next_tx_indicator = T38_IND_V17_12000_SHORT_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V17_12000; new_modem = (new_transmit) ? FAX_MODEM_V17_TX : FAX_MODEM_V17_RX; s->short_train = TRUE; s->bit_rate = 12000; break; case 145: s->t38_fe.next_tx_indicator = T38_IND_V17_14400_LONG_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V17_14400; new_modem = (new_transmit) ? FAX_MODEM_V17_TX : FAX_MODEM_V17_RX; s->short_train = FALSE; s->bit_rate = 14400; break; case 146: s->t38_fe.next_tx_indicator = T38_IND_V17_14400_SHORT_TRAINING; s->t38_fe.current_tx_data_type = T38_DATA_V17_14400; new_modem = (new_transmit) ? FAX_MODEM_V17_TX : FAX_MODEM_V17_RX; s->short_train = TRUE; s->bit_rate = 14400; break; default: return -1; } span_log(&s->logging, SPAN_LOG_FLOW, "Short training = %d, bit rate = %d\n", s->short_train, s->bit_rate); if (new_transmit) { t31_set_at_rx_mode(s, AT_MODE_STUFFED); at_put_response_code(&s->at_state, AT_RESPONSE_CODE_CONNECT); } else { t31_set_at_rx_mode(s, AT_MODE_DELIVERY); } restart_modem(s, new_modem); immediate_response = FALSE; break; } return immediate_response; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t31_call_event(t31_state_t *s, int event) { span_log(&s->logging, SPAN_LOG_FLOW, "Call event %d received\n", event); at_call_event(&s->at_state, event); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t31_at_rx(t31_state_t *s, const char *t, int len) { if (s->dte_data_timeout) s->dte_data_timeout = s->call_samples + ms_to_samples(5000); switch (s->at_state.at_rx_mode) { case AT_MODE_ONHOOK_COMMAND: case AT_MODE_OFFHOOK_COMMAND: at_interpreter(&s->at_state, t, len); break; case AT_MODE_DELIVERY: /* Data from the DTE in this state returns us to command mode */ if (len) { if (s->at_state.rx_signal_present) { s->at_state.rx_data[s->at_state.rx_data_bytes++] = DLE; s->at_state.rx_data[s->at_state.rx_data_bytes++] = ETX; s->at_state.at_tx_handler(&s->at_state, s->at_state.at_tx_user_data, s->at_state.rx_data, s->at_state.rx_data_bytes); } s->at_state.rx_data_bytes = 0; s->at_state.transmit = FALSE; s->modem = FAX_MODEM_SILENCE_TX; set_rx_handler(s, (span_rx_handler_t *) &span_dummy_rx, (span_rx_fillin_handler_t *) &span_dummy_rx_fillin, NULL); t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND); at_put_response_code(&s->at_state, AT_RESPONSE_CODE_OK); } break; case AT_MODE_HDLC: dle_unstuff_hdlc(s, t, len); break; case AT_MODE_STUFFED: if (s->tx.out_bytes) { /* Make room for new data in existing data buffer. */ s->tx.in_bytes = &s->tx.data[s->tx.in_bytes] - &s->tx.data[s->tx.out_bytes]; memmove(&s->tx.data[0], &s->tx.data[s->tx.out_bytes], s->tx.in_bytes); s->tx.out_bytes = 0; } dle_unstuff(s, t, len); break; case AT_MODE_CONNECTED: /* TODO: Implement for data modem operation */ break; } return len; } /*- End of function --------------------------------------------------------*/ static void set_rx_handler(t31_state_t *s, span_rx_handler_t *rx_handler, span_rx_fillin_handler_t *fillin_handler, void *user_data) { s->audio.modems.rx_handler = rx_handler; s->audio.modems.rx_fillin_handler = fillin_handler; s->audio.modems.rx_user_data = user_data; } /*- End of function --------------------------------------------------------*/ static void set_tx_handler(t31_state_t *s, span_tx_handler_t *handler, void *user_data) { s->audio.modems.tx_handler = handler; s->audio.modems.tx_user_data = user_data; } /*- End of function --------------------------------------------------------*/ static void set_next_tx_handler(t31_state_t *s, span_tx_handler_t *handler, void *user_data) { s->audio.modems.next_tx_handler = handler; s->audio.modems.next_tx_user_data = user_data; } /*- End of function --------------------------------------------------------*/ static int silence_rx(void *user_data, const int16_t amp[], int len) { t31_state_t *s; /* Searching for a specified minimum period of silence. */ s = (t31_state_t *) user_data; if (s->silence_awaited && s->audio.silence_heard >= s->silence_awaited) { at_put_response_code(&s->at_state, AT_RESPONSE_CODE_OK); t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND); s->audio.silence_heard = 0; s->silence_awaited = 0; } return 0; } /*- End of function --------------------------------------------------------*/ static int cng_rx(void *user_data, const int16_t amp[], int len) { t31_state_t *s; s = (t31_state_t *) user_data; if (s->call_samples > ms_to_samples(s->at_state.p.s_regs[7]*1000)) { /* After calling, S7 has elapsed... no carrier found. */ at_put_response_code(&s->at_state, AT_RESPONSE_CODE_NO_CARRIER); restart_modem(s, FAX_MODEM_SILENCE_TX); at_modem_control(&s->at_state, AT_MODEM_CONTROL_HANGUP, NULL); t31_set_at_rx_mode(s, AT_MODE_ONHOOK_COMMAND); } else { fsk_rx(&s->audio.modems.v21_rx, amp, len); } return 0; } /*- End of function --------------------------------------------------------*/ static int v17_v21_rx(void *user_data, const int16_t amp[], int len) { t31_state_t *t; fax_modems_state_t *s; t = (t31_state_t *) user_data; s = &t->audio.modems; v17_rx(&s->fast_modems.v17_rx, amp, len); if (t->at_state.rx_trained) { /* The fast modem has trained, so we no longer need to run the slow one in parallel. */ span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.17 + V.21 to V.17 (%.2fdBm0)\n", v17_rx_signal_power(&s->fast_modems.v17_rx)); set_rx_handler(t, (span_rx_handler_t *) &v17_rx, (span_rx_fillin_handler_t *) &v17_rx_fillin, &s->fast_modems.v17_rx); } else { fsk_rx(&s->v21_rx, amp, len); if (t->rx_frame_received) { /* We have received something, and the fast modem has not trained. We must be receiving valid V.21 */ span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.17 + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx)); set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &s->v21_rx); } } return len; } /*- End of function --------------------------------------------------------*/ static int v17_v21_rx_fillin(void *user_data, int len) { t31_state_t *t; fax_modems_state_t *s; t = (t31_state_t *) user_data; s = &t->audio.modems; v17_rx_fillin(&s->fast_modems.v17_rx, len); fsk_rx_fillin(&s->v21_rx, len); return 0; } /*- End of function --------------------------------------------------------*/ static int v27ter_v21_rx(void *user_data, const int16_t amp[], int len) { t31_state_t *t; fax_modems_state_t *s; t = (t31_state_t *) user_data; s = &t->audio.modems; v27ter_rx(&s->fast_modems.v27ter_rx, amp, len); if (t->at_state.rx_trained) { /* The fast modem has trained, so we no longer need to run the slow one in parallel. */ span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.27ter + V.21 to V.27ter (%.2fdBm0)\n", v27ter_rx_signal_power(&s->fast_modems.v27ter_rx)); set_rx_handler(t, (span_rx_handler_t *) &v27ter_rx, (span_rx_fillin_handler_t *) &v27ter_rx_fillin, &s->fast_modems.v27ter_rx); } else { fsk_rx(&s->v21_rx, amp, len); if (t->rx_frame_received) { /* We have received something, and the fast modem has not trained. We must be receiving valid V.21 */ span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.27ter + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx)); set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &s->v21_rx); } } return len; } /*- End of function --------------------------------------------------------*/ static int v27ter_v21_rx_fillin(void *user_data, int len) { t31_state_t *t; fax_modems_state_t *s; t = (t31_state_t *) user_data; s = &t->audio.modems; v27ter_rx_fillin(&s->fast_modems.v27ter_rx, len); fsk_rx_fillin(&s->v21_rx, len); return 0; } /*- End of function --------------------------------------------------------*/ static int v29_v21_rx(void *user_data, const int16_t amp[], int len) { t31_state_t *t; fax_modems_state_t *s; t = (t31_state_t *) user_data; s = &t->audio.modems; v29_rx(&s->fast_modems.v29_rx, amp, len); if (t->at_state.rx_trained) { /* The fast modem has trained, so we no longer need to run the slow one in parallel. */ span_log(&s->logging, SPAN_LOG_FLOW, "Switching from V.29 + V.21 to V.29 (%.2fdBm0)\n", v29_rx_signal_power(&s->fast_modems.v29_rx)); set_rx_handler(t, (span_rx_handler_t *) &v29_rx, (span_rx_fillin_handler_t *) &v29_rx_fillin, &s->fast_modems.v29_rx); } else { fsk_rx(&s->v21_rx, amp, len); if (t->rx_frame_received) { /* We have received something, and the fast modem has not trained. We must be receiving valid V.21 */ span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.29 + V.21 to V.21 (%.2fdBm0)\n", fsk_rx_signal_power(&s->v21_rx)); set_rx_handler(t, (span_rx_handler_t *) &fsk_rx, (span_rx_fillin_handler_t *) &fsk_rx_fillin, &s->v21_rx); } } return len; } /*- End of function --------------------------------------------------------*/ static int v29_v21_rx_fillin(void *user_data, int len) { t31_state_t *t; fax_modems_state_t *s; t = (t31_state_t *) user_data; s = &t->audio.modems; v29_rx_fillin(&s->fast_modems.v29_rx, len); fsk_rx_fillin(&s->v21_rx, len); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) t31_rx(t31_state_t *s, int16_t amp[], int len) { int i; int32_t power; /* Monitor for received silence. Maximum needed detection is AT+FRS=255 (255*10ms). */ /* We could probably only run this loop if (s->modem == FAX_MODEM_SILENCE_RX), however, the spec says "when silence has been present on the line for the amount of time specified". That means some of the silence may have occurred before the AT+FRS=n command. This condition, however, is not likely to ever be the case. (AT+FRS=n will usually be issued before the remote goes silent.) */ for (i = 0; i < len; i++) { /* Clean up any DC influence. */ power = power_meter_update(&s->audio.rx_power, amp[i] - s->audio.last_sample); s->audio.last_sample = amp[i]; if (power > s->audio.silence_threshold_power) { s->audio.silence_heard = 0; } else { if (s->audio.silence_heard <= ms_to_samples(255*10)) s->audio.silence_heard++; } } /* Time is determined by counting the samples in audio packets coming in. */ s->call_samples += len; /* In HDLC transmit mode, if 5 seconds elapse without data from the DTE we must treat this as an error. We return the result ERROR, and change to command-mode. */ if (s->dte_data_timeout && s->call_samples > s->dte_data_timeout) { t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND); at_put_response_code(&s->at_state, AT_RESPONSE_CODE_ERROR); restart_modem(s, FAX_MODEM_SILENCE_TX); } if (!s->at_state.transmit || s->modem == FAX_MODEM_CNG_TONE) s->audio.modems.rx_handler(s->audio.modems.rx_user_data, amp, len); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) t31_rx_fillin(t31_state_t *s, int len) { /* To mitigate the effect of lost packets on a packet network we should try to sustain the status quo. If there is no receive modem running, keep things that way. If there is a receive modem running, try to sustain its operation, without causing a phase hop, or letting its adaptive functions diverge. */ /* Time is determined by counting the samples in audio packets coming in. */ s->call_samples += len; /* In HDLC transmit mode, if 5 seconds elapse without data from the DTE we must treat this as an error. We return the result ERROR, and change to command-mode. */ if (s->dte_data_timeout && s->call_samples > s->dte_data_timeout) { t31_set_at_rx_mode(s, AT_MODE_OFFHOOK_COMMAND); at_put_response_code(&s->at_state, AT_RESPONSE_CODE_ERROR); restart_modem(s, FAX_MODEM_SILENCE_TX); } /* Call the fillin function of the current modem (if there is one). */ switch (s->modem) { case FAX_MODEM_V21_RX: len = fsk_rx_fillin(&s->audio.modems.v21_rx, len); break; case FAX_MODEM_V27TER_RX: /* TODO: what about FSK in the early stages */ len = v27ter_rx_fillin(&s->audio.modems.fast_modems.v27ter_rx, len); break; case FAX_MODEM_V29_RX: /* TODO: what about FSK in the early stages */ len = v29_rx_fillin(&s->audio.modems.fast_modems.v29_rx, len); break; case FAX_MODEM_V17_RX: /* TODO: what about FSK in the early stages */ len = v17_rx_fillin(&s->audio.modems.fast_modems.v17_rx, len); break; } return 0; } /*- End of function --------------------------------------------------------*/ static int set_next_tx_type(t31_state_t *s) { if (s->audio.next_tx_handler) { set_tx_handler(s, s->audio.next_tx_handler, s->audio.next_tx_user_data); set_next_tx_handler(s, (span_tx_handler_t *) NULL, NULL); return 0; } /* There is nothing else to change to, so use zero length silence */ silence_gen_alter(&s->audio.modems.silence_gen, 0); set_tx_handler(s, (span_tx_handler_t *) &silence_gen, &s->audio.modems.silence_gen); set_next_tx_handler(s, (span_tx_handler_t *) NULL, NULL); return -1; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) t31_tx(t31_state_t *s, int16_t amp[], int max_len) { int len; len = 0; if (s->at_state.transmit) { if ((len = s->audio.modems.tx_handler(s->audio.modems.tx_user_data, amp, max_len)) < max_len) { /* Allow for one change of tx handler within a block */ set_next_tx_type(s); if ((len += s->audio.modems.tx_handler(s->audio.modems.tx_user_data, amp + len, max_len - len)) < max_len) front_end_status(s, T30_FRONT_END_SEND_STEP_COMPLETE); } } if (s->audio.modems.transmit_on_idle) { /* Pad to the requested length with silence */ memset(amp + len, 0, (max_len - len)*sizeof(int16_t)); len = max_len; } return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t31_set_transmit_on_idle(t31_state_t *s, int transmit_on_idle) { s->audio.modems.transmit_on_idle = transmit_on_idle; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t31_set_tep_mode(t31_state_t *s, int use_tep) { s->audio.modems.use_tep = use_tep; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t31_set_t38_config(t31_state_t *s, int without_pacing) { if (without_pacing) { /* Continuous streaming mode, as used for TPKT over TCP transport */ /* Inhibit indicator packets */ t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_INDICATOR, 0); t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_CONTROL_DATA, 1); t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_CONTROL_DATA_END, 1); t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_IMAGE_DATA, 1); t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_IMAGE_DATA_END, 1); s->t38_fe.ms_per_tx_chunk = 0; } else { /* Paced streaming mode, as used for UDP transports */ t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_INDICATOR, INDICATOR_TX_COUNT); t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_CONTROL_DATA, DATA_TX_COUNT); t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_CONTROL_DATA_END, DATA_END_TX_COUNT); t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_IMAGE_DATA, DATA_TX_COUNT); t38_set_redundancy_control(&s->t38_fe.t38, T38_PACKET_CATEGORY_IMAGE_DATA_END, DATA_END_TX_COUNT); s->t38_fe.ms_per_tx_chunk = MS_PER_TX_CHUNK; } set_octets_per_data_packet(s, 300); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) t31_set_mode(t31_state_t *s, int t38_mode) { s->t38_mode = t38_mode; span_log(&s->logging, SPAN_LOG_FLOW, "Mode set to %d\n", s->t38_mode); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) t31_get_logging_state(t31_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(t38_core_state_t *) t31_get_t38_core_state(t31_state_t *s) { return &s->t38_fe.t38; } /*- End of function --------------------------------------------------------*/ static int t31_t38_fe_init(t31_state_t *t, t38_tx_packet_handler_t *tx_packet_handler, void *tx_packet_user_data) { t31_t38_front_end_state_t *s; s = &t->t38_fe; t38_core_init(&s->t38, process_rx_indicator, process_rx_data, process_rx_missing, (void *) t, tx_packet_handler, tx_packet_user_data); s->t38.fastest_image_data_rate = 14400; s->timed_step = T38_TIMED_STEP_NONE; //s->iaf = T30_IAF_MODE_T37 | T30_IAF_MODE_T38; s->iaf = T30_IAF_MODE_T38; s->current_tx_data_type = T38_DATA_NONE; s->next_tx_samples = 0; s->chunking_modes = T38_CHUNKING_ALLOW_TEP_TIME; t->hdlc_tx.ptr = 0; hdlc_tx_init(&s->hdlc_tx_term, FALSE, 1, FALSE, NULL, NULL); hdlc_rx_init(&s->hdlc_rx_term, FALSE, TRUE, 2, NULL, NULL); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(t31_state_t *) t31_init(t31_state_t *s, at_tx_handler_t *at_tx_handler, void *at_tx_user_data, t31_modem_control_handler_t *modem_control_handler, void *modem_control_user_data, t38_tx_packet_handler_t *tx_t38_packet_handler, void *tx_t38_packet_user_data) { #if 0 v8_parms_t v8_parms; #endif int alloced; if (at_tx_handler == NULL || modem_control_handler == NULL) return NULL; alloced = FALSE; if (s == NULL) { if ((s = (t31_state_t *) malloc(sizeof (*s))) == NULL) return NULL; alloced = TRUE; } memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "T.31"); s->modem_control_handler = modem_control_handler; s->modem_control_user_data = modem_control_user_data; fax_modems_init(&s->audio.modems, FALSE, hdlc_accept_frame, hdlc_tx_underflow, non_ecm_put_bit, non_ecm_get_bit, tone_detected, (void *) s); #if 0 v8_parms.modem_connect_tone = MODEM_CONNECT_TONES_ANSAM_PR; v8_parms.call_function = V8_CALL_T30_RX; v8_parms.modulations = V8_MOD_V21 #if 0 | V8_MOD_V34HALF #endif | V8_MOD_V17 | V8_MOD_V29 | V8_MOD_V27TER; v8_parms.protocol = V8_PROTOCOL_NONE; v8_parms.pcm_modem_availability = 0; v8_parms.pstn_access = 0; v8_parms.nsf = -1; v8_parms.t66 = -1; v8_init(&s->audio.v8, FALSE, &v8_parms, v8_handler, s); #endif power_meter_init(&s->audio.rx_power, 4); s->audio.last_sample = 0; s->audio.silence_threshold_power = power_meter_level_dbm0(-36); s->at_state.rx_signal_present = FALSE; s->at_state.rx_trained = FALSE; s->at_state.do_hangup = FALSE; s->at_state.line_ptr = 0; s->audio.silence_heard = 0; s->silence_awaited = 0; s->call_samples = 0; s->modem = FAX_MODEM_NONE; s->at_state.transmit = TRUE; if ((s->rx_queue = queue_init(NULL, 4096, QUEUE_WRITE_ATOMIC | QUEUE_READ_ATOMIC)) == NULL) { if (alloced) free(s); return NULL; } at_init(&s->at_state, at_tx_handler, at_tx_user_data, t31_modem_control_handler, s); at_set_class1_handler(&s->at_state, process_class1_cmd, s); s->at_state.dte_inactivity_timeout = DEFAULT_DTE_TIMEOUT; if (tx_t38_packet_handler) { t31_t38_fe_init(s, tx_t38_packet_handler, tx_t38_packet_user_data); t31_set_t38_config(s, FALSE); } s->t38_mode = FALSE; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t31_release(t31_state_t *s) { at_reset_call_info(&s->at_state); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) t31_free(t31_state_t *s) { t31_release(s); free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/gsm0610_short_term.c0000664000175000017500000002502711422612262014412 00000000000000/* * SpanDSP - a series of DSP components for telephony * * gsm0610_short_term.c - GSM 06.10 full rate speech codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * This code is based on the widely used GSM 06.10 code available from * http://kbs.cs.tu-berlin.de/~jutta/toast.html */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/bitstream.h" #include "spandsp/saturated.h" #include "spandsp/gsm0610.h" #include "gsm0610_local.h" /* SHORT TERM ANALYSIS FILTERING SECTION */ /* 4.2.8 */ static void decode_log_area_ratios(int16_t LARc[8], int16_t *LARpp) { int16_t temp1; /* This procedure requires for efficient implementation two tables. INVA[1..8] = integer((32768*8)/real_A[1..8]) MIC[1..8] = minimum value of the LARc[1..8] */ /* Compute the LARpp[1..8] */ #undef STEP #define STEP(B,MIC,INVA) \ temp1 = saturated_add16(*LARc++, MIC) << 10; \ temp1 = saturated_sub16(temp1, B << 1); \ temp1 = gsm_mult_r(INVA, temp1); \ *LARpp++ = saturated_add16(temp1, temp1); STEP( 0, -32, 13107); STEP( 0, -32, 13107); STEP( 2048, -16, 13107); STEP(-2560, -16, 13107); STEP( 94, -8, 19223); STEP(-1792, -8, 17476); STEP( -341, -4, 31454); STEP(-1144, -4, 29708); /* NOTE: the addition of *MIC is used to restore the sign of *LARc. */ } /*- End of function --------------------------------------------------------*/ /* 4.2.9 */ /* Computation of the quantized reflection coefficients */ /* 4.2.9.1 Interpolation of the LARpp[1..8] to get the LARp[1..8] */ /* Within each frame of 160 analyzed speech samples the short term analysis and synthesis filters operate with four different sets of coefficients, derived from the previous set of decoded LARs(LARpp(j - 1)) and the actual set of decoded LARs (LARpp(j)) (Initial value: LARpp(j - 1)[1..8] = 0.) */ static void coefficients_0_12(int16_t *LARpp_j_1, int16_t *LARpp_j, int16_t *LARp) { int i; for (i = 1; i <= 8; i++, LARp++, LARpp_j_1++, LARpp_j++) { *LARp = saturated_add16(*LARpp_j_1 >> 2, *LARpp_j >> 2); *LARp = saturated_add16(*LARp, *LARpp_j_1 >> 1); } /*endfor*/ } /*- End of function --------------------------------------------------------*/ static void coefficients_13_26(int16_t *LARpp_j_1, int16_t *LARpp_j, int16_t *LARp) { int i; for (i = 1; i <= 8; i++, LARpp_j_1++, LARpp_j++, LARp++) *LARp = saturated_add16(*LARpp_j_1 >> 1, *LARpp_j >> 1); /*endfor*/ } /*- End of function --------------------------------------------------------*/ static void coefficients_27_39(int16_t *LARpp_j_1, int16_t *LARpp_j, int16_t *LARp) { int i; for (i = 1; i <= 8; i++, LARpp_j_1++, LARpp_j++, LARp++) { *LARp = saturated_add16(*LARpp_j_1 >> 2, *LARpp_j >> 2); *LARp = saturated_add16(*LARp, *LARpp_j >> 1); } /*endfor*/ } /*- End of function --------------------------------------------------------*/ static void coefficients_40_159(int16_t *LARpp_j, int16_t *LARp) { int i; for (i = 1; i <= 8; i++) *LARp++ = *LARpp_j++; /*endfor*/ } /*- End of function --------------------------------------------------------*/ /* 4.2.9.2 */ static void larp_to_rp(int16_t LARp[8]) { int i; int16_t *LARpx; int16_t temp; /* The input to this procedure is the interpolated LARp[0..7] array. The reflection coefficients, rp[i], are used in the analysis filter and in the synthesis filter. */ LARpx = LARp; for (i = 1; i <= 8; i++, LARpx++) { temp = *LARpx; if (temp < 0) { if (temp == INT16_MIN) temp = INT16_MAX; else temp = -temp; /*endif*/ if (temp < 11059) temp <<= 1; else if (temp < 20070) temp += 11059; else temp = saturated_add16(temp >> 2, 26112); /*endif*/ *LARpx = -temp; } else { if (temp < 11059) temp <<= 1; else if (temp < 20070) temp += 11059; else temp = saturated_add16(temp >> 2, 26112); /*endif*/ *LARpx = temp; } /*endif*/ } /*endfor*/ } /*- End of function --------------------------------------------------------*/ /* 4.2.10 */ static void short_term_analysis_filtering(gsm0610_state_t *s, int16_t rp[8], int k_n, // k_end - k_start int16_t amp[]) // [0..n-1] IN/OUT { /* This procedure computes the short term residual signal d[..] to be fed to the RPE-LTP loop from the s[..] signal and from the local rp[..] array (quantized reflection coefficients). As the call of this procedure can be done in many ways (see the interpolation of the LAR coefficient), it is assumed that the computation begins with index k_start (for arrays d[..] and s[..]) and stops with index k_end (k_start and k_end are defined in 4.2.9.1). This procedure also needs to keep the array u[0..7] in memory for each call. */ int16_t *u0; int16_t *u_top; int i; int16_t *u; int16_t *rpx; int32_t di; int32_t u_out; u0 = s->u; u_top = u0 + 8; for (i = 0; i < k_n; i++) { di = u_out = amp[i]; for (rpx = rp, u = u0; u < u_top; ) { int32_t ui; int32_t rpi; ui = *u; *u++ = (int16_t) u_out; rpi = *rpx++; u_out = ui + (((rpi*di) + 0x4000) >> 15); di = di + (((rpi*ui) + 0x4000) >> 15); u_out = saturate(u_out); di = saturate(di); } /*endfor*/ amp[i] = (int16_t) di; } /*endfor*/ } /*- End of function --------------------------------------------------------*/ static void short_term_synthesis_filtering(gsm0610_state_t *s, int16_t rrp[8], int k, // k_end - k_start int16_t *wt, // [0..k - 1] int16_t *sr) // [0..k - 1] { int16_t *v; int i; int16_t sri; int16_t tmp1; int16_t tmp2; v = s->v; while (k--) { sri = *wt++; for (i = 8; i--; ) { tmp1 = rrp[i]; tmp2 = v[i]; tmp2 = ((tmp1 == INT16_MIN && tmp2 == INT16_MIN) ? INT16_MAX : (int16_t) (((int32_t) tmp1*(int32_t) tmp2 + 16384) >> 15) & 0xFFFF); sri = saturated_sub16(sri, tmp2); tmp1 = ((tmp1 == INT16_MIN && sri == INT16_MIN) ? INT16_MAX : (int16_t) (((int32_t) tmp1*(int32_t) sri + 16384) >> 15) & 0xFFFF); v[i + 1] = saturated_add16(v[i], tmp1); } /*endfor*/ *sr++ = v[0] = sri; } /*endwhile*/ } /*- End of function --------------------------------------------------------*/ void gsm0610_short_term_analysis_filter(gsm0610_state_t *s, int16_t LARc[8], int16_t amp[GSM0610_FRAME_LEN]) { int16_t *LARpp_j; int16_t *LARpp_j_1; int16_t LARp[8]; LARpp_j = s->LARpp[s->j]; LARpp_j_1 = s->LARpp[s->j ^= 1]; decode_log_area_ratios(LARc, LARpp_j); coefficients_0_12(LARpp_j_1, LARpp_j, LARp); larp_to_rp(LARp); short_term_analysis_filtering(s, LARp, 13, amp); coefficients_13_26(LARpp_j_1, LARpp_j, LARp); larp_to_rp(LARp); short_term_analysis_filtering(s, LARp, 14, amp + 13); coefficients_27_39(LARpp_j_1, LARpp_j, LARp); larp_to_rp(LARp); short_term_analysis_filtering(s, LARp, 13, amp + 27); coefficients_40_159(LARpp_j, LARp); larp_to_rp(LARp); short_term_analysis_filtering(s, LARp, 120, amp + 40); } /*- End of function --------------------------------------------------------*/ void gsm0610_short_term_synthesis_filter(gsm0610_state_t *s, int16_t LARcr[8], int16_t wt[GSM0610_FRAME_LEN], int16_t amp[GSM0610_FRAME_LEN]) { int16_t *LARpp_j; int16_t *LARpp_j_1; int16_t LARp[8]; LARpp_j = s->LARpp[s->j]; LARpp_j_1 = s->LARpp[s->j ^= 1]; decode_log_area_ratios(LARcr, LARpp_j); coefficients_0_12(LARpp_j_1, LARpp_j, LARp); larp_to_rp(LARp); short_term_synthesis_filtering(s, LARp, 13, wt, amp); coefficients_13_26(LARpp_j_1, LARpp_j, LARp); larp_to_rp(LARp); short_term_synthesis_filtering(s, LARp, 14, wt + 13, amp + 13); coefficients_27_39(LARpp_j_1, LARpp_j, LARp); larp_to_rp(LARp); short_term_synthesis_filtering(s, LARp, 13, wt + 27, amp + 27); coefficients_40_159(LARpp_j, LARp); larp_to_rp(LARp); short_term_synthesis_filtering(s, LARp, 120, wt + 40, amp + 40); } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/v22bis_rx.c0000664000175000017500000010310612101202357012655 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v22bis_rx.c - ITU V.22bis modem receive part * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /* THIS IS A WORK IN PROGRESS - It is basically functional, but it is not feature complete, and doesn't reliably sync over the signal and noise level ranges it should. There are some nasty inefficiencies too! TODO: Better noise performance Retrain is incomplete Rate change is not implemented Remote loopback is not implemented */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/complex.h" #include "spandsp/vector_float.h" #include "spandsp/complex_vector_float.h" #include "spandsp/vector_int.h" #include "spandsp/complex_vector_int.h" #include "spandsp/async.h" #include "spandsp/power_meter.h" #include "spandsp/arctan2.h" #include "spandsp/dds.h" #include "spandsp/complex_filters.h" #include "spandsp/v29rx.h" #include "spandsp/v22bis.h" #include "spandsp/private/logging.h" #include "spandsp/private/v22bis.h" #if defined(SPANDSP_USE_FIXED_POINTx) #define FP_SHIFT_FACTOR 10 #define FP_SCALE FP_Q_6_10 #include "v22bis_rx_1200_fixed_rrc.h" #include "v22bis_rx_2400_fixed_rrc.h" #else #define FP_SCALE(x) (x) #include "v22bis_rx_1200_floating_rrc.h" #include "v22bis_rx_2400_floating_rrc.h" #endif #define ms_to_symbols(t) (((t)*600)/1000) /*! The adaption rate coefficient for the equalizer */ #define EQUALIZER_DELTA 0.25f /*! The number of phase shifted coefficient set for the pulse shaping/bandpass filter */ #define PULSESHAPER_COEFF_SETS 12 /* The basic method used by the V.22bis receiver is: Put each sample into the pulse-shaping and phase shift filter buffer At T/2 rate: Filter and demodulate the contents of the input filter buffer, producing a sample in the equalizer filter buffer. Tune the symbol timing based on the latest 3 samples in the equalizer buffer. This updates the decision points for taking the T/2 samples. Equalize the contents of the equalizer buffer, producing a demodulated constellation point. Find the nearest constellation point to the received position. This is our received symbol. Tune the local carrier, based on the angular mismatch between the actual signal and the decision. Tune the equalizer, based on the mismatch between the actual signal and the decision. Descramble and output the bits represented by the decision. */ static const uint8_t space_map_v22bis[6][6] = { {11, 9, 9, 6, 6, 7}, {10, 8, 8, 4, 4, 5}, {10, 8, 8, 4, 4, 5}, {13, 12, 12, 0, 0, 2}, {13, 12, 12, 0, 0, 2}, {15, 14, 14, 1, 1, 3} }; static const uint8_t phase_steps[4] = { 1, 0, 2, 3 }; static const uint8_t ones[] = { 0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4 }; SPAN_DECLARE(float) v22bis_rx_carrier_frequency(v22bis_state_t *s) { return dds_frequencyf(s->rx.carrier_phase_rate); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) v22bis_rx_symbol_timing_correction(v22bis_state_t *s) { return (float) s->rx.total_baud_timing_correction/((float) PULSESHAPER_COEFF_SETS*40.0f/(3.0f*2.0f)); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) v22bis_rx_signal_power(v22bis_state_t *s) { return power_meter_current_dbm0(&s->rx.rx_power) + 6.34f; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v22bis_rx_signal_cutoff(v22bis_state_t *s, float cutoff) { s->rx.carrier_on_power = (int32_t) (power_meter_level_dbm0(cutoff + 2.5f)*0.232f); s->rx.carrier_off_power = (int32_t) (power_meter_level_dbm0(cutoff - 2.5f)*0.232f); } /*- End of function --------------------------------------------------------*/ void v22bis_report_status_change(v22bis_state_t *s, int status) { if (s->status_handler) s->status_handler(s->status_user_data, status); else if (s->put_bit) s->put_bit(s->put_bit_user_data, status); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v22bis_rx_equalizer_state(v22bis_state_t *s, complexf_t **coeffs) { *coeffs = s->rx.eq_coeff; return 2*V22BIS_EQUALIZER_LEN + 1; } /*- End of function --------------------------------------------------------*/ void v22bis_equalizer_coefficient_reset(v22bis_state_t *s) { /* Start with an equalizer based on everything being perfect */ #if defined(SPANDSP_USE_FIXED_POINTx) static const complexi16_t x = {FP_Q_6_10(3.0f), FP_Q_6_10(0.0f)}; cvec_zeroi16(s->rx.eq_coeff, 2*V22BIS_EQUALIZER_LEN + 1); s->rx.eq_coeff[V22BIS_EQUALIZER_LEN] = x; s->rx.eq_delta = 32768.0f*EQUALIZER_DELTA/(2*V22BIS_EQUALIZER_LEN + 1); #else static const complexf_t x = {3.0f, 0.0f}; cvec_zerof(s->rx.eq_coeff, 2*V22BIS_EQUALIZER_LEN + 1); s->rx.eq_coeff[V22BIS_EQUALIZER_LEN] = x; s->rx.eq_delta = EQUALIZER_DELTA/(2*V22BIS_EQUALIZER_LEN + 1); #endif } /*- End of function --------------------------------------------------------*/ static void equalizer_reset(v22bis_state_t *s) { v22bis_equalizer_coefficient_reset(s); #if defined(SPANDSP_USE_FIXED_POINTx) cvec_zeroi16(s->rx.eq_buf, V22BIS_EQUALIZER_MASK + 1); #else cvec_zerof(s->rx.eq_buf, V22BIS_EQUALIZER_MASK + 1); #endif s->rx.eq_put_step = 20 - 1; s->rx.eq_step = 0; } /*- End of function --------------------------------------------------------*/ static complexf_t equalizer_get(v22bis_state_t *s) { int i; int p; complexf_t z; complexf_t z1; /* Get the next equalized value. */ z = complex_setf(0.0f, 0.0f); p = s->rx.eq_step - 1; for (i = 0; i < 2*V22BIS_EQUALIZER_LEN + 1; i++) { p = (p - 1) & V22BIS_EQUALIZER_MASK; z1 = complex_mulf(&s->rx.eq_coeff[i], &s->rx.eq_buf[p]); z = complex_addf(&z, &z1); } return z; } /*- End of function --------------------------------------------------------*/ static void tune_equalizer(v22bis_state_t *s, const complexf_t *z, const complexf_t *target) { int i; int p; complexf_t ez; complexf_t z1; /* Find the x and y mismatch from the exact constellation position. */ ez = complex_subf(target, z); ez.re *= s->rx.eq_delta; ez.im *= s->rx.eq_delta; p = s->rx.eq_step - 1; for (i = 0; i < 2*V22BIS_EQUALIZER_LEN + 1; i++) { p = (p - 1) & V22BIS_EQUALIZER_MASK; z1 = complex_conjf(&s->rx.eq_buf[p]); z1 = complex_mulf(&ez, &z1); s->rx.eq_coeff[i] = complex_addf(&s->rx.eq_coeff[i], &z1); /* If we don't leak a little bit we seem to get some wandering adaption */ s->rx.eq_coeff[i].re *= 0.9999f; s->rx.eq_coeff[i].im *= 0.9999f; } } /*- End of function --------------------------------------------------------*/ static __inline__ void track_carrier(v22bis_state_t *s, const complexf_t *z, const complexf_t *target) { float error; /* For small errors the imaginary part of the difference between the actual and the target positions is proportional to the phase error, for any particular target. However, the different amplitudes of the various target positions scale things. */ error = z->im*target->re - z->re*target->im; s->rx.carrier_phase_rate += (int32_t) (s->rx.carrier_track_i*error); s->rx.carrier_phase += (int32_t) (s->rx.carrier_track_p*error); //span_log(&s->logging, SPAN_LOG_FLOW, "Im = %15.5f f = %15.5f\n", error, dds_frequencyf(s->rx.carrier_phase_rate)); } /*- End of function --------------------------------------------------------*/ static __inline__ int descramble(v22bis_state_t *s, int bit) { int out_bit; bit &= 1; /* Descramble the bit */ out_bit = (bit ^ (s->rx.scramble_reg >> 13) ^ (s->rx.scramble_reg >> 16)) & 1; s->rx.scramble_reg = (s->rx.scramble_reg << 1) | bit; if (s->rx.scrambler_pattern_count >= 64) { out_bit ^= 1; s->rx.scrambler_pattern_count = 0; } if (bit) s->rx.scrambler_pattern_count++; else s->rx.scrambler_pattern_count = 0; return out_bit; } /*- End of function --------------------------------------------------------*/ static __inline__ void put_bit(v22bis_state_t *s, int bit) { int out_bit; /* Descramble the bit */ out_bit = descramble(s, bit); s->put_bit(s->put_bit_user_data, out_bit); } /*- End of function --------------------------------------------------------*/ static void decode_baud(v22bis_state_t *s, int nearest) { int raw_bits; raw_bits = phase_steps[((nearest >> 2) - (s->rx.constellation_state >> 2)) & 3]; s->rx.constellation_state = nearest; /* The first two bits are the quadrant */ put_bit(s, raw_bits >> 1); put_bit(s, raw_bits); if (s->rx.sixteen_way_decisions) { /* The other two bits are the position within the quadrant */ put_bit(s, nearest >> 1); put_bit(s, nearest); } } /*- End of function --------------------------------------------------------*/ static int decode_baudx(v22bis_state_t *s, int nearest) { int raw_bits; int out_bits; raw_bits = phase_steps[((nearest >> 2) - (s->rx.constellation_state >> 2)) & 3]; s->rx.constellation_state = nearest; /* The first two bits are the quadrant */ out_bits = descramble(s, raw_bits >> 1); out_bits = (out_bits << 1) | descramble(s, raw_bits); if (s->rx.sixteen_way_decisions) { /* The other two bits are the position within the quadrant */ out_bits = (out_bits << 1) | descramble(s, nearest >> 1); out_bits = (out_bits << 1) | descramble(s, nearest); } return out_bits; } /*- End of function --------------------------------------------------------*/ static __inline__ void symbol_sync(v22bis_state_t *s) { float p; float q; complexf_t zz; complexf_t a; complexf_t b; complexf_t c; /* This routine adapts the position of the half baud samples entering the equalizer. */ /* Perform a Gardner test for baud alignment on the three most recent samples. */ if (s->rx.sixteen_way_decisions) { p = s->rx.eq_buf[(s->rx.eq_step - 3) & V22BIS_EQUALIZER_MASK].re - s->rx.eq_buf[(s->rx.eq_step - 1) & V22BIS_EQUALIZER_MASK].re; p *= s->rx.eq_buf[(s->rx.eq_step - 2) & V22BIS_EQUALIZER_MASK].re; q = s->rx.eq_buf[(s->rx.eq_step - 3) & V22BIS_EQUALIZER_MASK].im - s->rx.eq_buf[(s->rx.eq_step - 1) & V22BIS_EQUALIZER_MASK].im; q *= s->rx.eq_buf[(s->rx.eq_step - 2) & V22BIS_EQUALIZER_MASK].im; } else { /* Rotate the points to the 45 degree positions, to maximise the effectiveness of the Gardner algorithm. This is particularly significant at the start of operation to pull things in quickly. */ zz = complex_setf(0.894427, 0.44721f); a = complex_mulf(&s->rx.eq_buf[(s->rx.eq_step - 3) & V22BIS_EQUALIZER_MASK], &zz); b = complex_mulf(&s->rx.eq_buf[(s->rx.eq_step - 2) & V22BIS_EQUALIZER_MASK], &zz); c = complex_mulf(&s->rx.eq_buf[(s->rx.eq_step - 1) & V22BIS_EQUALIZER_MASK], &zz); p = (a.re - c.re)*b.re; q = (a.im - c.im)*b.im; } s->rx.gardner_integrate += (p + q > 0.0f) ? s->rx.gardner_step : -s->rx.gardner_step; if (abs(s->rx.gardner_integrate) >= 16) { /* This integrate and dump approach avoids rapid changes of the equalizer put step. Rapid changes, without hysteresis, are bad. They degrade the equalizer performance when the true symbol boundary is close to a sample boundary. */ s->rx.eq_put_step += (s->rx.gardner_integrate/16); s->rx.total_baud_timing_correction += (s->rx.gardner_integrate/16); //span_log(&s->logging, SPAN_LOG_FLOW, "Gardner kick %d [total %d]\n", s->rx.gardner_integrate, s->rx.total_baud_timing_correction); if (s->rx.qam_report) s->rx.qam_report(s->rx.qam_user_data, NULL, NULL, s->rx.gardner_integrate); s->rx.gardner_integrate = 0; } } /*- End of function --------------------------------------------------------*/ static void process_half_baud(v22bis_state_t *s, const complexf_t *sample) { complexf_t z; complexf_t zz; const complexf_t *target; int re; int im; int nearest; int bitstream; int raw_bits; z.re = sample->re; z.im = sample->im; /* Add a sample to the equalizer's circular buffer, but don't calculate anything at this time. */ s->rx.eq_buf[s->rx.eq_step] = z; s->rx.eq_step = (s->rx.eq_step + 1) & V22BIS_EQUALIZER_MASK; /* On alternate insertions we have a whole baud and must process it. */ if ((s->rx.baud_phase ^= 1)) return; symbol_sync(s); z = equalizer_get(s); /* Find the constellation point */ if (s->rx.sixteen_way_decisions) { re = (int) (z.re + 3.0f); im = (int) (z.im + 3.0f); if (re > 5) re = 5; else if (re < 0) re = 0; if (im > 5) im = 5; else if (im < 0) im = 0; nearest = space_map_v22bis[re][im]; } else { /* Rotate to 45 degrees, to make the slicing trivial. */ zz = complex_setf(0.894427, 0.44721f); zz = complex_mulf(&z, &zz); nearest = 0x01; if (zz.re < 0) nearest |= 0x04; if (zz.im < 0) { nearest ^= 0x04; nearest |= 0x08; } } raw_bits = 0; switch (s->rx.training) { case V22BIS_RX_TRAINING_STAGE_NORMAL_OPERATION: /* Normal operation. */ target = &v22bis_constellation[nearest]; track_carrier(s, &z, target); tune_equalizer(s, &z, target); raw_bits = phase_steps[((nearest >> 2) - (s->rx.constellation_state >> 2)) & 3]; /* TODO: detect unscrambled ones indicating a loopback request */ /* Search for the S1 signal that might be requesting a retrain */ if ((s->rx.last_raw_bits ^ raw_bits) == 0x3) { s->rx.pattern_repeats++; } else { if (s->rx.pattern_repeats >= 50 && (s->rx.last_raw_bits == 0x3 || s->rx.last_raw_bits == 0x0)) { /* We should get a full run of 00 11 (about 60 bauds) at either modem. */ span_log(&s->logging, SPAN_LOG_FLOW, "+++ S1 detected (%d long)\n", s->rx.pattern_repeats); span_log(&s->logging, SPAN_LOG_FLOW, "+++ Accepting a retrain request\n"); s->rx.pattern_repeats = 0; s->rx.training_count = 0; s->rx.training = V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200; s->tx.training_count = 0; s->tx.training = V22BIS_TX_TRAINING_STAGE_U0011; v22bis_equalizer_coefficient_reset(s); v22bis_report_status_change(s, SIG_STATUS_MODEM_RETRAIN_OCCURRED); } s->rx.pattern_repeats = 0; } decode_baud(s, nearest); break; case V22BIS_RX_TRAINING_STAGE_SYMBOL_ACQUISITION: /* Allow time for the Gardner algorithm to settle the symbol timing. */ target = &z; if (++s->rx.training_count >= 40) { /* QAM and Gardner only play nicely with heavy damping, so we need to change to a slow rate of symbol timing adaption. However, it must not be so slow that it cannot track the worst case timing error specified in V.22bis. This should be 0.01%, but since we might be off in the opposite direction from the source, the total error could be higher. */ s->rx.gardner_step = 4; s->rx.pattern_repeats = 0; s->rx.training = (s->calling_party) ? V22BIS_RX_TRAINING_STAGE_UNSCRAMBLED_ONES : V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200; /* Be pessimistic and see what the handshake brings */ s->negotiated_bit_rate = 1200; break; } /* Once we have pulled in the symbol timing in a coarse way, use finer steps to fine tune the timing. */ if (s->rx.training_count == 30) s->rx.gardner_step = 32; break; case V22BIS_RX_TRAINING_STAGE_UNSCRAMBLED_ONES: /* Calling modem only */ /* The calling modem should initially receive unscrambled ones at 1200bps */ target = &v22bis_constellation[nearest]; track_carrier(s, &z, target); raw_bits = phase_steps[((nearest >> 2) - (s->rx.constellation_state >> 2)) & 3]; s->rx.constellation_state = nearest; if (raw_bits != s->rx.last_raw_bits) s->rx.pattern_repeats = 0; else s->rx.pattern_repeats++; if (++s->rx.training_count == ms_to_symbols(155 + 456)) { /* After the first 155ms things should have been steady, so check if the last 456ms was steady at 11 or 00. */ if (raw_bits == s->rx.last_raw_bits && (raw_bits == 0x3 || raw_bits == 0x0) && s->rx.pattern_repeats >= ms_to_symbols(456)) { /* It looks like the answering machine is sending us a clean unscrambled 11 or 00 */ if (s->bit_rate == 2400) { /* Try to establish at 2400bps. */ span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting U0011 (S1) (Caller)\n"); s->tx.training = V22BIS_TX_TRAINING_STAGE_U0011; s->tx.training_count = 0; } else { /* Only try to establish at 1200bps. */ span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting S11 (1200) (Caller)\n"); s->tx.training = V22BIS_TX_TRAINING_STAGE_S11; s->tx.training_count = 0; } } s->rx.pattern_repeats = 0; s->rx.training_count = 0; s->rx.training = V22BIS_RX_TRAINING_STAGE_UNSCRAMBLED_ONES_SUSTAINING; } break; case V22BIS_RX_TRAINING_STAGE_UNSCRAMBLED_ONES_SUSTAINING: /* Calling modem only. */ /* Wait for the end of the unscrambled ones at 1200bps. */ target = &v22bis_constellation[nearest]; track_carrier(s, &z, target); raw_bits = phase_steps[((nearest >> 2) - (s->rx.constellation_state >> 2)) & 3]; s->rx.constellation_state = nearest; if (raw_bits != s->rx.last_raw_bits) { /* This looks like the end of the sustained initial unscrambled 11 or 00. */ s->tx.training_count = 0; s->tx.training = V22BIS_TX_TRAINING_STAGE_TIMED_S11; s->rx.training_count = 0; s->rx.training = V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200; s->rx.pattern_repeats = 0; } break; case V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200: target = &v22bis_constellation[nearest]; track_carrier(s, &z, target); tune_equalizer(s, &z, target); raw_bits = phase_steps[((nearest >> 2) - (s->rx.constellation_state >> 2)) & 3]; bitstream = decode_baudx(s, nearest); s->rx.training_count++; //span_log(&s->logging, SPAN_LOG_FLOW, "S11 0x%02x 0x%02x 0x%X %d %d %d %d %d\n", raw_bits, nearest, bitstream, s->rx.scrambled_ones_to_date, 0, 0, 0, s->rx.training_count); if (s->negotiated_bit_rate == 1200) { /* Search for the S1 signal */ if ((s->rx.last_raw_bits ^ raw_bits) == 0x3) { s->rx.pattern_repeats++; } else { if (s->rx.pattern_repeats >= 15 && (s->rx.last_raw_bits == 0x3 || s->rx.last_raw_bits == 0x0)) { /* We should get a full run of 00 11 (about 60 bauds) at the calling modem, but only about 20 at the answering modem, as the first 40 are TED settling time. */ span_log(&s->logging, SPAN_LOG_FLOW, "+++ S1 detected (%d long)\n", s->rx.pattern_repeats); if (s->bit_rate == 2400) { if (!s->calling_party) { /* Accept establishment at 2400bps */ span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting U0011 (S1) (Answerer)\n"); s->tx.training = V22BIS_TX_TRAINING_STAGE_U0011; s->tx.training_count = 0; } s->negotiated_bit_rate = 2400; } } s->rx.pattern_repeats = 0; } if (s->rx.training_count >= ms_to_symbols(270)) { /* If we haven't seen the S1 signal by now, we are committed to be in 1200bps mode. */ if (s->calling_party) { span_log(&s->logging, SPAN_LOG_FLOW, "+++ Rx normal operation (1200)\n"); /* The transmit side needs to sustain the scrambled ones for a timed period. */ s->tx.training_count = 0; s->tx.training = V22BIS_TX_TRAINING_STAGE_TIMED_S11; /* Normal reception starts immediately. */ s->rx.training = V22BIS_RX_TRAINING_STAGE_NORMAL_OPERATION; s->rx.carrier_track_i = 8000.0f; } else { span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting S11 (1200) (Answerer)\n"); /* The transmit side needs to sustain the scrambled ones for a timed period. */ s->tx.training_count = 0; s->tx.training = V22BIS_TX_TRAINING_STAGE_TIMED_S11; /* The receive side needs to wait a timed period, receiving scrambled ones, before entering normal operation. */ s->rx.training = V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200_SUSTAINING; } } } else { if (s->calling_party) { if (s->rx.training_count >= ms_to_symbols(100 + 450)) { span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting 16 way decisions (caller)\n"); s->rx.sixteen_way_decisions = TRUE; s->rx.training = V22BIS_RX_TRAINING_STAGE_WAIT_FOR_SCRAMBLED_ONES_AT_2400; s->rx.pattern_repeats = 0; s->rx.carrier_track_i = 8000.0f; } } else { if (s->rx.training_count >= ms_to_symbols(450)) { span_log(&s->logging, SPAN_LOG_FLOW, "+++ starting 16 way decisions (answerer)\n"); s->rx.sixteen_way_decisions = TRUE; s->rx.training = V22BIS_RX_TRAINING_STAGE_WAIT_FOR_SCRAMBLED_ONES_AT_2400; s->rx.pattern_repeats = 0; } } } break; case V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200_SUSTAINING: target = &v22bis_constellation[nearest]; track_carrier(s, &z, target); tune_equalizer(s, &z, target); bitstream = decode_baudx(s, nearest); if (++s->rx.training_count > ms_to_symbols(270 + 765)) { span_log(&s->logging, SPAN_LOG_FLOW, "+++ Rx normal operation (1200)\n"); s->rx.training = V22BIS_RX_TRAINING_STAGE_NORMAL_OPERATION; } break; case V22BIS_RX_TRAINING_STAGE_WAIT_FOR_SCRAMBLED_ONES_AT_2400: target = &v22bis_constellation[nearest]; track_carrier(s, &z, target); tune_equalizer(s, &z, target); bitstream = decode_baudx(s, nearest); /* We need 32 sustained 1's to switch into normal operation. */ if (bitstream == 0xF) { if (++s->rx.pattern_repeats >= 9) { span_log(&s->logging, SPAN_LOG_FLOW, "+++ Rx normal operation (2400)\n"); s->rx.training = V22BIS_RX_TRAINING_STAGE_NORMAL_OPERATION; } } else { s->rx.pattern_repeats = 0; } break; case V22BIS_RX_TRAINING_STAGE_PARKED: default: /* We failed to train! */ /* Park here until the carrier drops. */ target = &z; break; } s->rx.last_raw_bits = raw_bits; if (s->rx.qam_report) s->rx.qam_report(s->rx.qam_user_data, &z, target, s->rx.constellation_state); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) v22bis_rx(v22bis_state_t *s, const int16_t amp[], int len) { int i; int step; complexf_t z; complexf_t zz; int32_t power; complexf_t sample; float ii; float qq; for (i = 0; i < len; i++) { /* Complex bandpass filter the signal, using a pair of FIRs, and RRC coeffs shifted to centre at 1200Hz or 2400Hz. The filters support 12 fractional phase shifts, to permit signal extraction very close to the middle of a symbol. */ s->rx.rrc_filter[s->rx.rrc_filter_step] = amp[i]; if (++s->rx.rrc_filter_step >= V22BIS_RX_FILTER_STEPS) s->rx.rrc_filter_step = 0; /* Calculate the I filter, with an arbitrary phase step, just so we can calculate the signal power of the required carrier, with any guard tone or spillback of our own transmitted signal suppressed. */ if (s->calling_party) { #if defined(SPANDSP_USE_FIXED_POINT) ii = vec_circular_dot_prodi16(s->rx.rrc_filter, rx_pulseshaper_2400_re[6], V22BIS_RX_FILTER_STEPS, s->rx.rrc_filter_step); #else ii = vec_circular_dot_prodf(s->rx.rrc_filter, rx_pulseshaper_2400_re[6], V22BIS_RX_FILTER_STEPS, s->rx.rrc_filter_step); #endif } else { #if defined(SPANDSP_USE_FIXED_POINT) ii = vec_circular_dot_prodi16(s->rx.rrc_filter, rx_pulseshaper_1200_re[6], V22BIS_RX_FILTER_STEPS, s->rx.rrc_filter_step); #else ii = vec_circular_dot_prodf(s->rx.rrc_filter, rx_pulseshaper_1200_re[6], V22BIS_RX_FILTER_STEPS, s->rx.rrc_filter_step); #endif } power = power_meter_update(&s->rx.rx_power, (int16_t) ii); if (s->rx.signal_present) { /* Look for power below the carrier off point */ if (power < s->rx.carrier_off_power) { v22bis_restart(s, s->bit_rate); v22bis_report_status_change(s, SIG_STATUS_CARRIER_DOWN); continue; } } else { /* Look for power exceeding the carrier on point */ if (power < s->rx.carrier_on_power) continue; s->rx.signal_present = TRUE; v22bis_report_status_change(s, SIG_STATUS_CARRIER_UP); } if (s->rx.training != V22BIS_RX_TRAINING_STAGE_PARKED) { /* Only spend effort processing this data if the modem is not parked, after a training failure. */ z = dds_complexf(&s->rx.carrier_phase, s->rx.carrier_phase_rate); if (s->rx.training == V22BIS_RX_TRAINING_STAGE_SYMBOL_ACQUISITION) { /* Only AGC during the initial symbol acquisition, and then lock the gain. */ s->rx.agc_scaling = 0.18f*3.60f/sqrtf(power); } /* Put things into the equalization buffer at T/2 rate. The Gardner algorithm will fiddle the step to align this with the symbols. */ if ((s->rx.eq_put_step -= PULSESHAPER_COEFF_SETS) <= 0) { /* Pulse shape while still at the carrier frequency, using a quadrature pair of filters. This results in a properly bandpass filtered complex signal, which can be brought directly to bandband by complex mixing. No further filtering, to remove mixer harmonics, is needed. */ step = -s->rx.eq_put_step; if (step > PULSESHAPER_COEFF_SETS - 1) step = PULSESHAPER_COEFF_SETS - 1; s->rx.eq_put_step += PULSESHAPER_COEFF_SETS*40/(3*2); if (s->calling_party) { #if defined(SPANDSP_USE_FIXED_POINT) ii = vec_circular_dot_prodi16(s->rx.rrc_filter, rx_pulseshaper_2400_re[step], V22BIS_RX_FILTER_STEPS, s->rx.rrc_filter_step); qq = vec_circular_dot_prodi16(s->rx.rrc_filter, rx_pulseshaper_2400_im[step], V22BIS_RX_FILTER_STEPS, s->rx.rrc_filter_step); #else ii = vec_circular_dot_prodf(s->rx.rrc_filter, rx_pulseshaper_2400_re[step], V22BIS_RX_FILTER_STEPS, s->rx.rrc_filter_step); qq = vec_circular_dot_prodf(s->rx.rrc_filter, rx_pulseshaper_2400_im[step], V22BIS_RX_FILTER_STEPS, s->rx.rrc_filter_step); #endif } else { #if defined(SPANDSP_USE_FIXED_POINT) ii = vec_circular_dot_prodi16(s->rx.rrc_filter, rx_pulseshaper_1200_re[step], V22BIS_RX_FILTER_STEPS, s->rx.rrc_filter_step); qq = vec_circular_dot_prodi16(s->rx.rrc_filter, rx_pulseshaper_1200_im[step], V22BIS_RX_FILTER_STEPS, s->rx.rrc_filter_step); #else ii = vec_circular_dot_prodf(s->rx.rrc_filter, rx_pulseshaper_1200_re[step], V22BIS_RX_FILTER_STEPS, s->rx.rrc_filter_step); qq = vec_circular_dot_prodf(s->rx.rrc_filter, rx_pulseshaper_1200_im[step], V22BIS_RX_FILTER_STEPS, s->rx.rrc_filter_step); #endif } sample.re = ii*s->rx.agc_scaling; sample.im = qq*s->rx.agc_scaling; /* Shift to baseband - since this is done in a full complex form, the result is clean, and requires no further filtering apart from the equalizer. */ zz.re = sample.re*z.re - sample.im*z.im; zz.im = -sample.re*z.im - sample.im*z.re; process_half_baud(s, &zz); } } } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) v22bis_rx_fillin(v22bis_state_t *s, int len) { int i; /* We want to sustain the current state (i.e carrier on<->carrier off), and try to sustain the carrier phase. We should probably push the filters, as well */ span_log(&s->logging, SPAN_LOG_FLOW, "Fill-in %d samples\n", len); if (!s->rx.signal_present) return 0; for (i = 0; i < len; i++) { #if defined(SPANDSP_USE_FIXED_POINTx) dds_advance(&s->rx.carrier_phase, s->rx.carrier_phase_rate); #else dds_advancef(&s->rx.carrier_phase, s->rx.carrier_phase_rate); #endif } /* TODO: Advance the symbol phase the appropriate amount */ return 0; } /*- End of function --------------------------------------------------------*/ int v22bis_rx_restart(v22bis_state_t *s) { #if defined(SPANDSP_USE_FIXED_POINTx) vec_zeroi16(s->rx.rrc_filter, sizeof(s->rx.rrc_filter)/sizeof(s->rx.rrc_filter[0])); #else vec_zerof(s->rx.rrc_filter, sizeof(s->rx.rrc_filter)/sizeof(s->rx.rrc_filter[0])); #endif s->rx.rrc_filter_step = 0; s->rx.scramble_reg = 0; s->rx.scrambler_pattern_count = 0; s->rx.training = V22BIS_RX_TRAINING_STAGE_SYMBOL_ACQUISITION; s->rx.training_count = 0; s->rx.signal_present = FALSE; s->rx.carrier_phase_rate = dds_phase_ratef((s->calling_party) ? 2400.0f : 1200.0f); s->rx.carrier_phase = 0; power_meter_init(&s->rx.rx_power, 5); v22bis_rx_signal_cutoff(s, -45.5f); s->rx.agc_scaling = 0.0005f*0.025f; s->rx.constellation_state = 0; s->rx.sixteen_way_decisions = FALSE; equalizer_reset(s); s->rx.pattern_repeats = 0; s->rx.last_raw_bits = 0; s->rx.gardner_integrate = 0; s->rx.gardner_step = 256; s->rx.baud_phase = 0; s->rx.training_error = 0.0f; s->rx.total_baud_timing_correction = 0; /* We want the carrier to pull in faster on the answerer side, as it has very little time to adapt. */ s->rx.carrier_track_i = (s->calling_party) ? 8000.0f : 40000.0f; s->rx.carrier_track_p = 8000000.0f; s->negotiated_bit_rate = 1200; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v22bis_rx_set_qam_report_handler(v22bis_state_t *s, qam_report_handler_t handler, void *user_data) { s->rx.qam_report = handler; s->rx.qam_user_data = user_data; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/v27ter_rx.c0000664000175000017500000012535212350627747012732 00000000000000#define IAXMODEM_STUFF /* * SpanDSP - a series of DSP components for telephony * * v27ter_rx.c - ITU V.27ter modem receive part * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/complex.h" #include "spandsp/vector_float.h" #include "spandsp/complex_vector_float.h" #include "spandsp/vector_int.h" #include "spandsp/complex_vector_int.h" #include "spandsp/async.h" #include "spandsp/power_meter.h" #include "spandsp/arctan2.h" #include "spandsp/dds.h" #include "spandsp/complex_filters.h" #include "spandsp/v29rx.h" #include "spandsp/v27ter_rx.h" #include "spandsp/private/logging.h" #include "spandsp/private/v27ter_rx.h" #if defined(SPANDSP_USE_FIXED_POINT) #include "v27ter_rx_4800_fixed_rrc.h" #include "v27ter_rx_2400_fixed_rrc.h" #else #include "v27ter_rx_4800_floating_rrc.h" #include "v27ter_rx_2400_floating_rrc.h" #endif /* V.27ter is a DPSK modem, but this code treats it like QAM. It nails down the signal to a static constellation, even though dealing with differences is all that is necessary. */ /*! The nominal frequency of the carrier, in Hertz */ #define CARRIER_NOMINAL_FREQ 1800.0f /*! The nominal baud or symbol rate in 2400bps mode */ #define BAUD_RATE_2400 1200 /*! The nominal baud or symbol rate in 4800bps mode */ #define BAUD_RATE_4800 1600 /*! The adaption rate coefficient for the equalizer */ #define EQUALIZER_DELTA 0.25f #if defined(SPANDSP_USE_FIXED_POINT) #define FP_FACTOR 4096 #define FP_SHIFT_FACTOR 12 #endif /* Segments of the training sequence */ /* V.27ter defines a long and a short sequence. FAX doesn't use the short sequence, so it is not implemented here. */ /*! The length of training segment 3, in symbols */ #define V27TER_TRAINING_SEG_3_LEN 50 /*! The length of training segment 5, in symbols */ #define V27TER_TRAINING_SEG_5_LEN 1074 /*! The length of training segment 6, in symbols */ #define V27TER_TRAINING_SEG_6_LEN 8 enum { TRAINING_STAGE_NORMAL_OPERATION = 0, TRAINING_STAGE_SYMBOL_ACQUISITION, TRAINING_STAGE_LOG_PHASE, TRAINING_STAGE_WAIT_FOR_HOP, TRAINING_STAGE_TRAIN_ON_ABAB, TRAINING_STAGE_TEST_ONES, TRAINING_STAGE_PARKED }; #if defined(SPANDSP_USE_FIXED_POINTx) static const complexi16_t v27ter_constellation[8] = { {((int)(FP_FACTOR* 1.414f), ((int)(FP_FACTOR* 0.0f)}, /* 0deg */ {((int)(FP_FACTOR* 1.0f), ((int)(FP_FACTOR* 1.0f)}, /* 45deg */ {((int)(FP_FACTOR* 0.0f), ((int)(FP_FACTOR* 1.414f)}, /* 90deg */ {((int)(FP_FACTOR*-1.0f), ((int)(FP_FACTOR* 1.0f)}, /* 135deg */ {((int)(FP_FACTOR*-1.414f), ((int)(FP_FACTOR* 0.0f)}, /* 180deg */ {((int)(FP_FACTOR*-1.0f), ((int)(FP_FACTOR*-1.0f)}, /* 225deg */ {((int)(FP_FACTOR* 0.0f), ((int)(FP_FACTOR*-1.414f)}, /* 270deg */ {((int)(FP_FACTOR* 1.0f), ((int)(FP_FACTOR*-1.0f)} /* 315deg */ }; #else static const complexf_t v27ter_constellation[8] = { { 1.414f, 0.0f}, /* 0deg */ { 1.0f, 1.0f}, /* 45deg */ { 0.0f, 1.414f}, /* 90deg */ {-1.0f, 1.0f}, /* 135deg */ {-1.414f, 0.0f}, /* 180deg */ {-1.0f, -1.0f}, /* 225deg */ { 0.0f, -1.414f}, /* 270deg */ { 1.0f, -1.0f} /* 315deg */ }; #endif SPAN_DECLARE(float) v27ter_rx_carrier_frequency(v27ter_rx_state_t *s) { return dds_frequencyf(s->carrier_phase_rate); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) v27ter_rx_symbol_timing_correction(v27ter_rx_state_t *s) { int steps_per_symbol; steps_per_symbol = (s->bit_rate == 4800) ? RX_PULSESHAPER_4800_COEFF_SETS*5 : RX_PULSESHAPER_2400_COEFF_SETS*20/3; return (float) s->total_baud_timing_correction/(float) steps_per_symbol; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) v27ter_rx_signal_power(v27ter_rx_state_t *s) { return power_meter_current_dbm0(&s->power) + 3.98f; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v27ter_rx_signal_cutoff(v27ter_rx_state_t *s, float cutoff) { /* The 0.4 factor allows for the gain of the DC blocker */ s->carrier_on_power = (int32_t) (power_meter_level_dbm0(cutoff + 2.5f)*0.4f); s->carrier_off_power = (int32_t) (power_meter_level_dbm0(cutoff - 2.5f)*0.4f); } /*- End of function --------------------------------------------------------*/ static void report_status_change(v27ter_rx_state_t *s, int status) { if (s->status_handler) s->status_handler(s->status_user_data, status); else if (s->put_bit) s->put_bit(s->put_bit_user_data, status); } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINTx) SPAN_DECLARE(int) v27ter_rx_equalizer_state(v27ter_rx_state_t *s, complexi16_t **coeffs) #else SPAN_DECLARE(int) v27ter_rx_equalizer_state(v27ter_rx_state_t *s, complexf_t **coeffs) #endif { *coeffs = s->eq_coeff; return V27TER_EQUALIZER_LEN; } /*- End of function --------------------------------------------------------*/ static void equalizer_save(v27ter_rx_state_t *s) { #if defined(SPANDSP_USE_FIXED_POINTx) cvec_copyi16(s->eq_coeff_save, s->eq_coeff, V27TER_EQUALIZER_LEN); #else cvec_copyf(s->eq_coeff_save, s->eq_coeff, V27TER_EQUALIZER_LEN); #endif } /*- End of function --------------------------------------------------------*/ static void equalizer_restore(v27ter_rx_state_t *s) { #if defined(SPANDSP_USE_FIXED_POINTx) cvec_copyi16(s->eq_coeff, s->eq_coeff_save, V27TER_EQUALIZER_LEN); cvec_zeroi16(s->eq_buf, V27TER_EQUALIZER_LEN); s->eq_delta = 32768.0f*EQUALIZER_DELTA/V27TER_EQUALIZER_LEN; #else cvec_copyf(s->eq_coeff, s->eq_coeff_save, V27TER_EQUALIZER_LEN); cvec_zerof(s->eq_buf, V27TER_EQUALIZER_LEN); s->eq_delta = EQUALIZER_DELTA/V27TER_EQUALIZER_LEN; #endif s->eq_put_step = (s->bit_rate == 4800) ? (RX_PULSESHAPER_4800_COEFF_SETS*5/2 - 1) : (RX_PULSESHAPER_2400_COEFF_SETS*20/(3*2) - 1); s->eq_step = 0; } /*- End of function --------------------------------------------------------*/ static void equalizer_reset(v27ter_rx_state_t *s) { /* Start with an equalizer based on everything being perfect. */ #if defined(SPANDSP_USE_FIXED_POINTx) static const complexi16_t x = {FP_SCALE(1.414f), FP_SCALE(0.0f)}; cvec_zeroi16(s->eq_coeff, V27TER_EQUALIZER_LEN); s->eq_coeff[V27TER_EQUALIZER_PRE_LEN + 1] = x; cvec_zeroi16(s->eq_buf, V27TER_EQUALIZER_LEN); s->eq_delta = 32768.0f*EQUALIZER_DELTA/V27TER_EQUALIZER_LEN; #else static const complexf_t x = {1.414f, 0.0f}; cvec_zerof(s->eq_coeff, V27TER_EQUALIZER_LEN); s->eq_coeff[V27TER_EQUALIZER_PRE_LEN + 1] = x; cvec_zerof(s->eq_buf, V27TER_EQUALIZER_LEN); s->eq_delta = EQUALIZER_DELTA/V27TER_EQUALIZER_LEN; #endif s->eq_put_step = (s->bit_rate == 4800) ? RX_PULSESHAPER_4800_COEFF_SETS*5/2 : RX_PULSESHAPER_2400_COEFF_SETS*20/(3*2); s->eq_step = 0; } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINTx) static __inline__ complexi16_t complex_mul_q4_12(const complexi16_t *x, const complexi16_t *y) { complexi16_t z; z.re = ((int32_t) x->re*(int32_t) y->re - (int32_t) x->im*(int32_t) y->im) >> 12; z.im = ((int32_t) x->re*(int32_t) y->im + (int32_t) x->im*(int32_t) y->re) >> 12; return z; } /*- End of function --------------------------------------------------------*/ #endif #if defined(SPANDSP_USE_FIXED_POINTx) static __inline__ complexi16_t equalizer_get(v27ter_rx_state_t *s) { complexi32_t zz; complexi16_t z; /* Get the next equalized value. */ zz = cvec_circular_dot_prodi16(s->eq_buf, s->eq_coeff, V27TER_EQUALIZER_LEN, s->eq_step); z.re = zz.re >> FP_SHIFT_FACTOR; z.im = zz.im >> FP_SHIFT_FACTOR; return z; } #else static __inline__ complexf_t equalizer_get(v27ter_rx_state_t *s) { /* Get the next equalized value. */ return cvec_circular_dot_prodf(s->eq_buf, s->eq_coeff, V27TER_EQUALIZER_LEN, s->eq_step); } #endif /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINTx) static void tune_equalizer(v27ter_rx_state_t *s, const complexi16_t *z, const complexi16_t *target) { complexi16_t err; /* Find the x and y mismatch from the exact constellation position. */ err.re = target->re*FP_FACTOR - z->re; err.im = target->im*FP_FACTOR - z->im; err.re = ((int32_t) err.re*(int32_t) s->eq_delta) >> 15; err.im = ((int32_t) err.im*(int32_t) s->eq_delta) >> 15; cvec_circular_lmsi16(s->eq_buf, s->eq_coeff, V27TER_EQUALIZER_LEN, s->eq_step, &err); } #else static void tune_equalizer(v27ter_rx_state_t *s, const complexf_t *z, const complexf_t *target) { complexf_t err; /* Find the x and y mismatch from the exact constellation position. */ err = complex_subf(target, z); err.re *= s->eq_delta; err.im *= s->eq_delta; cvec_circular_lmsf(s->eq_buf, s->eq_coeff, V27TER_EQUALIZER_LEN, s->eq_step, &err); } #endif /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINTx) static __inline__ void track_carrier(v27ter_rx_state_t *s, const complexi16_t *z, const complexi16_t *target) #else static __inline__ void track_carrier(v27ter_rx_state_t *s, const complexf_t *z, const complexf_t *target) #endif { #if defined(SPANDSP_USE_FIXED_POINTx) int32_t error; #else float error; #endif /* For small errors the imaginary part of the difference between the actual and the target positions is proportional to the phase error, for any particular target. However, the different amplitudes of the various target positions scale things. */ error = z->im*target->re - z->re*target->im; #if defined(SPANDSP_USE_FIXED_POINTx) error /= (float) FP_FACTOR; s->carrier_phase_rate += (int32_t) (s->carrier_track_i*error); s->carrier_phase += (int32_t) (s->carrier_track_p*error); #else s->carrier_phase_rate += (int32_t) (s->carrier_track_i*error); s->carrier_phase += (int32_t) (s->carrier_track_p*error); //span_log(&s->logging, SPAN_LOG_FLOW, "Im = %15.5f f = %15.5f\n", error, dds_frequencyf(s->carrier_phase_rate)); #endif } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINTx) static __inline__ int find_quadrant(const complexi16_t *z) #else static __inline__ int find_quadrant(const complexf_t *z) #endif { int b1; int b2; /* Split the space along the two diagonals. */ b1 = (z->im > z->re); b2 = (z->im < -z->re); return (b2 << 1) | (b1 ^ b2); } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINTx) static __inline__ int find_octant(complexi16_t *z) #else static __inline__ int find_octant(complexf_t *z) #endif { float abs_re; float abs_im; int b1; int b2; int bits; /* Are we near an axis or a diagonal? */ abs_re = fabsf(z->re); abs_im = fabsf(z->im); if (abs_im > abs_re*0.4142136f && abs_im < abs_re*2.4142136f) { /* Split the space along the two axes. */ b1 = (z->re < 0.0f); b2 = (z->im < 0.0f); bits = (b2 << 2) | ((b1 ^ b2) << 1) | 1; } else { /* Split the space along the two diagonals. */ b1 = (z->im > z->re); b2 = (z->im < -z->re); bits = (b2 << 2) | ((b1 ^ b2) << 1); } return bits; } /*- End of function --------------------------------------------------------*/ static __inline__ int descramble(v27ter_rx_state_t *s, int in_bit) { int out_bit; in_bit &= 1; out_bit = (in_bit ^ (s->scramble_reg >> 5) ^ (s->scramble_reg >> 6)) & 1; if (s->scrambler_pattern_count >= 33) { out_bit ^= 1; s->scrambler_pattern_count = 0; } else { if (s->training_stage > TRAINING_STAGE_NORMAL_OPERATION && s->training_stage < TRAINING_STAGE_TEST_ONES) { s->scrambler_pattern_count = 0; } else { if ((((s->scramble_reg >> 7) ^ in_bit) & ((s->scramble_reg >> 8) ^ in_bit) & ((s->scramble_reg >> 11) ^ in_bit) & 1)) s->scrambler_pattern_count = 0; else s->scrambler_pattern_count++; } } s->scramble_reg <<= 1; if (s->training_stage > TRAINING_STAGE_NORMAL_OPERATION && s->training_stage < TRAINING_STAGE_TEST_ONES) s->scramble_reg |= out_bit; else s->scramble_reg |= in_bit; return out_bit; } /*- End of function --------------------------------------------------------*/ static __inline__ void put_bit(v27ter_rx_state_t *s, int bit) { int out_bit; out_bit = descramble(s, bit); /* We need to strip the last part of the training before we let data go to the application. */ if (s->training_stage == TRAINING_STAGE_NORMAL_OPERATION) { s->put_bit(s->put_bit_user_data, out_bit); } else { //span_log(&s->logging, SPAN_LOG_FLOW, "Test bit %d\n", out_bit); /* The bits during the final stage of training should be all ones. However, buggy modems mean you cannot rely on this. Therefore we don't bother testing for ones, but just rely on a constellation mismatch measurement. */ } } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINTx) static void decode_baud(v27ter_rx_state_t *s, complexi16_t *z) #else static void decode_baud(v27ter_rx_state_t *s, complexf_t *z) #endif { static const uint8_t phase_steps_4800[8] = { 4, 0, 2, 6, 7, 3, 1, 5 }; static const uint8_t phase_steps_2400[4] = { 0, 2, 3, 1 }; int nearest; int raw_bits; if (s->bit_rate == 2400) { nearest = find_quadrant(z); raw_bits = phase_steps_2400[(nearest - s->constellation_state) & 3]; put_bit(s, raw_bits); put_bit(s, raw_bits >> 1); s->constellation_state = nearest; nearest <<= 1; } else { nearest = find_octant(z); raw_bits = phase_steps_4800[(nearest - s->constellation_state) & 7]; put_bit(s, raw_bits); put_bit(s, raw_bits >> 1); put_bit(s, raw_bits >> 2); s->constellation_state = nearest; } track_carrier(s, z, &v27ter_constellation[nearest]); if (--s->eq_skip <= 0) { /* Once we are in the data the equalization should not need updating. However, the line characteristics may slowly drift. We, therefore, tune up on the occassional sample, keeping the compute down. */ s->eq_skip = 100; tune_equalizer(s, z, &v27ter_constellation[nearest]); } } /*- End of function --------------------------------------------------------*/ static __inline__ void symbol_sync(v27ter_rx_state_t *s) { float p; float q; /* This routine adapts the position of the half baud samples entering the equalizer. */ /* Perform a Gardner test for baud alignment */ p = s->eq_buf[(s->eq_step - 3) & (V27TER_EQUALIZER_LEN - 1)].re - s->eq_buf[(s->eq_step - 1) & (V27TER_EQUALIZER_LEN - 1)].re; p *= s->eq_buf[(s->eq_step - 2) & (V27TER_EQUALIZER_LEN - 1)].re; q = s->eq_buf[(s->eq_step - 3) & (V27TER_EQUALIZER_LEN - 1)].im - s->eq_buf[(s->eq_step - 1) & (V27TER_EQUALIZER_LEN - 1)].im; q *= s->eq_buf[(s->eq_step - 2) & (V27TER_EQUALIZER_LEN - 1)].im; s->gardner_integrate += (p + q > 0.0f) ? s->gardner_step : -s->gardner_step; if (abs(s->gardner_integrate) >= 256) { /* This integrate and dump approach avoids rapid changes of the equalizer put step. Rapid changes, without hysteresis, are bad. They degrade the equalizer performance when the true symbol boundary is close to a sample boundary. */ //span_log(&s->logging, SPAN_LOG_FLOW, "Hop %d\n", s->gardner_integrate); s->eq_put_step += (s->gardner_integrate/256); s->total_baud_timing_correction += (s->gardner_integrate/256); if (s->qam_report) s->qam_report(s->qam_user_data, NULL, NULL, s->gardner_integrate); s->gardner_integrate = 0; } //span_log(&s->logging, SPAN_LOG_FLOW, "Gardner=%10.5f 0x%X\n", p, s->eq_put_step); } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINT) static __inline__ void process_half_baud(v27ter_rx_state_t *s, const complexi16_t *sample) #else static __inline__ void process_half_baud(v27ter_rx_state_t *s, const complexf_t *sample) #endif { static const int abab_pos[2] = {0, 4}; complexf_t zz; #if defined(SPANDSP_USE_FIXED_POINTx) complexf_t z1; complexi16_t z; const complexi16_t *target; static const complexi16_t zero = {0, 0}; #else float p; complexf_t z; const complexf_t *target; static const complexf_t zero = {0.0f, 0.0f}; #endif int i; int j; int32_t angle; int32_t ang; int constellation_state; /* Add a sample to the equalizer's circular buffer, but don't calculate anything at this time. */ #if defined(SPANDSP_USE_FIXED_POINT) s->eq_buf[s->eq_step].re = sample->re/(float) FP_FACTOR; s->eq_buf[s->eq_step].im = sample->im/(float) FP_FACTOR; #else s->eq_buf[s->eq_step] = *sample; #endif if (++s->eq_step >= V27TER_EQUALIZER_LEN) s->eq_step = 0; /* On alternate insertions we have a whole baud, and must process it. */ if ((s->baud_half ^= 1)) return; symbol_sync(s); z = equalizer_get(s); //span_log(&s->logging, SPAN_LOG_FLOW, "Equalized symbol - %15.5f %15.5f\n", z.re, z.im); switch (s->training_stage) { case TRAINING_STAGE_NORMAL_OPERATION: decode_baud(s, &z); constellation_state = (s->bit_rate == 4800) ? s->constellation_state : (s->constellation_state << 1); target = &v27ter_constellation[constellation_state]; break; case TRAINING_STAGE_SYMBOL_ACQUISITION: /* Allow time for the Gardner algorithm to settle the baud timing */ /* Don't start narrowing the bandwidth of the Gardner algorithm too early. Some modems are a bit wobbly when they start sending the signal. Also, we start this analysis before our filter buffers have completely filled. */ target = &zero; if (++s->training_count >= 30) { s->gardner_step = 32; s->training_stage = TRAINING_STAGE_LOG_PHASE; vec_zeroi32(s->diff_angles, 16); s->last_angles[0] = arctan2(z.im, z.re); } break; case TRAINING_STAGE_LOG_PHASE: /* Record the current alternate phase angle */ target = &zero; s->last_angles[1] = arctan2(z.im, z.re); s->training_count = 1; s->training_stage = TRAINING_STAGE_WAIT_FOR_HOP; break; case TRAINING_STAGE_WAIT_FOR_HOP: target = &zero; angle = arctan2(z.im, z.re); /* Look for the initial ABAB sequence to display a phase reversal, which will signal the start of the scrambled ABAB segment */ i = s->training_count + 1; ang = angle - s->last_angles[i & 1]; s->last_angles[i & 1] = angle; s->diff_angles[i & 0xF] = s->diff_angles[(i - 2) & 0xF] + (ang >> 4); if ((ang > DDS_PHASE(45.0f) || ang < DDS_PHASE(-45.0f)) && s->training_count >= 13) { /* We seem to have a phase reversal */ /* Slam the carrier frequency into line, based on the total phase drift over the last section. Use the shift from the odd bits and the shift from the even bits to get better jitter suppression. We need to scale here, or at the maximum specified frequency deviation we could overflow, and get a silly answer. */ /* Step back a few symbols so we don't get ISI distorting things. */ i = (s->training_count - 8) & ~1; /* Avoid the possibility of a divide by zero */ if (i > 1) { j = i & 0xF; ang = (s->diff_angles[j] + s->diff_angles[j | 0x1])/(i - 1); if (s->bit_rate == 4800) s->carrier_phase_rate += 16*(ang/10); else s->carrier_phase_rate += 3*16*(ang/40); } span_log(&s->logging, SPAN_LOG_FLOW, "Coarse carrier frequency %7.2f (%d)\n", dds_frequencyf(s->carrier_phase_rate), s->training_count); /* Check if the carrier frequency is plausible */ if (s->carrier_phase_rate < DDS_PHASE_RATE(CARRIER_NOMINAL_FREQ - 20.0f) || s->carrier_phase_rate > DDS_PHASE_RATE(CARRIER_NOMINAL_FREQ + 20.0f)) { span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (sequence failed)\n"); /* Park this modem */ s->training_stage = TRAINING_STAGE_PARKED; report_status_change(s, SIG_STATUS_TRAINING_FAILED); break; } /* Make a step shift in the phase, to pull it into line. We need to rotate the equalizer buffer, as well as the carrier phase, for this to play out nicely. */ angle += DDS_PHASE(180.0f); #if defined(SPANDSP_USE_FIXED_POINTx) zz = complex_setf(cosf(p), -sinf(p)); for (i = 0; i < V27TER_EQUALIZER_LEN; i++) { z1 = complex_setf(s->eq_buf[i].re, s->eq_buf[i].im); z1 = complex_mulf(&z1, &zz); s->eq_buf[i].re = z1.re; s->eq_buf[i].im = z1.im; } #else p = dds_phase_to_radians(angle); zz = complex_setf(cosf(p), -sinf(p)); for (i = 0; i < V27TER_EQUALIZER_LEN; i++) s->eq_buf[i] = complex_mulf(&s->eq_buf[i], &zz); #endif s->carrier_phase += angle; s->gardner_step = 2; /* We have just seen the first element of the scrambled sequence so skip it. */ s->training_bc = 1; s->training_bc ^= descramble(s, 1); descramble(s, 1); descramble(s, 1); s->constellation_state = abab_pos[s->training_bc]; target = &v27ter_constellation[s->constellation_state]; s->training_count = 1; s->training_stage = TRAINING_STAGE_TRAIN_ON_ABAB; report_status_change(s, SIG_STATUS_TRAINING_IN_PROGRESS); } else if (++s->training_count > V27TER_TRAINING_SEG_3_LEN) { /* This is bogus. There are not this many bits in this section of a real training sequence. */ span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (sequence failed)\n"); /* Park this modem */ s->training_stage = TRAINING_STAGE_PARKED; report_status_change(s, SIG_STATUS_TRAINING_FAILED); } break; case TRAINING_STAGE_TRAIN_ON_ABAB: /* Train on the scrambled ABAB section */ s->training_bc ^= descramble(s, 1); descramble(s, 1); descramble(s, 1); s->constellation_state = abab_pos[s->training_bc]; target = &v27ter_constellation[s->constellation_state]; track_carrier(s, &z, target); tune_equalizer(s, &z, target); #if defined(SPANDSP_USE_FIXED_POINTx) s->carrier_track_i = 400 + (200000 - 400)*(float) (V27TER_TRAINING_SEG_5_LEN - s->training_count)/(float) V27TER_TRAINING_SEG_5_LEN; s->carrier_track_p = 1000000 + (10000000 - 1000000)*(float) (V27TER_TRAINING_SEG_5_LEN - s->training_count)/(float) V27TER_TRAINING_SEG_5_LEN; #else s->carrier_track_i = 400.0f + (200000.0f - 400.0f)*(float) (V27TER_TRAINING_SEG_5_LEN - s->training_count)/(float) V27TER_TRAINING_SEG_5_LEN; s->carrier_track_p = 1000000.0f + (10000000.0f - 1000000.0f)*(float) (V27TER_TRAINING_SEG_5_LEN - s->training_count)/(float) V27TER_TRAINING_SEG_5_LEN; #endif if (++s->training_count >= V27TER_TRAINING_SEG_5_LEN) { s->constellation_state = (s->bit_rate == 4800) ? 4 : 2; s->training_count = 0; s->training_stage = TRAINING_STAGE_TEST_ONES; } break; case TRAINING_STAGE_TEST_ONES: decode_baud(s, &z); constellation_state = (s->bit_rate == 4800) ? s->constellation_state : (s->constellation_state << 1); target = &v27ter_constellation[constellation_state]; /* Measure the training error */ #if defined(SPANDSP_USE_FIXED_POINTx) z1.re = z.re/(float) FP_FACTOR; z1.im = z.im/(float) FP_FACTOR; zz.re = target->re; zz.im = target->im; zz = complex_subf(&z1, &zz); s->training_error += powerf(&zz); #else zz = complex_subf(&z, target); s->training_error += powerf(&zz); #endif if (++s->training_count >= V27TER_TRAINING_SEG_6_LEN) { /* At 4800bps the symbols are 1.08238 (Euclidian) apart. At 2400bps the symbols are 2.0 (Euclidian) apart. */ if ((s->bit_rate == 4800 && s->training_error < V27TER_TRAINING_SEG_6_LEN*0.25f) || (s->bit_rate == 2400 && s->training_error < V27TER_TRAINING_SEG_6_LEN*0.5f)) { #if defined(SPANDSP_USE_FIXED_POINTx) span_log(&s->logging, SPAN_LOG_FLOW, "Training succeeded at %dbps (constellation mismatch %d)\n", s->bit_rate, s->training_error); #else span_log(&s->logging, SPAN_LOG_FLOW, "Training succeeded at %dbps (constellation mismatch %f)\n", s->bit_rate, s->training_error); #endif /* We are up and running */ report_status_change(s, SIG_STATUS_TRAINING_SUCCEEDED); /* Apply some lag to the carrier off condition, to ensure the last few bits get pushed through the processing. */ s->signal_present = (s->bit_rate == 4800) ? 90 : 120; s->training_stage = TRAINING_STAGE_NORMAL_OPERATION; equalizer_save(s); s->carrier_phase_rate_save = s->carrier_phase_rate; s->agc_scaling_save = s->agc_scaling; } else { /* Training has failed */ #if defined(SPANDSP_USE_FIXED_POINTx) span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (constellation mismatch %d)\n", s->training_error); #else span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (constellation mismatch %f)\n", s->training_error); #endif /* Park this modem */ s->training_stage = TRAINING_STAGE_PARKED; report_status_change(s, SIG_STATUS_TRAINING_FAILED); } } break; case TRAINING_STAGE_PARKED: default: /* We failed to train! */ /* Park here until the carrier drops. */ target = &zero; break; } if (s->qam_report) { #if defined(SPANDSP_USE_FIXED_POINTx) z1.re = z.re/(float) FP_FACTOR; z1.im = z.im/(float) FP_FACTOR; zz.re = target->re; zz.im = target->im; s->qam_report(s->qam_user_data, &z1, &zz, s->constellation_state); #else s->qam_report(s->qam_user_data, &z, target, s->constellation_state); #endif } } /*- End of function --------------------------------------------------------*/ static __inline__ int signal_detect(v27ter_rx_state_t *s, int16_t amp) { int16_t diff; int16_t x; int32_t power; /* There should be no DC in the signal, but sometimes there is. We need to measure the power with the DC blocked, but not using a slow to respond DC blocker. Use the most elementary HPF. */ x = amp >> 1; /* There could be overflow here, but it isn't a problem in practice */ diff = x - s->last_sample; s->last_sample = x; power = power_meter_update(&s->power, diff); #if defined(IAXMODEM_STUFF) /* Quick power drop fudge */ diff = abs(diff); if (10*diff < s->high_sample) { if (++s->low_samples > 120) { power_meter_init(&s->power, 4); s->high_sample = 0; s->low_samples = 0; } } else { s->low_samples = 0; if (diff > s->high_sample) s->high_sample = diff; } #endif //span_log(&s->logging, SPAN_LOG_FLOW, "Power = %f\n", power_meter_current_dbm0(&s->power)); if (s->signal_present > 0) { /* Look for power below turn-off threshold to turn the carrier off */ #if defined(IAXMODEM_STUFF) if (s->carrier_drop_pending || power < s->carrier_off_power) #else if (power < s->carrier_off_power) #endif { if (--s->signal_present <= 0) { /* Count down a short delay, to ensure we push the last few bits through the filters before stopping. */ v27ter_rx_restart(s, s->bit_rate, FALSE); report_status_change(s, SIG_STATUS_CARRIER_DOWN); return 0; } #if defined(IAXMODEM_STUFF) /* Carrier has dropped, but the put_bit is pending the signal_present delay. */ s->carrier_drop_pending = TRUE; #endif } } else { /* Look for power exceeding turn-on threshold to turn the carrier on */ if (power < s->carrier_on_power) return 0; s->signal_present = 1; #if defined(IAXMODEM_STUFF) s->carrier_drop_pending = FALSE; #endif report_status_change(s, SIG_STATUS_CARRIER_UP); } return power; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) v27ter_rx(v27ter_rx_state_t *s, const int16_t amp[], int len) { int i; int step; #if defined(SPANDSP_USE_FIXED_POINT) complexi16_t z; complexi16_t zz; complexi16_t sample; int32_t v; #else complexf_t z; complexf_t zz; complexf_t sample; float v; #endif int32_t power; if (s->bit_rate == 4800) { for (i = 0; i < len; i++) { s->rrc_filter[s->rrc_filter_step] = amp[i]; if (++s->rrc_filter_step >= V27TER_RX_4800_FILTER_STEPS) s->rrc_filter_step = 0; if ((power = signal_detect(s, amp[i])) == 0) continue; /* Only spend effort processing this data if the modem is not parked, after training failure. */ if (s->training_stage == TRAINING_STAGE_PARKED) continue; /* Put things into the equalization buffer at T/2 rate. The Gardner algorithm will fiddle the step to align this with the symbols. */ if ((s->eq_put_step -= RX_PULSESHAPER_4800_COEFF_SETS) <= 0) { if (s->training_stage == TRAINING_STAGE_SYMBOL_ACQUISITION) { /* Only AGC during the initial training */ #if defined(SPANDSP_USE_FIXED_POINT) s->agc_scaling = (float) FP_FACTOR*32768.0f*(1.0f/RX_PULSESHAPER_4800_GAIN)*1.414f/sqrtf(power); #else s->agc_scaling = (1.0f/RX_PULSESHAPER_4800_GAIN)*1.414f/sqrtf(power); #endif } /* Pulse shape while still at the carrier frequency, using a quadrature pair of filters. This results in a properly bandpass filtered complex signal, which can be brought directly to baseband by complex mixing. No further filtering, to remove mixer harmonics, is needed. */ step = -s->eq_put_step; if (step > RX_PULSESHAPER_4800_COEFF_SETS - 1) step = RX_PULSESHAPER_4800_COEFF_SETS - 1; #if defined(SPANDSP_USE_FIXED_POINT) v = vec_circular_dot_prodi16(s->rrc_filter, rx_pulseshaper_4800_re[step], V27TER_RX_FILTER_STEPS, s->rrc_filter_step); sample.re = (v*(int32_t) s->agc_scaling) >> 15; v = vec_circular_dot_prodi16(s->rrc_filter, rx_pulseshaper_4800_im[step], V27TER_RX_FILTER_STEPS, s->rrc_filter_step); sample.im = (v*(int32_t) s->agc_scaling) >> 15; z = dds_lookup_complexi16(s->carrier_phase); zz.re = ((int32_t) sample.re*z.re - (int32_t) sample.im*z.im) >> 15; zz.im = ((int32_t) -sample.re*z.im - (int32_t) sample.im*z.re) >> 15; #else v = vec_circular_dot_prodf(s->rrc_filter, rx_pulseshaper_4800_re[step], V27TER_RX_FILTER_STEPS, s->rrc_filter_step); sample.re = v*s->agc_scaling; v = vec_circular_dot_prodf(s->rrc_filter, rx_pulseshaper_4800_im[step], V27TER_RX_FILTER_STEPS, s->rrc_filter_step); sample.im = v*s->agc_scaling; z = dds_lookup_complexf(s->carrier_phase); zz.re = sample.re*z.re - sample.im*z.im; zz.im = -sample.re*z.im - sample.im*z.re; #endif s->eq_put_step += RX_PULSESHAPER_4800_COEFF_SETS*5/2; process_half_baud(s, &zz); } #if defined(SPANDSP_USE_FIXED_POINT) dds_advance(&s->carrier_phase, s->carrier_phase_rate); #else dds_advancef(&s->carrier_phase, s->carrier_phase_rate); #endif } } else { for (i = 0; i < len; i++) { s->rrc_filter[s->rrc_filter_step] = amp[i]; if (++s->rrc_filter_step >= V27TER_RX_2400_FILTER_STEPS) s->rrc_filter_step = 0; if ((power = signal_detect(s, amp[i])) == 0) continue; /* Only spend effort processing this data if the modem is not parked, after training failure. */ if (s->training_stage == TRAINING_STAGE_PARKED) continue; /* Put things into the equalization buffer at T/2 rate. The Gardner algorithm will fiddle the step to align this with the symbols. */ if ((s->eq_put_step -= RX_PULSESHAPER_2400_COEFF_SETS) <= 0) { if (s->training_stage == TRAINING_STAGE_SYMBOL_ACQUISITION) { /* Only AGC during the initial training */ #if defined(SPANDSP_USE_FIXED_POINT) s->agc_scaling = (float) FP_FACTOR*32768.0f*(1.0f/RX_PULSESHAPER_2400_GAIN)*1.414f/sqrtf(power); #else s->agc_scaling = (1.0f/RX_PULSESHAPER_2400_GAIN)*1.414f/sqrtf(power); #endif } /* Pulse shape while still at the carrier frequency, using a quadrature pair of filters. This results in a properly bandpass filtered complex signal, which can be brought directly to bandband by complex mixing. No further filtering, to remove mixer harmonics, is needed. */ step = -s->eq_put_step; if (step > RX_PULSESHAPER_2400_COEFF_SETS - 1) step = RX_PULSESHAPER_2400_COEFF_SETS - 1; #if defined(SPANDSP_USE_FIXED_POINT) v = vec_circular_dot_prodi16(s->rrc_filter, rx_pulseshaper_2400_re[step], V27TER_RX_FILTER_STEPS, s->rrc_filter_step); sample.re = (v*(int32_t) s->agc_scaling) >> 15; v = vec_circular_dot_prodi16(s->rrc_filter, rx_pulseshaper_2400_im[step], V27TER_RX_FILTER_STEPS, s->rrc_filter_step); sample.im = (v*(int32_t) s->agc_scaling) >> 15; z = dds_lookup_complexi16(s->carrier_phase); zz.re = ((int32_t) sample.re*z.re - (int32_t) sample.im*(int32_t) z.im) >> 15; zz.im = ((int32_t) -sample.re*z.im - (int32_t) sample.im*(int32_t) z.re) >> 15; #else v = vec_circular_dot_prodf(s->rrc_filter, rx_pulseshaper_2400_re[step], V27TER_RX_FILTER_STEPS, s->rrc_filter_step); sample.re = v*s->agc_scaling; v = vec_circular_dot_prodf(s->rrc_filter, rx_pulseshaper_2400_im[step], V27TER_RX_FILTER_STEPS, s->rrc_filter_step); sample.im = v*s->agc_scaling; z = dds_lookup_complexf(s->carrier_phase); zz.re = sample.re*z.re - sample.im*z.im; zz.im = -sample.re*z.im - sample.im*z.re; #endif s->eq_put_step += RX_PULSESHAPER_2400_COEFF_SETS*20/(3*2); process_half_baud(s, &zz); } #if defined(SPANDSP_USE_FIXED_POINT) dds_advance(&s->carrier_phase, s->carrier_phase_rate); #else dds_advancef(&s->carrier_phase, s->carrier_phase_rate); #endif } } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) v27ter_rx_fillin(v27ter_rx_state_t *s, int len) { int i; /* We want to sustain the current state (i.e carrier on<->carrier off), and try to sustain the carrier phase. We should probably push the filters, as well */ span_log(&s->logging, SPAN_LOG_FLOW, "Fill-in %d samples\n", len); if (s->signal_present <= 0) return 0; if (s->training_stage == TRAINING_STAGE_PARKED) return 0; for (i = 0; i < len; i++) { #if defined(SPANDSP_USE_FIXED_POINT) dds_advance(&s->carrier_phase, s->carrier_phase_rate); #else dds_advancef(&s->carrier_phase, s->carrier_phase_rate); #endif /* Advance the symbol phase the appropriate amount */ if (s->bit_rate == 4800) { if ((s->eq_put_step -= RX_PULSESHAPER_4800_COEFF_SETS) <= 0) s->eq_put_step += RX_PULSESHAPER_4800_COEFF_SETS*5/2; } else { if ((s->eq_put_step -= RX_PULSESHAPER_2400_COEFF_SETS) <= 0) s->eq_put_step += RX_PULSESHAPER_2400_COEFF_SETS*20/(3*2); } /* TODO: Should we rotate any buffers */ } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v27ter_rx_set_put_bit(v27ter_rx_state_t *s, put_bit_func_t put_bit, void *user_data) { s->put_bit = put_bit; s->put_bit_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v27ter_rx_set_modem_status_handler(v27ter_rx_state_t *s, modem_status_func_t handler, void *user_data) { s->status_handler = handler; s->status_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) v27ter_rx_get_logging_state(v27ter_rx_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v27ter_rx_restart(v27ter_rx_state_t *s, int bit_rate, int old_train) { span_log(&s->logging, SPAN_LOG_FLOW, "Restarting V.27ter\n"); if (bit_rate != 4800 && bit_rate != 2400) return -1; s->bit_rate = bit_rate; #if defined(SPANDSP_USE_FIXED_POINT) vec_zeroi16(s->rrc_filter, sizeof(s->rrc_filter)/sizeof(s->rrc_filter[0])); #else vec_zerof(s->rrc_filter, sizeof(s->rrc_filter)/sizeof(s->rrc_filter[0])); #endif s->rrc_filter_step = 0; s->scramble_reg = 0x3C; s->scrambler_pattern_count = 0; s->training_stage = TRAINING_STAGE_SYMBOL_ACQUISITION; s->training_bc = 0; s->training_count = 0; s->training_error = 0.0f; s->signal_present = 0; #if defined(IAXMODEM_STUFF) s->high_sample = 0; s->low_samples = 0; s->carrier_drop_pending = FALSE; #endif vec_zeroi32(s->diff_angles, 16); s->carrier_phase = 0; #if defined(SPANDSP_USE_FIXED_POINTx) s->carrier_track_i = 200000; s->carrier_track_p = 10000000; #else s->carrier_track_i = 200000.0f; s->carrier_track_p = 10000000.0f; #endif power_meter_init(&s->power, 4); s->constellation_state = 0; if (s->old_train) { s->carrier_phase_rate = s->carrier_phase_rate_save; s->agc_scaling = s->agc_scaling_save; equalizer_restore(s); } else { s->carrier_phase_rate = DDS_PHASE_RATE(CARRIER_NOMINAL_FREQ); #if defined(SPANDSP_USE_FIXED_POINTx) s->agc_scaling = (float) FP_FACTOR*32768.0f*0.005f/RX_PULSESHAPER_4800_GAIN; #else s->agc_scaling = 0.005f/RX_PULSESHAPER_4800_GAIN; #endif equalizer_reset(s); } s->eq_skip = 0; s->last_sample = 0; s->gardner_integrate = 0; s->total_baud_timing_correction = 0; s->gardner_step = 512; s->baud_half = 0; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(v27ter_rx_state_t *) v27ter_rx_init(v27ter_rx_state_t *s, int bit_rate, put_bit_func_t put_bit, void *user_data) { switch (bit_rate) { case 4800: case 2400: break; default: return NULL; } if (s == NULL) { if ((s = (v27ter_rx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "V.27ter RX"); v27ter_rx_signal_cutoff(s, -45.5f); s->put_bit = put_bit; s->put_bit_user_data = user_data; v27ter_rx_restart(s, bit_rate, FALSE); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v27ter_rx_release(v27ter_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v27ter_rx_free(v27ter_rx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v27ter_rx_set_qam_report_handler(v27ter_rx_state_t *s, qam_report_handler_t handler, void *user_data) { s->qam_report = handler; s->qam_user_data = user_data; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/v8.c0000664000175000017500000010235712100754174011411 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v8.c - V.8 modem negotiation processing. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/queue.h" #include "spandsp/async.h" #include "spandsp/vector_int.h" #include "spandsp/complex.h" #include "spandsp/dds.h" #include "spandsp/tone_detect.h" #include "spandsp/tone_generate.h" #include "spandsp/super_tone_rx.h" #include "spandsp/power_meter.h" #include "spandsp/fsk.h" #include "spandsp/modem_connect_tones.h" #include "spandsp/v8.h" #include "spandsp/private/logging.h" #include "spandsp/private/fsk.h" #include "spandsp/private/modem_connect_tones.h" #include "spandsp/private/v8.h" enum { V8_WAIT_1S, /* Start point when sending CI */ V8_AWAIT_ANSAM, /* Start point when sending initial silence */ V8_CI_ON, V8_CI_OFF, V8_HEARD_ANSAM, V8_CM_ON, V8_CJ_ON, V8_CM_WAIT, V8_SIGC, V8_JM_ON, V8_SIGA, V8_PARKED } v8_states_e; enum { V8_SYNC_UNKNOWN = 0, V8_SYNC_CI, V8_SYNC_CM_JM, V8_SYNC_V92 } v8_sync_types_e; enum { V8_CALL_FUNCTION_TAG = 0x01, V8_MODULATION_TAG = 0x05, V8_PROTOCOLS_TAG = 0x0A, V8_PSTN_ACCESS_TAG = 0x0D, V8_NSF_TAG = 0x0F, V8_PCM_MODEM_AVAILABILITY_TAG = 0x07, V8_T66_TAG = 0x0E }; enum { V8_CI_SYNC_OCTET = 0x00, V8_CM_JM_SYNC_OCTET = 0xE0, V8_V92_SYNC_OCTET = 0x55 }; SPAN_DECLARE(const char *) v8_call_function_to_str(int call_function) { switch (call_function) { case V8_CALL_TBS: return "TBS"; case V8_CALL_H324: return "H.324 PSTN multimedia terminal"; case V8_CALL_V18: return "V.18 textphone"; case V8_CALL_T101: return "T.101 videotext"; case V8_CALL_T30_TX: return "T.30 Tx FAX"; case V8_CALL_T30_RX: return "T.30 Rx FAX"; case V8_CALL_V_SERIES: return "V series modem data"; case V8_CALL_FUNCTION_EXTENSION: return "Call function is in extension octet"; } return "Unknown call function"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) v8_modulation_to_str(int modulation_scheme) { switch (modulation_scheme) { case V8_MOD_V17: return "V.17 half-duplex"; case V8_MOD_V21: return "V.21 duplex"; case V8_MOD_V22: return "V.22/V.22bis duplex"; case V8_MOD_V23HDX: return "V.23 half-duplex"; case V8_MOD_V23: return "V.23 duplex"; case V8_MOD_V26BIS: return "V.26bis duplex"; case V8_MOD_V26TER: return "V.26ter duplex"; case V8_MOD_V27TER: return "V.27ter duplex"; case V8_MOD_V29: return "V.29 half-duplex"; case V8_MOD_V32: return "V.32/V.32bis duplex"; case V8_MOD_V34HDX: return "V.34 half-duplex"; case V8_MOD_V34: return "V.34 duplex"; case V8_MOD_V90: return "V.90 duplex"; case V8_MOD_V92: return "V.92 duplex"; } return "???"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) v8_protocol_to_str(int protocol) { switch (protocol) { case V8_PROTOCOL_NONE: return "None"; case V8_PROTOCOL_LAPM_V42: return "LAPM"; case V8_PROTOCOL_EXTENSION: return "Extension"; } return "Undefined"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) v8_pstn_access_to_str(int pstn_access) { switch (pstn_access) { case V8_PSTN_ACCESS_CALL_DCE_CELLULAR: return "Calling modem on cellular"; case V8_PSTN_ACCESS_ANSWER_DCE_CELLULAR: return "Answering modem on cellular"; case V8_PSTN_ACCESS_ANSWER_DCE_CELLULAR | V8_PSTN_ACCESS_CALL_DCE_CELLULAR: return "Answering and calling modems on cellular"; case V8_PSTN_ACCESS_DCE_ON_DIGITAL: return "DCE on digital"; case V8_PSTN_ACCESS_DCE_ON_DIGITAL | V8_PSTN_ACCESS_CALL_DCE_CELLULAR: return "DCE on digital, and calling modem on cellular"; case V8_PSTN_ACCESS_DCE_ON_DIGITAL | V8_PSTN_ACCESS_ANSWER_DCE_CELLULAR: return "DCE on digital, answering modem on cellular"; case V8_PSTN_ACCESS_DCE_ON_DIGITAL | V8_PSTN_ACCESS_ANSWER_DCE_CELLULAR | V8_PSTN_ACCESS_CALL_DCE_CELLULAR: return "DCE on digital, and answering and calling modems on cellular"; } return "PSTN access unknown"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) v8_nsf_to_str(int nsf) { switch (nsf) { case 0: return "???"; } return "???"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) v8_pcm_modem_availability_to_str(int pcm_modem_availability) { switch (pcm_modem_availability) { case 0: return "PCM unavailable"; case V8_PSTN_PCM_MODEM_V90_V92_ANALOGUE: return "V.90/V.92 analogue available"; case V8_PSTN_PCM_MODEM_V90_V92_DIGITAL: return "V.90/V.92 digital available"; case V8_PSTN_PCM_MODEM_V90_V92_DIGITAL | V8_PSTN_PCM_MODEM_V90_V92_ANALOGUE: return "V.90/V.92 digital/analogue available"; case V8_PSTN_PCM_MODEM_V91: return "V.91 available"; case V8_PSTN_PCM_MODEM_V91 | V8_PSTN_PCM_MODEM_V90_V92_ANALOGUE: return "V.91 and V.90/V.92 analogue available"; case V8_PSTN_PCM_MODEM_V91 | V8_PSTN_PCM_MODEM_V90_V92_DIGITAL: return "V.91 and V.90/V.92 digital available"; case V8_PSTN_PCM_MODEM_V91 | V8_PSTN_PCM_MODEM_V90_V92_DIGITAL | V8_PSTN_PCM_MODEM_V90_V92_ANALOGUE: return "V.91 and V.90/V.92 digital/analogue available"; } return "PCM availability unknown"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) v8_t66_to_str(int t66) { /* T.66 doesn't really define any V.8 values. The bits are all reserved. */ switch (t66) { case 0: return "???"; case 1: return "Reserved TIA"; case 2: return "Reserved"; case 3: return "Reserved TIA + others"; case 4: return "Reserved"; case 5: return "Reserved TIA + others"; case 6: return "Reserved"; case 7: return "Reserved TIA + others"; } return "???"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v8_log_supported_modulations(v8_state_t *s, int modulation_schemes) { const char *comma; int i; comma = ""; span_log(&s->logging, SPAN_LOG_FLOW, ""); for (i = 0; i < 32; i++) { if ((modulation_schemes & (1 << i))) { span_log(&s->logging, SPAN_LOG_FLOW | SPAN_LOG_SUPPRESS_LABELLING, "%s%s", comma, v8_modulation_to_str(modulation_schemes & (1 << i))); comma = ", "; } } span_log(&s->logging, SPAN_LOG_FLOW | SPAN_LOG_SUPPRESS_LABELLING, " supported\n"); } /*- End of function --------------------------------------------------------*/ static int report_event(v8_state_t *s) { if (s->result_handler) s->result_handler(s->result_handler_user_data, &s->result); return 0; } /*- End of function --------------------------------------------------------*/ static const uint8_t *process_call_function(v8_state_t *s, const uint8_t *p) { s->result.call_function = (*p >> 5) & 0x07; span_log(&s->logging, SPAN_LOG_FLOW, "%s\n", v8_call_function_to_str(s->result.call_function)); return ++p; } /*- End of function --------------------------------------------------------*/ static const uint8_t *process_modulation_mode(v8_state_t *s, const uint8_t *p) { unsigned int modulations; /* Modulation mode octets */ /* We must record the number of bytes of modulation information, so a resulting JM can be made to have the same number (V.8/8.2.3) */ modulations = 0; s->modulation_bytes = 1; if (*p & 0x80) modulations |= V8_MOD_V34HDX; if (*p & 0x40) modulations |= V8_MOD_V34; if (*p & 0x20) modulations |= V8_MOD_V90; ++p; /* Check for an extension octet */ if ((*p & 0x38) == 0x10) { s->modulation_bytes++; if (*p & 0x80) modulations |= V8_MOD_V27TER; if (*p & 0x40) modulations |= V8_MOD_V29; if (*p & 0x04) modulations |= V8_MOD_V17; if (*p & 0x02) modulations |= V8_MOD_V22; if (*p & 0x01) modulations |= V8_MOD_V32; ++p; /* Check for an extension octet */ if ((*p & 0x38) == 0x10) { s->modulation_bytes++; if (*p & 0x80) modulations |= V8_MOD_V21; if (*p & 0x40) modulations |= V8_MOD_V23HDX; if (*p & 0x04) modulations |= V8_MOD_V23; if (*p & 0x02) modulations |= V8_MOD_V26BIS; if (*p & 0x01) modulations |= V8_MOD_V26TER; ++p; } } s->result.modulations = modulations; v8_log_supported_modulations(s, modulations); return p; } /*- End of function --------------------------------------------------------*/ static const uint8_t *process_protocols(v8_state_t *s, const uint8_t *p) { s->result.protocol = (*p >> 5) & 0x07; span_log(&s->logging, SPAN_LOG_FLOW, "%s\n", v8_protocol_to_str(s->result.protocol)); return ++p; } /*- End of function --------------------------------------------------------*/ static const uint8_t *process_pstn_access(v8_state_t *s, const uint8_t *p) { s->result.pstn_access = (*p >> 5) & 0x07; span_log(&s->logging, SPAN_LOG_FLOW, "%s\n", v8_pstn_access_to_str(s->result.pstn_access)); return ++p; } /*- End of function --------------------------------------------------------*/ static const uint8_t *process_non_standard_facilities(v8_state_t *s, const uint8_t *p) { /* TODO: This is wrong */ s->result.nsf = (*p >> 5) & 0x07; span_log(&s->logging, SPAN_LOG_FLOW, "%s\n", v8_nsf_to_str(s->result.nsf)); return p; } /*- End of function --------------------------------------------------------*/ static const uint8_t *process_pcm_modem_availability(v8_state_t *s, const uint8_t *p) { s->result.pcm_modem_availability = (*p >> 5) & 0x07; span_log(&s->logging, SPAN_LOG_FLOW, "%s\n", v8_pcm_modem_availability_to_str(s->result.pcm_modem_availability)); return ++p; } /*- End of function --------------------------------------------------------*/ static const uint8_t *process_t66(v8_state_t *s, const uint8_t *p) { s->result.t66 = (*p >> 5) & 0x07; span_log(&s->logging, SPAN_LOG_FLOW, "%s\n", v8_t66_to_str(s->result.t66)); return ++p; } /*- End of function --------------------------------------------------------*/ static void ci_decode(v8_state_t *s) { if ((s->rx_data[0] & 0x1F) == V8_CALL_FUNCTION_TAG) process_call_function(s, &s->rx_data[0]); } /*- End of function --------------------------------------------------------*/ static void cm_jm_decode(v8_state_t *s) { const uint8_t *p; if (s->got_cm_jm) return; /* We must receive two consecutive identical CM or JM sequences to accept it. */ if (s->cm_jm_len <= 0 || s->cm_jm_len != s->rx_data_ptr || memcmp(s->cm_jm_data, s->rx_data, s->rx_data_ptr)) { /* Save the current CM or JM sequence */ s->cm_jm_len = s->rx_data_ptr; memcpy(s->cm_jm_data, s->rx_data, s->rx_data_ptr); return; } /* We have a matching pair of CMs or JMs, so we are happy this is correct. */ s->got_cm_jm = TRUE; span_log(&s->logging, SPAN_LOG_FLOW, "Decoding\n"); /* Zero indicates the end */ s->cm_jm_data[s->cm_jm_len] = 0; s->result.modulations = 0; p = s->cm_jm_data; while (*p) { switch (*p & 0x1F) { case V8_CALL_FUNCTION_TAG: p = process_call_function(s, p); break; case V8_MODULATION_TAG: p = process_modulation_mode(s, p); break; case V8_PROTOCOLS_TAG: p = process_protocols(s, p); break; case V8_PSTN_ACCESS_TAG: p = process_pstn_access(s, p); break; case V8_NSF_TAG: p = process_non_standard_facilities(s, p); break; case V8_PCM_MODEM_AVAILABILITY_TAG: p = process_pcm_modem_availability(s, p); break; case V8_T66_TAG: p = process_t66(s, p); break; default: p++; break; } /* Skip any future extensions we do not understand */ while ((*p & 0x38) == 0x10) p++; } } /*- End of function --------------------------------------------------------*/ static void put_bit(void *user_data, int bit) { v8_state_t *s; int new_preamble_type; const char *tag; uint8_t data; s = user_data; if (bit < 0) { /* Special conditions */ switch (bit) { case SIG_STATUS_CARRIER_UP: case SIG_STATUS_CARRIER_DOWN: case SIG_STATUS_TRAINING_SUCCEEDED: case SIG_STATUS_TRAINING_FAILED: break; default: break; } return; } //span_log(&s->logging, SPAN_LOG_FLOW, "Bit %d\n", bit); /* Wait until we sync. */ s->bit_stream = (s->bit_stream >> 1) | (bit << 19); /* CI preamble is 10 ones then a framed 0x00 CM/JM preamble is 10 ones then a framed 0x07 V.92 preamble is 10 ones then a framed 0x55 Should we look at all 10 ones? The first couple might be settling down. */ /* The preamble + synchronisation bit sequence should be unique in any bit stream, so we can rely on seeing this at any time as being a real sync code. */ switch (s->bit_stream) { case 0x803FF: new_preamble_type = V8_SYNC_CI; break; case 0xF03FF: new_preamble_type = V8_SYNC_CM_JM; break; case 0xAABFF: new_preamble_type = V8_SYNC_V92; break; default: new_preamble_type = V8_SYNC_UNKNOWN; break; } if (new_preamble_type != V8_SYNC_UNKNOWN) { /* We have seen a fresh sync code */ /* Debug */ if (span_log_test(&s->logging, SPAN_LOG_FLOW)) { if (s->preamble_type != V8_SYNC_UNKNOWN) { switch (s->preamble_type) { case V8_SYNC_CI: tag = "CI: "; break; case V8_SYNC_CM_JM: tag = (s->calling_party) ? "JM: " : "CM: "; break; case V8_SYNC_V92: tag = "V92: "; break; default: tag = "??: "; break; } span_log_buf(&s->logging, SPAN_LOG_FLOW, tag, s->rx_data, s->rx_data_ptr); } } /* If we were handling a valid sync code then we should process what has been received to date. */ switch (s->preamble_type) { case V8_SYNC_CI: ci_decode(s); break; case V8_SYNC_CM_JM: cm_jm_decode(s); break; } s->preamble_type = new_preamble_type; s->bit_cnt = 0; s->rx_data_ptr = 0; } if (s->preamble_type != V8_SYNC_UNKNOWN) { /* Parse octets with 1 bit start, 1 bit stop */ s->bit_cnt++; /* Start, stop? */ if ((s->bit_stream & 0x80400) == 0x80000 && s->bit_cnt >= 10) { /* Store the available data */ data = (uint8_t) ((s->bit_stream >> 11) & 0xFF); /* CJ (3 successive zero octets) detection */ if (data == 0) { if (++s->zero_byte_count == 3) s->got_cj = TRUE; } else { s->zero_byte_count = 0; } if (s->rx_data_ptr < (int) (sizeof(s->rx_data) - 1)) s->rx_data[s->rx_data_ptr++] = data; s->bit_cnt = 0; } } } /*- End of function --------------------------------------------------------*/ static void v8_decode_init(v8_state_t *s) { fsk_rx_init(&s->v21rx, &preset_fsk_specs[(s->calling_party) ? FSK_V21CH2 : FSK_V21CH1], FSK_FRAME_MODE_ASYNC, put_bit, s); fsk_rx_signal_cutoff(&s->v21rx, -45.5f); s->preamble_type = V8_SYNC_UNKNOWN; s->bit_stream = 0; s->cm_jm_len = 0; s->got_cm_jm = FALSE; s->got_cj = FALSE; s->zero_byte_count = 0; s->rx_data_ptr = 0; } /*- End of function --------------------------------------------------------*/ static int get_bit(void *user_data) { v8_state_t *s; uint8_t bit; s = user_data; if (queue_read(s->tx_queue, &bit, 1) <= 0) return SIG_STATUS_END_OF_DATA; return bit; } /*- End of function --------------------------------------------------------*/ static void v8_put_preamble(v8_state_t *s) { static const uint8_t preamble[10] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; queue_write(s->tx_queue, preamble, 10); } /*- End of function --------------------------------------------------------*/ static void v8_put_byte(v8_state_t *s, int data) { int i; uint8_t bits[10]; /* Insert start & stop bits */ bits[0] = 0; for (i = 1; i < 9; i++) { bits[i] = (uint8_t) (data & 1); data >>= 1; } bits[9] = 1; queue_write(s->tx_queue, bits, 10); } /*- End of function --------------------------------------------------------*/ static void send_cm_jm(v8_state_t *s) { int val; unsigned int offered_modulations; int bytes; /* Send a CM, or a JM as appropriate */ v8_put_preamble(s); v8_put_byte(s, V8_CM_JM_SYNC_OCTET); /* Data call */ v8_put_byte(s, (s->result.call_function << 5) | V8_CALL_FUNCTION_TAG); /* Supported modulations */ offered_modulations = s->result.modulations; bytes = 0; val = 0x05; if (offered_modulations & V8_MOD_V90) val |= 0x20; if (offered_modulations & V8_MOD_V34) val |= 0x40; v8_put_byte(s, val); if (++bytes < s->modulation_bytes) { val = 0x10; if (offered_modulations & V8_MOD_V32) val |= 0x01; if (offered_modulations & V8_MOD_V22) val |= 0x02; if (offered_modulations & V8_MOD_V17) val |= 0x04; if (offered_modulations & V8_MOD_V29) val |= 0x40; if (offered_modulations & V8_MOD_V27TER) val |= 0x80; v8_put_byte(s, val); } if (++bytes < s->modulation_bytes) { val = 0x10; if (offered_modulations & V8_MOD_V26TER) val |= 0x01; if (offered_modulations & V8_MOD_V26BIS) val |= 0x02; if (offered_modulations & V8_MOD_V23) val |= 0x04; if (offered_modulations & V8_MOD_V23HDX) val |= 0x40; if (offered_modulations & V8_MOD_V21) val |= 0x80; v8_put_byte(s, val); } if (s->parms.protocol) v8_put_byte(s, (s->parms.protocol << 5) | V8_PROTOCOLS_TAG); if (s->parms.pstn_access) v8_put_byte(s, (s->parms.pstn_access << 5) | V8_PSTN_ACCESS_TAG); if (s->parms.pcm_modem_availability) v8_put_byte(s, (s->parms.pcm_modem_availability << 5) | V8_PCM_MODEM_AVAILABILITY_TAG); if (s->parms.t66 >= 0) v8_put_byte(s, (s->parms.t66 << 5) | V8_T66_TAG); /* No NSF */ //v8_put_byte(s, (0 << 5) | V8_NSF_TAG); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) v8_tx(v8_state_t *s, int16_t *amp, int max_len) { int len; //span_log(&s->logging, SPAN_LOG_FLOW, "v8_tx state %d\n", s->state); len = 0; if (s->modem_connect_tone_tx_on) { if (s->modem_connect_tone_tx_on > ms_to_samples(75)) { /* Send the ANSam tone */ len = modem_connect_tones_tx(&s->ansam_tx, amp, max_len); if (len < max_len) { span_log(&s->logging, SPAN_LOG_FLOW, "ANSam or ANSam/ ended\n"); s->modem_connect_tone_tx_on = ms_to_samples(75); } } else { /* Send the 75ms of silence after the ANSam tone */ if (max_len > s->modem_connect_tone_tx_on) len = s->modem_connect_tone_tx_on; else len = max_len; vec_zeroi16(amp, len); s->modem_connect_tone_tx_on -= len; } } if (s->fsk_tx_on && len < max_len) { max_len -= len; len = fsk_tx(&s->v21tx, amp + len, max_len); if (len < max_len) { span_log(&s->logging, SPAN_LOG_FLOW, "FSK ends\n"); s->fsk_tx_on = FALSE; } } return len; } /*- End of function --------------------------------------------------------*/ static void send_v92(v8_state_t *s) { int i; if (s->result.v92 >= 0) { /* Send 2 V.92 packets */ for (i = 0; i < 2; i++) { v8_put_preamble(s); v8_put_byte(s, V8_V92_SYNC_OCTET); v8_put_byte(s, s->result.v92); } } } /*- End of function --------------------------------------------------------*/ static void send_ci(v8_state_t *s) { int i; /* Send 4 CI packets in a burst (the spec says at least 3) */ for (i = 0; i < 4; i++) { v8_put_preamble(s); v8_put_byte(s, V8_CI_SYNC_OCTET); v8_put_byte(s, (s->result.call_function << 5) | V8_CALL_FUNCTION_TAG); } } /*- End of function --------------------------------------------------------*/ static void handle_modem_connect_tone(v8_state_t *s, int tone) { s->result.modem_connect_tone = tone; span_log(&s->logging, SPAN_LOG_FLOW, "'%s' recognised\n", modem_connect_tone_to_str(tone)); if (tone == MODEM_CONNECT_TONES_ANSAM || tone == MODEM_CONNECT_TONES_ANSAM_PR) { /* Set the Te interval. The spec. says 500ms is the minimum, but gives reasons why 1 second is a better value (V.8/8.1.1). */ s->state = V8_HEARD_ANSAM; s->ci_timer = ms_to_samples(1000); } else { /* If we found a connect tone, and it isn't one of the modulated answer tones, indicating V.8 startup, we are not going to do V.8 processing. */ span_log(&s->logging, SPAN_LOG_FLOW, "Non-V.8 modem connect tone detected\n"); s->state = V8_PARKED; s->result.status = V8_STATUS_NON_V8_CALL; report_event(s); } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) v8_rx(v8_state_t *s, const int16_t *amp, int len) { int i; int residual_samples; int tone; //span_log(&s->logging, SPAN_LOG_FLOW, "v8_rx state %d\n", s->state); residual_samples = 0; switch (s->state) { case V8_WAIT_1S: residual_samples = modem_connect_tones_rx(&s->ansam_rx, amp, len); /* Wait 1 second before sending the first CI packet */ if ((s->negotiation_timer -= len) > 0) break; fsk_tx_restart(&s->v21tx, &preset_fsk_specs[FSK_V21CH1]); send_ci(s); s->state = V8_CI_ON; s->fsk_tx_on = TRUE; break; case V8_CI_ON: residual_samples = modem_connect_tones_rx(&s->ansam_rx, amp, len); /* Check if an ANSam or ANSam/ tone has been detected */ if ((tone = modem_connect_tones_rx_get(&s->ansam_rx)) != MODEM_CONNECT_TONES_NONE) { handle_modem_connect_tone(s, tone); break; } if (!s->fsk_tx_on) { s->state = V8_CI_OFF; s->ci_timer = ms_to_samples(500); break; } break; case V8_CI_OFF: residual_samples = modem_connect_tones_rx(&s->ansam_rx, amp, len); /* Check if an ANSam or ANSam/ tone has been detected */ if ((tone = modem_connect_tones_rx_get(&s->ansam_rx)) != MODEM_CONNECT_TONES_NONE) { handle_modem_connect_tone(s, tone); break; } if ((s->ci_timer -= len) <= 0) { if (++s->ci_count >= 10) { /* The spec says we should give up now. */ span_log(&s->logging, SPAN_LOG_FLOW, "Timeout waiting for modem connect tone\n"); s->state = V8_PARKED; s->result.status = V8_STATUS_FAILED; report_event(s); } else { /* Try again */ fsk_tx_restart(&s->v21tx, &preset_fsk_specs[FSK_V21CH1]); send_ci(s); s->state = V8_CI_ON; s->fsk_tx_on = TRUE; } } break; case V8_AWAIT_ANSAM: residual_samples = modem_connect_tones_rx(&s->ansam_rx, amp, len); /* Check if an ANSam or ANSam/ tone has been detected */ if ((tone = modem_connect_tones_rx_get(&s->ansam_rx)) != MODEM_CONNECT_TONES_NONE) handle_modem_connect_tone(s, tone); break; case V8_HEARD_ANSAM: /* We have heard the ANSam or ANSam/ signal, but we still need to wait for the end of the Te timeout period to comply with the spec. */ if ((s->ci_timer -= len) <= 0) { v8_decode_init(s); s->negotiation_timer = ms_to_samples(5000); fsk_tx_restart(&s->v21tx, &preset_fsk_specs[FSK_V21CH1]); send_v92(s); send_cm_jm(s); s->state = V8_CM_ON; s->fsk_tx_on = TRUE; } break; case V8_CM_ON: residual_samples = fsk_rx(&s->v21rx, amp, len); if (s->got_cm_jm) { span_log(&s->logging, SPAN_LOG_FLOW, "JM recognised\n"); /* Now JM has been detected, we send CJ and wait for 75 ms before finishing the V.8 analysis. */ fsk_tx_restart(&s->v21tx, &preset_fsk_specs[FSK_V21CH1]); for (i = 0; i < 3; i++) v8_put_byte(s, 0); s->state = V8_CJ_ON; s->fsk_tx_on = TRUE; break; } if ((s->negotiation_timer -= len) <= 0) { /* Timeout */ span_log(&s->logging, SPAN_LOG_FLOW, "Timeout waiting for JM\n"); s->state = V8_PARKED; s->result.status = V8_STATUS_FAILED; report_event(s); } if (queue_contents(s->tx_queue) < 10) { /* Send CM again */ send_cm_jm(s); } break; case V8_CJ_ON: residual_samples = fsk_rx(&s->v21rx, amp, len); if (!s->fsk_tx_on) { #if 0 s->negotiation_timer = ms_to_samples(75); s->state = V8_SIGC; } break; case V8_SIGC: if ((s->negotiation_timer -= len) <= 0) { #endif /* The V.8 negotiation has succeeded. */ span_log(&s->logging, SPAN_LOG_FLOW, "Negotiation succeeded\n"); s->state = V8_PARKED; s->result.status = V8_STATUS_V8_CALL; report_event(s); } break; case V8_CM_WAIT: residual_samples = fsk_rx(&s->v21rx, amp, len); if (s->got_cm_jm) { span_log(&s->logging, SPAN_LOG_FLOW, "CM recognised\n"); s->result.status = V8_STATUS_V8_OFFERED; report_event(s); /* Stop sending ANSam or ANSam/ and send JM instead */ fsk_tx_init(&s->v21tx, &preset_fsk_specs[FSK_V21CH2], get_bit, s); /* Set the timeout for JM */ s->negotiation_timer = ms_to_samples(5000); s->state = V8_JM_ON; send_cm_jm(s); s->modem_connect_tone_tx_on = ms_to_samples(75); s->fsk_tx_on = TRUE; break; } if ((s->negotiation_timer -= len) <= 0) { /* Timeout */ span_log(&s->logging, SPAN_LOG_FLOW, "Timeout waiting for CM\n"); s->state = V8_PARKED; s->result.status = V8_STATUS_FAILED; report_event(s); } break; case V8_JM_ON: residual_samples = fsk_rx(&s->v21rx, amp, len); if (s->got_cj) { span_log(&s->logging, SPAN_LOG_FLOW, "CJ recognised\n"); /* Stop sending JM, flushing anything left in the buffer, and wait 75 ms */ queue_flush(s->tx_queue); s->negotiation_timer = ms_to_samples(75); s->state = V8_SIGA; break; } if ((s->negotiation_timer -= len) <= 0) { /* Timeout */ span_log(&s->logging, SPAN_LOG_FLOW, "Timeout waiting for CJ\n"); s->state = V8_PARKED; s->result.status = V8_STATUS_FAILED; report_event(s); break; } if (queue_contents(s->tx_queue) < 10) { /* Send JM */ send_cm_jm(s); } break; case V8_SIGA: if (!s->fsk_tx_on) //if ((s->negotiation_timer -= len) <= 0) { /* The V.8 negotiation has succeeded. */ span_log(&s->logging, SPAN_LOG_FLOW, "Negotiation succeeded\n"); s->state = V8_PARKED; s->result.status = V8_STATUS_V8_CALL; report_event(s); } break; case V8_PARKED: residual_samples = len; break; } return residual_samples; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) v8_get_logging_state(v8_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v8_restart(v8_state_t *s, int calling_party, v8_parms_t *parms) { memcpy(&s->parms, parms, sizeof(s->parms)); memset(&s->result, 0, sizeof(s->result)); s->result.status = V8_STATUS_IN_PROGRESS; s->result.modem_connect_tone = MODEM_CONNECT_TONES_NONE; s->result.modulations = s->parms.modulations; s->result.call_function = s->parms.call_function; s->result.nsf = -1; s->result.t66 = -1; s->modulation_bytes = 3; s->ci_timer = 0; s->calling_party = calling_party; if (s->calling_party) { if (s->result.send_ci) { s->state = V8_WAIT_1S; s->negotiation_timer = ms_to_samples(1000); s->ci_count = 0; } else { s->state = V8_AWAIT_ANSAM; } modem_connect_tones_rx_init(&s->ansam_rx, MODEM_CONNECT_TONES_ANS_PR, NULL, NULL); fsk_tx_init(&s->v21tx, &preset_fsk_specs[FSK_V21CH1], get_bit, s); } else { /* Send the ANSam or ANSam/ tone */ s->state = V8_CM_WAIT; s->negotiation_timer = ms_to_samples(200 + 5000); v8_decode_init(s); modem_connect_tones_tx_init(&s->ansam_tx, s->parms.modem_connect_tone); s->modem_connect_tone_tx_on = ms_to_samples(75) + 1; } if ((s->tx_queue = queue_init(NULL, 1024, 0)) == NULL) return -1; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(v8_state_t *) v8_init(v8_state_t *s, int calling_party, v8_parms_t *parms, v8_result_handler_t result_handler, void *user_data) { if (s == NULL) { if ((s = (v8_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "V.8"); s->result_handler = result_handler; s->result_handler_user_data = user_data; v8_restart(s, calling_party, parms); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v8_release(v8_state_t *s) { return queue_free(s->tx_queue); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v8_free(v8_state_t *s) { int ret; ret = queue_free(s->tx_queue); free(s); return ret; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/dtmf.c0000664000175000017500000005222512343630242012002 00000000000000/* * SpanDSP - a series of DSP components for telephony * * dtmf.c - DTMF generation and detection. * * Written by Steve Underwood * * Copyright (C) 2001-2003, 2005, 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/fast_convert.h" #include "spandsp/queue.h" #include "spandsp/complex.h" #include "spandsp/dds.h" #include "spandsp/tone_detect.h" #include "spandsp/tone_generate.h" #include "spandsp/super_tone_rx.h" #include "spandsp/dtmf.h" #include "spandsp/private/logging.h" #include "spandsp/private/queue.h" #include "spandsp/private/tone_generate.h" #include "spandsp/private/dtmf.h" #define DEFAULT_DTMF_TX_LEVEL -10 #define DEFAULT_DTMF_TX_ON_TIME 50 #define DEFAULT_DTMF_TX_OFF_TIME 55 #if defined(SPANDSP_USE_FIXED_POINT) #define DTMF_THRESHOLD 10438 /* -42dBm0 */ #define DTMF_NORMAL_TWIST 6.309f /* 8dB */ #define DTMF_REVERSE_TWIST 2.512f /* 4dB */ #define DTMF_RELATIVE_PEAK_ROW 6.309f /* 8dB */ #define DTMF_RELATIVE_PEAK_COL 6.309f /* 8dB */ #define DTMF_TO_TOTAL_ENERGY 83.868f /* -0.85dB */ #define DTMF_POWER_OFFSET 68.251f /* 10*log(256.0*256.0*DTMF_SAMPLES_PER_BLOCK) */ #define DTMF_SAMPLES_PER_BLOCK 102 #else #define DTMF_THRESHOLD 171032462.0f /* -42dBm0 [((DTMF_SAMPLES_PER_BLOCK*32768.0/1.4142)*10^((-42 - DBM0_MAX_SINE_POWER)/20.0))^2 => 171032462.0] */ #define DTMF_NORMAL_TWIST 6.309f /* 8dB [10^(8/10) => 6.309] */ #define DTMF_REVERSE_TWIST 2.512f /* 4dB */ #define DTMF_RELATIVE_PEAK_ROW 6.309f /* 8dB */ #define DTMF_RELATIVE_PEAK_COL 6.309f /* 8dB */ #define DTMF_TO_TOTAL_ENERGY 83.868f /* -0.85dB [DTMF_SAMPLES_PER_BLOCK*10^(-0.85/10.0)] */ #define DTMF_POWER_OFFSET 110.395f /* 10*log(32768.0*32768.0*DTMF_SAMPLES_PER_BLOCK) */ #define DTMF_SAMPLES_PER_BLOCK 102 #endif static const float dtmf_row[] = { 697.0f, 770.0f, 852.0f, 941.0f }; static const float dtmf_col[] = { 1209.0f, 1336.0f, 1477.0f, 1633.0f }; static const char dtmf_positions[] = "123A" "456B" "789C" "*0#D"; static goertzel_descriptor_t dtmf_detect_row[4]; static goertzel_descriptor_t dtmf_detect_col[4]; static int dtmf_tx_inited = FALSE; static tone_gen_descriptor_t dtmf_digit_tones[16]; SPAN_DECLARE(int) dtmf_rx(dtmf_rx_state_t *s, const int16_t amp[], int samples) { #if defined(SPANDSP_USE_FIXED_POINT) int32_t row_energy[4]; int32_t col_energy[4]; int16_t xamp; float famp; #else float row_energy[4]; float col_energy[4]; float xamp; float famp; #endif float v1; int i; int j; int sample; int best_row; int best_col; int limit; uint8_t hit; hit = 0; for (sample = 0; sample < samples; sample = limit) { /* The block length is optimised to meet the DTMF specs. */ if ((samples - sample) >= (DTMF_SAMPLES_PER_BLOCK - s->current_sample)) limit = sample + (DTMF_SAMPLES_PER_BLOCK - s->current_sample); else limit = samples; /* The following unrolled loop takes only 35% (rough estimate) of the time of a rolled loop on the machine on which it was developed */ for (j = sample; j < limit; j++) { xamp = amp[j]; if (s->filter_dialtone) { famp = xamp; /* Sharp notches applied at 350Hz and 440Hz - the two common dialtone frequencies. These are rather high Q, to achieve the required narrowness, without using lots of sections. */ v1 = 0.98356f*famp + 1.8954426f*s->z350[0] - 0.9691396f*s->z350[1]; famp = v1 - 1.9251480f*s->z350[0] + s->z350[1]; s->z350[1] = s->z350[0]; s->z350[0] = v1; v1 = 0.98456f*famp + 1.8529543f*s->z440[0] - 0.9691396f*s->z440[1]; famp = v1 - 1.8819938f*s->z440[0] + s->z440[1]; s->z440[1] = s->z440[0]; s->z440[0] = v1; xamp = famp; } xamp = goertzel_preadjust_amp(xamp); #if defined(SPANDSP_USE_FIXED_POINT) s->energy += ((int32_t) xamp*xamp); #else s->energy += xamp*xamp; #endif goertzel_samplex(&s->row_out[0], xamp); goertzel_samplex(&s->col_out[0], xamp); goertzel_samplex(&s->row_out[1], xamp); goertzel_samplex(&s->col_out[1], xamp); goertzel_samplex(&s->row_out[2], xamp); goertzel_samplex(&s->col_out[2], xamp); goertzel_samplex(&s->row_out[3], xamp); goertzel_samplex(&s->col_out[3], xamp); } if (s->duration < INT_MAX - (limit - sample)) s->duration += (limit - sample); s->current_sample += (limit - sample); if (s->current_sample < DTMF_SAMPLES_PER_BLOCK) continue; /* We are at the end of a DTMF detection block */ /* Find the peak row and the peak column */ row_energy[0] = goertzel_result(&s->row_out[0]); best_row = 0; col_energy[0] = goertzel_result(&s->col_out[0]); best_col = 0; for (i = 1; i < 4; i++) { row_energy[i] = goertzel_result(&s->row_out[i]); if (row_energy[i] > row_energy[best_row]) best_row = i; col_energy[i] = goertzel_result(&s->col_out[i]); if (col_energy[i] > col_energy[best_col]) best_col = i; } hit = 0; /* Basic signal level test and the twist test */ if (row_energy[best_row] >= s->threshold && col_energy[best_col] >= s->threshold) { if (col_energy[best_col] < row_energy[best_row]*s->reverse_twist && col_energy[best_col]*s->normal_twist > row_energy[best_row]) { /* Relative peak test ... */ for (i = 0; i < 4; i++) { if ((i != best_col && col_energy[i]*DTMF_RELATIVE_PEAK_COL > col_energy[best_col]) || (i != best_row && row_energy[i]*DTMF_RELATIVE_PEAK_ROW > row_energy[best_row])) { break; } } /* ... and fraction of total energy test */ if (i >= 4 && (row_energy[best_row] + col_energy[best_col]) > DTMF_TO_TOTAL_ENERGY*s->energy) { /* Got a hit */ hit = dtmf_positions[(best_row << 2) + best_col]; } } if (span_log_test(&s->logging, SPAN_LOG_FLOW)) { /* Log information about the quality of the signal, to aid analysis of detection problems */ /* Logging at this point filters the total no-hoper frames out of the log, and leaves anything which might feasibly be a DTMF digit. The log will then contain a list of the total, row and coloumn power levels for detailed analysis of detection problems. */ span_log(&s->logging, SPAN_LOG_FLOW, "Potentially '%c' - total %.2fdB, row %.2fdB, col %.2fdB, duration %d - %s\n", dtmf_positions[(best_row << 2) + best_col], log10f(s->energy)*10.0f - DTMF_POWER_OFFSET + DBM0_MAX_POWER, log10f(row_energy[best_row]/DTMF_TO_TOTAL_ENERGY)*10.0f - DTMF_POWER_OFFSET + DBM0_MAX_POWER, log10f(col_energy[best_col]/DTMF_TO_TOTAL_ENERGY)*10.0f - DTMF_POWER_OFFSET + DBM0_MAX_POWER, s->duration, (hit) ? "hit" : "miss"); } } /* The logic in the next test should ensure the following for different successive hit patterns: -----ABB = start of digit B. ----B-BB = start of digit B ----A-BB = start of digit B BBBBBABB = still in digit B. BBBBBB-- = end of digit B BBBBBBC- = end of digit B BBBBACBB = B ends, then B starts again. BBBBBBCC = B ends, then C starts. BBBBBCDD = B ends, then D starts. This can work with: - Back to back differing digits. Back-to-back digits should not happen. The spec. says there should be a gap between digits. However, many real phones do not impose a gap, and rolling across the keypad can produce little or no gap. - It tolerates nasty phones that give a very wobbly start to a digit. - VoIP can give sample slips. The phase jumps that produces will cause the block it is in to give no detection. This logic will ride over a single missed block, and not falsely declare a second digit. If the hiccup happens in the wrong place on a minimum length digit, however we would still fail to detect that digit. Could anything be done to deal with that? Packet loss is clearly a no-go zone. Note this is only relevant to VoIP using A-law, u-law or similar. Low bit rate codecs scramble DTMF too much for it to be recognised, and often slip in units larger than a sample. */ if (hit != s->in_digit && s->last_hit != s->in_digit) { /* We have two successive indications that something has changed. */ /* To declare digit on, the hits must agree. Otherwise we declare tone off. */ hit = (hit && hit == s->last_hit) ? hit : 0; if (s->realtime_callback) { /* Avoid reporting multiple no digit conditions on flaky hits */ if (s->in_digit || hit) { i = (s->in_digit && !hit) ? -99 : lfastrintf(log10f(s->energy)*10.0f - DTMF_POWER_OFFSET + DBM0_MAX_POWER); s->realtime_callback(s->realtime_callback_data, hit, i, s->duration); s->duration = 0; } } else { if (hit) { if (s->current_digits < MAX_DTMF_DIGITS) { s->digits[s->current_digits++] = (char) hit; s->digits[s->current_digits] = '\0'; if (s->digits_callback) { s->digits_callback(s->digits_callback_data, s->digits, s->current_digits); s->current_digits = 0; } } else { s->lost_digits++; } } } s->in_digit = hit; } s->last_hit = hit; #if defined(SPANDSP_USE_FIXED_POINT) s->energy = 0; #else s->energy = 0.0f; #endif s->current_sample = 0; } if (s->current_digits && s->digits_callback) { s->digits_callback(s->digits_callback_data, s->digits, s->current_digits); s->digits[0] = '\0'; s->current_digits = 0; } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) dtmf_rx_fillin(dtmf_rx_state_t *s, int samples) { int i; /* Restart any Goertzel and energy gathering operation we might be in the middle of. */ for (i = 0; i < 4; i++) { goertzel_reset(&s->row_out[i]); goertzel_reset(&s->col_out[i]); } #if defined(SPANDSP_USE_FIXED_POINT) s->energy = 0; #else s->energy = 0.0f; #endif s->current_sample = 0; /* Don't update the hit detection. Pretend it never happened. */ /* TODO: Surely we can be cleverer than this. */ return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) dtmf_rx_status(dtmf_rx_state_t *s) { if (s->in_digit) return s->in_digit; if (s->last_hit) return 'x'; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(size_t) dtmf_rx_get(dtmf_rx_state_t *s, char *buf, int max) { if (max > s->current_digits) max = s->current_digits; if (max > 0) { memcpy(buf, s->digits, max); memmove(s->digits, s->digits + max, s->current_digits - max); s->current_digits -= max; } buf[max] = '\0'; return max; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) dtmf_rx_set_realtime_callback(dtmf_rx_state_t *s, tone_report_func_t callback, void *user_data) { s->realtime_callback = callback; s->realtime_callback_data = user_data; s->duration = 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) dtmf_rx_parms(dtmf_rx_state_t *s, int filter_dialtone, int twist, int reverse_twist, int threshold) { float x; if (filter_dialtone >= 0) { s->z350[0] = 0.0f; s->z350[1] = 0.0f; s->z440[0] = 0.0f; s->z440[1] = 0.0f; s->filter_dialtone = filter_dialtone; } if (twist >= 0) s->normal_twist = powf(10.0f, twist/10.0f); if (reverse_twist >= 0) s->reverse_twist = powf(10.0f, reverse_twist/10.0f); if (threshold > -99) { x = (DTMF_SAMPLES_PER_BLOCK*32768.0f/1.4142f)*powf(10.0f, (threshold - DBM0_MAX_SINE_POWER)/20.0f); s->threshold = x*x; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) dtmf_rx_get_logging_state(dtmf_rx_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(dtmf_rx_state_t *) dtmf_rx_init(dtmf_rx_state_t *s, digits_rx_callback_t callback, void *user_data) { int i; static int initialised = FALSE; if (s == NULL) { if ((s = (dtmf_rx_state_t *) malloc(sizeof (*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "DTMF"); s->digits_callback = callback; s->digits_callback_data = user_data; s->realtime_callback = NULL; s->realtime_callback_data = NULL; s->filter_dialtone = FALSE; s->normal_twist = DTMF_NORMAL_TWIST; s->reverse_twist = DTMF_REVERSE_TWIST; s->threshold = DTMF_THRESHOLD; s->in_digit = 0; s->last_hit = 0; if (!initialised) { for (i = 0; i < 4; i++) { make_goertzel_descriptor(&dtmf_detect_row[i], dtmf_row[i], DTMF_SAMPLES_PER_BLOCK); make_goertzel_descriptor(&dtmf_detect_col[i], dtmf_col[i], DTMF_SAMPLES_PER_BLOCK); } initialised = TRUE; } for (i = 0; i < 4; i++) { goertzel_init(&s->row_out[i], &dtmf_detect_row[i]); goertzel_init(&s->col_out[i], &dtmf_detect_col[i]); } #if defined(SPANDSP_USE_FIXED_POINT) s->energy = 0; #else s->energy = 0.0f; #endif s->current_sample = 0; s->lost_digits = 0; s->current_digits = 0; s->digits[0] = '\0'; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) dtmf_rx_release(dtmf_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) dtmf_rx_free(dtmf_rx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ static void dtmf_tx_initialise(void) { int row; int col; if (dtmf_tx_inited) return; for (row = 0; row < 4; row++) { for (col = 0; col < 4; col++) { tone_gen_descriptor_init(&dtmf_digit_tones[row*4 + col], (int) dtmf_row[row], DEFAULT_DTMF_TX_LEVEL, (int) dtmf_col[col], DEFAULT_DTMF_TX_LEVEL, DEFAULT_DTMF_TX_ON_TIME, DEFAULT_DTMF_TX_OFF_TIME, 0, 0, FALSE); } } dtmf_tx_inited = TRUE; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) dtmf_tx(dtmf_tx_state_t *s, int16_t amp[], int max_samples) { int len; const char *cp; int digit; len = 0; if (s->tones.current_section >= 0) { /* Deal with the fragment left over from last time */ len = tone_gen(&s->tones, amp, max_samples); } while (len < max_samples && (digit = queue_read_byte(&s->queue.queue)) >= 0) { /* Step to the next digit */ if (digit == 0) continue; if ((cp = strchr(dtmf_positions, digit)) == NULL) continue; tone_gen_init(&s->tones, &dtmf_digit_tones[cp - dtmf_positions]); s->tones.tone[0].gain = s->low_level; s->tones.tone[1].gain = s->high_level; s->tones.duration[0] = s->on_time; s->tones.duration[1] = s->off_time; len += tone_gen(&s->tones, amp + len, max_samples - len); } return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) dtmf_tx_put(dtmf_tx_state_t *s, const char *digits, int len) { size_t space; /* This returns the number of characters that would not fit in the buffer. The buffer will only be loaded if the whole string of digits will fit, in which case zero is returned. */ if (len < 0) { if ((len = strlen(digits)) == 0) return 0; } if ((space = queue_free_space(&s->queue.queue)) < (size_t) len) return len - (int) space; if (queue_write(&s->queue.queue, (const uint8_t *) digits, len) >= 0) return 0; return -1; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) dtmf_tx_set_level(dtmf_tx_state_t *s, int level, int twist) { s->low_level = dds_scaling_dbm0f((float) level); s->high_level = dds_scaling_dbm0f((float) (level + twist)); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) dtmf_tx_set_timing(dtmf_tx_state_t *s, int on_time, int off_time) { s->on_time = ((on_time >= 0) ? on_time : DEFAULT_DTMF_TX_ON_TIME)*SAMPLE_RATE/1000; s->off_time = ((off_time >= 0) ? off_time : DEFAULT_DTMF_TX_OFF_TIME)*SAMPLE_RATE/1000; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(dtmf_tx_state_t *) dtmf_tx_init(dtmf_tx_state_t *s) { if (s == NULL) { if ((s = (dtmf_tx_state_t *) malloc(sizeof (*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); if (!dtmf_tx_inited) dtmf_tx_initialise(); tone_gen_init(&s->tones, &dtmf_digit_tones[0]); dtmf_tx_set_level(s, DEFAULT_DTMF_TX_LEVEL, 0); dtmf_tx_set_timing(s, -1, -1); queue_init(&s->queue.queue, MAX_DTMF_DIGITS, QUEUE_READ_ATOMIC | QUEUE_WRITE_ATOMIC); s->tones.current_section = -1; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) dtmf_tx_release(dtmf_tx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) dtmf_tx_free(dtmf_tx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/lpc10_voicing.c0000664000175000017500000004316012100560214013473 00000000000000/* * SpanDSP - a series of DSP components for telephony * * lpc10_voicing.c - LPC10 low bit rate speech codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * This code is based on the U.S. Department of Defense reference * implementation of the LPC-10 2400 bps Voice Coder. They do not * exert copyright claims on their code, and it may be freely used. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/lpc10.h" #include "spandsp/private/lpc10.h" #include "lpc10_encdecs.h" static void vparms(int32_t vwin[], float *inbuf, float *lpbuf, const int32_t buflim[], int32_t half, float *dither, int32_t *mintau, int32_t *zc, int32_t *lbe, int32_t *fbe, float *qs, float *rc1, float *ar_b, float *ar_f) { int32_t inbuf_offset; int32_t lpbuf_offset; int32_t vlen; int32_t stop; int32_t i; int32_t start; float r1; float r2; float e_pre; float ap_rms; float e_0; float oldsgn; float lp_rms; float e_b; float e_f; float r_b; float r_f; float e0ap; /* Calculate zero crossings (ZC) and several energy and correlation */ /* measures on low band and full band speech. Each measure is taken */ /* over either the first or the second half of the voicing window, */ /* depending on the variable HALF. */ lpbuf_offset = buflim[2]; lpbuf -= lpbuf_offset; inbuf_offset = buflim[0]; inbuf -= inbuf_offset; lp_rms = 0.0f; ap_rms = 0.0f; e_pre = 0.0f; e0ap = 0.0f; *rc1 = 0.0f; e_0 = 0.0f; e_b = 0.0f; e_f = 0.0f; r_f = 0.0f; r_b = 0.0f; *zc = 0; vlen = vwin[1] - vwin[0] + 1; start = vwin[0] + half*vlen/2 + 1; stop = start + vlen/2 - 1; /* I'll use the symbol HVL in the table below to represent the value */ /* VLEN/2. Note that if VLEN is odd, then HVL should be rounded down, */ /* i.e., HVL = (VLEN-1)/2. */ /* HALF START STOP */ /* 1 VWIN(1)+1 VWIN(1)+HVL */ /* 2 VWIN(1)+HVL+1 VWIN(1)+2*HVL */ oldsgn = r_sign(1.0f, inbuf[start - 1] - *dither); for (i = start; i <= stop; i++) { lp_rms += fabsf(lpbuf[i]); ap_rms += fabsf(inbuf[i]); e_pre += fabsf(inbuf[i] - inbuf[i - 1]); r1 = inbuf[i]; e0ap += r1*r1; *rc1 += inbuf[i]*inbuf[i - 1]; r1 = lpbuf[i]; e_0 += r1*r1; r1 = lpbuf[i - *mintau]; e_b += r1*r1; r1 = lpbuf[i + *mintau]; e_f += r1*r1; r_f += lpbuf[i]*lpbuf[i + *mintau]; r_b += lpbuf[i]*lpbuf[i - *mintau]; r1 = inbuf[i] + *dither; if (r_sign(1.0f, r1) != oldsgn) { ++(*zc); oldsgn = -oldsgn; } *dither = -(*dither); } /* Normalized short-term autocovariance coefficient at unit sample delay */ *rc1 /= max(e0ap, 1.0f); /* Ratio of the energy of the first difference signal (6 dB/oct preemphasis)*/ /* to the energy of the full band signal */ /* Computing MAX */ r1 = ap_rms*2.0f; *qs = e_pre/max(r1, 1.0f); /* aR_b is the product of the forward and reverse prediction gains, */ /* looking backward in time (the causal case). */ *ar_b = r_b/max(e_b, 1.0f)*(r_b/max(e_0, 1.0f)); /* aR_f is the same as aR_b, but looking forward in time (non causal case).*/ *ar_f = r_f/max(e_f, 1.0f)*(r_f/max(e_0, 1.0f)); /* Normalize ZC, LBE, and FBE to old fixed window length of 180. */ /* (The fraction 90/VLEN has a range of 0.58 to 1) */ r2 = (float) (*zc << 1); *zc = lfastrintf(r2*(90.0f/vlen)); r1 = lp_rms/4*(90.0f/vlen); *lbe = min(lfastrintf(r1), 32767); r1 = ap_rms/4*(90.0f/vlen); *fbe = min(lfastrintf(r1), 32767); } /*- End of function --------------------------------------------------------*/ /* Voicing detection makes voicing decisions for each half */ /* frame of input speech. Tentative voicing decisions are made two frames*/ /* in the future (2F) for each half frame. These decisions are carried */ /* through one frame in the future (1F) to the present (P) frame where */ /* they are examined and smoothed, resulting in the final voicing */ /* decisions for each half frame. */ /* The voicing parameter (signal measurement) column vector (VALUE) */ /* is based on a rectangular window of speech samples determined by the */ /* window placement algorithm. The voicing parameter vector contains the*/ /* AMDF windowed maximum-to-minimum ratio, the zero crossing rate, energy*/ /* measures, reflection coefficients, and prediction gains. The voicing */ /* window is placed to avoid contamination of the voicing parameter vector*/ /* with speech onsets. */ /* The input signal is then classified as unvoiced (including */ /* silence) or voiced. This decision is made by a linear discriminant */ /* function consisting of a dot product of the voicing decision */ /* coefficient (VDC) row vector with the measurement column vector */ /* (VALUE). The VDC vector is 2-dimensional, each row vector is optimized*/ /* for a particular signal-to-noise ratio (SNR). So, before the dot */ /* product is performed, the SNR is estimated to select the appropriate */ /* VDC vector. */ /* The smoothing algorithm is a modified median smoother. The */ /* voicing discriminant function is used by the smoother to determine how*/ /* strongly voiced or unvoiced a signal is. The smoothing is further */ /* modified if a speech onset and a voicing decision transition occur */ /* within one half frame. In this case, the voicing decision transition */ /* is extended to the speech onset. For transmission purposes, there are*/ /* constraints on the duration and transition of voicing decisions. The */ /* smoother takes these constraints into account. */ /* Finally, the energy estimates are updated along with the dither */ /* threshold used to calculate the zero crossing rate (ZC). */ void lpc10_voicing(lpc10_encode_state_t *s, int32_t vwin[], float *inbuf, float *lpbuf, const int32_t buflim[], int32_t half, float *minamd, float *maxamd, int32_t *mintau, float ivrc[], int32_t obound[]) { static const float vdc[100] = { 0.0f, 1714.0f, -110.0f, 334.0f, -4096.0f, -654.0f, 3752.0f, 3769.0f, 0.0f, 1181.0f, 0.0f, 874.0f, -97.0f, 300.0f, -4096.0f, -1021.0f, 2451.0f, 2527.0f, 0.0f, -500.0f, 0.0f, 510.0f, -70.0f, 250.0f, -4096.0f, -1270.0f, 2194.0f, 2491.0f, 0.0f, -1500.0f, 0.0f, 500.0f, -10.0f, 200.0f, -4096.0f, -1300.0f, 2.0e3f, 2.0e3f, 0.0f, -2.0e3f, 0.0f, 500.0f, 0.0f, 0.0f, -4096.0f, -1300.0f, 2.0e3f, 2.0e3f, 0.0f, -2500.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f }; static const int nvdcl = 5; static const float vdcl[10] = { 600.0f, 450.0f, 300.0f, 200.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f }; int32_t inbuf_offset; int32_t lpbuf_offset; int32_t i1; float r1; float r2; float ar_b; float ar_f; int32_t snrl; int32_t i; float value[9]; int32_t zc; int ot; float qs; int32_t vstate; float rc1; int32_t fbe; int32_t lbe; float snr2; #if (_MSC_VER >= 1400) __analysis_assume(half >= 0 && half < 2); #endif inbuf_offset = 0; lpbuf_offset = 0; if (inbuf) { inbuf_offset = buflim[0]; inbuf -= inbuf_offset; } if (lpbuf) { lpbuf_offset = buflim[2]; lpbuf -= lpbuf_offset; } /* Voicing Decision Parameter vector (* denotes zero coefficient): */ /* * MAXMIN */ /* LBE/LBVE */ /* ZC */ /* RC1 */ /* QS */ /* IVRC2 */ /* aR_B */ /* aR_F */ /* * LOG(LBE/LBVE) */ /* Define 2-D voicing decision coefficient vector according to the voicing */ /* parameter order above. Each row (VDC vector) is optimized for a specific */ /* SNR. The last element of the vector is the constant. */ /* E ZC RC1 Qs IVRC2 aRb aRf c */ /* The VOICE array contains the result of the linear discriminant function*/ /* (analog values). The VOIBUF array contains the hard-limited binary */ /* voicing decisions. The VOICE and VOIBUF arrays, according to FORTRAN */ /* memory allocation, are addressed as: */ /* (half-frame number, future-frame number) */ /* | Past | Present | Future1 | Future2 | */ /* | 1,0 | 2,0 | 1,1 | 2,1 | 1,2 | 2,2 | 1,3 | 2,3 | ---> time */ /* Update linear discriminant function history each frame: */ if (half == 0) { s->voice[0][0] = s->voice[1][0]; s->voice[0][1] = s->voice[1][1]; s->voice[1][0] = s->voice[2][0]; s->voice[1][1] = s->voice[2][1]; s->maxmin = *maxamd / max(*minamd, 1.0f); } /* Calculate voicing parameters twice per frame */ vparms(vwin, &inbuf[inbuf_offset], &lpbuf[lpbuf_offset], buflim, half, &s->dither, mintau, &zc, &lbe, &fbe, &qs, &rc1, &ar_b, &ar_f); /* Estimate signal-to-noise ratio to select the appropriate VDC vector. */ /* The SNR is estimated as the running average of the ratio of the */ /* running average full-band voiced energy to the running average */ /* full-band unvoiced energy. SNR filter has gain of 63. */ r1 = (s->snr + s->fbve/(float) max(s->fbue, 1))*63/64.0f; s->snr = (float) lfastrintf(r1); snr2 = s->snr*s->fbue/max(s->lbue, 1); /* Quantize SNR to SNRL according to VDCL thresholds. */ i1 = nvdcl - 1; for (snrl = 0; snrl < i1; snrl++) { if (snr2 > vdcl[snrl]) break; } /* (Note: SNRL = NVDCL here) */ /* Linear discriminant voicing parameters: */ value[0] = s->maxmin; value[1] = (float) lbe/max(s->lbve, 1); value[2] = (float) zc; value[3] = rc1; value[4] = qs; value[5] = ivrc[1]; value[6] = ar_b; value[7] = ar_f; /* Evaluation of linear discriminant function: */ s->voice[2][half] = vdc[snrl*10 + 9]; for (i = 0; i < 8; i++) s->voice[2][half] += vdc[snrl*10 + i]*value[i]; /* Classify as voiced if discriminant > 0, otherwise unvoiced */ /* Voicing decision for current half-frame: 1 = Voiced; 0 = Unvoiced */ s->voibuf[3][half] = (s->voice[2][half] > 0.0f) ? 1 : 0; /* Skip voicing decision smoothing in first half-frame: */ /* Give a value to VSTATE, so that trace statements below will print */ /* a consistent value from one call to the next when HALF .EQ. 1. */ /* The value of VSTATE is not used for any other purpose when this is */ /* true. */ vstate = -1; if (half != 0) { /* Voicing decision smoothing rules (override of linear combination): */ /* Unvoiced half-frames: At least two in a row. */ /* -------------------- */ /* Voiced half-frames: At least two in a row in one frame. */ /* ------------------- Otherwise at least three in a row. */ /* (Due to the way transition frames are encoded) */ /* In many cases, the discriminant function determines how to smooth. */ /* In the following chart, the decisions marked with a * may be overridden. */ /* Voicing override of transitions at onsets: */ /* If a V/UV or UV/V voicing decision transition occurs within one-half */ /* frame of an onset bounding a voicing window, then the transition is */ /* moved to occur at the onset. */ /* P 1F */ /* ----- ----- */ /* 0 0 0 0 */ /* 0 0 0* 1 (If there is an onset there) */ /* 0 0 1* 0* (Based on 2F and discriminant distance) */ /* 0 0 1 1 */ /* 0 1* 0 0 (Always) */ /* 0 1* 0* 1 (Based on discriminant distance) */ /* 0* 1 1 0* (Based on past, 2F, and discriminant distance) */ /* 0 1* 1 1 (If there is an onset there) */ /* 1 0* 0 0 (If there is an onset there) */ /* 1 0 0 1 */ /* 1 0* 1* 0 (Based on discriminant distance) */ /* 1 0* 1 1 (Always) */ /* 1 1 0 0 */ /* 1 1 0* 1* (Based on 2F and discriminant distance) */ /* 1 1 1* 0 (If there is an onset there) */ /* 1 1 1 1 */ /* Determine if there is an onset transition between P and 1F. */ /* OT (Onset Transition) is true if there is an onset between */ /* P and 1F but not after 1F. */ ot = ((obound[0] & 2) != 0 || obound[1] == 1) && (obound[2] & 1) == 0; /* Multi-way dispatch on voicing decision history: */ vstate = (s->voibuf[1][0] << 3) + (s->voibuf[1][1] << 2) + (s->voibuf[2][0] << 1) + s->voibuf[2][1]; switch (vstate + 1) { case 2: if (ot && s->voibuf[3][0] == 1) s->voibuf[2][0] = 1; break; case 3: if (s->voibuf[3][0] == 0 || s->voice[1][0] < -s->voice[1][1]) s->voibuf[2][0] = 0; else s->voibuf[2][1] = 1; break; case 5: s->voibuf[1][1] = 0; break; case 6: if (s->voice[0][1] < -s->voice[1][0]) s->voibuf[1][1] = 0; else s->voibuf[2][0] = 1; break; case 7: if (s->voibuf[0][0] == 1 || s->voibuf[3][0] == 1 || s->voice[1][1] > s->voice[0][0]) s->voibuf[2][1] = 1; else s->voibuf[1][0] = 1; break; case 8: if (ot) s->voibuf[1][1] = 0; break; case 9: if (ot) s->voibuf[1][1] = 1; break; case 11: if (s->voice[1][0] < -s->voice[0][1]) s->voibuf[2][0] = 0; else s->voibuf[1][1] = 1; break; case 12: s->voibuf[1][1] = 1; break; case 14: if (s->voibuf[3][0] == 0 && s->voice[1][1] < -s->voice[1][0]) s->voibuf[2][1] = 0; else s->voibuf[2][0] = 1; break; case 15: if (ot && s->voibuf[3][0] == 0) s->voibuf[2][0] = 0; break; } } /* During unvoiced half-frames, update the low band and full band unvoiced*/ /* energy estimates (LBUE and FBUE) and also the zero crossing */ /* threshold (DITHER). (The input to the unvoiced energy filters is */ /* restricted to be less than 10dB above the previous inputs of the */ /* filters.) */ /* During voiced half-frames, update the low-pass (LBVE) and all-pass */ /* (FBVE) voiced energy estimates. */ if (s->voibuf[3][half] == 0) { r1 = (s->sfbue*63 + (min(fbe, s->ofbue*3) << 3))/64.0f; s->sfbue = lfastrintf(r1); s->fbue = s->sfbue/8; s->ofbue = fbe; r1 = (s->slbue*63 + (min(lbe, s->olbue*3) << 3))/64.0f; s->slbue = lfastrintf(r1); s->lbue = s->slbue/8; s->olbue = lbe; } else { s->lbve = lfastrintf((s->lbve*63 + lbe)/64.0f); s->fbve = lfastrintf((s->fbve*63 + fbe)/64.0f); } /* Set dither threshold to yield proper zero crossing rates in the */ /* presence of low frequency noise and low level signal input. */ /* NOTE: The divisor is a function of REF, the expected energies. */ /* Computing MIN */ /* Computing MAX */ r2 = sqrtf((float) (s->lbue*s->lbve))*64/3000; r1 = max(r2, 1.0f); s->dither = min(r1, 20.0f); /* Voicing decisions are returned in VOIBUF. */ } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/libspandsp.2008.vcproj0000664000175000017500000004313112343640733014662 00000000000000 spandsp-0.0.6/src/ima_adpcm.c0000664000175000017500000003375511422612262012770 00000000000000/* * SpanDSP - a series of DSP components for telephony * * ima_adpcm.c - Conversion routines between linear 16 bit PCM data and * IMA/DVI/Intel ADPCM format. * * Written by Steve Underwood * * Copyright (C) 2001, 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/saturated.h" #include "spandsp/ima_adpcm.h" #include "spandsp/private/ima_adpcm.h" /* * Intel/DVI ADPCM coder/decoder. * * The algorithm for this coder was taken from the IMA Compatability Project * proceedings, Vol 2, Number 2; May 1992. * * The RTP payload specs. reference a variant of DVI, called VDVI. This attempts to * further compress, in a variable bit rate manner, by expressing the 4 bit codes * from the DVI codec as: * * 0 00 * 1 010 * 2 1100 * 3 11100 * 4 111100 * 5 1111100 * 6 11111100 * 7 11111110 * 8 10 * 9 011 * 10 1101 * 11 11101 * 12 111101 * 13 1111101 * 14 11111101 * 15 11111111 * * Any left over bits in the last octet of an encoded burst are set to one. */ /* DVI4 uses an adaptive delta pulse code modulation (ADPCM) encoding scheme that was specified by the Interactive Multimedia Association (IMA) as the "IMA ADPCM wave type". However, the encoding defined here as DVI4 differs in three respects from the IMA specification: o The RTP DVI4 header contains the predicted value rather than the first sample value contained the IMA ADPCM block header. o IMA ADPCM blocks contain an odd number of samples, since the first sample of a block is contained just in the header (uncompressed), followed by an even number of compressed samples. DVI4 has an even number of compressed samples only, using the `predict' word from the header to decode the first sample. o For DVI4, the 4-bit samples are packed with the first sample in the four most significant bits and the second sample in the four least significant bits. In the IMA ADPCM codec, the samples are packed in the opposite order. Each packet contains a single DVI block. This profile only defines the 4-bit-per-sample version, while IMA also specified a 3-bit-per- sample encoding. The "header" word for each channel has the following structure: int16 predict; // predicted value of first sample // from the previous block (L16 format) u_int8 index; // current index into stepsize table u_int8 reserved; // set to zero by sender, ignored by receiver Each octet following the header contains two 4-bit samples, thus the number of samples per packet MUST be even because there is no means to indicate a partially filled last octet. */ /*! The number of ADPCM step sizes */ #define STEP_MAX 88 /* Intel ADPCM step variation table */ static const int step_size[STEP_MAX + 1] = { 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130, 143, 157, 173, 190, 209, 230, 253, 279, 307, 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 }; static const int step_adjustment[8] = { -1, -1, -1, -1, 2, 4, 6, 8 }; static const struct { uint8_t code; uint8_t bits; } vdvi_encode[] = { {0x00, 2}, {0x02, 3}, {0x0C, 4}, {0x1C, 5}, {0x3C, 6}, {0x7C, 7}, {0xFC, 8}, {0xFE, 8}, {0x02, 2}, {0x03, 3}, {0x0D, 4}, {0x1D, 5}, {0x3D, 6}, {0x7D, 7}, {0xFD, 8}, {0xFF, 8} }; static const struct { uint16_t code; uint16_t mask; uint8_t bits; } vdvi_decode[] = { {0x0000, 0xC000, 2}, {0x4000, 0xE000, 3}, {0xC000, 0xF000, 4}, {0xE000, 0xF800, 5}, {0xF000, 0xFC00, 6}, {0xF800, 0xFE00, 7}, {0xFC00, 0xFF00, 8}, {0xFE00, 0xFF00, 8}, {0x8000, 0xC000, 2}, {0x6000, 0xE000, 3}, {0xD000, 0xF000, 4}, {0xE800, 0xF800, 5}, {0xF400, 0xFC00, 6}, {0xFA00, 0xFE00, 7}, {0xFD00, 0xFF00, 8}, {0xFF00, 0xFF00, 8} }; static int16_t decode(ima_adpcm_state_t *s, uint8_t adpcm) { int e; int ss; int16_t linear; /* e = (adpcm+0.5)*step/4 */ ss = step_size[s->step_index]; e = ss >> 3; if (adpcm & 0x01) e += (ss >> 2); /*endif*/ if (adpcm & 0x02) e += (ss >> 1); /*endif*/ if (adpcm & 0x04) e += ss; /*endif*/ if (adpcm & 0x08) e = -e; /*endif*/ linear = saturate(s->last + e); s->last = linear; s->step_index += step_adjustment[adpcm & 0x07]; if (s->step_index < 0) s->step_index = 0; else if (s->step_index > STEP_MAX) s->step_index = STEP_MAX; /*endif*/ return linear; } /*- End of function --------------------------------------------------------*/ static uint8_t encode(ima_adpcm_state_t *s, int16_t linear) { int e; int ss; int adpcm; int diff; int initial_e; ss = step_size[s->step_index]; initial_e = e = linear - s->last; diff = ss >> 3; adpcm = (uint8_t) 0x00; if (e < 0) { adpcm = (uint8_t) 0x08; e = -e; } /*endif*/ if (e >= ss) { adpcm |= (uint8_t) 0x04; e -= ss; } /*endif*/ ss >>= 1; if (e >= ss) { adpcm |= (uint8_t) 0x02; e -= ss; } /*endif*/ ss >>= 1; if (e >= ss) { adpcm |= (uint8_t) 0x01; e -= ss; } /*endif*/ if (initial_e < 0) diff = -(diff - initial_e - e); else diff = diff + initial_e - e; /*endif*/ s->last = saturate(diff + s->last); s->step_index += step_adjustment[adpcm & 0x07]; if (s->step_index < 0) s->step_index = 0; else if (s->step_index > STEP_MAX) s->step_index = STEP_MAX; /*endif*/ return (uint8_t) adpcm; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(ima_adpcm_state_t *) ima_adpcm_init(ima_adpcm_state_t *s, int variant, int chunk_size) { if (s == NULL) { if ((s = (ima_adpcm_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } /*endif*/ memset(s, 0, sizeof(*s)); s->variant = variant; s->chunk_size = chunk_size; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) ima_adpcm_release(ima_adpcm_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) ima_adpcm_free(ima_adpcm_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) ima_adpcm_decode(ima_adpcm_state_t *s, int16_t amp[], const uint8_t ima_data[], int ima_bytes) { int i; int j; int samples; uint16_t code; samples = 0; switch (s->variant) { case IMA_ADPCM_IMA4: i = 0; if (s->chunk_size == 0) { amp[samples++] = (ima_data[1] << 8) | ima_data[0]; s->step_index = ima_data[2]; s->last = amp[0]; i = 4; } /*endif*/ for ( ; i < ima_bytes; i++) { amp[samples++] = decode(s, ima_data[i] & 0xF); amp[samples++] = decode(s, (ima_data[i] >> 4) & 0xF); } /*endfor*/ break; case IMA_ADPCM_DVI4: i = 0; if (s->chunk_size == 0) { s->last = (int16_t) ((ima_data[0] << 8) | ima_data[1]); s->step_index = ima_data[2]; i = 4; } /*endif*/ for ( ; i < ima_bytes; i++) { amp[samples++] = decode(s, (ima_data[i] >> 4) & 0xF); amp[samples++] = decode(s, ima_data[i] & 0xF); } /*endfor*/ break; case IMA_ADPCM_VDVI: i = 0; if (s->chunk_size == 0) { s->last = (int16_t) ((ima_data[0] << 8) | ima_data[1]); s->step_index = ima_data[2]; i = 4; } /*endif*/ code = 0; s->bits = 0; for (;;) { if (s->bits <= 8) { if (i >= ima_bytes) break; /*endif*/ code |= ((uint16_t) ima_data[i++] << (8 - s->bits)); s->bits += 8; } /*endif*/ for (j = 0; j < 8; j++) { if ((vdvi_decode[j].mask & code) == vdvi_decode[j].code) break; if ((vdvi_decode[j + 8].mask & code) == vdvi_decode[j + 8].code) { j += 8; break; } /*endif*/ } /*endfor*/ amp[samples++] = decode(s, (uint8_t) j); code <<= vdvi_decode[j].bits; s->bits -= vdvi_decode[j].bits; } /*endfor*/ /* Use up the remanents of the last octet */ while (s->bits > 0) { for (j = 0; j < 8; j++) { if ((vdvi_decode[j].mask & code) == vdvi_decode[j].code) break; /*endif*/ if ((vdvi_decode[j + 8].mask & code) == vdvi_decode[j + 8].code) { j += 8; break; } /*endif*/ } /*endfor*/ if (vdvi_decode[j].bits > s->bits) break; /*endif*/ amp[samples++] = decode(s, (uint8_t) j); code <<= vdvi_decode[j].bits; s->bits -= vdvi_decode[j].bits; } /*endwhile*/ break; } /*endswitch*/ return samples; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) ima_adpcm_encode(ima_adpcm_state_t *s, uint8_t ima_data[], const int16_t amp[], int len) { int i; int bytes; uint8_t code; bytes = 0; switch (s->variant) { case IMA_ADPCM_IMA4: i = 0; if (s->chunk_size == 0) { ima_data[bytes++] = (uint8_t) amp[0]; ima_data[bytes++] = (uint8_t) (amp[0] >> 8); ima_data[bytes++] = (uint8_t) s->step_index; ima_data[bytes++] = 0; s->last = amp[0]; s->bits = 0; i = 1; } /*endif*/ for ( ; i < len; i++) { s->ima_byte = (uint8_t) ((s->ima_byte >> 4) | (encode(s, amp[i]) << 4)); if ((s->bits++ & 1)) ima_data[bytes++] = (uint8_t) s->ima_byte; /*endif*/ } /*endfor*/ break; case IMA_ADPCM_DVI4: if (s->chunk_size == 0) { ima_data[bytes++] = (uint8_t) (s->last >> 8); ima_data[bytes++] = (uint8_t) s->last; ima_data[bytes++] = (uint8_t) s->step_index; ima_data[bytes++] = 0; } /*endif*/ for (i = 0; i < len; i++) { s->ima_byte = (uint8_t) ((s->ima_byte << 4) | encode(s, amp[i])); if ((s->bits++ & 1)) ima_data[bytes++] = (uint8_t) s->ima_byte; /*endif*/ } /*endfor*/ break; case IMA_ADPCM_VDVI: if (s->chunk_size == 0) { ima_data[bytes++] = (uint8_t) (s->last >> 8); ima_data[bytes++] = (uint8_t) s->last; ima_data[bytes++] = (uint8_t) s->step_index; ima_data[bytes++] = 0; } /*endif*/ s->bits = 0; for (i = 0; i < len; i++) { code = encode(s, amp[i]); s->ima_byte = (s->ima_byte << vdvi_encode[code].bits) | vdvi_encode[code].code; s->bits += vdvi_encode[code].bits; if (s->bits >= 8) { s->bits -= 8; ima_data[bytes++] = (uint8_t) (s->ima_byte >> s->bits); } /*endif*/ } /*endfor*/ if (s->bits) ima_data[bytes++] = (uint8_t) (((s->ima_byte << 8) | 0xFF) >> s->bits); /*endif*/ break; } /*endswitch*/ return bytes; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/floating_fudge.h0000664000175000017500000000535611422612261014033 00000000000000/* * SpanDSP - a series of DSP components for telephony * * floating_fudge.h - A bunch of shims, to use double maths * functions on platforms which lack the * float versions with an 'f' at the end, * and to deal with the vaguaries of lrint(). * * Written by Steve Underwood * * Copyright (C) 2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_FLOATING_FUDGE_H_) #define _FLOATING_FUDGE_H_ #if defined(__cplusplus) extern "C" { #endif #if !defined(HAVE_SINF) static __inline__ float sinf(float x) { return (float) sin((double) x); } #endif #if !defined(HAVE_COSF) static __inline__ float cosf(float x) { return (float) cos((double) x); } #endif #if !defined(HAVE_TANF) static __inline__ float tanf(float x) { return (float) tan((double) x); } #endif #if !defined(HAVE_ASINF) static __inline__ float asinf(float x) { return (float) asin((double) x); } #endif #if !defined(HAVE_ACOSF) static __inline__ float acosf(float x) { return (float) acos((double) x); } #endif #if !defined(HAVE_ATANF) static __inline__ float atanf(float x) { return (float) atan((double) x); } #endif #if !defined(HAVE_ATAN2F) static __inline__ float atan2f(float y, float x) { return (float) atan2((double) y, (double) x); } #endif #if !defined(HAVE_CEILF) static __inline__ float ceilf(float x) { return (float) ceil((double) x); } #endif #if !defined(HAVE_FLOORF) static __inline__ float floorf(float x) { return (float) floor((double) x); } #endif #if !defined(HAVE_POWF) static __inline__ float powf(float x, float y) { return (float) pow((double) x, (double) y); } #endif #if !defined(HAVE_EXPF) static __inline__ float expf(float x) { return (float) expf((double) x); } #endif #if !defined(HAVE_LOGF) static __inline__ float logf(float x) { return (float) logf((double) x); } #endif #if !defined(HAVE_LOG10F) static __inline__ float log10f(float x) { return (float) log10((double) x); } #endif #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/complex_vector_float.c0000664000175000017500000001346311422612261015265 00000000000000/* * SpanDSP - a series of DSP components for telephony * * complex_vector_float.c - Floating complex vector arithmetic routines. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include #include "floating_fudge.h" #include "mmx_sse_decs.h" #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/complex.h" #include "spandsp/vector_float.h" #include "spandsp/complex_vector_float.h" #if defined(__GNUC__) && defined(SPANDSP_USE_SSE3) SPAN_DECLARE(void) cvec_mulf(complexf_t z[], const complexf_t x[], const complexf_t y[], int n) { int i; __m128 n0; __m128 n1; __m128 n2; __m128 n3; if ((i = n & ~1)) { i <<= 1; for (i -= 4; i >= 0; i -= 4) { n3 = _mm_loadu_ps((float *) x + i); n0 = _mm_moveldup_ps(n3); n1 = _mm_loadu_ps((float *) y + i); n0 = _mm_mul_ps(n0, n1); n1 = _mm_shuffle_ps(n1, n1, 0xB1); n2 = _mm_movehdup_ps(n3); n2 = _mm_mul_ps(n2, n1); n0 = _mm_addsub_ps(n0, n2); _mm_storeu_ps((float *) z + i, n0); } } /* Now deal with the last element, which doesn't fill an SSE2 register */ switch (n & 1) { case 1: z[n - 1].re = x[n - 1].re*y[n - 1].re - x[n - 1].im*y[n - 1].im; z[n - 1].im = x[n - 1].re*y[n - 1].im + x[n - 1].im*y[n - 1].re; } } #else SPAN_DECLARE(void) cvec_mulf(complexf_t z[], const complexf_t x[], const complexf_t y[], int n) { int i; for (i = 0; i < n; i++) { z[i].re = x[i].re*y[i].re - x[i].im*y[i].im; z[i].im = x[i].re*y[i].im + x[i].im*y[i].re; } } #endif /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) cvec_mul(complex_t z[], const complex_t x[], const complex_t y[], int n) { int i; for (i = 0; i < n; i++) { z[i].re = x[i].re*y[i].re - x[i].im*y[i].im; z[i].im = x[i].re*y[i].im + x[i].im*y[i].re; } } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) cvec_mull(complexl_t z[], const complexl_t x[], const complexl_t y[], int n) { int i; for (i = 0; i < n; i++) { z[i].re = x[i].re*y[i].re - x[i].im*y[i].im; z[i].im = x[i].re*y[i].im + x[i].im*y[i].re; } } /*- End of function --------------------------------------------------------*/ #endif SPAN_DECLARE(complexf_t) cvec_dot_prodf(const complexf_t x[], const complexf_t y[], int n) { int i; complexf_t z; z = complex_setf(0.0f, 0.0f); for (i = 0; i < n; i++) { z.re += (x[i].re*y[i].re - x[i].im*y[i].im); z.im += (x[i].re*y[i].im + x[i].im*y[i].re); } return z; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(complex_t) cvec_dot_prod(const complex_t x[], const complex_t y[], int n) { int i; complex_t z; z = complex_set(0.0, 0.0); for (i = 0; i < n; i++) { z.re += (x[i].re*y[i].re - x[i].im*y[i].im); z.im += (x[i].re*y[i].im + x[i].im*y[i].re); } return z; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(complexl_t) cvec_dot_prodl(const complexl_t x[], const complexl_t y[], int n) { int i; complexl_t z; z = complex_setl(0.0L, 0.0L); for (i = 0; i < n; i++) { z.re += (x[i].re*y[i].re - x[i].im*y[i].im); z.im += (x[i].re*y[i].im + x[i].im*y[i].re); } return z; } /*- End of function --------------------------------------------------------*/ #endif SPAN_DECLARE(complexf_t) cvec_circular_dot_prodf(const complexf_t x[], const complexf_t y[], int n, int pos) { complexf_t z; complexf_t z1; z = cvec_dot_prodf(&x[pos], &y[0], n - pos); z1 = cvec_dot_prodf(&x[0], &y[n - pos], pos); z = complex_addf(&z, &z1); return z; } /*- End of function --------------------------------------------------------*/ #define LMS_LEAK_RATE 0.9999f SPAN_DECLARE(void) cvec_lmsf(const complexf_t x[], complexf_t y[], int n, const complexf_t *error) { int i; for (i = 0; i < n; i++) { /* Leak a little to tame uncontrolled wandering */ y[i].re = y[i].re*LMS_LEAK_RATE + (x[i].im*error->im + x[i].re*error->re); y[i].im = y[i].im*LMS_LEAK_RATE + (x[i].re*error->im - x[i].im*error->re); } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) cvec_circular_lmsf(const complexf_t x[], complexf_t y[], int n, int pos, const complexf_t *error) { cvec_lmsf(&x[pos], &y[0], n - pos, error); cvec_lmsf(&x[0], &y[n - pos], pos, error); } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/v17tx.c0000664000175000017500000003753512343630403012047 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v17tx.c - ITU V.17 modem transmit part * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/logging.h" #include "spandsp/complex.h" #include "spandsp/vector_float.h" #include "spandsp/complex_vector_float.h" #include "spandsp/vector_int.h" #include "spandsp/complex_vector_int.h" #include "spandsp/async.h" #include "spandsp/dds.h" #include "spandsp/power_meter.h" #include "spandsp/v17tx.h" #include "spandsp/private/logging.h" #include "spandsp/private/v17tx.h" #if defined(SPANDSP_USE_FIXED_POINT) #define SPANDSP_USE_FIXED_POINTx #endif #include "v17_v32bis_tx_constellation_maps.h" #if defined(SPANDSP_USE_FIXED_POINT) #include "v17_v32bis_tx_fixed_rrc.h" #else #include "v17_v32bis_tx_floating_rrc.h" #endif /*! The nominal frequency of the carrier, in Hertz */ #define CARRIER_NOMINAL_FREQ 1800.0f /* Segments of the training sequence */ /*! The start of the optional TEP, that may preceed the actual training, in symbols */ #define V17_TRAINING_SEG_TEP_A 0 /*! The mid point of the optional TEP, that may preceed the actual training, in symbols */ #define V17_TRAINING_SEG_TEP_B (V17_TRAINING_SEG_TEP_A + 480) /*! The start of training segment 1, in symbols */ #define V17_TRAINING_SEG_1 (V17_TRAINING_SEG_TEP_B + 48) /*! The start of training segment 2, in symbols */ #define V17_TRAINING_SEG_2 (V17_TRAINING_SEG_1 + 256) /*! The start of training segment 3, in symbols */ #define V17_TRAINING_SEG_3 (V17_TRAINING_SEG_2 + 2976) /*! The start of training segment 4, in symbols */ #define V17_TRAINING_SEG_4 (V17_TRAINING_SEG_3 + 64) /*! The start of training segment 4 in short training mode, in symbols */ #define V17_TRAINING_SHORT_SEG_4 (V17_TRAINING_SEG_2 + 38) /*! The end of the training, in symbols */ #define V17_TRAINING_END (V17_TRAINING_SEG_4 + 48) #define V17_TRAINING_SHUTDOWN_A (V17_TRAINING_END + 32) /*! The end of the shutdown sequence, in symbols */ #define V17_TRAINING_SHUTDOWN_END (V17_TRAINING_SHUTDOWN_A + 48) /*! The 16 bit pattern used in the bridge section of the training sequence */ #define V17_BRIDGE_WORD 0x8880 static __inline__ int scramble(v17_tx_state_t *s, int in_bit) { int out_bit; //out_bit = (in_bit ^ (s->scramble_reg >> s->scrambler_tap) ^ (s->scramble_reg >> (23 - 1))) & 1; out_bit = (in_bit ^ (s->scramble_reg >> (18 - 1)) ^ (s->scramble_reg >> (23 - 1))) & 1; s->scramble_reg = (s->scramble_reg << 1) | out_bit; return out_bit; } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINT) static __inline__ complexi16_t training_get(v17_tx_state_t *s) #else static __inline__ complexf_t training_get(v17_tx_state_t *s) #endif { static const int cdba_to_abcd[4] = { 2, 3, 1, 0 }; static const int dibit_to_step[4] = { 1, 0, 2, 3 }; #if defined(SPANDSP_USE_FIXED_POINT) static const complexi16_t zero = {0, 0}; #else static const complexf_t zero = {0.0f, 0.0f}; #endif int bits; int shift; if (++s->training_step <= V17_TRAINING_SEG_3) { if (s->training_step <= V17_TRAINING_SEG_2) { if (s->training_step <= V17_TRAINING_SEG_TEP_B) { /* Optional segment: Unmodulated carrier (talker echo protection) */ return v17_v32bis_abcd_constellation[0]; } if (s->training_step <= V17_TRAINING_SEG_1) { /* Optional segment: silence (talker echo protection) */ return zero; } /* Segment 1: ABAB... */ return v17_v32bis_abcd_constellation[(s->training_step & 1) ^ 1]; } /* Segment 2: CDBA... */ /* Apply the scrambler */ bits = scramble(s, 1); bits = (bits << 1) | scramble(s, 1); s->constellation_state = cdba_to_abcd[bits]; if (s->short_train && s->training_step == V17_TRAINING_SHORT_SEG_4) { /* Go straight to the ones test. */ s->training_step = V17_TRAINING_SEG_4; } return v17_v32bis_abcd_constellation[s->constellation_state]; } /* Segment 3: Bridge... */ shift = ((s->training_step - V17_TRAINING_SEG_3 - 1) & 0x7) << 1; //span_log(&s->logging, SPAN_LOG_FLOW, "Seg 3 shift %d\n", shift); bits = scramble(s, V17_BRIDGE_WORD >> shift); bits = (bits << 1) | scramble(s, V17_BRIDGE_WORD >> (shift + 1)); s->constellation_state = (s->constellation_state + dibit_to_step[bits]) & 3; return v17_v32bis_abcd_constellation[s->constellation_state]; } /*- End of function --------------------------------------------------------*/ static __inline__ int diff_and_convolutional_encode(v17_tx_state_t *s, int q) { static const uint8_t v32bis_4800_differential_encoder[4][4] = { {2, 3, 0, 1}, {0, 2, 1, 3}, {3, 1, 2, 0}, {1, 0, 3, 2} }; static const uint8_t v17_differential_encoder[4][4] = { {0, 1, 2, 3}, {1, 2, 3, 0}, {2, 3, 0, 1}, {3, 0, 1, 2} }; static const uint8_t v17_convolutional_coder[8][4] = { {0, 2, 3, 1}, {4, 7, 5, 6}, {1, 3, 2, 0}, {7, 4, 6, 5}, {2, 0, 1, 3}, {6, 5, 7, 4}, {3, 1, 0, 2}, {5, 6, 4, 7} }; if (s->bits_per_symbol == 2) { /* 4800bps mode for V.32bis */ /* There is no trellis. We just differentially encode. */ s->diff = v32bis_4800_differential_encoder[s->diff][q & 0x03]; return s->diff; } /* Differentially encode */ s->diff = v17_differential_encoder[s->diff][q & 0x03]; /* Convolutionally encode the redundant bit */ s->convolution = v17_convolutional_coder[s->convolution][s->diff]; /* The final result is the combination of some uncoded bits, 2 differentially encoded bits, and the convolutionally encoded redundant bit. */ return ((q << 1) & 0x78) | (s->diff << 1) | ((s->convolution >> 2) & 1); } /*- End of function --------------------------------------------------------*/ static int fake_get_bit(void *user_data) { return 1; } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINT) static __inline__ complexi16_t getbaud(v17_tx_state_t *s) #else static __inline__ complexf_t getbaud(v17_tx_state_t *s) #endif { int i; int bit; int bits; if (s->in_training) { if (s->training_step <= V17_TRAINING_END) { /* Send the training sequence */ if (s->training_step < V17_TRAINING_SEG_4) return training_get(s); /* The last step in training is to send some 1's */ if (++s->training_step > V17_TRAINING_END) { /* Training finished - commence normal operation. */ s->current_get_bit = s->get_bit; s->in_training = FALSE; } } else { if (++s->training_step > V17_TRAINING_SHUTDOWN_A) { /* The shutdown sequence is 32 bauds of all 1's, then 48 bauds of silence */ #if defined(SPANDSP_USE_FIXED_POINT) return complex_seti16(0, 0); #else return complex_setf(0.0f, 0.0f); #endif } if (s->training_step == V17_TRAINING_SHUTDOWN_END) { if (s->status_handler) s->status_handler(s->status_user_data, SIG_STATUS_SHUTDOWN_COMPLETE); } } } bits = 0; for (i = 0; i < s->bits_per_symbol; i++) { if ((bit = s->current_get_bit(s->get_bit_user_data)) == SIG_STATUS_END_OF_DATA) { /* End of real data. Switch to the fake get_bit routine, until we have shut down completely. */ if (s->status_handler) s->status_handler(s->status_user_data, SIG_STATUS_END_OF_DATA); s->current_get_bit = fake_get_bit; s->in_training = TRUE; bit = 1; } bits |= (scramble(s, bit) << i); } return s->constellation[diff_and_convolutional_encode(s, bits)]; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) v17_tx(v17_tx_state_t *s, int16_t amp[], int len) { #if defined(SPANDSP_USE_FIXED_POINT) complexi_t x; complexi_t z; #else complexf_t x; complexf_t z; #endif int i; int sample; if (s->training_step >= V17_TRAINING_SHUTDOWN_END) { /* Once we have sent the shutdown sequence, we stop sending completely. */ return 0; } for (sample = 0; sample < len; sample++) { if ((s->baud_phase += 3) >= 10) { s->baud_phase -= 10; s->rrc_filter[s->rrc_filter_step] = s->rrc_filter[s->rrc_filter_step + V17_TX_FILTER_STEPS] = getbaud(s); if (++s->rrc_filter_step >= V17_TX_FILTER_STEPS) s->rrc_filter_step = 0; } /* Root raised cosine pulse shaping at baseband */ #if defined(SPANDSP_USE_FIXED_POINT) x = complex_seti(0, 0); for (i = 0; i < V17_TX_FILTER_STEPS; i++) { x.re += (int32_t) tx_pulseshaper[TX_PULSESHAPER_COEFF_SETS - 1 - s->baud_phase][i]*(int32_t) s->rrc_filter[i + s->rrc_filter_step].re; x.im += (int32_t) tx_pulseshaper[TX_PULSESHAPER_COEFF_SETS - 1 - s->baud_phase][i]*(int32_t) s->rrc_filter[i + s->rrc_filter_step].im; } /* Now create and modulate the carrier */ x.re >>= 4; x.im >>= 4; z = dds_complexi(&s->carrier_phase, s->carrier_phase_rate); /* Don't bother saturating. We should never clip. */ i = (x.re*z.re - x.im*z.im) >> 15; amp[sample] = (int16_t) ((i*s->gain) >> 15); #else x = complex_setf(0.0f, 0.0f); for (i = 0; i < V17_TX_FILTER_STEPS; i++) { x.re += tx_pulseshaper[TX_PULSESHAPER_COEFF_SETS - 1 - s->baud_phase][i]*s->rrc_filter[i + s->rrc_filter_step].re; x.im += tx_pulseshaper[TX_PULSESHAPER_COEFF_SETS - 1 - s->baud_phase][i]*s->rrc_filter[i + s->rrc_filter_step].im; } /* Now create and modulate the carrier */ z = dds_complexf(&s->carrier_phase, s->carrier_phase_rate); /* Don't bother saturating. We should never clip. */ amp[sample] = (int16_t) lfastrintf((x.re*z.re - x.im*z.im)*s->gain); #endif } return sample; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v17_tx_power(v17_tx_state_t *s, float power) { /* The constellation design seems to keep the average power the same, regardless of which bit rate is in use. */ #if defined(SPANDSP_USE_FIXED_POINT) s->gain = 0.223f*powf(10.0f, (power - DBM0_MAX_POWER)/20.0f)*16.0f*(32767.0f/30672.52f)*32768.0f/TX_PULSESHAPER_GAIN; #else s->gain = 0.223f*powf(10.0f, (power - DBM0_MAX_POWER)/20.0f)*32768.0f/TX_PULSESHAPER_GAIN; #endif } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v17_tx_set_get_bit(v17_tx_state_t *s, get_bit_func_t get_bit, void *user_data) { if (s->get_bit == s->current_get_bit) s->current_get_bit = get_bit; s->get_bit = get_bit; s->get_bit_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v17_tx_set_modem_status_handler(v17_tx_state_t *s, modem_status_func_t handler, void *user_data) { s->status_handler = handler; s->status_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) v17_tx_get_logging_state(v17_tx_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v17_tx_restart(v17_tx_state_t *s, int bit_rate, int tep, int short_train) { switch (bit_rate) { case 14400: s->bits_per_symbol = 6; s->constellation = v17_v32bis_14400_constellation; break; case 12000: s->bits_per_symbol = 5; s->constellation = v17_v32bis_12000_constellation; break; case 9600: s->bits_per_symbol = 4; s->constellation = v17_v32bis_9600_constellation; break; case 7200: s->bits_per_symbol = 3; s->constellation = v17_v32bis_7200_constellation; break; case 4800: /* This does not exist in the V.17 spec as a valid mode of operation. However, it does exist in V.32bis, so it is here for completeness. */ s->bits_per_symbol = 2; s->constellation = v17_v32bis_4800_constellation; break; default: return -1; } s->bit_rate = bit_rate; /* NB: some modems seem to use 3 instead of 1 for long training */ s->diff = (short_train) ? 0 : 1; #if defined(SPANDSP_USE_FIXED_POINT) cvec_zeroi16(s->rrc_filter, sizeof(s->rrc_filter)/sizeof(s->rrc_filter[0])); #else cvec_zerof(s->rrc_filter, sizeof(s->rrc_filter)/sizeof(s->rrc_filter[0])); #endif s->rrc_filter_step = 0; s->convolution = 0; s->scramble_reg = 0x2ECDD5; s->in_training = TRUE; s->short_train = short_train; s->training_step = (tep) ? V17_TRAINING_SEG_TEP_A : V17_TRAINING_SEG_1; s->carrier_phase = 0; s->baud_phase = 0; s->constellation_state = 0; s->current_get_bit = fake_get_bit; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(v17_tx_state_t *) v17_tx_init(v17_tx_state_t *s, int bit_rate, int tep, get_bit_func_t get_bit, void *user_data) { switch (bit_rate) { case 14400: case 12000: case 9600: case 7200: case 4800: /* 4800 is an extension of V.17, to provide full converage of the V.32bis modes */ break; default: return NULL; } if (s == NULL) { if ((s = (v17_tx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "V.17 TX"); s->get_bit = get_bit; s->get_bit_user_data = user_data; //s->scrambler_tap = 18 - 1; s->carrier_phase_rate = dds_phase_ratef(CARRIER_NOMINAL_FREQ); v17_tx_power(s, -14.0f); v17_tx_restart(s, bit_rate, tep, FALSE); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v17_tx_release(v17_tx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v17_tx_free(v17_tx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/v42bis.c0000664000175000017500000005727412100753014012164 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v42bis.c * * Written by Steve Underwood * * Copyright (C) 2005, 2011 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* THIS IS A WORK IN PROGRESS. IT IS NOT FINISHED. Currently it performs the core compression and decompression functions OK. However, a number of the bells and whistles in V.42bis are incomplete. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #include #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/bit_operations.h" #include "spandsp/async.h" #include "spandsp/v42bis.h" #include "spandsp/private/logging.h" #include "spandsp/private/v42bis.h" /* Fixed parameters from the spec. */ /* Character size (bits) */ #define V42BIS_N3 8 /* Number of characters in the alphabet */ #define V42BIS_N4 256 /* Index number of first dictionary entry used to store a string */ #define V42BIS_N5 (V42BIS_N4 + V42BIS_N6) /* Number of control codewords */ #define V42BIS_N6 3 /* V.42bis/9.2 */ #define V42BIS_ESC_STEP 51 /* Compreeibility monitoring parameters for assessing automated switches between transparent and compressed mode */ #define COMPRESSIBILITY_MONITOR (256*V42BIS_N3) #define COMPRESSIBILITY_MONITOR_HYSTERESIS 11 /* Control code words in compressed mode */ enum { V42BIS_ETM = 0, /* Enter transparent mode */ V42BIS_FLUSH = 1, /* Flush data */ V42BIS_STEPUP = 2 /* Step up codeword size */ }; /* Command codes in transparent mode */ enum { V42BIS_ECM = 0, /* Enter compression mode */ V42BIS_EID = 1, /* Escape character in data */ V42BIS_RESET = 2 /* Force reinitialisation */ }; static __inline__ void push_octet(v42bis_comp_state_t *s, int octet) { s->output_buf[s->output_octet_count++] = (uint8_t) octet; if (s->output_octet_count >= s->max_output_len) { s->handler(s->user_data, s->output_buf, s->output_octet_count); s->output_octet_count = 0; } } /*- End of function --------------------------------------------------------*/ static __inline__ void push_octets(v42bis_comp_state_t *s, const uint8_t buf[], int len) { int i; int chunk; i = 0; while ((s->output_octet_count + len - i) >= s->max_output_len) { chunk = s->max_output_len - s->output_octet_count; memcpy(&s->output_buf[s->output_octet_count], &buf[i], chunk); s->handler(s->user_data, s->output_buf, s->max_output_len); s->output_octet_count = 0; i += chunk; } chunk = len - i; if (chunk > 0) { memcpy(&s->output_buf[s->output_octet_count], &buf[i], chunk); s->output_octet_count += chunk; } } /*- End of function --------------------------------------------------------*/ static __inline__ void push_compressed_code(v42bis_comp_state_t *s, int code) { s->bit_buffer |= code << s->bit_count; s->bit_count += s->v42bis_parm_c2; while (s->bit_count >= 8) { push_octet(s, s->bit_buffer & 0xFF); s->bit_buffer >>= 8; s->bit_count -= 8; } } /*- End of function --------------------------------------------------------*/ static __inline__ void push_octet_alignment(v42bis_comp_state_t *s) { if ((s->bit_count & 7)) { s->bit_count += (8 - (s->bit_count & 7)); while (s->bit_count >= 8) { push_octet(s, s->bit_buffer & 0xFF); s->bit_buffer >>= 8; s->bit_count -= 8; } } } /*- End of function --------------------------------------------------------*/ static __inline__ void flush_octets(v42bis_comp_state_t *s) { if (s->output_octet_count > 0) { s->handler(s->user_data, s->output_buf, s->output_octet_count); s->output_octet_count = 0; } } /*- End of function --------------------------------------------------------*/ static void dictionary_init(v42bis_comp_state_t *s) { int i; memset(s->dict, 0, sizeof(s->dict)); for (i = 0; i < V42BIS_N4; i++) s->dict[i + V42BIS_N6].node_octet = i; s->v42bis_parm_c1 = V42BIS_N5; s->v42bis_parm_c2 = V42BIS_N3 + 1; s->v42bis_parm_c3 = V42BIS_N4 << 1; s->last_matched = 0; s->update_at = 0; s->last_added = 0; s->bit_buffer = 0; s->bit_count = 0; s->flushed_length = 0; s->string_length = 0; s->escape_code = 0; s->transparent = TRUE; s->escaped = FALSE; s->compression_performance = COMPRESSIBILITY_MONITOR; } /*- End of function --------------------------------------------------------*/ static uint16_t match_octet(v42bis_comp_state_t *s, uint16_t at, uint8_t octet) { uint16_t e; if (at == 0) return octet + V42BIS_N6; e = s->dict[at].child; while (e) { if (s->dict[e].node_octet == octet) return e; e = s->dict[e].next; } return 0; } /*- End of function --------------------------------------------------------*/ static uint16_t add_octet_to_dictionary(v42bis_comp_state_t *s, uint16_t at, uint8_t octet) { uint16_t newx; uint16_t next; uint16_t e; newx = s->v42bis_parm_c1; s->dict[newx].node_octet = octet; s->dict[newx].parent = at; s->dict[newx].child = 0; s->dict[newx].next = s->dict[at].child; s->dict[at].child = newx; next = newx; /* 6.5 Recovering a dictionary entry to use next */ do { /* 6.5(a) and (b) */ if (++next == s->v42bis_parm_n2) next = V42BIS_N5; } while (s->dict[next].child); /* 6.5(c) We need to reuse a leaf node */ if (s->dict[next].parent) { /* 6.5(d) Detach the leaf node from its parent, and re-use it */ e = s->dict[next].parent; if (s->dict[e].child == next) { s->dict[e].child = s->dict[next].next; } else { e = s->dict[e].child; while (s->dict[e].next != next) e = s->dict[e].next; s->dict[e].next = s->dict[next].next; } } s->v42bis_parm_c1 = next; return newx; } /*- End of function --------------------------------------------------------*/ static void send_string(v42bis_comp_state_t *s) { push_octets(s, s->string, s->string_length); s->string_length = 0; s->flushed_length = 0; } /*- End of function --------------------------------------------------------*/ static void expand_codeword_to_string(v42bis_comp_state_t *s, uint16_t code) { int i; uint16_t p; /* Work out the length */ for (i = 0, p = code; p; i++) p = s->dict[p].parent; s->string_length += i; /* Now expand the known length of string */ i = s->string_length - 1; for (p = code; p; ) { s->string[i--] = s->dict[p].node_octet; p = s->dict[p].parent; } } /*- End of function --------------------------------------------------------*/ static void send_encoded_data(v42bis_comp_state_t *s, uint16_t code) { int i; /* Update compressibility metric */ /* Integrate at the compressed bit rate, and leak at the pre-compression bit rate */ s->compression_performance += (s->v42bis_parm_c2 - s->compression_performance*s->string_length*V42BIS_N3/COMPRESSIBILITY_MONITOR); if (s->transparent) { for (i = 0; i < s->string_length; i++) { push_octet(s, s->string[i]); if (s->string[i] == s->escape_code) { push_octet(s, V42BIS_EID); s->escape_code += V42BIS_ESC_STEP; } } } else { /* Allow for any escape octets in the string */ for (i = 0; i < s->string_length; i++) { if (s->string[i] == s->escape_code) s->escape_code += V42BIS_ESC_STEP; } /* 7.4 Encoding - we now have the longest matchable string, and will need to output the code for it. */ while (code >= s->v42bis_parm_c3) { /* We need to increase the codeword size */ /* 7.4(a) */ push_compressed_code(s, V42BIS_STEPUP); /* 7.4(b) */ s->v42bis_parm_c2++; /* 7.4(c) */ s->v42bis_parm_c3 <<= 1; /* 7.4(d) this might need to be repeated, so we loop */ } /* 7.5 Transfer - output the last state of the string */ push_compressed_code(s, code); } s->string_length = 0; s->flushed_length = 0; } /*- End of function --------------------------------------------------------*/ static void go_compressed(v42bis_state_t *ss) { v42bis_comp_state_t *s; s = &ss->compress; if (!s->transparent) return; span_log(&ss->logging, SPAN_LOG_FLOW, "Changing to compressed mode\n"); /* Switch out of transparent now, between codes. We need to send the octet which did not match, just before switching. */ if (s->last_matched) { s->update_at = s->last_matched; send_encoded_data(s, s->last_matched); s->last_matched = 0; } push_octet(s, s->escape_code); push_octet(s, V42BIS_ECM); s->bit_buffer = 0; s->transparent = FALSE; } /*- End of function --------------------------------------------------------*/ static void go_transparent(v42bis_state_t *ss) { v42bis_comp_state_t *s; s = &ss->compress; if (s->transparent) return; span_log(&ss->logging, SPAN_LOG_FLOW, "Changing to transparent mode\n"); /* Switch into transparent now, between codes, and the unmatched octet should go out in transparent mode, just below */ if (s->last_matched) { s->update_at = s->last_matched; send_encoded_data(s, s->last_matched); s->last_matched = 0; } s->last_added = 0; push_compressed_code(s, V42BIS_ETM); push_octet_alignment(s); s->transparent = TRUE; } /*- End of function --------------------------------------------------------*/ static void monitor_for_mode_change(v42bis_state_t *ss) { v42bis_comp_state_t *s; s = &ss->compress; switch (s->compression_mode) { case V42BIS_COMPRESSION_MODE_DYNAMIC: /* 7.8 Data compressibility test */ if (s->transparent) { if (s->compression_performance < COMPRESSIBILITY_MONITOR - COMPRESSIBILITY_MONITOR_HYSTERESIS) { /* 7.8.1 Transition to compressed mode */ go_compressed(ss); } } else { if (s->compression_performance > COMPRESSIBILITY_MONITOR) { /* 7.8.2 Transition to transparent mode */ go_transparent(ss); } } /* 7.8.3 Reset function - TODO */ break; case V42BIS_COMPRESSION_MODE_ALWAYS: if (s->transparent) go_compressed(ss); break; case V42BIS_COMPRESSION_MODE_NEVER: if (!s->transparent) go_transparent(ss); break; } } /*- End of function --------------------------------------------------------*/ static int v42bis_comp_init(v42bis_comp_state_t *s, int p1, int p2, put_msg_func_t handler, void *user_data, int max_output_len) { memset(s, 0, sizeof(*s)); s->v42bis_parm_n2 = p1; s->v42bis_parm_n7 = p2; s->handler = handler; s->user_data = user_data; s->max_output_len = (max_output_len < V42BIS_MAX_OUTPUT_LENGTH) ? max_output_len : V42BIS_MAX_OUTPUT_LENGTH; s->output_octet_count = 0; dictionary_init(s); return 0; } /*- End of function --------------------------------------------------------*/ static int comp_exit(v42bis_comp_state_t *s) { s->v42bis_parm_n2 = 0; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v42bis_compress(v42bis_state_t *ss, const uint8_t buf[], int len) { v42bis_comp_state_t *s; int i; uint16_t code; s = &ss->compress; if (!s->v42bis_parm_p0) { /* Compression is off - just push the incoming data out */ push_octets(s, buf, len); return 0; } for (i = 0; i < len; ) { /* 6.4 Add the string to the dictionary */ if (s->update_at) { if (match_octet(s, s->update_at, buf[i]) == 0) s->last_added = add_octet_to_dictionary(s, s->update_at, buf[i]); s->update_at = 0; } /* Match string */ while (i < len) { code = match_octet(s, s->last_matched, buf[i]); if (code == 0) { s->update_at = s->last_matched; send_encoded_data(s, s->last_matched); s->last_matched = 0; break; } if (code == s->last_added) { s->last_added = 0; send_encoded_data(s, s->last_matched); s->last_matched = 0; break; } s->last_matched = code; /* 6.3(b) If the string matches a dictionary entry, and the entry is not that entry created by the last invocation of the string matching procedure, then the next character shall be read and appended to the string and this step repeated. */ s->string[s->string_length++] = buf[i++]; /* 6.4(a) The string must not exceed N7 in length */ if (s->string_length + s->flushed_length == s->v42bis_parm_n7) { send_encoded_data(s, s->last_matched); s->last_matched = 0; break; } } monitor_for_mode_change(ss); } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v42bis_compress_flush(v42bis_state_t *ss) { v42bis_comp_state_t *s; int len; s = &ss->compress; if (s->update_at) return 0; if (s->last_matched) { len = s->string_length; send_encoded_data(s, s->last_matched); s->flushed_length += len; } if (!s->transparent) { s->update_at = s->last_matched; s->last_matched = 0; s->flushed_length = 0; push_compressed_code(s, V42BIS_FLUSH); push_octet_alignment(s); } flush_octets(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v42bis_decompress(v42bis_state_t *ss, const uint8_t buf[], int len) { v42bis_comp_state_t *s; int i; int j; int yyy; uint16_t code; uint16_t p; uint8_t ch; uint8_t in; s = &ss->decompress; if (!s->v42bis_parm_p0) { /* Compression is off - just push the incoming data out */ push_octets(s, buf, len); return 0; } for (i = 0; i < len; ) { if (s->transparent) { in = buf[i]; if (s->escaped) { /* Command */ s->escaped = FALSE; switch (in) { case V42BIS_ECM: /* Enter compressed mode */ span_log(&ss->logging, SPAN_LOG_FLOW, "Hit V42BIS_ECM\n"); send_string(s); s->transparent = FALSE; s->update_at = s->last_matched; s->last_matched = 0; i++; continue; case V42BIS_EID: /* Escape symbol */ span_log(&ss->logging, SPAN_LOG_FLOW, "Hit V42BIS_EID\n"); in = s->escape_code; s->escape_code += V42BIS_ESC_STEP; break; case V42BIS_RESET: /* Reset dictionary */ span_log(&ss->logging, SPAN_LOG_FLOW, "Hit V42BIS_RESET\n"); /* TODO: */ send_string(s); dictionary_init(s); i++; continue; default: span_log(&ss->logging, SPAN_LOG_FLOW, "Hit V42BIS_???? - %" PRIu32 "\n", in); return -1; } } else if (in == s->escape_code) { s->escaped = TRUE; i++; continue; } yyy = TRUE; for (j = 0; j < 2 && yyy; j++) { if (s->update_at) { if (match_octet(s, s->update_at, in) == 0) s->last_added = add_octet_to_dictionary(s, s->update_at, in); s->update_at = 0; } code = match_octet(s, s->last_matched, in); if (code == 0) { s->update_at = s->last_matched; send_string(s); s->last_matched = 0; } else if (code == s->last_added) { s->last_added = 0; send_string(s); s->last_matched = 0; } else { s->last_matched = code; s->string[s->string_length++] = in; if (s->string_length + s->flushed_length == s->v42bis_parm_n7) { send_string(s); s->last_matched = 0; } i++; yyy = FALSE; } } } else { /* Get code from input */ while (s->bit_count < s->v42bis_parm_c2 && i < len) { s->bit_buffer |= buf[i++] << s->bit_count; s->bit_count += 8; } if (s->bit_count < s->v42bis_parm_c2) continue; code = s->bit_buffer & ((1 << s->v42bis_parm_c2) - 1); s->bit_buffer >>= s->v42bis_parm_c2; s->bit_count -= s->v42bis_parm_c2; if (code < V42BIS_N6) { /* We have a control code. */ switch (code) { case V42BIS_ETM: /* Enter transparent mode */ span_log(&ss->logging, SPAN_LOG_FLOW, "Hit V42BIS_ETM\n"); s->bit_count = 0; s->transparent = TRUE; s->last_matched = 0; s->last_added = 0; break; case V42BIS_FLUSH: /* Flush signal */ span_log(&ss->logging, SPAN_LOG_FLOW, "Hit V42BIS_FLUSH\n"); s->bit_count = 0; break; case V42BIS_STEPUP: /* Increase code word size */ span_log(&ss->logging, SPAN_LOG_FLOW, "Hit V42BIS_STEPUP\n"); s->v42bis_parm_c2++; s->v42bis_parm_c3 <<= 1; if (s->v42bis_parm_c2 > (s->v42bis_parm_n2 >> 3)) return -1; break; } continue; } /* Regular codeword */ if (code == s->v42bis_parm_c1) return -1; expand_codeword_to_string(s, code); if (s->update_at) { ch = s->string[0]; if ((p = match_octet(s, s->update_at, ch)) == 0) { s->last_added = add_octet_to_dictionary(s, s->update_at, ch); if (code == s->v42bis_parm_c1) return -1; } else if (p == s->last_added) { s->last_added = 0; } } s->update_at = ((s->string_length + s->flushed_length) == s->v42bis_parm_n7) ? 0 : code; /* Allow for any escapes which may be in this string */ for (j = 0; j < s->string_length; j++) { if (s->string[j] == s->escape_code) s->escape_code += V42BIS_ESC_STEP; } send_string(s); } } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v42bis_decompress_flush(v42bis_state_t *ss) { v42bis_comp_state_t *s; int len; s = &ss->decompress; len = s->string_length; send_string(s); s->flushed_length += len; flush_octets(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v42bis_compression_control(v42bis_state_t *s, int mode) { s->compress.compression_mode = mode; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(v42bis_state_t *) v42bis_init(v42bis_state_t *s, int negotiated_p0, int negotiated_p1, int negotiated_p2, put_msg_func_t encode_handler, void *encode_user_data, int max_encode_len, put_msg_func_t decode_handler, void *decode_user_data, int max_decode_len) { int ret; if (negotiated_p1 < V42BIS_MIN_DICTIONARY_SIZE || negotiated_p1 > 65535) return NULL; if (negotiated_p2 < V42BIS_MIN_STRING_SIZE || negotiated_p2 > V42BIS_MAX_STRING_SIZE) return NULL; if (s == NULL) { if ((s = (v42bis_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "V.42bis"); if ((ret = v42bis_comp_init(&s->compress, negotiated_p1, negotiated_p2, encode_handler, encode_user_data, max_encode_len))) return NULL; if ((ret = v42bis_comp_init(&s->decompress, negotiated_p1, negotiated_p2, decode_handler, decode_user_data, max_decode_len))) { comp_exit(&s->compress); return NULL; } s->compress.v42bis_parm_p0 = negotiated_p0 & 2; s->decompress.v42bis_parm_p0 = negotiated_p0 & 1; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v42bis_release(v42bis_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v42bis_free(v42bis_state_t *s) { comp_exit(&s->compress); comp_exit(&s->decompress); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/libspandsp.dsp0000664000175000017500000004752312343640731013564 00000000000000# Microsoft Developer Studio Project File - Name="spandsp" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=spandsp - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "spandsp.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "spandsp.mak" CFG="spandsp - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "spandsp - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "spandsp - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "spandsp - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D HAVE_TGMATH_H /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /Zi /O2 /I "." /I "..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D HAVE_TGMATH_H /D "_WINDLL" /FR /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib ws2_32.lib winmm.lib /nologo /dll /map /debug /machine:I386 /out:"Release/libspandsp.dll" !ELSEIF "$(CFG)" == "spandsp - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D HAVE_TGMATH_H /YX /FD /GZ /c # ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "." /I "..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D HAVE_TGMATH_H /FR /FD /GZ /c # SUBTRACT CPP /WX /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib ws2_32.lib winmm.lib /nologo /dll /incremental:no /map /debug /machine:I386 /out:"Debug/libspandsp.dll" /pdbtype:sept # SUBTRACT LINK32 /nodefaultlib !ENDIF # Begin Target # Name "spandsp - Win32 Release" # Name "spandsp - Win32 Debug" # Begin Group "Source Files" # Begin Source File SOURCE=.\ademco_contactid.c # End Source File # Begin Source File SOURCE=.\adsi.c # End Source File # Begin Source File SOURCE=.\async.c # End Source File # Begin Source File SOURCE=.\at_interpreter.c # End Source File # Begin Source File SOURCE=.\awgn.c # End Source File # Begin Source File SOURCE=.\bell_r2_mf.c # End Source File # Begin Source File SOURCE=.\bert.c # End Source File # Begin Source File SOURCE=.\bit_operations.c # End Source File # Begin Source File SOURCE=.\bitstream.c # End Source File # Begin Source File SOURCE=.\complex_filters.c # End Source File # Begin Source File SOURCE=.\complex_vector_float.c # End Source File # Begin Source File SOURCE=.\complex_vector_int.c # End Source File # Begin Source File SOURCE=.\crc.c # End Source File # Begin Source File SOURCE=.\dds_float.c # End Source File # Begin Source File SOURCE=.\dds_int.c # End Source File # Begin Source File SOURCE=.\dtmf.c # End Source File # Begin Source File SOURCE=.\echo.c # End Source File # Begin Source File SOURCE=.\fax.c # End Source File # Begin Source File SOURCE=.\fax_modems.c # End Source File # Begin Source File SOURCE=.\fsk.c # End Source File # Begin Source File SOURCE=.\g711.c # End Source File # Begin Source File SOURCE=.\g722.c # End Source File # Begin Source File SOURCE=.\g726.c # End Source File # Begin Source File SOURCE=.\gsm0610_decode.c # End Source File # Begin Source File SOURCE=.\gsm0610_encode.c # End Source File # Begin Source File SOURCE=.\gsm0610_long_term.c # End Source File # Begin Source File SOURCE=.\gsm0610_lpc.c # End Source File # Begin Source File SOURCE=.\gsm0610_preprocess.c # End Source File # Begin Source File SOURCE=.\gsm0610_rpe.c # End Source File # Begin Source File SOURCE=.\gsm0610_short_term.c # End Source File # Begin Source File SOURCE=.\hdlc.c # End Source File # Begin Source File SOURCE=.\ima_adpcm.c # End Source File # Begin Source File SOURCE=.\image_translate.c # End Source File # Begin Source File SOURCE=.\logging.c # End Source File # Begin Source File SOURCE=.\lpc10_analyse.c # End Source File # Begin Source File SOURCE=.\lpc10_decode.c # End Source File # Begin Source File SOURCE=.\lpc10_encode.c # End Source File # Begin Source File SOURCE=.\lpc10_placev.c # End Source File # Begin Source File SOURCE=.\lpc10_voicing.c # End Source File # Begin Source File SOURCE=.\math_fixed.c # End Source File # Begin Source File SOURCE=.\modem_echo.c # End Source File # Begin Source File SOURCE=.\modem_connect_tones.c # End Source File # Begin Source File SOURCE=.\noise.c # End Source File # Begin Source File SOURCE=.\oki_adpcm.c # End Source File # Begin Source File SOURCE=.\playout.c # End Source File # Begin Source File SOURCE=.\plc.c # End Source File # Begin Source File SOURCE=.\power_meter.c # End Source File # Begin Source File SOURCE=.\queue.c # End Source File # Begin Source File SOURCE=.\schedule.c # End Source File # Begin Source File SOURCE=.\sig_tone.c # End Source File # Begin Source File SOURCE=.\silence_gen.c # End Source File # Begin Source File SOURCE=.\super_tone_rx.c # End Source File # Begin Source File SOURCE=.\super_tone_tx.c # End Source File # Begin Source File SOURCE=.\swept_tone.c # End Source File # Begin Source File SOURCE=.\t4_rx.c # End Source File # Begin Source File SOURCE=.\t4_tx.c # End Source File # Begin Source File SOURCE=.\t30.c # End Source File # Begin Source File SOURCE=.\t30_api.c # End Source File # Begin Source File SOURCE=.\t30_logging.c # End Source File # Begin Source File SOURCE=.\t31.c # End Source File # Begin Source File SOURCE=.\t35.c # End Source File # Begin Source File SOURCE=.\t38_core.c # End Source File # Begin Source File SOURCE=.\t38_gateway.c # End Source File # Begin Source File SOURCE=.\t38_non_ecm_buffer.c # End Source File # Begin Source File SOURCE=.\t38_terminal.c # End Source File # Begin Source File SOURCE=.\testcpuid.c # End Source File # Begin Source File SOURCE=.\time_scale.c # End Source File # Begin Source File SOURCE=.\timezone.c # End Source File # Begin Source File SOURCE=.\tone_detect.c # End Source File # Begin Source File SOURCE=.\tone_generate.c # End Source File # Begin Source File SOURCE=.\v17rx.c # End Source File # Begin Source File SOURCE=.\v17tx.c # End Source File # Begin Source File SOURCE=.\v18.c # End Source File # Begin Source File SOURCE=.\v22bis_rx.c # End Source File # Begin Source File SOURCE=.\v22bis_tx.c # End Source File # Begin Source File SOURCE=.\v27ter_rx.c # End Source File # Begin Source File SOURCE=.\v27ter_tx.c # End Source File # Begin Source File SOURCE=.\v29rx.c # End Source File # Begin Source File SOURCE=.\v29tx.c # End Source File # Begin Source File SOURCE=.\v42.c # End Source File # Begin Source File SOURCE=.\v42bis.c # End Source File # Begin Source File SOURCE=.\v8.c # End Source File # Begin Source File SOURCE=.\vector_float.c # End Source File # Begin Source File SOURCE=.\vector_int.c # End Source File # Begin Source File SOURCE=.\.\msvc\gettimeofday.c # End Source File # End Group # Begin Group "Header Files" # Begin Source File SOURCE=.\spandsp/ademco_contactid.h # End Source File # Begin Source File SOURCE=.\spandsp/adsi.h # End Source File # Begin Source File SOURCE=.\spandsp/async.h # End Source File # Begin Source File SOURCE=.\spandsp/arctan2.h # End Source File # Begin Source File SOURCE=.\spandsp/at_interpreter.h # End Source File # Begin Source File SOURCE=.\spandsp/awgn.h # End Source File # Begin Source File SOURCE=.\spandsp/bell_r2_mf.h # End Source File # Begin Source File SOURCE=.\spandsp/bert.h # End Source File # Begin Source File SOURCE=.\spandsp/biquad.h # End Source File # Begin Source File SOURCE=.\spandsp/bit_operations.h # End Source File # Begin Source File SOURCE=.\spandsp/bitstream.h # End Source File # Begin Source File SOURCE=.\spandsp/crc.h # End Source File # Begin Source File SOURCE=.\spandsp/complex.h # End Source File # Begin Source File SOURCE=.\spandsp/complex_filters.h # End Source File # Begin Source File SOURCE=.\spandsp/complex_vector_float.h # End Source File # Begin Source File SOURCE=.\spandsp/complex_vector_int.h # End Source File # Begin Source File SOURCE=.\spandsp/dc_restore.h # End Source File # Begin Source File SOURCE=.\spandsp/dds.h # End Source File # Begin Source File SOURCE=.\spandsp/dtmf.h # End Source File # Begin Source File SOURCE=.\spandsp/echo.h # End Source File # Begin Source File SOURCE=.\spandsp/fast_convert.h # End Source File # Begin Source File SOURCE=.\spandsp/fax.h # End Source File # Begin Source File SOURCE=.\spandsp/fax_modems.h # End Source File # Begin Source File SOURCE=.\spandsp/fir.h # End Source File # Begin Source File SOURCE=.\spandsp/fsk.h # End Source File # Begin Source File SOURCE=.\spandsp/g168models.h # End Source File # Begin Source File SOURCE=.\spandsp/g711.h # End Source File # Begin Source File SOURCE=.\spandsp/g722.h # End Source File # Begin Source File SOURCE=.\spandsp/g726.h # End Source File # Begin Source File SOURCE=.\spandsp/gsm0610.h # End Source File # Begin Source File SOURCE=.\spandsp/hdlc.h # End Source File # Begin Source File SOURCE=.\spandsp/ima_adpcm.h # End Source File # Begin Source File SOURCE=.\spandsp/image_translate.h # End Source File # Begin Source File SOURCE=.\spandsp/logging.h # End Source File # Begin Source File SOURCE=.\spandsp/lpc10.h # End Source File # Begin Source File SOURCE=.\spandsp/math_fixed.h # End Source File # Begin Source File SOURCE=.\spandsp/modem_echo.h # End Source File # Begin Source File SOURCE=.\spandsp/modem_connect_tones.h # End Source File # Begin Source File SOURCE=.\spandsp/noise.h # End Source File # Begin Source File SOURCE=.\spandsp/oki_adpcm.h # End Source File # Begin Source File SOURCE=.\spandsp/playout.h # End Source File # Begin Source File SOURCE=.\spandsp/plc.h # End Source File # Begin Source File SOURCE=.\spandsp/power_meter.h # End Source File # Begin Source File SOURCE=.\spandsp/queue.h # End Source File # Begin Source File SOURCE=.\spandsp/saturated.h # End Source File # Begin Source File SOURCE=.\spandsp/schedule.h # End Source File # Begin Source File SOURCE=.\spandsp/stdbool.h # End Source File # Begin Source File SOURCE=.\spandsp/sig_tone.h # End Source File # Begin Source File SOURCE=.\spandsp/silence_gen.h # End Source File # Begin Source File SOURCE=.\spandsp/super_tone_rx.h # End Source File # Begin Source File SOURCE=.\spandsp/super_tone_tx.h # End Source File # Begin Source File SOURCE=.\spandsp/swept_tone.h # End Source File # Begin Source File SOURCE=.\spandsp/t30.h # End Source File # Begin Source File SOURCE=.\spandsp/t30_api.h # End Source File # Begin Source File SOURCE=.\spandsp/t30_fcf.h # End Source File # Begin Source File SOURCE=.\spandsp/t30_logging.h # End Source File # Begin Source File SOURCE=.\spandsp/t31.h # End Source File # Begin Source File SOURCE=.\spandsp/t35.h # End Source File # Begin Source File SOURCE=.\spandsp/t38_core.h # End Source File # Begin Source File SOURCE=.\spandsp/t38_gateway.h # End Source File # Begin Source File SOURCE=.\spandsp/t38_non_ecm_buffer.h # End Source File # Begin Source File SOURCE=.\spandsp/t38_terminal.h # End Source File # Begin Source File SOURCE=.\spandsp/t4_rx.h # End Source File # Begin Source File SOURCE=.\spandsp/t4_tx.h # End Source File # Begin Source File SOURCE=.\spandsp/t4_t6_decode.h # End Source File # Begin Source File SOURCE=.\spandsp/t4_t6_encode.h # End Source File # Begin Source File SOURCE=.\spandsp/telephony.h # End Source File # Begin Source File SOURCE=.\spandsp/time_scale.h # End Source File # Begin Source File SOURCE=.\spandsp/timezone.h # End Source File # Begin Source File SOURCE=.\spandsp/timing.h # End Source File # Begin Source File SOURCE=.\spandsp/tone_detect.h # End Source File # Begin Source File SOURCE=.\spandsp/tone_generate.h # End Source File # Begin Source File SOURCE=.\spandsp/v17rx.h # End Source File # Begin Source File SOURCE=.\spandsp/v17tx.h # End Source File # Begin Source File SOURCE=.\spandsp/v18.h # End Source File # Begin Source File SOURCE=.\spandsp/v22bis.h # End Source File # Begin Source File SOURCE=.\spandsp/v27ter_rx.h # End Source File # Begin Source File SOURCE=.\spandsp/v27ter_tx.h # End Source File # Begin Source File SOURCE=.\spandsp/v29rx.h # End Source File # Begin Source File SOURCE=.\spandsp/v29tx.h # End Source File # Begin Source File SOURCE=.\spandsp/v42.h # End Source File # Begin Source File SOURCE=.\spandsp/v42bis.h # End Source File # Begin Source File SOURCE=.\spandsp/v8.h # End Source File # Begin Source File SOURCE=.\spandsp/vector_float.h # End Source File # Begin Source File SOURCE=.\spandsp/vector_int.h # End Source File # Begin Source File SOURCE=.\spandsp/version.h # End Source File # Begin Source File SOURCE=.\spandsp/private/ademco_contactid.h # End Source File # Begin Source File SOURCE=.\spandsp/private/adsi.h # End Source File # Begin Source File SOURCE=.\spandsp/private/async.h # End Source File # Begin Source File SOURCE=.\spandsp/private/at_interpreter.h # End Source File # Begin Source File SOURCE=.\spandsp/private/awgn.h # End Source File # Begin Source File SOURCE=.\spandsp/private/bell_r2_mf.h # End Source File # Begin Source File SOURCE=.\spandsp/private/bert.h # End Source File # Begin Source File SOURCE=.\spandsp/private/bitstream.h # End Source File # Begin Source File SOURCE=.\spandsp/private/dtmf.h # End Source File # Begin Source File SOURCE=.\spandsp/private/echo.h # End Source File # Begin Source File SOURCE=.\spandsp/private/fax.h # End Source File # Begin Source File SOURCE=.\spandsp/private/fax_modems.h # End Source File # Begin Source File SOURCE=.\spandsp/private/fsk.h # End Source File # Begin Source File SOURCE=.\spandsp/private/g711.h # End Source File # Begin Source File SOURCE=.\spandsp/private/g722.h # End Source File # Begin Source File SOURCE=.\spandsp/private/g726.h # End Source File # Begin Source File SOURCE=.\spandsp/private/gsm0610.h # End Source File # Begin Source File SOURCE=.\spandsp/private/hdlc.h # End Source File # Begin Source File SOURCE=.\spandsp/private/ima_adpcm.h # End Source File # Begin Source File SOURCE=.\spandsp/private/image_translate.h # End Source File # Begin Source File SOURCE=.\spandsp/private/logging.h # End Source File # Begin Source File SOURCE=.\spandsp/private/lpc10.h # End Source File # Begin Source File SOURCE=.\spandsp/private/modem_connect_tones.h # End Source File # Begin Source File SOURCE=.\spandsp/private/modem_echo.h # End Source File # Begin Source File SOURCE=.\spandsp/private/noise.h # End Source File # Begin Source File SOURCE=.\spandsp/private/oki_adpcm.h # End Source File # Begin Source File SOURCE=.\spandsp/private/queue.h # End Source File # Begin Source File SOURCE=.\spandsp/private/schedule.h # End Source File # Begin Source File SOURCE=.\spandsp/private/sig_tone.h # End Source File # Begin Source File SOURCE=.\spandsp/private/silence_gen.h # End Source File # Begin Source File SOURCE=.\spandsp/private/super_tone_rx.h # End Source File # Begin Source File SOURCE=.\spandsp/private/super_tone_tx.h # End Source File # Begin Source File SOURCE=.\spandsp/private/swept_tone.h # End Source File # Begin Source File SOURCE=.\spandsp/private/t30.h # End Source File # Begin Source File SOURCE=.\spandsp/private/t30_dis_dtc_dcs_bits.h # End Source File # Begin Source File SOURCE=.\spandsp/private/t31.h # End Source File # Begin Source File SOURCE=.\spandsp/private/t38_core.h # End Source File # Begin Source File SOURCE=.\spandsp/private/t38_gateway.h # End Source File # Begin Source File SOURCE=.\spandsp/private/t38_non_ecm_buffer.h # End Source File # Begin Source File SOURCE=.\spandsp/private/t38_terminal.h # End Source File # Begin Source File SOURCE=.\spandsp/private/t4_rx.h # End Source File # Begin Source File SOURCE=.\spandsp/private/t4_tx.h # End Source File # Begin Source File SOURCE=.\spandsp/private/t4_t6_decode.h # End Source File # Begin Source File SOURCE=.\spandsp/private/t4_t6_encode.h # End Source File # Begin Source File SOURCE=.\spandsp/private/time_scale.h # End Source File # Begin Source File SOURCE=.\spandsp/private/timezone.h # End Source File # Begin Source File SOURCE=.\spandsp/private/tone_detect.h # End Source File # Begin Source File SOURCE=.\spandsp/private/tone_generate.h # End Source File # Begin Source File SOURCE=.\spandsp/private/v17rx.h # End Source File # Begin Source File SOURCE=.\spandsp/private/v17tx.h # End Source File # Begin Source File SOURCE=.\spandsp/private/v18.h # End Source File # Begin Source File SOURCE=.\spandsp/private/v22bis.h # End Source File # Begin Source File SOURCE=.\spandsp/private/v27ter_rx.h # End Source File # Begin Source File SOURCE=.\spandsp/private/v27ter_tx.h # End Source File # Begin Source File SOURCE=.\spandsp/private/v29rx.h # End Source File # Begin Source File SOURCE=.\spandsp/private/v29tx.h # End Source File # Begin Source File SOURCE=.\spandsp/private/v42.h # End Source File # Begin Source File SOURCE=.\spandsp/private/v42bis.h # End Source File # Begin Source File SOURCE=.\spandsp/private/v8.h # End Source File # Begin Source File SOURCE=.\spandsp/expose.h # End Source File # Begin Source File SOURCE=.\spandsp.h # End Source File # End Group # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project spandsp-0.0.6/src/gsm0610_decode.c0000664000175000017500000002256611422612261013453 00000000000000/* * SpanDSP - a series of DSP components for telephony * * gsm0610_decode.c - GSM 06.10 full rate speech codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * This code is based on the widely used GSM 06.10 code available from * http://kbs.cs.tu-berlin.de/~jutta/toast.html */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/bitstream.h" #include "spandsp/saturated.h" #include "spandsp/gsm0610.h" #include "gsm0610_local.h" /* 4.3 FIXED POINT IMPLEMENTATION OF THE RPE-LTP DECODER */ static void postprocessing(gsm0610_state_t *s, int16_t amp[]) { int k; int16_t msr; int16_t tmp; msr = s->msr; for (k = 0; k < GSM0610_FRAME_LEN; k++) { tmp = gsm_mult_r(msr, 28180); /* De-emphasis */ msr = saturated_add16(amp[k], tmp); /* Truncation & upscaling */ amp[k] = (int16_t) (saturated_add16(msr, msr) & 0xFFF8); } /*endfor*/ s->msr = msr; } /*- End of function --------------------------------------------------------*/ static void decode_a_frame(gsm0610_state_t *s, int16_t amp[GSM0610_FRAME_LEN], gsm0610_frame_t *f) { int j; int k; int16_t erp[40]; int16_t wt[GSM0610_FRAME_LEN]; int16_t *drp; drp = s->dp0 + 120; for (j = 0; j < 4; j++) { gsm0610_rpe_decoding(s, f->xmaxc[j], f->Mc[j], f->xMc[j], erp); gsm0610_long_term_synthesis_filtering(s, f->Nc[j], f->bc[j], erp, drp); for (k = 0; k < 40; k++) wt[j*40 + k] = drp[k]; /*endfor*/ } /*endfor*/ gsm0610_short_term_synthesis_filter(s, f->LARc, wt, amp); postprocessing(s, amp); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) gsm0610_unpack_none(gsm0610_frame_t *s, const uint8_t c[]) { int i; int j; int k; i = 0; for (j = 0; j < 8; j++) s->LARc[j] = c[i++]; for (j = 0; j < 4; j++) { s->Nc[j] = c[i++]; s->bc[j] = c[i++]; s->Mc[j] = c[i++]; s->xmaxc[j] = c[i++]; for (k = 0; k < 13; k++) s->xMc[j][k] = c[i++]; } return 76; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) gsm0610_unpack_wav49(gsm0610_frame_t *s, const uint8_t c[]) { uint16_t sr; int i; sr = *c++; s->LARc[0] = sr & 0x3F; sr >>= 6; sr |= (uint16_t) *c++ << 2; s->LARc[1] = sr & 0x3F; sr >>= 6; sr |= (uint16_t) *c++ << 4; s->LARc[2] = sr & 0x1F; sr >>= 5; s->LARc[3] = sr & 0x1F; sr >>= 5; sr |= (uint16_t) *c++ << 2; s->LARc[4] = sr & 0xF; sr >>= 4; s->LARc[5] = sr & 0xF; sr >>= 4; sr |= (uint16_t) *c++ << 2; s->LARc[6] = sr & 0x7; sr >>= 3; s->LARc[7] = sr & 0x7; sr >>= 3; for (i = 0; i < 4; i++) { sr |= (uint16_t) *c++ << 4; s->Nc[i] = sr & 0x7F; sr >>= 7; s->bc[i] = sr & 0x3; sr >>= 2; s->Mc[i] = sr & 0x3; sr >>= 2; sr |= (uint16_t) *c++ << 1; s->xmaxc[i] = sr & 0x3F; sr >>= 6; s->xMc[i][0] = sr & 0x7; sr >>= 3; sr = *c++; s->xMc[i][1] = sr & 0x7; sr >>= 3; s->xMc[i][2] = sr & 0x7; sr >>= 3; sr |= (uint16_t) *c++ << 2; s->xMc[i][3] = sr & 0x7; sr >>= 3; s->xMc[i][4] = sr & 0x7; sr >>= 3; s->xMc[i][5] = sr & 0x7; sr >>= 3; sr |= (uint16_t) *c++ << 1; s->xMc[i][6] = sr & 0x7; sr >>= 3; s->xMc[i][7] = sr & 0x7; sr >>= 3; s->xMc[i][8] = sr & 0x7; sr >>= 3; sr = *c++; s->xMc[i][9] = sr & 0x7; sr >>= 3; s->xMc[i][10] = sr & 0x7; sr >>= 3; sr |= (uint16_t) *c++ << 2; s->xMc[i][11] = sr & 0x7; sr >>= 3; s->xMc[i][12] = sr & 0x7; sr >>= 3; } s++; sr |= (uint16_t) *c++ << 4; s->LARc[0] = sr & 0x3F; sr >>= 6; s->LARc[1] = sr & 0x3F; sr >>= 6; sr = *c++; s->LARc[2] = sr & 0x1F; sr >>= 5; sr |= (uint16_t) *c++ << 3; s->LARc[3] = sr & 0x1F; sr >>= 5; s->LARc[4] = sr & 0xF; sr >>= 4; sr |= (uint16_t) *c++ << 2; s->LARc[5] = sr & 0xF; sr >>= 4; s->LARc[6] = sr & 0x7; sr >>= 3; s->LARc[7] = sr & 0x7; sr >>= 3; for (i = 0; i < 4; i++) { sr = *c++; s->Nc[i] = sr & 0x7F; sr >>= 7; sr |= (uint16_t) *c++ << 1; s->bc[i] = sr & 0x3; sr >>= 2; s->Mc[i] = sr & 0x3; sr >>= 2; sr |= (uint16_t) *c++ << 5; s->xmaxc[i] = sr & 0x3F; sr >>= 6; s->xMc[i][0] = sr & 0x7; sr >>= 3; s->xMc[i][1] = sr & 0x7; sr >>= 3; sr |= (uint16_t) *c++ << 1; s->xMc[i][2] = sr & 0x7; sr >>= 3; s->xMc[i][3] = sr & 0x7; sr >>= 3; s->xMc[i][4] = sr & 0x7; sr >>= 3; sr = *c++; s->xMc[i][5] = sr & 0x7; sr >>= 3; s->xMc[i][6] = sr & 0x7; sr >>= 3; sr |= (uint16_t) *c++ << 2; s->xMc[i][7] = sr & 0x7; sr >>= 3; s->xMc[i][8] = sr & 0x7; sr >>= 3; s->xMc[i][9] = sr & 0x7; sr >>= 3; sr |= (uint16_t) *c++ << 1; s->xMc[i][10] = sr & 0x7; sr >>= 3; s->xMc[i][11] = sr & 0x7; sr >>= 3; s->xMc[i][12] = sr & 0x7; sr >>= 3; } return 65; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) gsm0610_unpack_voip(gsm0610_frame_t *s, const uint8_t c[33]) { int i; s->LARc[0] = (*c++ & 0xF) << 2; s->LARc[0] |= (*c >> 6) & 0x3; s->LARc[1] = *c++ & 0x3F; s->LARc[2] = (*c >> 3) & 0x1F; s->LARc[3] = (*c++ & 0x7) << 2; s->LARc[3] |= (*c >> 6) & 0x3; s->LARc[4] = (*c >> 2) & 0xF; s->LARc[5] = (*c++ & 0x3) << 2; s->LARc[5] |= (*c >> 6) & 0x3; s->LARc[6] = (*c >> 3) & 0x7; s->LARc[7] = *c++ & 0x7; for (i = 0; i < 4; i++) { s->Nc[i] = (*c >> 1) & 0x7F; s->bc[i] = (*c++ & 0x1) << 1; s->bc[i] |= (*c >> 7) & 0x1; s->Mc[i] = (*c >> 5) & 0x3; s->xmaxc[i] = (*c++ & 0x1F) << 1; s->xmaxc[i] |= (*c >> 7) & 0x1; s->xMc[i][0] = (*c >> 4) & 0x7; s->xMc[i][1] = (*c >> 1) & 0x7; s->xMc[i][2] = (*c++ & 0x1) << 2; s->xMc[i][2] |= (*c >> 6) & 0x3; s->xMc[i][3] = (*c >> 3) & 0x7; s->xMc[i][4] = *c++ & 0x7; s->xMc[i][5] = (*c >> 5) & 0x7; s->xMc[i][6] = (*c >> 2) & 0x7; s->xMc[i][7] = (*c++ & 0x3) << 1; s->xMc[i][7] |= (*c >> 7) & 0x1; s->xMc[i][8] = (*c >> 4) & 0x7; s->xMc[i][9] = (*c >> 1) & 0x7; s->xMc[i][10] = (*c++ & 0x1) << 2; s->xMc[i][10] |= (*c >> 6) & 0x3; s->xMc[i][11] = (*c >> 3) & 0x7; s->xMc[i][12] = *c++ & 0x7; } return 33; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) gsm0610_decode(gsm0610_state_t *s, int16_t amp[], const uint8_t code[], int len) { gsm0610_frame_t frame[2]; int bytes; int samples; int i; samples = 0; for (i = 0; i < len; i += bytes) { switch (s->packing) { default: case GSM0610_PACKING_NONE: if ((bytes = gsm0610_unpack_none(frame, &code[i])) < 0) return 0; decode_a_frame(s, &[samples], frame); samples += GSM0610_FRAME_LEN; break; case GSM0610_PACKING_WAV49: if ((bytes = gsm0610_unpack_wav49(frame, &code[i])) < 0) return 0; decode_a_frame(s, &[samples], frame); samples += GSM0610_FRAME_LEN; decode_a_frame(s, &[samples], frame + 1); samples += GSM0610_FRAME_LEN; break; case GSM0610_PACKING_VOIP: if ((bytes = gsm0610_unpack_voip(frame, &code[i])) < 0) return 0; decode_a_frame(s, &[samples], frame); samples += GSM0610_FRAME_LEN; break; } /*endswitch*/ } /*endfor*/ return samples; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/v18.c0000664000175000017500000006310412101174517011464 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v18.c - V.18 text telephony for the deaf. * * Written by Steve Underwood * * Copyright (C) 2004-2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/queue.h" #include "spandsp/async.h" #include "spandsp/complex.h" #include "spandsp/dds.h" #include "spandsp/tone_detect.h" #include "spandsp/tone_generate.h" #include "spandsp/super_tone_rx.h" #include "spandsp/power_meter.h" #include "spandsp/fsk.h" #include "spandsp/dtmf.h" #include "spandsp/modem_connect_tones.h" #include "spandsp/v8.h" #include "spandsp/v18.h" #include "spandsp/private/logging.h" #include "spandsp/private/queue.h" #include "spandsp/private/tone_generate.h" #include "spandsp/private/async.h" #include "spandsp/private/fsk.h" #include "spandsp/private/dtmf.h" #include "spandsp/private/modem_connect_tones.h" #include "spandsp/private/v18.h" #include /* Ways in which a V.18 call may start ----------------------------------- Originate: ANS Silence for 0.5s then send TXP DTMF Proceed as Annex B 1650Hz (V21 ch 2 low) Proceed as Annex F in call mode 1300Hz (Calling tone) Proceed as Annex E in call mode 1400Hz/1800Hz (Weitbrecht) Detect rate and proceed as Annex A 980Hz/1180Hz (V21 ch 1) Start timer Tr 2225Hz (Bell ANS) Proceed as Annex D call mode 1270Hz (Bell103 ch 2 high) Proceed as Annex D answer mode 390Hz (V23 ch 2 low) Proceed as Annex E answer mode Answer: ANS Monitor as caller for 980Hz or 1300Hz CI/XCI Respond with ANSam 1300Hz Probe Timer Ta (3s) Probe 1400Hz/1800Hz (Weitbrecht) Detect rate and proceed as Annex A DTMF Proceed as Annex B 980Hz (V21 ch 1 low) Start timer Te 1270Hz (Bell103 ch 2 high) Proceed as Annex D answer mode 2225Hz (Bell ANS) Proceed as Annex D call mode 1650Hz (V21 ch 2 low) Proceed as Annex F answer mode ANSam Proceed as V.8 caller Annex G */ /*! The baudot code to shift from alpha to digits and symbols */ #define BAUDOT_FIGURE_SHIFT 0x1B /*! The baudot code to shift from digits and symbols to alpha */ #define BAUDOT_LETTER_SHIFT 0x1F struct dtmf_to_ascii_s { const char *dtmf; char ascii; }; static const struct dtmf_to_ascii_s dtmf_to_ascii[] = { {"###1", 'C'}, {"###2", 'F'}, {"###3", 'I'}, {"###4", 'L'}, {"###5", 'O'}, {"###6", 'R'}, {"###7", 'U'}, {"###8", 'X'}, {"###9", ';'}, {"###0", '!'}, {"##*1", 'A'}, {"##*2", 'D'}, {"##*3", 'G'}, {"##*4", 'J'}, {"##*5", 'M'}, {"##*6", 'P'}, {"##*7", 'S'}, {"##*8", 'V'}, {"##*9", 'Y'}, {"##1", 'B'}, {"##2", 'E'}, {"##3", 'H'}, {"##4", 'K'}, {"##5", 'N'}, {"##6", 'Q'}, {"##7", 'T'}, {"##8", 'W'}, {"##9", 'Z'}, {"##0", ' '}, #if defined(WIN32) || (defined(__SVR4) && defined (__sun)) {"#*1", 'X'}, // (Note 1) 111 1011 {"#*2", 'X'}, // (Note 1) 111 1100 {"#*3", 'X'}, // (Note 1) 111 1101 {"#*4", 'X'}, // (Note 1) 101 1011 {"#*5", 'X'}, // (Note 1) 101 1100 {"#*6", 'X'}, // (Note 1) 101 1101 #else {"#*1", 0xE6}, // (Note 1) 111 1011 {"#*2", 0xF8}, // (Note 1) 111 1100 {"#*3", 0xE5}, // (Note 1) 111 1101 {"#*4", 0xC6}, // (Note 1) 101 1011 {"#*5", 0xD8}, // (Note 1) 101 1100 {"#*6", 0xC5}, // (Note 1) 101 1101 #endif {"#0", '?'}, {"#1", 'c'}, {"#2", 'f'}, {"#3", 'i'}, {"#4", 'l'}, {"#5", 'o'}, {"#6", 'r'}, {"#7", 'u'}, {"#8", 'x'}, {"#9", '.'}, {"*#0", '0'}, {"*#1", '1'}, {"*#2", '2'}, {"*#3", '3'}, {"*#4", '4'}, {"*#5", '5'}, {"*#6", '6'}, {"*#7", '7'}, {"*#8", '8'}, {"*#9", '9'}, {"**1", '+'}, {"**2", '-'}, {"**3", '='}, {"**4", ':'}, {"**5", '%'}, {"**6", '('}, {"**7", ')'}, {"**8", ','}, {"**9", '\n'}, {"*0", '\b'}, {"*1", 'a'}, {"*2", 'd'}, {"*3", 'g'}, {"*4", 'j'}, {"*5", 'm'}, {"*6", 'p'}, {"*7", 's'}, {"*8", 'v'}, {"*9", 'y'}, {"0", ' '}, {"1", 'b'}, {"2", 'e'}, {"3", 'h'}, {"4", 'k'}, {"5", 'n'}, {"6", 'q'}, {"7", 't'}, {"8", 'w'}, {"9", 'z'}, {"", '\0'} }; static const char *ascii_to_dtmf[128] = { "", /* NULL */ "", /* SOH */ "", /* STX */ "", /* ETX */ "", /* EOT */ "", /* ENQ */ "", /* ACK */ "", /* BEL */ "*0", /* BACK SPACE */ "0", /* HT >> SPACE */ "**9", /* LF */ "**9", /* VT >> LF */ "**9", /* FF >> LF */ "", /* CR */ "", /* SO */ "", /* SI */ "", /* DLE */ "", /* DC1 */ "", /* DC2 */ "", /* DC3 */ "", /* DC4 */ "", /* NAK */ "", /* SYN */ "", /* ETB */ "", /* CAN */ "", /* EM */ "#0", /* SUB >> ? */ "", /* ESC */ "**9", /* IS4 >> LF */ "**9", /* IS3 >> LF */ "**9", /* IS2 >> LF */ "0", /* IS1 >> SPACE */ "0", /* SPACE */ "###0", /* ! */ "", /* " */ "", /* # */ "", /* $ */ "**5", /* % */ "**1", /* & >> + */ "", /* 0x92 */ "**6", /* ( */ "**7", /* ) */ "#9", /* _ >> . */ "**1", /* + */ "**8", /* , */ "**2", /* - */ "#9", /* . */ "", /* / */ "*#0", /* 0 */ "*#1", /* 1 */ "*#2", /* 2 */ "*#3", /* 3 */ "*#4", /* 4 */ "*#5", /* 5 */ "*#6", /* 6 */ "*#7", /* 7 */ "*#8", /* 8 */ "*#9", /* 9 */ "**4", /* : */ "###9", /* ; */ "**6", /* < >> ( */ "**3", /* = */ "**7", /* > >> ) */ "#0", /* ? */ "###8", /* @ >> X */ "##*1", /* A */ "##1", /* B */ "###1", /* C */ "##*2", /* D */ "##2", /* E */ "###2", /* F */ "##*3", /* G */ "##3", /* H */ "###3", /* I */ "##*4", /* J */ "##4", /* K */ "###4", /* L */ "##*5", /* M */ "##5", /* N */ "###5", /* O */ "##*6", /* P */ "##6", /* Q */ "###6", /* R */ "##*7", /* S */ "##7", /* T */ "###7", /* U */ "##*8", /* V */ "##8", /* W */ "###8", /* X */ "##*9", /* Y */ "##9", /* Z */ "#*4", /* 0xC6 (National code) */ "#*5", /* 0xD8 (National code) */ "#*6", /* 0xC5 (National code) */ "", /* ^ */ "0", /* _ >> SPACE */ "", /* 0x92 */ "*1", /* a */ "1", /* b */ "#1", /* c */ "*2", /* d */ "2", /* e */ "#2", /* f */ "*3", /* g */ "3", /* h */ "#3", /* i */ "*4", /* j */ "4", /* k */ "#4", /* l */ "*5", /* m */ "5", /* n */ "#5", /* o */ "*6", /* p */ "6", /* q */ "#6", /* r */ "*7", /* s */ "7", /* t */ "#7", /* u */ "*8", /* v */ "8", /* w */ "#8", /* x */ "*9", /* y */ "9", /* z */ "#*1", /* 0xE6 (National code) */ "#*2", /* 0xF8 (National code) */ "#*3", /* 0xE5 (National code) */ "0", /* ~ >> SPACE */ "*0" /* DEL >> BACK SPACE */ }; static const uint8_t txp[] = "1111111111000101011100001101110000010101"; /* XCI is: 400 ms mark; XCI marker; 800 ms mark; XCI marker; 800 ms mark; XCI marker; 800 ms mark; XCI marker; 100 ms mark. */ static const uint8_t xci[] = "01111111110111111111"; static int cmp(const void *s, const void *t) { const char *ss; struct dtmf_to_ascii_s *tt; ss = (const char *) s; tt = (struct dtmf_to_ascii_s *) t; return strncmp(ss, tt->dtmf, strlen(tt->dtmf)); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v18_encode_dtmf(v18_state_t *s, char dtmf[], const char msg[]) { const char *t; char *u; const char *v; t = msg; u = dtmf; while (*t) { v = ascii_to_dtmf[*t & 0x7F]; while (*v) *u++ = *v++; t++; } *u = '\0'; return u - dtmf; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v18_decode_dtmf(v18_state_t *s, char msg[], const char dtmf[]) { int entries; const char *t; char *u; struct dtmf_to_ascii_s *ss; entries = sizeof(dtmf_to_ascii)/sizeof(dtmf_to_ascii[0]) - 1; t = dtmf; u = msg; while (*t) { ss = bsearch(t, dtmf_to_ascii, entries, sizeof(dtmf_to_ascii[0]), cmp); if (ss) { t += strlen(ss->dtmf); *u++ = ss->ascii; } else { /* Can't match the code. Let's assume this is a code we just don't know, and skip over it */ while (*t == '#' || *t == '*') t++; if (*t) t++; } } *u = '\0'; return u - msg; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(uint16_t) v18_encode_baudot(v18_state_t *s, uint8_t ch) { static const uint8_t conv[128] = { 0xFF, /* NUL */ 0xFF, /* SOH */ 0xFF, /* STX */ 0xFF, /* ETX */ 0xFF, /* EOT */ 0xFF, /* ENQ */ 0xFF, /* ACK */ 0xFF, /* BEL */ 0x00, /* BS */ 0x44, /* HT >> SPACE */ 0x42, /* LF */ 0x42, /* VT >> LF */ 0x42, /* FF >> LF */ 0x48, /* CR */ 0xFF, /* SO */ 0xFF, /* SI */ 0xFF, /* DLE */ 0xFF, /* DC1 */ 0xFF, /* DC2 */ 0xFF, /* DC3 */ 0xFF, /* DC4 */ 0xFF, /* NAK */ 0xFF, /* SYN */ 0xFF, /* ETB */ 0xFF, /* CAN */ 0xFF, /* EM */ 0x99, /* SUB >> ? */ 0xFF, /* ESC */ 0x42, /* IS4 >> LF */ 0x42, /* IS3 >> LF */ 0x42, /* IS2 >> LF */ 0x44, /* IS1 >> SPACE */ 0x44, /* */ 0x8D, /* ! */ 0x91, /* " */ 0x89, /* # >> $ */ 0x89, /* $ */ 0x9D, /* % >> / */ 0x9A, /* & >> + */ 0x8B, /* ' */ 0x8F, /* ( */ 0x92, /* ) */ 0x9C, /* * >> . */ 0x9A, /* + */ 0x8C, /* , */ 0x83, /* - */ 0x9C, /* . */ 0x9D, /* / */ 0x96, /* 0 */ 0x97, /* 1 */ 0x93, /* 2 */ 0x81, /* 3 */ 0x8A, /* 4 */ 0x90, /* 5 */ 0x95, /* 6 */ 0x87, /* 7 */ 0x86, /* 8 */ 0x98, /* 9 */ 0x8E, /* : */ 0x9E, /* ; */ 0x8F, /* < >> )*/ 0x94, /* = */ 0x92, /* > >> ( */ 0x99, /* ? */ 0x1D, /* @ >> X */ 0x03, /* A */ 0x19, /* B */ 0x0E, /* C */ 0x09, /* D */ 0x01, /* E */ 0x0D, /* F */ 0x1A, /* G */ 0x14, /* H */ 0x06, /* I */ 0x0B, /* J */ 0x0F, /* K */ 0x12, /* L */ 0x1C, /* M */ 0x0C, /* N */ 0x18, /* O */ 0x16, /* P */ 0x17, /* Q */ 0x0A, /* R */ 0x05, /* S */ 0x10, /* T */ 0x07, /* U */ 0x1E, /* V */ 0x13, /* W */ 0x1D, /* X */ 0x15, /* Y */ 0x11, /* Z */ 0x8F, /* [ >> (*/ 0x9D, /* \ >> / */ 0x92, /* ] >> ) */ 0x8B, /* ^ >> ' */ 0x44, /* _ >> Space */ 0x8B, /* ` >> ' */ 0x03, /* a */ 0x19, /* b */ 0x0E, /* c */ 0x09, /* d */ 0x01, /* e */ 0x0D, /* f */ 0x1A, /* g */ 0x14, /* h */ 0x06, /* i */ 0x0B, /* j */ 0x0F, /* k */ 0x12, /* l */ 0x1C, /* m */ 0x0C, /* n */ 0x18, /* o */ 0x16, /* p */ 0x17, /* q */ 0x0A, /* r */ 0x05, /* s */ 0x10, /* t */ 0x07, /* u */ 0x1E, /* v */ 0x13, /* w */ 0x1D, /* x */ 0x15, /* y */ 0x11, /* z */ 0x8F, /* { >> ( */ 0x8D, /* | >> ! */ 0x92, /* } >> ) */ 0x44, /* ~ >> Space */ 0xFF, /* DEL */ }; uint16_t shift; if (ch == 0x7F) { /* DLE is a special character meaning "force a change to the letter character set */ shift = BAUDOT_LETTER_SHIFT; return 0; } ch = conv[ch]; /* Is it a non-existant code? */ if (ch == 0xFF) return 0; /* Is it a code present in both character sets? */ if ((ch & 0x40)) return 0x8000 | (ch & 0x1F); /* Need to allow for a possible character set change. */ if ((ch & 0x80)) { //if (!s->repeat_shifts && s->baudot_tx_shift == 1) if (s->baudot_tx_shift == 1) return ch & 0x1F; s->baudot_tx_shift = 1; shift = BAUDOT_FIGURE_SHIFT; } else { //if (!s->repeat_shifts && s->baudot_tx_shift == 0) if (s->baudot_tx_shift == 0) return ch & 0x1F; s->baudot_tx_shift = 0; shift = BAUDOT_LETTER_SHIFT; } return 0x8000 | (shift << 5) | (ch & 0x1F); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(uint8_t) v18_decode_baudot(v18_state_t *s, uint8_t ch) { static const uint8_t conv[2][32] = { {"\bE\nA SIU\rDRJNFCKTZLWHYPQOBG^MXV^"}, {"\b3\n- -87\r$4',!:(5\")2=6019?+^./;^"} }; switch (ch) { case BAUDOT_FIGURE_SHIFT: s->baudot_rx_shift = 1; break; case BAUDOT_LETTER_SHIFT: s->baudot_rx_shift = 0; break; default: return conv[s->baudot_rx_shift][ch]; } /* return 0 if we did not produce a character */ return 0; } /*- End of function --------------------------------------------------------*/ static void v18_rx_dtmf(void *user_data, const char digits[], int len) { #if 0 v18_state_t *s; s = (v18_state_t *) user_data; #endif } /*- End of function --------------------------------------------------------*/ static int v18_tdd_get_async_byte(void *user_data) { v18_state_t *s; int ch; s = (v18_state_t *) user_data; if ((ch = queue_read_byte(&s->queue.queue)) >= 0) return ch; if (s->tx_signal_on) { /* The FSK should now be switched off. */ s->tx_signal_on = FALSE; } return 0x1F; } /*- End of function --------------------------------------------------------*/ static int v18_edt_get_async_byte(void *user_data) { return 0; } /*- End of function --------------------------------------------------------*/ static void v18_tdd_put_async_byte(void *user_data, int byte) { v18_state_t *s; uint8_t octet; s = (v18_state_t *) user_data; if (byte < 0) { /* Special conditions */ span_log(&s->logging, SPAN_LOG_FLOW, "V.18 signal status is %s (%d)\n", signal_status_to_str(byte), byte); switch (byte) { case SIG_STATUS_CARRIER_UP: s->consecutive_ones = 0; s->bit_pos = 0; s->in_progress = 0; s->rx_msg_len = 0; break; case SIG_STATUS_CARRIER_DOWN: if (s->rx_msg_len > 0) { /* Whatever we have to date constitutes the message */ s->rx_msg[s->rx_msg_len] = '\0'; s->put_msg(s->user_data, s->rx_msg, s->rx_msg_len); s->rx_msg_len = 0; } break; default: span_log(&s->logging, SPAN_LOG_WARNING, "Unexpected special put byte value - %d!\n", byte); break; } return; } span_log(&s->logging, SPAN_LOG_FLOW, "Rx byte %x\n", byte); if ((octet = v18_decode_baudot(s, byte))) s->rx_msg[s->rx_msg_len++] = octet; if (s->rx_msg_len >= 256) { s->rx_msg[s->rx_msg_len] = '\0'; s->put_msg(s->user_data, s->rx_msg, s->rx_msg_len); s->rx_msg_len = 0; } } /*- End of function --------------------------------------------------------*/ static void v18_edt_put_async_byte(void *user_data, int byte) { } /*- End of function --------------------------------------------------------*/ static void v18_bell103_put_async_byte(void *user_data, int byte) { } /*- End of function --------------------------------------------------------*/ static void v18_videotex_put_async_byte(void *user_data, int byte) { } /*- End of function --------------------------------------------------------*/ static void v18_textphone_put_async_byte(void *user_data, int byte) { } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) v18_tx(v18_state_t *s, int16_t *amp, int max_len) { int len; int lenx; len = tone_gen(&s->alert_tone_gen, amp, max_len); if (s->tx_signal_on) { switch (s->mode) { case V18_MODE_DTMF: if (len < max_len) len += dtmf_tx(&s->dtmftx, amp, max_len - len); break; default: if (len < max_len) { if ((lenx = fsk_tx(&s->fsktx, amp + len, max_len - len)) <= 0) s->tx_signal_on = FALSE; len += lenx; } break; } } return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) v18_rx(v18_state_t *s, const int16_t amp[], int len) { switch (s->mode) { case V18_MODE_DTMF: /* Apply a message timeout. */ s->in_progress -= len; if (s->in_progress <= 0) s->rx_msg_len = 0; dtmf_rx(&s->dtmfrx, amp, len); break; default: fsk_rx(&s->fskrx, amp, len); break; } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v18_put(v18_state_t *s, const char msg[], int len) { char buf[256 + 1]; int x; int n; int i; /* This returns the number of characters that would not fit in the buffer. The buffer will only be loaded if the whole string of digits will fit, in which case zero is returned. */ if (len < 0) { if ((len = strlen(msg)) == 0) return 0; } switch (s->mode) { case V18_MODE_5BIT_45: case V18_MODE_5BIT_50: for (i = 0; i < len; i++) { n = 0; if ((x = v18_encode_baudot(s, msg[i]))) { if ((x & 0x3E0)) buf[n++] = (uint8_t) ((x >> 5) & 0x1F); buf[n++] = (uint8_t) (x & 0x1F); /* TODO: Deal with out of space condition */ if (queue_write(&s->queue.queue, (const uint8_t *) buf, n) < 0) return i; s->tx_signal_on = TRUE; } } return len; case V18_MODE_DTMF: break; } return -1; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) v18_get_logging_state(v18_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(v18_state_t *) v18_init(v18_state_t *s, int calling_party, int mode, put_msg_func_t put_msg, void *user_data) { if (s == NULL) { if ((s = (v18_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); s->calling_party = calling_party; s->mode = mode & 0xFF; s->put_msg = put_msg; s->user_data = user_data; switch (s->mode) { case V18_MODE_5BIT_45: fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_WEITBRECHT], async_tx_get_bit, &s->asynctx); async_tx_init(&s->asynctx, 5, ASYNC_PARITY_NONE, 2, FALSE, v18_tdd_get_async_byte, s); /* Schedule an explicit shift at the start of baudot transmission */ s->baudot_tx_shift = 2; /* TDD uses 5 bit data, no parity and 1.5 stop bits. We scan for the first stop bit, and ride over the fraction. */ fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_WEITBRECHT], FSK_FRAME_MODE_5N1_FRAMES, v18_tdd_put_async_byte, s); s->baudot_rx_shift = 0; //s->repeat_shifts = mode & 0x100; break; case V18_MODE_5BIT_50: fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_WEITBRECHT50], async_tx_get_bit, &s->asynctx); async_tx_init(&s->asynctx, 5, ASYNC_PARITY_NONE, 2, FALSE, v18_tdd_get_async_byte, s); /* Schedule an explicit shift at the start of baudot transmission */ s->baudot_tx_shift = 2; /* TDD uses 5 bit data, no parity and 1.5 stop bits. We scan for the first stop bit, and ride over the fraction. */ fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_WEITBRECHT50], FSK_FRAME_MODE_5N1_FRAMES, v18_tdd_put_async_byte, s); s->baudot_rx_shift = 0; //s->repeat_shifts = mode & 0x100; break; case V18_MODE_DTMF: dtmf_tx_init(&s->dtmftx); dtmf_rx_init(&s->dtmfrx, v18_rx_dtmf, s); break; case V18_MODE_EDT: fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_V21CH1_110], async_tx_get_bit, &s->asynctx); async_tx_init(&s->asynctx, 7, ASYNC_PARITY_EVEN, 2, FALSE, v18_edt_get_async_byte, s); fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_V21CH1_110], FSK_FRAME_MODE_7E2_FRAMES, v18_edt_put_async_byte, s); break; case V18_MODE_BELL103: fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_BELL103CH1], async_tx_get_bit, &s->asynctx); async_tx_init(&s->asynctx, 7, ASYNC_PARITY_EVEN, 1, FALSE, v18_edt_get_async_byte, s); fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_BELL103CH2], FSK_FRAME_MODE_7E1_FRAMES, v18_bell103_put_async_byte, s); break; case V18_MODE_V23VIDEOTEX: fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_V23CH1], async_tx_get_bit, &s->asynctx); async_tx_init(&s->asynctx, 7, ASYNC_PARITY_EVEN, 1, FALSE, v18_edt_get_async_byte, s); fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_V23CH2], FSK_FRAME_MODE_7E1_FRAMES, v18_videotex_put_async_byte, s); break; case V18_MODE_V21TEXTPHONE: fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_V21CH1], async_tx_get_bit, &s->asynctx); async_tx_init(&s->asynctx, 7, ASYNC_PARITY_EVEN, 1, FALSE, v18_edt_get_async_byte, s); fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_V21CH1], FSK_FRAME_MODE_7E1_FRAMES, v18_textphone_put_async_byte, s); break; case V18_MODE_V18TEXTPHONE: fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_V21CH1], async_tx_get_bit, &s->asynctx); async_tx_init(&s->asynctx, 7, ASYNC_PARITY_EVEN, 1, FALSE, v18_edt_get_async_byte, s); fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_V21CH1], FSK_FRAME_MODE_7E1_FRAMES, v18_textphone_put_async_byte, s); break; } queue_init(&s->queue.queue, 128, QUEUE_READ_ATOMIC | QUEUE_WRITE_ATOMIC); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v18_release(v18_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v18_free(v18_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) v18_mode_to_str(int mode) { switch ((mode & 0xFF)) { case V18_MODE_NONE: return "None"; case V18_MODE_5BIT_45: return "Weitbrecht TDD (45.45bps)"; case V18_MODE_5BIT_50: return "Weitbrecht TDD (50bps)"; case V18_MODE_DTMF: return "DTMF"; case V18_MODE_EDT: return "EDT"; case V18_MODE_BELL103: return "Bell 103"; case V18_MODE_V23VIDEOTEX: return "Videotex"; case V18_MODE_V21TEXTPHONE: return "V.21"; case V18_MODE_V18TEXTPHONE: return "V.18 text telephone"; } return "???"; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/playout.c0000664000175000017500000002764011422612262012547 00000000000000/* * SpanDSP - a series of DSP components for telephony * * playout.c * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This was kicked off from jitter buffering code * Copyright (C) 2004, Horizon Wimba, Inc. * Author Steve Kann * However, there isn't a lot of the original left, now. The original * was licenced under the LGPL, so any remaining fragments are * compatible with the GPL licence used here. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include "spandsp/telephony.h" #include "spandsp/playout.h" static playout_frame_t *queue_get(playout_state_t *s, timestamp_t sender_stamp) { playout_frame_t *frame; if ((frame = s->first_frame) == NULL) return NULL; if (sender_stamp >= frame->sender_stamp) { /* Remove this frame from the queue */ if (frame->later) { frame->later->earlier = NULL; s->first_frame = frame->later; } else { /* The queue is now empty */ s->first_frame = NULL; s->last_frame = NULL; } return frame; } return NULL; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(timestamp_t) playout_next_due(playout_state_t *s) { return s->last_speech_sender_stamp + s->last_speech_sender_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(timestamp_t) playout_current_length(playout_state_t *s) { return s->target_buffer_length; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(playout_frame_t *) playout_get_unconditional(playout_state_t *s) { playout_frame_t *frame; if ((frame = queue_get(s, 0x7FFFFFFF))) { /* Put it on the free list */ frame->later = s->free_frames; s->free_frames = frame; /* We return the frame pointer, even though it's on the free list. The caller *must* copy the data before this frame has any chance of being reused. */ } return frame; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) playout_get(playout_state_t *s, playout_frame_t *frameout, timestamp_t now) { playout_frame_t *frame; /* Make the last_speech_sender_stamp the current expected one. */ s->last_speech_sender_stamp += s->last_speech_sender_len; if ((frame = queue_get(s, s->last_speech_sender_stamp)) == NULL) { /* The required frame was not received (or at least not in time) */ s->frames_missing++; return PLAYOUT_FILLIN; } if (s->dynamic && frame->type == PLAYOUT_TYPE_SPEECH) { /* Assess whether the buffer length is appropriate */ if (!s->not_first) { /* Prime things the first time through */ s->not_first = TRUE; s->latest_expected = frame->receiver_stamp + s->min_length; } /* Leaky integrate the rate of occurance of frames received just in time and late */ s->state_late += ((((frame->receiver_stamp > s->latest_expected) ? 0x10000000 : 0) - s->state_late) >> 8); s->state_just_in_time += ((((frame->receiver_stamp > s->latest_expected - frame->sender_len) ? 0x10000000 : 0) - s->state_just_in_time) >> 8); s->latest_expected += frame->sender_len; if (s->state_late > s->dropable_threshold) { if (s->since_last_step < 10) { if (s->target_buffer_length < s->max_length - 2) { /* The late bin is too big - increase buffering */ s->target_buffer_length += 3*frame->sender_len; s->latest_expected += 3*frame->sender_len; s->state_just_in_time = s->dropable_threshold; s->state_late = 0; s->since_last_step = 0; s->last_speech_sender_stamp -= 3*s->last_speech_sender_len; } } else { if (s->target_buffer_length < s->max_length) { /* The late bin is too big - increase buffering */ s->target_buffer_length += frame->sender_len; s->latest_expected += frame->sender_len; s->state_just_in_time = s->dropable_threshold; s->state_late = 0; s->since_last_step = 0; s->last_speech_sender_stamp -= s->last_speech_sender_len; } } } else if (s->since_last_step > 500 && s->state_just_in_time < s->dropable_threshold) { if (s->target_buffer_length > s->min_length) { /* The just-in-time bin is pretty small - decrease buffering */ s->target_buffer_length -= frame->sender_len; s->latest_expected -= frame->sender_len; s->state_just_in_time = s->dropable_threshold; s->state_late = 0; s->since_last_step = 0; s->last_speech_sender_stamp += s->last_speech_sender_len; } } s->since_last_step++; } /* If its not a speech frame, just return it. */ if (frame->type != PLAYOUT_TYPE_SPEECH) { /* Rewind last_speech_sender_stamp, since this isn't speech */ s->last_speech_sender_stamp -= s->last_speech_sender_len; *frameout = *frame; /* Put it on the free list */ frame->later = s->free_frames; s->free_frames = frame; s->frames_out++; return PLAYOUT_OK; } if (frame->sender_stamp < s->last_speech_sender_stamp) { /* This speech frame is late */ *frameout = *frame; /* Put it on the free list */ frame->later = s->free_frames; s->free_frames = frame; /* Rewind last_speech_sender_stamp, since we're just dumping */ s->last_speech_sender_stamp -= s->last_speech_sender_len; s->frames_out++; s->frames_late++; s->frames_missing--; return PLAYOUT_DROP; } /* Keep track of frame sizes, to allow for variable sized frames */ if (frame->sender_len > 0) s->last_speech_sender_len = frame->sender_len; /* Normal case. Return the frame, and increment stuff */ *frameout = *frame; /* Put it on the free list */ frame->later = s->free_frames; s->free_frames = frame; s->frames_out++; return PLAYOUT_OK; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) playout_put(playout_state_t *s, void *data, int type, timestamp_t sender_len, timestamp_t sender_stamp, timestamp_t receiver_stamp) { playout_frame_t *frame; playout_frame_t *p; /* When a frame arrives we just queue it in order. We leave all the tricky stuff until frames are read from the queue. */ s->frames_in++; /* Acquire a frame */ if ((frame = s->free_frames)) { s->free_frames = frame->later; } else { if ((frame = (playout_frame_t *) malloc(sizeof(*frame))) == NULL) return PLAYOUT_ERROR; } /* Fill out the frame */ frame->data = data; frame->type = type; frame->sender_stamp = sender_stamp; frame->sender_len = sender_len; frame->receiver_stamp = receiver_stamp; /* Frames are kept in a list, sorted by the timestamp assigned by the sender. */ if (s->last_frame == NULL) { /* The queue is empty. */ frame->later = NULL; frame->earlier = NULL; s->first_frame = frame; s->last_frame = frame; } else if (sender_stamp >= s->last_frame->sender_stamp) { /* Frame goes at the end of the queue. */ frame->later = NULL; frame->earlier = s->last_frame; s->last_frame->later = frame; s->last_frame = frame; } else { /* Frame is out of sequence. */ s->frames_oos++; /* Find where it should go in the queue */ p = s->last_frame; while (sender_stamp < p->sender_stamp && p->earlier) p = p->earlier; if (p->earlier) { /* It needs to go somewhere in the queue */ frame->later = p->later; frame->earlier = p; p->later->earlier = frame; p->later = frame; } else { /* It needs to go at the very beginning of the queue */ frame->later = p; frame->earlier = NULL; p->earlier = frame; s->first_frame = frame; } } if (s->start && type == PLAYOUT_TYPE_SPEECH) { s->last_speech_sender_stamp = sender_stamp - sender_len - s->min_length; s->last_speech_sender_len = sender_len; s->start = FALSE; } return PLAYOUT_OK; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) playout_restart(playout_state_t *s, int min_length, int max_length) { playout_frame_t *frame; playout_frame_t *next; /* Free all the frames on the free list */ for (frame = s->free_frames; frame; frame = next) { next = frame->later; free(frame); } memset(s, 0, sizeof(*s)); s->dynamic = (min_length < max_length); s->min_length = min_length; s->max_length = (max_length > min_length) ? max_length : min_length; s->dropable_threshold = 1*0x10000000/100; s->start = TRUE; s->since_last_step = 0x7FFFFFFF; /* Start with the minimum buffer length allowed, and work from there */ s->actual_buffer_length = s->target_buffer_length = (s->max_length - s->min_length)/2; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(playout_state_t *) playout_init(int min_length, int max_length) { playout_state_t *s; if ((s = (playout_state_t *) malloc(sizeof(playout_state_t))) == NULL) return NULL; memset(s, 0, sizeof(*s)); playout_restart(s, min_length, max_length); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) playout_release(playout_state_t *s) { playout_frame_t *frame; playout_frame_t *next; /* Free all the frames in the queue. In most cases these should have been removed already, so their associated data could be freed. */ for (frame = s->first_frame; frame; frame = next) { next = frame->later; free(frame); } /* Free all the frames on the free list */ for (frame = s->free_frames; frame; frame = next) { next = frame->later; free(frame); } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) playout_free(playout_state_t *s) { if (s) { playout_release(s); /* Finally, free ourselves! */ free(s); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/vector_int.c0000664000175000017500000004672211422612263013231 00000000000000/* * SpanDSP - a series of DSP components for telephony * * vector_int.c - Integer vector arithmetic * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include #include "floating_fudge.h" #include "mmx_sse_decs.h" #include "spandsp/telephony.h" #include "spandsp/vector_int.h" SPAN_DECLARE(int32_t) vec_dot_prodi16(const int16_t x[], const int16_t y[], int n) { int32_t z; #if defined(__GNUC__) && defined(SPANDSP_USE_MMX) && defined(__x86_64__) __asm__ __volatile__( " emms;\n" " pxor %%mm0,%%mm0;\n" " leaq -32(%%rsi,%%rax,2),%%rdx;\n" /* rdx = top - 32 */ " cmpq %%rdx,%%rsi;\n" " ja 1f;\n" /* Work in blocks of 16 int16_t's until we are near the end */ " .p2align 2;\n" "2:\n" " movq (%%rdi),%%mm1;\n" " movq (%%rsi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 8(%%rdi),%%mm1;\n" " movq 8(%%rsi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 16(%%rdi),%%mm1;\n" " movq 16(%%rsi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 24(%%rdi),%%mm1;\n" " movq 24(%%rsi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " addq $32,%%rsi;\n" " addq $32,%%rdi;\n" " cmpq %%rdx,%%rsi;\n" " jbe 2b;\n" " .p2align 2;\n" "1:\n" " addq $24,%%rdx;\n" /* Now edx = top - 8 */ " cmpq %%rdx,%%rsi;\n" " ja 3f;\n" /* Work in blocks of 4 int16_t's until we are near the end */ " .p2align 2;\n" "4:\n" " movq (%%rdi),%%mm1;\n" " movq (%%rsi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " addq $8,%%rsi;\n" " addq $8,%%rdi;\n" " cmpq %%rdx,%%rsi;" " jbe 4b;\n" " .p2align 2;\n" "3:\n" " addq $4,%%rdx;\n" /* Now edx = top - 4 */ " cmpq %%rdx,%%rsi;\n" " ja 5f;\n" /* Work in a block of 2 int16_t's */ " movd (%%rdi),%%mm1;\n" " movd (%%rsi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " addq $4,%%rsi;\n" " addq $4,%%rdi;\n" " .p2align 2;\n" "5:\n" " addq $2,%%rdx;\n" /* Now edx = top - 2 */ " cmpq %%rdx,%%rsi;\n" " ja 6f;\n" /* Deal with the very last int16_t, when n is odd */ " movswl (%%rdi),%%eax;\n" " andl $65535,%%eax;\n" " movd %%eax,%%mm1;\n" " movswl (%%rsi),%%eax;\n" " andl $65535,%%eax;\n" " movd %%eax,%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " .p2align 2;\n" "6:\n" /* Merge the pieces of the answer */ " movq %%mm0,%%mm1;\n" " punpckhdq %%mm0,%%mm1;\n" " paddd %%mm1,%%mm0;\n" /* Et voila, eax has the final result */ " movd %%mm0,%%eax;\n" " emms;\n" : "=a" (z) : "S" (x), "D" (y), "a" (n) : "cc" ); #elif defined(__GNUC__) && defined(SPANDSP_USE_MMX) && defined(__i386__) __asm__ __volatile__( " emms;\n" " pxor %%mm0,%%mm0;\n" " leal -32(%%esi,%%eax,2),%%edx;\n" /* edx = top - 32 */ " cmpl %%edx,%%esi;\n" " ja 1f;\n" /* Work in blocks of 16 int16_t's until we are near the end */ " .p2align 2;\n" "2:\n" " movq (%%edi),%%mm1;\n" " movq (%%esi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 8(%%edi),%%mm1;\n" " movq 8(%%esi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 16(%%edi),%%mm1;\n" " movq 16(%%esi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " movq 24(%%edi),%%mm1;\n" " movq 24(%%esi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " addl $32,%%esi;\n" " addl $32,%%edi;\n" " cmpl %%edx,%%esi;\n" " jbe 2b;\n" " .p2align 2;\n" "1:\n" " addl $24,%%edx;\n" /* Now edx = top - 8 */ " cmpl %%edx,%%esi;\n" " ja 3f;\n" /* Work in blocks of 4 int16_t's until we are near the end */ " .p2align 2;\n" "4:\n" " movq (%%edi),%%mm1;\n" " movq (%%esi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " addl $8,%%esi;\n" " addl $8,%%edi;\n" " cmpl %%edx,%%esi;" " jbe 4b;\n" " .p2align 2;\n" "3:\n" " addl $4,%%edx;\n" /* Now edx = top - 4 */ " cmpl %%edx,%%esi;\n" " ja 5f;\n" /* Work in a block of 2 int16_t's */ " movd (%%edi),%%mm1;\n" " movd (%%esi),%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " addl $4,%%esi;\n" " addl $4,%%edi;\n" " .p2align 2;\n" "5:\n" " addl $2,%%edx;\n" /* Now edx = top - 2 */ " cmpl %%edx,%%esi;\n" " ja 6f;\n" /* Deal with the very last int16_t, when n is odd */ " movswl (%%edi),%%eax;\n" " andl $65535,%%eax;\n" " movd %%eax,%%mm1;\n" " movswl (%%esi),%%eax;\n" " andl $65535,%%eax;\n" " movd %%eax,%%mm2;\n" " pmaddwd %%mm2,%%mm1;\n" " paddd %%mm1,%%mm0;\n" " .p2align 2;\n" "6:\n" /* Merge the pieces of the answer */ " movq %%mm0,%%mm1;\n" " punpckhdq %%mm0,%%mm1;\n" " paddd %%mm1,%%mm0;\n" /* Et voila, eax has the final result */ " movd %%mm0,%%eax;\n" " emms;\n" : "=a" (z) : "S" (x), "D" (y), "a" (n) : "cc" ); #else int i; z = 0; for (i = 0; i < n; i++) z += (int32_t) x[i]*(int32_t) y[i]; #endif return z; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int32_t) vec_circular_dot_prodi16(const int16_t x[], const int16_t y[], int n, int pos) { int32_t z; z = vec_dot_prodi16(&x[pos], &y[0], n - pos); z += vec_dot_prodi16(&x[0], &y[n - pos], pos); return z; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) vec_lmsi16(const int16_t x[], int16_t y[], int n, int16_t error) { int i; for (i = 0; i < n; i++) y[i] += (int16_t) (((int32_t) x[i]*(int32_t) error) >> 15); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) vec_circular_lmsi16(const int16_t x[], int16_t y[], int n, int pos, int16_t error) { vec_lmsi16(&x[pos], &y[0], n - pos, error); vec_lmsi16(&x[0], &y[n - pos], pos, error); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int32_t) vec_min_maxi16(const int16_t x[], int n, int16_t out[]) { #if defined(__GNUC__) && defined(SPANDSP_USE_MMX) && defined(__x86_64__) static const int32_t lower_bound = 0x80008000; static const int32_t upper_bound = 0x7FFF7FFF; int32_t max; __asm__ __volatile__( " emms;\n" " pushq %%rdx;\n" " leaq -8(%%rsi,%%rax,2),%%rdx;\n" " cmpq %%rdx,%%rsi;\n" " jbe 2f;\n" " movd %[lower],%%mm0;\n" " movd %[upper],%%mm1;\n" " jmp 1f;\n" " .p2align 2;\n" "2:\n" " movq (%%rsi),%%mm0;\n" /* mm0 will be max's */ " movq %%mm0,%%mm1;\n" /* mm1 will be min's */ " addq $8,%%rsi;\n" " cmpq %%rdx,%%rsi;\n" " ja 4f;\n" "3:\n" " movq (%%rsi),%%mm2;\n" " movq %%mm2,%%mm3;\n" " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ " movq %%mm3,%%mm4;\n" " pand %%mm2,%%mm3;\n" /* mm3 is mm2 masked to new max's */ " pandn %%mm0,%%mm4;\n" /* mm4 is mm0 masked to its max's */ " por %%mm3,%%mm4;\n" " movq %%mm4,%%mm0;\n" /* Now mm0 is updated max's */ " movq %%mm1,%%mm3;\n" " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new min's */ " pandn %%mm1,%%mm3;\n" /* mm3 is mm1 masked to its min's */ " por %%mm3,%%mm2;\n" " movq %%mm2,%%mm1;\n" /* now mm1 is updated min's */ " addq $8,%%rsi;\n" " cmpq %%rdx,%%rsi;\n" " jbe 3b;\n" " .p2align 2;\n" "4:\n" /* Merge down the 4-word max/mins to lower 2 words */ " movq %%mm0,%%mm2;\n" " psrlq $32,%%mm2;\n" " movq %%mm2,%%mm3;\n" " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new max's */ " pandn %%mm0,%%mm3;\n" /* mm3 is mm0 masked to its max's */ " por %%mm3,%%mm2;\n" " movq %%mm2,%%mm0;\n" /* now mm0 is updated max's */ " movq %%mm1,%%mm2;\n" " psrlq $32,%%mm2;\n" " movq %%mm1,%%mm3;\n" " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new min's */ " pandn %%mm1,%%mm3;\n" /* mm3 is mm1 masked to its min's */ " por %%mm3,%%mm2;\n" " movq %%mm2,%%mm1;\n" /* now mm1 is updated min's */ " .p2align 2;\n" "1:\n" " addq $4,%%rdx;\n" /* now dx = top-4 */ " cmpq %%rdx,%%rsi;\n" " ja 5f;\n" /* Here, there are >= 2 words of input remaining */ " movd (%%rsi),%%mm2;\n" " movq %%mm2,%%mm3;\n" " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ " movq %%mm3,%%mm4;\n" " pand %%mm2,%%mm3;\n" /* mm3 is mm2 masked to new max's */ " pandn %%mm0,%%mm4;\n" /* mm4 is mm0 masked to its max's */ " por %%mm3,%%mm4;\n" " movq %%mm4,%%mm0;\n" /* now mm0 is updated max's */ " movq %%mm1,%%mm3;\n" " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new min's */ " pandn %%mm1,%%mm3;\n" /* mm3 is mm1 masked to its min's */ " por %%mm3,%%mm2;\n" " movq %%mm2,%%mm1;\n" /* now mm1 is updated min's */ " addq $4,%%rsi;\n" " .p2align 2;\n" "5:\n" /* Merge down the 2-word max/mins to 1 word */ " movq %%mm0,%%mm2;\n" " psrlq $16,%%mm2;\n" " movq %%mm2,%%mm3;\n" " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new max's */ " pandn %%mm0,%%mm3;\n" /* mm3 is mm0 masked to its max's */ " por %%mm3,%%mm2;\n" " movd %%mm2,%%ecx;\n" /* cx is max so far */ " movq %%mm1,%%mm2;\n" " psrlq $16,%%mm2;\n" " movq %%mm1,%%mm3;\n" " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new min's */ " pandn %%mm1,%%mm3;\n" /* mm3 is mm1 masked to its min's */ " por %%mm3,%%mm2;\n" " movd %%mm2,%%eax;\n" /* ax is min so far */ " addq $2,%%rdx;\n" /* now dx = top-2 */ " cmpq %%rdx,%%rsi;\n" " ja 6f;\n" /* Here, there is one word of input left */ " cmpw (%%rsi),%%cx;\n" " jge 9f;\n" " movw (%%rsi),%%cx;\n" " .p2align 2;\n" "9:\n" " cmpw (%%rsi),%%ax;\n" " jle 6f;\n" " movw (%%rsi),%%ax;\n" " .p2align 2;\n" "6:\n" /* (finally!) cx is the max, ax the min */ " movswl %%cx,%%ecx;\n" " movswl %%ax,%%eax;\n" " popq %%rdx;\n" /* ptr to output max,min vals */ " andq %%rdx,%%rdx;\n" " jz 7f;\n" " movw %%cx,(%%rdx);\n" /* max */ " movw %%ax,2(%%rdx);\n" /* min */ " .p2align 2;\n" "7:\n" /* Now calculate max absolute value */ " negl %%eax;\n" " cmpl %%ecx,%%eax;\n" " jge 8f;\n" " movl %%ecx,%%eax;\n" " .p2align 2;\n" "8:\n" " emms;\n" : "=a" (max) : "S" (x), "a" (n), "d" (out), [lower] "m" (lower_bound), [upper] "m" (upper_bound) : "ecx" ); #elif defined(__GNUC__) && defined(SPANDSP_USE_MMX) && defined(__i386__) static const int32_t lower_bound = 0x80008000; static const int32_t upper_bound = 0x7FFF7FFF; int32_t max; __asm__ __volatile__( " emms;\n" " pushl %%edx;\n" " leal -8(%%esi,%%eax,2),%%edx;\n" " cmpl %%edx,%%esi;\n" " jbe 2f;\n" " movd %[lower],%%mm0;\n" " movd %[upper],%%mm1;\n" " jmp 1f;\n" " .p2align 2;\n" "2:\n" " movq (%%esi),%%mm0;\n" /* mm0 will be max's */ " movq %%mm0,%%mm1;\n" /* mm1 will be min's */ " addl $8,%%esi;\n" " cmpl %%edx,%%esi;\n" " ja 4f;\n" " .p2align 2;\n" "3:\n" " movq (%%esi),%%mm2;\n" " movq %%mm2,%%mm3;\n" " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ " movq %%mm3,%%mm4;\n" " pand %%mm2,%%mm3;\n" /* mm3 is mm2 masked to new max's */ " pandn %%mm0,%%mm4;\n" /* mm4 is mm0 masked to its max's */ " por %%mm3,%%mm4;\n" " movq %%mm4,%%mm0;\n" /* Now mm0 is updated max's */ " movq %%mm1,%%mm3;\n" " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new min's */ " pandn %%mm1,%%mm3;\n" /* mm3 is mm1 masked to its min's */ " por %%mm3,%%mm2;\n" " movq %%mm2,%%mm1;\n" /* now mm1 is updated min's */ " addl $8,%%esi;\n" " cmpl %%edx,%%esi;\n" " jbe 3b;\n" " .p2align 2;\n" "4:\n" /* Merge down the 4-word max/mins to lower 2 words */ " movq %%mm0,%%mm2;\n" " psrlq $32,%%mm2;\n" " movq %%mm2,%%mm3;\n" " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new max's */ " pandn %%mm0,%%mm3;\n" /* mm3 is mm0 masked to its max's */ " por %%mm3,%%mm2;\n" " movq %%mm2,%%mm0;\n" /* now mm0 is updated max's */ " movq %%mm1,%%mm2;\n" " psrlq $32,%%mm2;\n" " movq %%mm1,%%mm3;\n" " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new min's */ " pandn %%mm1,%%mm3;\n" /* mm3 is mm1 masked to its min's */ " por %%mm3,%%mm2;\n" " movq %%mm2,%%mm1;\n" /* now mm1 is updated min's */ " .p2align 2;\n" "1:\n" " addl $4,%%edx;\n" /* now dx = top-4 */ " cmpl %%edx,%%esi;\n" " ja 5f;\n" /* Here, there are >= 2 words of input remaining */ " movd (%%esi),%%mm2;\n" " movq %%mm2,%%mm3;\n" " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ " movq %%mm3,%%mm4;\n" " pand %%mm2,%%mm3;\n" /* mm3 is mm2 masked to new max's */ " pandn %%mm0,%%mm4;\n" /* mm4 is mm0 masked to its max's */ " por %%mm3,%%mm4;\n" " movq %%mm4,%%mm0;\n" /* now mm0 is updated max's */ " movq %%mm1,%%mm3;\n" " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new min's */ " pandn %%mm1,%%mm3;\n" /* mm3 is mm1 masked to its min's */ " por %%mm3,%%mm2;\n" " movq %%mm2,%%mm1;\n" /* now mm1 is updated min's */ " addl $4,%%esi;\n" " .p2align 2;\n" "5:\n" /* Merge down the 2-word max/mins to 1 word */ " movq %%mm0,%%mm2;\n" " psrlq $16,%%mm2;\n" " movq %%mm2,%%mm3;\n" " pcmpgtw %%mm0,%%mm3;\n" /* mm3 is bitmask for words where mm2 > mm0 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new max's */ " pandn %%mm0,%%mm3;\n" /* mm3 is mm0 masked to its max's */ " por %%mm3,%%mm2;\n" " movd %%mm2,%%ecx;\n" /* cx is max so far */ " movq %%mm1,%%mm2;\n" " psrlq $16,%%mm2;\n" " movq %%mm1,%%mm3;\n" " pcmpgtw %%mm2,%%mm3;\n" /* mm3 is bitmask for words where mm2 < mm1 */ " pand %%mm3,%%mm2;\n" /* mm2 is mm2 masked to new min's */ " pandn %%mm1,%%mm3;\n" /* mm3 is mm1 masked to its min's */ " por %%mm3,%%mm2;\n" " movd %%mm2,%%eax;\n" /* ax is min so far */ " addl $2,%%edx;\n" /* now dx = top-2 */ " cmpl %%edx,%%esi;\n" " ja 6f;\n" /* Here, there is one word of input left */ " cmpw (%%esi),%%cx;\n" " jge 9f;\n" " movw (%%esi),%%cx;\n" " .p2align 2;\n" "9:\n" " cmpw (%%esi),%%ax;\n" " jle 6f;\n" " movw (%%esi),%%ax;\n" " .p2align 2;\n" "6:\n" /* (finally!) cx is the max, ax the min */ " movswl %%cx,%%ecx;\n" " movswl %%ax,%%eax;\n" " popl %%edx;\n" /* ptr to output max,min vals */ " andl %%edx,%%edx;\n" " jz 7f;\n" " movw %%cx,(%%edx);\n" /* max */ " movw %%ax,2(%%edx);\n" /* min */ " .p2align 2;\n" "7:\n" /* Now calculate max absolute value */ " negl %%eax;\n" " cmpl %%ecx,%%eax;\n" " jge 8f;\n" " movl %%ecx,%%eax;\n" " .p2align 2;\n" "8:\n" " emms;\n" : "=a" (max) : "S" (x), "a" (n), "d" (out), [lower] "m" (lower_bound), [upper] "m" (upper_bound) : "ecx" ); #else int i; int16_t min; int16_t max; int16_t temp; int32_t z; max = INT16_MIN; min = INT16_MAX; for (i = 0; i < n; i++) { temp = x[i]; if (temp > max) max = temp; /*endif*/ if (temp < min) min = temp; /*endif*/ } /*endfor*/ if (out) { out[0] = max; out[1] = min; } z = abs(min); if (z > max) return z; #endif return max; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/super_tone_tx.c0000664000175000017500000002170311422612262013742 00000000000000/* * SpanDSP - a series of DSP components for telephony * * super_tone_tx.c - Flexible telephony supervisory tone generation. * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/complex.h" #include "spandsp/dds.h" #include "spandsp/tone_generate.h" #include "spandsp/super_tone_tx.h" #include "spandsp/private/tone_generate.h" #include "spandsp/private/super_tone_tx.h" /* The tone played to wake folk up when they have left the phone off hook is an oddity amongst supervisory tones. It is designed to sound loud and nasty. Most tones are one or two pure sine pitches, or one AM moduluated pitch. This alert tone varies between countries, but AT&T are a typical example. AT&T Receiver Off-Hook Tone is 1400 Hz, 2060 Hz, 2450 Hz and 2600 Hz at 0dBm0/frequency on and off every .1 second. On some older space division switching systems Receiver Off-Hook was 1400 Hz, 2060 Hz, 2450 Hz and 2600 Hz at +5 VU on and off every .1 second. On a No. 5 ESS this continues for 30 seconds. On a No. 2/2B ESS this continues for 40 seconds. On some other AT&T switches there are two iterations of 50 seconds each. */ SPAN_DECLARE(super_tone_tx_step_t *) super_tone_tx_make_step(super_tone_tx_step_t *s, float f1, float l1, float f2, float l2, int length, int cycles) { if (s == NULL) { if ((s = (super_tone_tx_step_t *) malloc(sizeof(*s))) == NULL) return NULL; } if (f1 >= 1.0f) { s->tone[0].phase_rate = dds_phase_ratef(f1); s->tone[0].gain = dds_scaling_dbm0f(l1); } else { s->tone[0].phase_rate = 0; s->tone[0].gain = 0.0f; } if (f2 >= 1.0f) { s->tone[1].phase_rate = dds_phase_ratef(f2); s->tone[1].gain = dds_scaling_dbm0f(l2); } else { s->tone[1].phase_rate = 0; s->tone[1].gain = 0.0f; } s->tone_on = (f1 > 0.0f); s->length = length*SAMPLE_RATE/1000; s->cycles = cycles; s->next = NULL; s->nest = NULL; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) super_tone_tx_free_tone(super_tone_tx_step_t *s) { super_tone_tx_step_t *t; while (s) { /* Follow nesting... */ if (s->nest) super_tone_tx_free_tone(s->nest); t = s; s = s->next; free(t); } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(super_tone_tx_state_t *) super_tone_tx_init(super_tone_tx_state_t *s, super_tone_tx_step_t *tree) { if (tree == NULL) return NULL; if (s == NULL) { if ((s = (super_tone_tx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); s->level = 0; s->levels[0] = tree; s->cycles[0] = tree->cycles; s->current_position = 0; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) super_tone_tx_release(super_tone_tx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) super_tone_tx_free(super_tone_tx_state_t *s) { if (s) free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) super_tone_tx(super_tone_tx_state_t *s, int16_t amp[], int max_samples) { int samples; int limit; int len; int i; float xamp; super_tone_tx_step_t *tree; if (s->level < 0 || s->level > 3) return 0; samples = 0; tree = s->levels[s->level]; while (tree && samples < max_samples) { if (tree->tone_on) { /* A period of tone. A length of zero means infinite length. */ if (s->current_position == 0) { /* New step - prepare the tone generator */ for (i = 0; i < 4; i++) s->tone[i] = tree->tone[i]; } len = tree->length - s->current_position; if (tree->length == 0) { len = max_samples - samples; /* We just need to make current position non-zero */ s->current_position = 1; } else if (len > max_samples - samples) { len = max_samples - samples; s->current_position += len; } else { s->current_position = 0; } if (s->tone[0].phase_rate < 0) { for (limit = len + samples; samples < limit; samples++) { /* There must be two, and only two tones */ xamp = dds_modf(&s->phase[0], -s->tone[0].phase_rate, s->tone[0].gain, 0) *(1.0f + dds_modf(&s->phase[1], s->tone[1].phase_rate, s->tone[1].gain, 0)); amp[samples] = (int16_t) lfastrintf(xamp); } } else { for (limit = len + samples; samples < limit; samples++) { xamp = 0.0f; for (i = 0; i < 4; i++) { if (s->tone[i].phase_rate == 0) break; xamp += dds_modf(&s->phase[i], s->tone[i].phase_rate, s->tone[i].gain, 0); } amp[samples] = (int16_t) lfastrintf(xamp); } } if (s->current_position) return samples; } else if (tree->length) { /* A period of silence. The length must always be explicitly stated. A length of zero does not give infinite silence. */ len = tree->length - s->current_position; if (len > max_samples - samples) { len = max_samples - samples; s->current_position += len; } else { s->current_position = 0; } memset(amp + samples, 0, sizeof(uint16_t)*len); samples += len; if (s->current_position) return samples; } /* Nesting has priority... */ if (tree->nest) { tree = tree->nest; s->levels[++s->level] = tree; s->cycles[s->level] = tree->cycles; } else { /* ...Next comes repeating, and finally moving forward a step. */ /* When repeating, note that zero cycles really means endless cycles. */ while (tree->cycles && --s->cycles[s->level] <= 0) { tree = tree->next; if (tree) { /* A fresh new step. */ s->levels[s->level] = tree; s->cycles[s->level] = tree->cycles; break; } /* If we are nested we need to pop, otherwise this is the end. */ if (s->level <= 0) { /* Mark the tone as completed */ s->levels[0] = NULL; break; } tree = s->levels[--s->level]; } } } return samples; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/oki_adpcm.c0000664000175000017500000002330111422612262012766 00000000000000/* * SpanDSP - a series of DSP components for telephony * * oki_adpcm.c - Conversion routines between linear 16 bit PCM data and * OKI (Dialogic) ADPCM format. Supports with the 32kbps * and 24kbps variants used by Dialogic. * * Written by Steve Underwood * * Copyright (C) 2001, 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * The actual OKI ADPCM encode and decode method is derived from freely * available code, whose exact origins seem uncertain. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include "spandsp/telephony.h" #include "spandsp/oki_adpcm.h" #include "spandsp/private/oki_adpcm.h" /* Routines to convert 12 bit linear samples to the Oki ADPCM coding format, widely used in CTI, because Dialogic use it. */ /* OKI ADPCM step variation table */ static const int16_t step_size[49] = { 16, 17, 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130, 143, 157, 173, 190, 209, 230, 253, 279, 307, 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, 876, 963, 1060, 1166, 1282, 1411, 1552 }; static const int16_t step_adjustment[8] = { -1, -1, -1, -1, 2, 4, 6, 8 }; /* Band limiting filter, to allow sample rate conversion to and from 6k samples/second. */ static const float cutoff_coeffs[] = { -3.648392e-4f, 5.062391e-4f, 1.206247e-3f, 1.804452e-3f, 1.691750e-3f, 4.083405e-4f, -1.931085e-3f, -4.452107e-3f, -5.794821e-3f, -4.778489e-3f, -1.161266e-3f, 3.928504e-3f, 8.259786e-3f, 9.500425e-3f, 6.512800e-3f, 2.227856e-4f, -6.531275e-3f, -1.026843e-2f, -8.718062e-3f, -2.280487e-3f, 5.817733e-3f, 1.096777e-2f, 9.634404e-3f, 1.569301e-3f, -9.522632e-3f, -1.748273e-2f, -1.684408e-2f, -6.100054e-3f, 1.071206e-2f, 2.525209e-2f, 2.871779e-2f, 1.664411e-2f, -7.706268e-3f, -3.331083e-2f, -4.521249e-2f, -3.085962e-2f, 1.373653e-2f, 8.089593e-2f, 1.529060e-1f, 2.080487e-1f, 2.286834e-1f, 2.080487e-1f, 1.529060e-1f, 8.089593e-2f, 1.373653e-2f, -3.085962e-2f, -4.521249e-2f, -3.331083e-2f, -7.706268e-3f, 1.664411e-2f, 2.871779e-2f, 2.525209e-2f, 1.071206e-2f, -6.100054e-3f, -1.684408e-2f, -1.748273e-2f, -9.522632e-3f, 1.569301e-3f, 9.634404e-3f, 1.096777e-2f, 5.817733e-3f, -2.280487e-3f, -8.718062e-3f, -1.026843e-2f, -6.531275e-3f, 2.227856e-4f, 6.512800e-3f, 9.500425e-3f, 8.259786e-3f, 3.928504e-3f, -1.161266e-3f, -4.778489e-3f, -5.794821e-3f, -4.452107e-3f, -1.931085e-3f, 4.083405e-4f, 1.691750e-3f, 1.804452e-3f, 1.206247e-3f, 5.062391e-4f, -3.648392e-4f }; static int16_t decode(oki_adpcm_state_t *s, uint8_t adpcm) { int16_t d; int16_t ss; int16_t linear; /* Doing the next part as follows: * * x = adpcm & 0x07; * e = (step_size[s->step_index]*(x + x + 1)) >> 3; * * Seems an obvious improvement on a modern machine, but remember * the truncation errors do not come out the same. It would * not, therefore, be an exact match for what this code is doing. * * Just what a Dialogic card does, I do not know! */ ss = step_size[s->step_index]; d = ss >> 3; if (adpcm & 0x01) d += (ss >> 2); /*endif*/ if (adpcm & 0x02) d += (ss >> 1); /*endif*/ if (adpcm & 0x04) d += ss; /*endif*/ if (adpcm & 0x08) d = -d; /*endif*/ linear = s->last + d; /* Saturate the values to +/- 2^11 (supposed to be 12 bits) */ if (linear > 2047) linear = 2047; else if (linear < -2048) linear = -2048; /*endif*/ s->last = linear; s->step_index += step_adjustment[adpcm & 0x07]; if (s->step_index < 0) s->step_index = 0; else if (s->step_index > 48) s->step_index = 48; /*endif*/ /* Note: the result here is a 12 bit value */ return linear; } /*- End of function --------------------------------------------------------*/ static uint8_t encode(oki_adpcm_state_t *s, int16_t linear) { int16_t d; int16_t ss; uint8_t adpcm; ss = step_size[s->step_index]; d = (linear >> 4) - s->last; adpcm = (uint8_t) 0x00; if (d < 0) { adpcm = (uint8_t) 0x08; d = -d; } /*endif*/ if (d >= ss) { adpcm |= (uint8_t) 0x04; d -= ss; } /*endif*/ if (d >= (ss >> 1)) { adpcm |= (uint8_t) 0x02; d -= (ss >> 1); } /*endif*/ if (d >= (ss >> 2)) adpcm |= (uint8_t) 0x01; /*endif*/ /* Use the decoder to set the estimate of the last sample. */ /* It also will adjust the step_index for us. */ s->last = decode(s, adpcm); return adpcm; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(oki_adpcm_state_t *) oki_adpcm_init(oki_adpcm_state_t *s, int bit_rate) { if (bit_rate != 32000 && bit_rate != 24000) return NULL; if (s == NULL) { if ((s = (oki_adpcm_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); s->bit_rate = bit_rate; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) oki_adpcm_release(oki_adpcm_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) oki_adpcm_free(oki_adpcm_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) oki_adpcm_decode(oki_adpcm_state_t *s, int16_t amp[], const uint8_t oki_data[], int oki_bytes) { int i; int x; int l; int n; int samples; float z; #if (_MSC_VER >= 1400) __analysis_assume(s->phase >= 0 && s->phase <= 4); #endif samples = 0; if (s->bit_rate == 32000) { for (i = 0; i < oki_bytes; i++) { amp[samples++] = decode(s, (oki_data[i] >> 4) & 0xF) << 4; amp[samples++] = decode(s, oki_data[i] & 0xF) << 4; } /*endwhile*/ } else { n = 0; for (i = 0; i < oki_bytes; ) { /* 6k to 8k sample/second conversion */ if (s->phase) { s->history[s->ptr++] = decode(s, (n++ & 1) ? (oki_data[i++] & 0xF) : ((oki_data[i] >> 4) & 0xF)) << 4; s->ptr &= (32 - 1); } /*endif*/ z = 0.0f; for (l = 80 - 3 + s->phase, x = s->ptr - 1; l >= 0; l -= 4, x--) z += cutoff_coeffs[l]*s->history[x & (32 - 1)]; amp[samples++] = (int16_t) (z*4.0f); if (++s->phase > 3) s->phase = 0; /*endif*/ } /*endfor*/ } /*endif*/ return samples; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) oki_adpcm_encode(oki_adpcm_state_t *s, uint8_t oki_data[], const int16_t amp[], int len) { int x; int l; int n; int bytes; float z; bytes = 0; if (s->bit_rate == 32000) { for (n = 0; n < len; n++) { s->oki_byte = (s->oki_byte << 4) | encode(s, amp[n]); if ((s->mark++ & 1)) oki_data[bytes++] = s->oki_byte; /*endif*/ } /*endfor*/ } else { n = 0; for (;;) { /* 8k to 6k sample/second conversion */ if (s->phase > 2) { s->history[s->ptr++] = amp[n]; s->ptr &= (32 - 1); s->phase = 0; if (++n >= len) break; /*endif*/ } /*endif*/ s->history[s->ptr++] = amp[n]; s->ptr &= (32 - 1); z = 0.0f; for (l = 80 - s->phase, x = s->ptr - 1; l >= 0; l -= 3, x--) z += cutoff_coeffs[l]*s->history[x & (32 - 1)]; /*endfor*/ s->oki_byte = (s->oki_byte << 4) | encode(s, (int16_t) (z*3.0f)); if ((s->mark++ & 1)) oki_data[bytes++] = s->oki_byte; /*endif*/ s->phase++; if (++n >= len) break; /*endif*/ } /*endfor*/ } /*endif*/ return bytes; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/v17_v32bis_tx_constellation_maps.h0000664000175000017500000004132112101013740017334 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v17_v32bis_tx_constellation_maps.h - ITU V.17 and V.32bis modems * transmit part. * Constellation mapping. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(FP_SCALE) #if defined(SPANDSP_USE_FIXED_POINTx) #define FP_SCALE(x) ((int16_t) x) #else #define FP_SCALE(x) (x) #endif #endif #if defined(SPANDSP_USE_FIXED_POINTx) static const complexi16_t v17_v32bis_14400_constellation[128] = #else static const complexf_t v17_v32bis_14400_constellation[128] = #endif { {FP_SCALE(-8.0f), FP_SCALE(-3.0f)}, /* 0x00 */ {FP_SCALE( 9.0f), FP_SCALE( 2.0f)}, /* 0x01 */ {FP_SCALE( 2.0f), FP_SCALE(-9.0f)}, /* 0x02 */ {FP_SCALE(-3.0f), FP_SCALE( 8.0f)}, /* 0x03 */ {FP_SCALE( 8.0f), FP_SCALE( 3.0f)}, /* 0x04 */ {FP_SCALE(-9.0f), FP_SCALE(-2.0f)}, /* 0x05 */ {FP_SCALE(-2.0f), FP_SCALE( 9.0f)}, /* 0x06 */ {FP_SCALE( 3.0f), FP_SCALE(-8.0f)}, /* 0x07 */ {FP_SCALE(-8.0f), FP_SCALE( 1.0f)}, /* 0x08 */ {FP_SCALE( 9.0f), FP_SCALE(-2.0f)}, /* 0x09 */ {FP_SCALE(-2.0f), FP_SCALE(-9.0f)}, /* 0x0A */ {FP_SCALE( 1.0f), FP_SCALE( 8.0f)}, /* 0x0B */ {FP_SCALE( 8.0f), FP_SCALE(-1.0f)}, /* 0x0C */ {FP_SCALE(-9.0f), FP_SCALE( 2.0f)}, /* 0x0D */ {FP_SCALE( 2.0f), FP_SCALE( 9.0f)}, /* 0x0E */ {FP_SCALE(-1.0f), FP_SCALE(-8.0f)}, /* 0x0F */ {FP_SCALE(-4.0f), FP_SCALE(-3.0f)}, /* 0x10 */ {FP_SCALE( 5.0f), FP_SCALE( 2.0f)}, /* 0x11 */ {FP_SCALE( 2.0f), FP_SCALE(-5.0f)}, /* 0x12 */ {FP_SCALE(-3.0f), FP_SCALE( 4.0f)}, /* 0x13 */ {FP_SCALE( 4.0f), FP_SCALE( 3.0f)}, /* 0x14 */ {FP_SCALE(-5.0f), FP_SCALE(-2.0f)}, /* 0x15 */ {FP_SCALE(-2.0f), FP_SCALE( 5.0f)}, /* 0x16 */ {FP_SCALE( 3.0f), FP_SCALE(-4.0f)}, /* 0x17 */ {FP_SCALE(-4.0f), FP_SCALE( 1.0f)}, /* 0x18 */ {FP_SCALE( 5.0f), FP_SCALE(-2.0f)}, /* 0x19 */ {FP_SCALE(-2.0f), FP_SCALE(-5.0f)}, /* 0x1A */ {FP_SCALE( 1.0f), FP_SCALE( 4.0f)}, /* 0x1B */ {FP_SCALE( 4.0f), FP_SCALE(-1.0f)}, /* 0x1C */ {FP_SCALE(-5.0f), FP_SCALE( 2.0f)}, /* 0x1D */ {FP_SCALE( 2.0f), FP_SCALE( 5.0f)}, /* 0x1E */ {FP_SCALE(-1.0f), FP_SCALE(-4.0f)}, /* 0x1F */ {FP_SCALE( 4.0f), FP_SCALE(-3.0f)}, /* 0x20 */ {FP_SCALE(-3.0f), FP_SCALE( 2.0f)}, /* 0x21 */ {FP_SCALE( 2.0f), FP_SCALE( 3.0f)}, /* 0x22 */ {FP_SCALE(-3.0f), FP_SCALE(-4.0f)}, /* 0x23 */ {FP_SCALE(-4.0f), FP_SCALE( 3.0f)}, /* 0x24 */ {FP_SCALE( 3.0f), FP_SCALE(-2.0f)}, /* 0x25 */ {FP_SCALE(-2.0f), FP_SCALE(-3.0f)}, /* 0x26 */ {FP_SCALE( 3.0f), FP_SCALE( 4.0f)}, /* 0x27 */ {FP_SCALE( 4.0f), FP_SCALE( 1.0f)}, /* 0x28 */ {FP_SCALE(-3.0f), FP_SCALE(-2.0f)}, /* 0x29 */ {FP_SCALE(-2.0f), FP_SCALE( 3.0f)}, /* 0x2A */ {FP_SCALE( 1.0f), FP_SCALE(-4.0f)}, /* 0x2B */ {FP_SCALE(-4.0f), FP_SCALE(-1.0f)}, /* 0x2C */ {FP_SCALE( 3.0f), FP_SCALE( 2.0f)}, /* 0x2D */ {FP_SCALE( 2.0f), FP_SCALE(-3.0f)}, /* 0x2E */ {FP_SCALE(-1.0f), FP_SCALE( 4.0f)}, /* 0x2F */ {FP_SCALE( 0.0f), FP_SCALE(-3.0f)}, /* 0x30 */ {FP_SCALE( 1.0f), FP_SCALE( 2.0f)}, /* 0x31 */ {FP_SCALE( 2.0f), FP_SCALE(-1.0f)}, /* 0x32 */ {FP_SCALE(-3.0f), FP_SCALE( 0.0f)}, /* 0x33 */ {FP_SCALE( 0.0f), FP_SCALE( 3.0f)}, /* 0x34 */ {FP_SCALE(-1.0f), FP_SCALE(-2.0f)}, /* 0x35 */ {FP_SCALE(-2.0f), FP_SCALE( 1.0f)}, /* 0x36 */ {FP_SCALE( 3.0f), FP_SCALE( 0.0f)}, /* 0x37 */ {FP_SCALE( 0.0f), FP_SCALE( 1.0f)}, /* 0x38 */ {FP_SCALE( 1.0f), FP_SCALE(-2.0f)}, /* 0x39 */ {FP_SCALE(-2.0f), FP_SCALE(-1.0f)}, /* 0x3A */ {FP_SCALE( 1.0f), FP_SCALE( 0.0f)}, /* 0x3B */ {FP_SCALE( 0.0f), FP_SCALE(-1.0f)}, /* 0x3C */ {FP_SCALE(-1.0f), FP_SCALE( 2.0f)}, /* 0x3D */ {FP_SCALE( 2.0f), FP_SCALE( 1.0f)}, /* 0x3E */ {FP_SCALE(-1.0f), FP_SCALE( 0.0f)}, /* 0x3F */ {FP_SCALE( 8.0f), FP_SCALE(-3.0f)}, /* 0x40 */ {FP_SCALE(-7.0f), FP_SCALE( 2.0f)}, /* 0x41 */ {FP_SCALE( 2.0f), FP_SCALE( 7.0f)}, /* 0x42 */ {FP_SCALE(-3.0f), FP_SCALE(-8.0f)}, /* 0x43 */ {FP_SCALE(-8.0f), FP_SCALE( 3.0f)}, /* 0x44 */ {FP_SCALE( 7.0f), FP_SCALE(-2.0f)}, /* 0x45 */ {FP_SCALE(-2.0f), FP_SCALE(-7.0f)}, /* 0x46 */ {FP_SCALE( 3.0f), FP_SCALE( 8.0f)}, /* 0x47 */ {FP_SCALE( 8.0f), FP_SCALE( 1.0f)}, /* 0x48 */ {FP_SCALE(-7.0f), FP_SCALE(-2.0f)}, /* 0x49 */ {FP_SCALE(-2.0f), FP_SCALE( 7.0f)}, /* 0x4A */ {FP_SCALE( 1.0f), FP_SCALE(-8.0f)}, /* 0x4B */ {FP_SCALE(-8.0f), FP_SCALE(-1.0f)}, /* 0x4C */ {FP_SCALE( 7.0f), FP_SCALE( 2.0f)}, /* 0x4D */ {FP_SCALE( 2.0f), FP_SCALE(-7.0f)}, /* 0x4E */ {FP_SCALE(-1.0f), FP_SCALE( 8.0f)}, /* 0x4F */ {FP_SCALE(-4.0f), FP_SCALE(-7.0f)}, /* 0x50 */ {FP_SCALE( 5.0f), FP_SCALE( 6.0f)}, /* 0x51 */ {FP_SCALE( 6.0f), FP_SCALE(-5.0f)}, /* 0x52 */ {FP_SCALE(-7.0f), FP_SCALE( 4.0f)}, /* 0x53 */ {FP_SCALE( 4.0f), FP_SCALE( 7.0f)}, /* 0x54 */ {FP_SCALE(-5.0f), FP_SCALE(-6.0f)}, /* 0x55 */ {FP_SCALE(-6.0f), FP_SCALE( 5.0f)}, /* 0x56 */ {FP_SCALE( 7.0f), FP_SCALE(-4.0f)}, /* 0x57 */ {FP_SCALE(-4.0f), FP_SCALE( 5.0f)}, /* 0x58 */ {FP_SCALE( 5.0f), FP_SCALE(-6.0f)}, /* 0x59 */ {FP_SCALE(-6.0f), FP_SCALE(-5.0f)}, /* 0x5A */ {FP_SCALE( 5.0f), FP_SCALE( 4.0f)}, /* 0x5B */ {FP_SCALE( 4.0f), FP_SCALE(-5.0f)}, /* 0x5C */ {FP_SCALE(-5.0f), FP_SCALE( 6.0f)}, /* 0x5D */ {FP_SCALE( 6.0f), FP_SCALE( 5.0f)}, /* 0x5E */ {FP_SCALE(-5.0f), FP_SCALE(-4.0f)}, /* 0x5F */ {FP_SCALE( 4.0f), FP_SCALE(-7.0f)}, /* 0x60 */ {FP_SCALE(-3.0f), FP_SCALE( 6.0f)}, /* 0x61 */ {FP_SCALE( 6.0f), FP_SCALE( 3.0f)}, /* 0x62 */ {FP_SCALE(-7.0f), FP_SCALE(-4.0f)}, /* 0x63 */ {FP_SCALE(-4.0f), FP_SCALE( 7.0f)}, /* 0x64 */ {FP_SCALE( 3.0f), FP_SCALE(-6.0f)}, /* 0x65 */ {FP_SCALE(-6.0f), FP_SCALE(-3.0f)}, /* 0x66 */ {FP_SCALE( 7.0f), FP_SCALE( 4.0f)}, /* 0x67 */ {FP_SCALE( 4.0f), FP_SCALE( 5.0f)}, /* 0x68 */ {FP_SCALE(-3.0f), FP_SCALE(-6.0f)}, /* 0x69 */ {FP_SCALE(-6.0f), FP_SCALE( 3.0f)}, /* 0x6A */ {FP_SCALE( 5.0f), FP_SCALE(-4.0f)}, /* 0x6B */ {FP_SCALE(-4.0f), FP_SCALE(-5.0f)}, /* 0x6C */ {FP_SCALE( 3.0f), FP_SCALE( 6.0f)}, /* 0x6D */ {FP_SCALE( 6.0f), FP_SCALE(-3.0f)}, /* 0x6E */ {FP_SCALE(-5.0f), FP_SCALE( 4.0f)}, /* 0x6F */ {FP_SCALE( 0.0f), FP_SCALE(-7.0f)}, /* 0x70 */ {FP_SCALE( 1.0f), FP_SCALE( 6.0f)}, /* 0x71 */ {FP_SCALE( 6.0f), FP_SCALE(-1.0f)}, /* 0x72 */ {FP_SCALE(-7.0f), FP_SCALE( 0.0f)}, /* 0x73 */ {FP_SCALE( 0.0f), FP_SCALE( 7.0f)}, /* 0x74 */ {FP_SCALE(-1.0f), FP_SCALE(-6.0f)}, /* 0x75 */ {FP_SCALE(-6.0f), FP_SCALE( 1.0f)}, /* 0x76 */ {FP_SCALE( 7.0f), FP_SCALE( 0.0f)}, /* 0x77 */ {FP_SCALE( 0.0f), FP_SCALE( 5.0f)}, /* 0x78 */ {FP_SCALE( 1.0f), FP_SCALE(-6.0f)}, /* 0x79 */ {FP_SCALE(-6.0f), FP_SCALE(-1.0f)}, /* 0x7A */ {FP_SCALE( 5.0f), FP_SCALE( 0.0f)}, /* 0x7B */ {FP_SCALE( 0.0f), FP_SCALE(-5.0f)}, /* 0x7C */ {FP_SCALE(-1.0f), FP_SCALE( 6.0f)}, /* 0x7D */ {FP_SCALE( 6.0f), FP_SCALE( 1.0f)}, /* 0x7E */ {FP_SCALE(-5.0f), FP_SCALE( 0.0f)} /* 0x7F */ }; #if defined(SPANDSP_USE_FIXED_POINTx) static const complexi16_t v17_v32bis_12000_constellation[64] = #else static const complexf_t v17_v32bis_12000_constellation[64] = #endif { {FP_SCALE( 7.0f), FP_SCALE( 1.0f)}, /* 0x00 */ {FP_SCALE(-5.0f), FP_SCALE(-1.0f)}, /* 0x01 */ {FP_SCALE(-1.0f), FP_SCALE( 5.0f)}, /* 0x02 */ {FP_SCALE( 1.0f), FP_SCALE(-7.0f)}, /* 0x03 */ {FP_SCALE(-7.0f), FP_SCALE(-1.0f)}, /* 0x04 */ {FP_SCALE( 5.0f), FP_SCALE( 1.0f)}, /* 0x05 */ {FP_SCALE( 1.0f), FP_SCALE(-5.0f)}, /* 0x06 */ {FP_SCALE(-1.0f), FP_SCALE( 7.0f)}, /* 0x07 */ {FP_SCALE( 3.0f), FP_SCALE(-3.0f)}, /* 0x08 */ {FP_SCALE(-1.0f), FP_SCALE( 3.0f)}, /* 0x09 */ {FP_SCALE( 3.0f), FP_SCALE( 1.0f)}, /* 0x0A */ {FP_SCALE(-3.0f), FP_SCALE(-3.0f)}, /* 0x0B */ {FP_SCALE(-3.0f), FP_SCALE( 3.0f)}, /* 0x0C */ {FP_SCALE( 1.0f), FP_SCALE(-3.0f)}, /* 0x0D */ {FP_SCALE(-3.0f), FP_SCALE(-1.0f)}, /* 0x0E */ {FP_SCALE( 3.0f), FP_SCALE( 3.0f)}, /* 0x0F */ {FP_SCALE( 7.0f), FP_SCALE(-7.0f)}, /* 0x10 */ {FP_SCALE(-5.0f), FP_SCALE( 7.0f)}, /* 0x11 */ {FP_SCALE( 7.0f), FP_SCALE( 5.0f)}, /* 0x12 */ {FP_SCALE(-7.0f), FP_SCALE(-7.0f)}, /* 0x13 */ {FP_SCALE(-7.0f), FP_SCALE( 7.0f)}, /* 0x14 */ {FP_SCALE( 5.0f), FP_SCALE(-7.0f)}, /* 0x15 */ {FP_SCALE(-7.0f), FP_SCALE(-5.0f)}, /* 0x16 */ {FP_SCALE( 7.0f), FP_SCALE( 7.0f)}, /* 0x17 */ {FP_SCALE(-1.0f), FP_SCALE(-7.0f)}, /* 0x18 */ {FP_SCALE( 3.0f), FP_SCALE( 7.0f)}, /* 0x19 */ {FP_SCALE( 7.0f), FP_SCALE(-3.0f)}, /* 0x1A */ {FP_SCALE(-7.0f), FP_SCALE( 1.0f)}, /* 0x1B */ {FP_SCALE( 1.0f), FP_SCALE( 7.0f)}, /* 0x1C */ {FP_SCALE(-3.0f), FP_SCALE(-7.0f)}, /* 0x1D */ {FP_SCALE(-7.0f), FP_SCALE( 3.0f)}, /* 0x1E */ {FP_SCALE( 7.0f), FP_SCALE(-1.0f)}, /* 0x1F */ {FP_SCALE( 3.0f), FP_SCALE( 5.0f)}, /* 0x20 */ {FP_SCALE(-1.0f), FP_SCALE(-5.0f)}, /* 0x21 */ {FP_SCALE(-5.0f), FP_SCALE( 1.0f)}, /* 0x22 */ {FP_SCALE( 5.0f), FP_SCALE(-3.0f)}, /* 0x23 */ {FP_SCALE(-3.0f), FP_SCALE(-5.0f)}, /* 0x24 */ {FP_SCALE( 1.0f), FP_SCALE( 5.0f)}, /* 0x25 */ {FP_SCALE( 5.0f), FP_SCALE(-1.0f)}, /* 0x26 */ {FP_SCALE(-5.0f), FP_SCALE( 3.0f)}, /* 0x27 */ {FP_SCALE(-1.0f), FP_SCALE( 1.0f)}, /* 0x28 */ {FP_SCALE( 3.0f), FP_SCALE(-1.0f)}, /* 0x29 */ {FP_SCALE(-1.0f), FP_SCALE(-3.0f)}, /* 0x2A */ {FP_SCALE( 1.0f), FP_SCALE( 1.0f)}, /* 0x2B */ {FP_SCALE( 1.0f), FP_SCALE(-1.0f)}, /* 0x2C */ {FP_SCALE(-3.0f), FP_SCALE( 1.0f)}, /* 0x2D */ {FP_SCALE( 1.0f), FP_SCALE( 3.0f)}, /* 0x2E */ {FP_SCALE(-1.0f), FP_SCALE(-1.0f)}, /* 0x2F */ {FP_SCALE(-5.0f), FP_SCALE( 5.0f)}, /* 0x30 */ {FP_SCALE( 7.0f), FP_SCALE(-5.0f)}, /* 0x31 */ {FP_SCALE(-5.0f), FP_SCALE(-7.0f)}, /* 0x32 */ {FP_SCALE( 5.0f), FP_SCALE( 5.0f)}, /* 0x33 */ {FP_SCALE( 5.0f), FP_SCALE(-5.0f)}, /* 0x34 */ {FP_SCALE(-7.0f), FP_SCALE( 5.0f)}, /* 0x35 */ {FP_SCALE( 5.0f), FP_SCALE( 7.0f)}, /* 0x36 */ {FP_SCALE(-5.0f), FP_SCALE(-5.0f)}, /* 0x37 */ {FP_SCALE(-5.0f), FP_SCALE(-3.0f)}, /* 0x38 */ {FP_SCALE( 7.0f), FP_SCALE( 3.0f)}, /* 0x39 */ {FP_SCALE( 3.0f), FP_SCALE(-7.0f)}, /* 0x3A */ {FP_SCALE(-3.0f), FP_SCALE( 5.0f)}, /* 0x3B */ {FP_SCALE( 5.0f), FP_SCALE( 3.0f)}, /* 0x3C */ {FP_SCALE(-7.0f), FP_SCALE(-3.0f)}, /* 0x3D */ {FP_SCALE(-3.0f), FP_SCALE( 7.0f)}, /* 0x3E */ {FP_SCALE( 3.0f), FP_SCALE(-5.0f)} /* 0x3F */ }; #if defined(SPANDSP_USE_FIXED_POINTx) static const complexi16_t v17_v32bis_9600_constellation[32] = #else static const complexf_t v17_v32bis_9600_constellation[32] = #endif { {FP_SCALE(-8.0f), FP_SCALE( 2.0f)}, /* 0x00 */ {FP_SCALE(-6.0f), FP_SCALE(-4.0f)}, /* 0x01 */ {FP_SCALE(-4.0f), FP_SCALE( 6.0f)}, /* 0x02 */ {FP_SCALE( 2.0f), FP_SCALE( 8.0f)}, /* 0x03 */ {FP_SCALE( 8.0f), FP_SCALE(-2.0f)}, /* 0x04 */ {FP_SCALE( 6.0f), FP_SCALE( 4.0f)}, /* 0x05 */ {FP_SCALE( 4.0f), FP_SCALE(-6.0f)}, /* 0x06 */ {FP_SCALE(-2.0f), FP_SCALE(-8.0f)}, /* 0x07 */ {FP_SCALE( 0.0f), FP_SCALE( 2.0f)}, /* 0x08 */ {FP_SCALE(-6.0f), FP_SCALE( 4.0f)}, /* 0x09 */ {FP_SCALE( 4.0f), FP_SCALE( 6.0f)}, /* 0x0A */ {FP_SCALE( 2.0f), FP_SCALE( 0.0f)}, /* 0x0B */ {FP_SCALE( 0.0f), FP_SCALE(-2.0f)}, /* 0x0C */ {FP_SCALE( 6.0f), FP_SCALE(-4.0f)}, /* 0x0D */ {FP_SCALE(-4.0f), FP_SCALE(-6.0f)}, /* 0x0E */ {FP_SCALE(-2.0f), FP_SCALE( 0.0f)}, /* 0x0F */ {FP_SCALE( 0.0f), FP_SCALE(-6.0f)}, /* 0x10 */ {FP_SCALE( 2.0f), FP_SCALE(-4.0f)}, /* 0x11 */ {FP_SCALE(-4.0f), FP_SCALE(-2.0f)}, /* 0x12 */ {FP_SCALE(-6.0f), FP_SCALE( 0.0f)}, /* 0x13 */ {FP_SCALE( 0.0f), FP_SCALE( 6.0f)}, /* 0x14 */ {FP_SCALE(-2.0f), FP_SCALE( 4.0f)}, /* 0x15 */ {FP_SCALE( 4.0f), FP_SCALE( 2.0f)}, /* 0x16 */ {FP_SCALE( 6.0f), FP_SCALE( 0.0f)}, /* 0x17 */ {FP_SCALE( 8.0f), FP_SCALE( 2.0f)}, /* 0x18 */ {FP_SCALE( 2.0f), FP_SCALE( 4.0f)}, /* 0x19 */ {FP_SCALE( 4.0f), FP_SCALE(-2.0f)}, /* 0x1A */ {FP_SCALE( 2.0f), FP_SCALE(-8.0f)}, /* 0x1B */ {FP_SCALE(-8.0f), FP_SCALE(-2.0f)}, /* 0x1C */ {FP_SCALE(-2.0f), FP_SCALE(-4.0f)}, /* 0x1D */ {FP_SCALE(-4.0f), FP_SCALE( 2.0f)}, /* 0x1E */ {FP_SCALE(-2.0f), FP_SCALE( 8.0f)} /* 0x1F */ }; #if defined(SPANDSP_USE_FIXED_POINTx) static const complexi16_t v17_v32bis_7200_constellation[16] = #else static const complexf_t v17_v32bis_7200_constellation[16] = #endif { {FP_SCALE( 6.0f), FP_SCALE(-6.0f)}, /* 0x00 */ {FP_SCALE(-2.0f), FP_SCALE( 6.0f)}, /* 0x01 */ {FP_SCALE( 6.0f), FP_SCALE( 2.0f)}, /* 0x02 */ {FP_SCALE(-6.0f), FP_SCALE(-6.0f)}, /* 0x03 */ {FP_SCALE(-6.0f), FP_SCALE( 6.0f)}, /* 0x04 */ {FP_SCALE( 2.0f), FP_SCALE(-6.0f)}, /* 0x05 */ {FP_SCALE(-6.0f), FP_SCALE(-2.0f)}, /* 0x06 */ {FP_SCALE( 6.0f), FP_SCALE( 6.0f)}, /* 0x07 */ {FP_SCALE(-2.0f), FP_SCALE( 2.0f)}, /* 0x08 */ {FP_SCALE( 6.0f), FP_SCALE(-2.0f)}, /* 0x09 */ {FP_SCALE(-2.0f), FP_SCALE(-6.0f)}, /* 0x0A */ {FP_SCALE( 2.0f), FP_SCALE( 2.0f)}, /* 0x0B */ {FP_SCALE( 2.0f), FP_SCALE(-2.0f)}, /* 0x0C */ {FP_SCALE(-6.0f), FP_SCALE( 2.0f)}, /* 0x0D */ {FP_SCALE( 2.0f), FP_SCALE( 6.0f)}, /* 0x0E */ {FP_SCALE(-2.0f), FP_SCALE(-2.0f)} /* 0x0F */ }; /* This one does not exist in V.17 as a data constellation. It is only the equaliser training constellation. In V.32/V.32bis it is a data mode. */ #if defined(SPANDSP_USE_FIXED_POINTx) static const complexi16_t v17_v32bis_4800_constellation[4] = #else static const complexf_t v17_v32bis_4800_constellation[4] = #endif { {FP_SCALE(-6.0f), FP_SCALE(-2.0f)}, /* 0x00 */ {FP_SCALE(-2.0f), FP_SCALE( 6.0f)}, /* 0x01 */ {FP_SCALE( 2.0f), FP_SCALE(-6.0f)}, /* 0x02 */ {FP_SCALE( 6.0f), FP_SCALE( 2.0f)} /* 0x03 */ }; #if defined(SPANDSP_USE_FIXED_POINTx) static const complexi16_t v17_v32bis_abcd_constellation[4] = #else static const complexf_t v17_v32bis_abcd_constellation[4] = #endif { {FP_SCALE(-6.0f), FP_SCALE(-2.0f)}, /* A */ {FP_SCALE( 2.0f), FP_SCALE(-6.0f)}, /* B */ {FP_SCALE( 6.0f), FP_SCALE( 2.0f)}, /* C */ {FP_SCALE(-2.0f), FP_SCALE( 6.0f)} /* D */ }; /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp.h.in0000664000175000017500000000766712343627441013153 00000000000000/* * SpanDSP - a series of DSP components for telephony * * spandsp.h - The head guy amongst the headers * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_H_) #define _SPANDSP_H_ @SPANDSP_USE_FIXED_POINT@ @SPANDSP_MISALIGNED_ACCESS_FAILS@ @SPANDSP_USE_EXPORT_CAPABILITY@ #include @INSERT_INTTYPES_HEADER@ #include #include #include @INSERT_MATH_HEADER@ @INSERT_STDBOOL_HEADER@ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /*#include */ #include #include #include /*#include */ #include #include #include #include #include #include #include /*#include */ /*#include */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif #if defined(SPANDSP_EXPOSE_INTERNAL_STRUCTURES) #include #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/vector_float.c0000664000175000017500000005473212100732110013530 00000000000000/* * SpanDSP - a series of DSP components for telephony * * vector_float.c - Floating vector arithmetic routines. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include #include "floating_fudge.h" #include "mmx_sse_decs.h" #include "spandsp/telephony.h" #include "spandsp/vector_float.h" #if defined(__GNUC__) && defined(SPANDSP_USE_SSE2) SPAN_DECLARE(void) vec_copyf(float z[], const float x[], int n) { int i; __m128 n1; if ((i = n & ~3)) { for (i -= 4; i >= 0; i -= 4) { n1 = _mm_loadu_ps(x + i); _mm_storeu_ps(z + i, n1); } } /* Now deal with the last 1 to 3 elements, which don't fill an SSE2 register */ switch (n & 3) { case 3: z[n - 3] = x[n - 3]; case 2: z[n - 2] = x[n - 2]; case 1: z[n - 1] = x[n - 1]; } } #else SPAN_DECLARE(void) vec_copyf(float z[], const float x[], int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]; } #endif /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) vec_copy(double z[], const double x[], int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_copyl(long double z[], const long double x[], int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]; } /*- End of function --------------------------------------------------------*/ #endif #if defined(__GNUC__) && defined(SPANDSP_USE_SSE2) SPAN_DECLARE(void) vec_negatef(float z[], const float x[], int n) { int i; static const uint32_t mask = 0x80000000; static const float *fmask = (float *) &mask; __m128 n1; __m128 n2; if ((i = n & ~3)) { n2 = _mm_set1_ps(*fmask); for (i -= 4; i >= 0; i -= 4) { n1 = _mm_loadu_ps(x + i); n1 = _mm_xor_ps(n1, n2); _mm_storeu_ps(z + i, n1); } } /* Now deal with the last 1 to 3 elements, which don't fill an SSE2 register */ switch (n & 3) { case 3: z[n - 3] = -x[n - 3]; case 2: z[n - 2] = -x[n - 2]; case 1: z[n - 1] = -x[n - 1]; } } #else SPAN_DECLARE(void) vec_negatef(float z[], const float x[], int n) { int i; for (i = 0; i < n; i++) z[i] = -x[i]; } #endif /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) vec_negate(double z[], const double x[], int n) { int i; for (i = 0; i < n; i++) z[i] = -x[i]; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_negatel(long double z[], const long double x[], int n) { int i; for (i = 0; i < n; i++) z[i] = -x[i]; } /*- End of function --------------------------------------------------------*/ #endif #if defined(__GNUC__) && defined(SPANDSP_USE_SSE2) SPAN_DECLARE(void) vec_zerof(float z[], int n) { int i; __m128 n1; if ((i = n & ~3)) { n1 = _mm_setzero_ps(); for (i -= 4; i >= 0; i -= 4) _mm_storeu_ps(z + i, n1); } /* Now deal with the last 1 to 3 elements, which don't fill an SSE2 register */ switch (n & 3) { case 3: z[n - 3] = 0; case 2: z[n - 2] = 0; case 1: z[n - 1] = 0; } } #else SPAN_DECLARE(void) vec_zerof(float z[], int n) { int i; for (i = 0; i < n; i++) z[i] = 0.0f; } #endif /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) vec_zero(double z[], int n) { int i; for (i = 0; i < n; i++) z[i] = 0.0; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_zerol(long double z[], int n) { int i; for (i = 0; i < n; i++) z[i] = 0.0L; } /*- End of function --------------------------------------------------------*/ #endif #if defined(__GNUC__) && defined(SPANDSP_USE_SSE2) SPAN_DECLARE(void) vec_setf(float z[], float x, int n) { int i; __m128 n1; if ((i = n & ~3)) { n1 = _mm_set1_ps(x); for (i -= 4; i >= 0; i -= 4) _mm_storeu_ps(z + i, n1); } /* Now deal with the last 1 to 3 elements, which don't fill an SSE2 register */ switch (n & 3) { case 3: z[n - 3] = x; case 2: z[n - 2] = x; case 1: z[n - 1] = x; } } #else SPAN_DECLARE(void) vec_setf(float z[], float x, int n) { int i; for (i = 0; i < n; i++) z[i] = x; } #endif /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) vec_set(double z[], double x, int n) { int i; for (i = 0; i < n; i++) z[i] = x; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_setl(long double z[], long double x, int n) { int i; for (i = 0; i < n; i++) z[i] = x; } /*- End of function --------------------------------------------------------*/ #endif #if defined(__GNUC__) && defined(SPANDSP_USE_SSE2) SPAN_DECLARE(void) vec_addf(float z[], const float x[], const float y[], int n) { int i; __m128 n1; __m128 n2; if ((i = n & ~3)) { for (i -= 4; i >= 0; i -= 4) { n1 = _mm_loadu_ps(x + i); n2 = _mm_loadu_ps(y + i); n2 = _mm_add_ps(n1, n2); _mm_storeu_ps(z + i, n2); } } /* Now deal with the last 1 to 3 elements, which don't fill an SSE2 register */ switch (n & 3) { case 3: z[n - 3] = x[n - 3] + y[n - 3]; case 2: z[n - 2] = x[n - 2] + y[n - 2]; case 1: z[n - 1] = x[n - 1] + y[n - 1]; } } #else SPAN_DECLARE(void) vec_addf(float z[], const float x[], const float y[], int n) { int i; for (i = 0; i < n; i++) z[i] = x[i] + y[i]; } #endif /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) vec_add(double z[], const double x[], const double y[], int n) { int i; for (i = 0; i < n; i++) z[i] = x[i] + y[i]; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_addl(long double z[], const long double x[], const long double y[], int n) { int i; for (i = 0; i < n; i++) z[i] = x[i] + y[i]; } /*- End of function --------------------------------------------------------*/ #endif #if defined(__GNUC__) && defined(SPANDSP_USE_SSE2) SPAN_DECLARE(void) vec_scaledxy_addf(float z[], const float x[], float x_scale, const float y[], float y_scale, int n) { int i; __m128 n1; __m128 n2; __m128 n3; __m128 n4; if ((i = n & ~3)) { n3 = _mm_set1_ps(x_scale); n4 = _mm_set1_ps(y_scale); for (i -= 4; i >= 0; i -= 4) { n1 = _mm_loadu_ps(x + i); n2 = _mm_loadu_ps(y + i); n1 = _mm_mul_ps(n1, n3); n2 = _mm_mul_ps(n2, n4); n2 = _mm_add_ps(n1, n2); _mm_storeu_ps(z + i, n2); } } /* Now deal with the last 1 to 3 elements, which don't fill an SSE2 register */ switch (n & 3) { case 3: z[n - 3] = x[n - 3]*x_scale + y[n - 3]*y_scale; case 2: z[n - 2] = x[n - 2]*x_scale + y[n - 2]*y_scale; case 1: z[n - 1] = x[n - 1]*x_scale + y[n - 1]*y_scale; } } #else SPAN_DECLARE(void) vec_scaledxy_addf(float z[], const float x[], float x_scale, const float y[], float y_scale, int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]*x_scale + y[i]*y_scale; } #endif /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) vec_scaledxy_add(double z[], const double x[], double x_scale, const double y[], double y_scale, int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]*x_scale + y[i]*y_scale; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_scaledxy_addl(long double z[], const long double x[], long double x_scale, const long double y[], long double y_scale, int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]*x_scale + y[i]*y_scale; } /*- End of function --------------------------------------------------------*/ #endif #if defined(__GNUC__) && defined(SPANDSP_USE_SSE2) SPAN_DECLARE(void) vec_scaledy_addf(float z[], const float x[], const float y[], float y_scale, int n) { int i; __m128 n1; __m128 n2; __m128 n3; if ((i = n & ~3)) { n3 = _mm_set1_ps(y_scale); for (i -= 4; i >= 0; i -= 4) { n1 = _mm_loadu_ps(x + i); n2 = _mm_loadu_ps(y + i); n2 = _mm_mul_ps(n2, n3); n2 = _mm_add_ps(n1, n2); _mm_storeu_ps(z + i, n2); } } /* Now deal with the last 1 to 3 elements, which don't fill an SSE2 register */ switch (n & 3) { case 3: z[n - 3] = x[n - 3] + y[n - 3]*y_scale; case 2: z[n - 2] = x[n - 2] + y[n - 2]*y_scale; case 1: z[n - 1] = x[n - 1] + y[n - 1]*y_scale; } } #else SPAN_DECLARE(void) vec_scaledy_addf(float z[], const float x[], const float y[], float y_scale, int n) { int i; for (i = 0; i < n; i++) z[i] = x[i] + y[i]*y_scale; } #endif /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) vec_scaledy_add(double z[], const double x[], const double y[], double y_scale, int n) { int i; for (i = 0; i < n; i++) z[i] = x[i] + y[i]*y_scale; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_scaledy_addl(long double z[], const long double x[], const long double y[], long double y_scale, int n) { int i; for (i = 0; i < n; i++) z[i] = x[i] + y[i]*y_scale; } /*- End of function --------------------------------------------------------*/ #endif #if defined(__GNUC__) && defined(SPANDSP_USE_SSE2) SPAN_DECLARE(void) vec_subf(float z[], const float x[], const float y[], int n) { int i; __m128 n1; __m128 n2; if ((i = n & ~3)) { for (i -= 4; i >= 0; i -= 4) { n1 = _mm_loadu_ps(x + i); n2 = _mm_loadu_ps(y + i); n2 = _mm_sub_ps(n1, n2); _mm_storeu_ps(z + i, n2); } } /* Now deal with the last 1 to 3 elements, which don't fill an SSE2 register */ switch (n & 3) { case 3: z[n - 3] = x[n - 3] - y[n - 3]; case 2: z[n - 2] = x[n - 2] - y[n - 2]; case 1: z[n - 1] = x[n - 1] - y[n - 1]; } } #else SPAN_DECLARE(void) vec_subf(float z[], const float x[], const float y[], int n) { int i; for (i = 0; i < n; i++) z[i] = x[i] - y[i]; } #endif /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) vec_sub(double z[], const double x[], const double y[], int n) { int i; for (i = 0; i < n; i++) z[i] = x[i] - y[i]; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_subl(long double z[], const long double x[], const long double y[], int n) { int i; for (i = 0; i < n; i++) z[i] = x[i] - y[i]; } /*- End of function --------------------------------------------------------*/ #endif SPAN_DECLARE(void) vec_scaledxy_subf(float z[], const float x[], float x_scale, const float y[], float y_scale, int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]*x_scale - y[i]*y_scale; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) vec_scaledxy_sub(double z[], const double x[], double x_scale, const double y[], double y_scale, int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]*x_scale - y[i]*y_scale; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_scaledxy_subl(long double z[], const long double x[], long double x_scale, const long double y[], long double y_scale, int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]*x_scale - y[i]*y_scale; } /*- End of function --------------------------------------------------------*/ #endif #if defined(__GNUC__) && defined(SPANDSP_USE_SSE2) SPAN_DECLARE(void) vec_scalar_mulf(float z[], const float x[], float y, int n) { int i; __m128 n1; __m128 n2; if ((i = n & ~3)) { n2 = _mm_set1_ps(y); for (i -= 4; i >= 0; i -= 4) { n1 = _mm_loadu_ps(x + i); n1 = _mm_mul_ps(n1, n2); _mm_storeu_ps(z + i, n1); } } /* Now deal with the last 1 to 3 elements, which don't fill an SSE2 register */ switch (n & 3) { case 3: z[n - 3] = x[n - 3]*y; case 2: z[n - 2] = x[n - 2]*y; case 1: z[n - 1] = x[n - 1]*y; } } #else SPAN_DECLARE(void) vec_scalar_mulf(float z[], const float x[], float y, int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]*y; } #endif /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) vec_scalar_mul(double z[], const double x[], double y, int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]*y; } /*- End of function --------------------------------------------------------*/ #if defined(__GNUC__) && defined(SPANDSP_USE_SSE2) SPAN_DECLARE(void) vec_scalar_addf(float z[], const float x[], float y, int n) { int i; __m128 n1; __m128 n2; if ((i = n & ~3)) { n2 = _mm_set1_ps(y); for (i -= 4; i >= 0; i -= 4) { n1 = _mm_loadu_ps(x + i); n1 = _mm_add_ps(n1, n2); _mm_storeu_ps(z + i, n1); } } /* Now deal with the last 1 to 3 elements, which don't fill an SSE2 register */ switch (n & 3) { case 3: z[n - 3] = x[n - 3] + y; case 2: z[n - 2] = x[n - 2] + y; case 1: z[n - 1] = x[n - 1] + y; } } #else SPAN_DECLARE(void) vec_scalar_addf(float z[], const float x[], float y, int n) { int i; for (i = 0; i < n; i++) z[i] = x[i] + y; } #endif /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) vec_scalar_add(double z[], const double x[], double y, int n) { int i; for (i = 0; i < n; i++) z[i] = x[i] + y; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_scalar_addl(long double z[], const long double x[], long double y, int n) { int i; for (i = 0; i < n; i++) z[i] = x[i] + y; } /*- End of function --------------------------------------------------------*/ #endif #if defined(__GNUC__) && defined(SPANDSP_USE_SSE2) SPAN_DECLARE(void) vec_scalar_subf(float z[], const float x[], float y, int n) { int i; __m128 n1; __m128 n2; if ((i = n & ~3)) { n2 = _mm_set1_ps(y); for (i -= 4; i >= 0; i -= 4) { n1 = _mm_loadu_ps(x + i); n1 = _mm_sub_ps(n1, n2); _mm_storeu_ps(z + i, n1); } } /* Now deal with the last 1 to 3 elements, which don't fill an SSE2 register */ switch (n & 3) { case 3: z[n - 3] = x[n - 3] - y; case 2: z[n - 2] = x[n - 2] - y; case 1: z[n - 1] = x[n - 1] - y; } } #else SPAN_DECLARE(void) vec_scalar_subf(float z[], const float x[], float y, int n) { int i; for (i = 0; i < n; i++) z[i] = x[i] - y; } #endif /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) vec_scalar_sub(double z[], const double x[], double y, int n) { int i; for (i = 0; i < n; i++) z[i] = x[i] - y; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_scalar_subl(long double z[], const long double x[], long double y, int n) { int i; for (i = 0; i < n; i++) z[i] = x[i] - y; } /*- End of function --------------------------------------------------------*/ #endif #if defined(__GNUC__) && defined(SPANDSP_USE_SSE2) SPAN_DECLARE(void) vec_mulf(float z[], const float x[], const float y[], int n) { int i; __m128 n1; __m128 n2; __m128 n3; if ((i = n & ~3)) { for (i -= 4; i >= 0; i -= 4) { n1 = _mm_loadu_ps(x + i); n2 = _mm_loadu_ps(y + i); n3 = _mm_mul_ps(n1, n2); _mm_storeu_ps(z + i, n3); } } /* Now deal with the last 1 to 3 elements, which don't fill an SSE2 register */ switch (n & 3) { case 3: z[n - 3] = x[n - 3]*y[n - 3]; case 2: z[n - 2] = x[n - 2]*y[n - 2]; case 1: z[n - 1] = x[n - 1]*y[n - 1]; } } #else SPAN_DECLARE(void) vec_mulf(float z[], const float x[], const float y[], int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]*y[i]; } /*- End of function --------------------------------------------------------*/ #endif SPAN_DECLARE(void) vec_mul(double z[], const double x[], const double y[], int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]*y[i]; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_mull(long double z[], const long double x[], const long double y[], int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]*y[i]; } /*- End of function --------------------------------------------------------*/ #endif #if defined(__GNUC__) && defined(SPANDSP_USE_SSE2) SPAN_DECLARE(float) vec_dot_prodf(const float x[], const float y[], int n) { int i; float z; __m128 n1; __m128 n2; __m128 n3; __m128 n4; z = 0.0f; if ((i = n & ~3)) { n4 = _mm_setzero_ps(); //sets sum to zero for (i -= 4; i >= 0; i -= 4) { n1 = _mm_loadu_ps(x + i); n2 = _mm_loadu_ps(y + i); n3 = _mm_mul_ps(n1, n2); n4 = _mm_add_ps(n4, n3); } n4 = _mm_add_ps(_mm_movehl_ps(n4, n4), n4); n4 = _mm_add_ss(_mm_shuffle_ps(n4, n4, 1), n4); _mm_store_ss(&z, n4); } /* Now deal with the last 1 to 3 elements, which don't fill an SSE2 register */ switch (n & 3) { case 3: z += x[n - 3]*y[n - 3]; case 2: z += x[n - 2]*y[n - 2]; case 1: z += x[n - 1]*y[n - 1]; } return z; } #else SPAN_DECLARE(float) vec_dot_prodf(const float x[], const float y[], int n) { int i; float z; z = 0.0f; for (i = 0; i < n; i++) z += x[i]*y[i]; return z; } /*- End of function --------------------------------------------------------*/ #endif SPAN_DECLARE(double) vec_dot_prod(const double x[], const double y[], int n) { int i; double z; z = 0.0; for (i = 0; i < n; i++) z += x[i]*y[i]; return z; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(long double) vec_dot_prodl(const long double x[], const long double y[], int n) { int i; long double z; z = 0.0L; for (i = 0; i < n; i++) z += x[i]*y[i]; return z; } /*- End of function --------------------------------------------------------*/ #endif SPAN_DECLARE(float) vec_circular_dot_prodf(const float x[], const float y[], int n, int pos) { float z; z = vec_dot_prodf(&x[pos], &y[0], n - pos); z += vec_dot_prodf(&x[0], &y[n - pos], pos); return z; } /*- End of function --------------------------------------------------------*/ #define LMS_LEAK_RATE 0.9999f #if defined(__GNUC__) && defined(SPANDSP_USE_SSE2) SPAN_DECLARE(void) vec_lmsf(const float x[], float y[], int n, float error) { int i; __m128 n1; __m128 n2; __m128 n3; __m128 n4; if ((i = n & ~3)) { n3 = _mm_set1_ps(error); n4 = _mm_set1_ps(LMS_LEAK_RATE); for (i -= 4; i >= 0; i -= 4) { n1 = _mm_loadu_ps(x + i); n2 = _mm_loadu_ps(y + i); n1 = _mm_mul_ps(n1, n3); n2 = _mm_mul_ps(n2, n4); n1 = _mm_add_ps(n1, n2); _mm_storeu_ps(y + i, n1); } } /* Now deal with the last 1 to 3 elements, which don't fill an SSE2 register */ switch (n & 3) { case 3: y[n - 3] = y[n - 3]*LMS_LEAK_RATE + x[n - 3]*error; case 2: y[n - 2] = y[n - 2]*LMS_LEAK_RATE + x[n - 2]*error; case 1: y[n - 1] = y[n - 1]*LMS_LEAK_RATE + x[n - 1]*error; } } #else SPAN_DECLARE(void) vec_lmsf(const float x[], float y[], int n, float error) { int i; for (i = 0; i < n; i++) { /* Leak a little to tame uncontrolled wandering */ y[i] = y[i]*LMS_LEAK_RATE + x[i]*error; } } #endif /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) vec_circular_lmsf(const float x[], float y[], int n, int pos, float error) { vec_lmsf(&x[pos], &y[0], n - pos, error); vec_lmsf(&x[0], &y[n - pos], pos, error); } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/make_at_dictionary.c0000664000175000017500000007756511422612262014713 00000000000000/* * SpanDSP - a series of DSP components for telephony * * make_at_dictionary.c - Generate a trie based dictionary for the AT * commands supported by the AT interpreter. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include const char *wordlist[] = { " ", /* Dummy to absorb spaces in commands */ "&C", /* V.250 6.2.8 - Circuit 109 (received line signal detector), behaviour */ "&D", /* V.250 6.2.9 - Circuit 108 (data terminal ready) behaviour */ "&F", /* V.250 6.1.2 - Set to factory-defined configuration */ "+A8A", /* V.251 6.3 - V.8 calling tone indication */ "+A8C", /* V.251 6.2 - V.8 answer signal indication */ "+A8E", /* V.251 5.1 - V.8 and V.8bis operation controls */ "+A8I", /* V.251 6.1 - V.8 CI signal indication */ "+A8J", /* V.251 6.4 - V.8 negotiation complete */ "+A8M", /* V.251 5.2 - Send V.8 menu signals */ "+A8R", /* V.251 6.6 - V.8bis signal and message reporting */ "+A8T", /* V.251 5.3 - Send V.8bis signal and/or message(s) */ "+ASTO", /* V.250 6.3.15 - Store telephone number */ "+CAAP", /* 3GPP TS 27.007 7.25 - Automatic answer for eMLPP Service */ "+CACM", /* 3GPP TS 27.007 8.25 - Accumulated call meter */ "+CACSP", /* 3GPP TS 27.007 11.1.7 - Voice Group or Voice Broadcast Call State Attribute Presentation */ "+CAD", /* IS-99 5.6.3 - Query analogue or digital service */ "+CAEMLPP", /* 3GPP TS 27.007 7.22 - eMLPP Priority Registration and Interrogation */ "+CAHLD", /* 3GPP TS 27.007 11.1.3 - Leave an ongoing Voice Group or Voice Broadcast Call */ "+CAJOIN", /* 3GPP TS 27.007 11.1.1 - Accept an incoming Voice Group or Voice Broadcast Call */ "+CALA", /* 3GPP TS 27.007 8.16 - Alarm */ "+CALCC", /* 3GPP TS 27.007 11.1.6 - List current Voice Group and Voice Broadcast Calls */ "+CALD", /* 3GPP TS 27.007 8.38 - Delete alar m */ "+CALM", /* 3GPP TS 27.007 8.20 - Alert sound mode */ "+CAMM", /* 3GPP TS 27.007 8.26 - Accumulated call meter maximum */ "+CANCHEV", /* 3GPP TS 27.007 11.1.8 - NCH Support Indication */ "+CAOC", /* 3GPP TS 27.007 7.16 - Advice of Charge */ "+CAPD", /* 3GPP TS 27.007 8.39 - Postpone or dismiss an alarm */ "+CAPTT", /* 3GPP TS 27.007 11.1.4 - Talker Access for Voice Group Call */ "+CAREJ", /* 3GPP TS 27.007 11.1.2 - Reject an incoming Voice Group or Voice Broadcast Call */ "+CAULEV", /* 3GPP TS 27.007 11.1.5 - Voice Group Call Uplink Status Presentation */ "+CBC", /* 3GPP TS 27.007 8.4 - Battery charge */ "+CBCS", /* 3GPP TS 27.007 11.3.2 - VBS subscriptions and GId status */ "+CBIP", /* IS-99 5.6 - Base station IP address */ "+CBST", /* 3GPP TS 27.007 6.7 - Select bearer service type */ "+CCFC", /* 3GPP TS 27.007 7.11 - Call forwarding number and conditions */ "+CCLK", /* 3GPP TS 27.007 8.15 - Clock */ "+CCS", /* IS-135 4.1.22 - Compression status */ "+CCUG", /* 3GPP TS 27.007 7.10 - Closed user group */ "+CCWA", /* 3GPP TS 27.007 7.12 - Call waiting */ "+CCWE", /* 3GPP TS 27.007 8.28 - Call Meter maximum event */ "+CDIP", /* 3GPP TS 27.007 7.9 - Called line identification presentation */ "+CDIS", /* 3GPP TS 27.007 8.8 - Display control */ "+CDV", /* IS-99 5.6 - Dial command for voice call */ "+CEER", /* 3GPP TS 27.007 6.10 - Extended error report */ "+CESP", /* GSM07.05 3.2.4 - Enter SMS block mode protocol */ "+CFCS", /* 3GPP TS 27.007 7.24 - Fast call setup conditions */ "+CFG", /* IS-99 5.6 - Configuration string */ "+CFUN", /* 3GPP TS 27.007 8.2 - Set phone functionality */ "+CGACT", /* 3GPP TS 27.007 10.1.10 - PDP context activate or deactivate */ "+CGANS", /* 3GPP TS 27.007 10.1.16 - Manual response to a network request for PDP context activation */ "+CGATT", /* 3GPP TS 27.007 10.1.9 - PS attach or detach */ "+CGAUTO", /* 3GPP TS 27.007 10.1.15 - Automatic response to a network request for PDP context activation */ "+CGCAP", /* IS-99 5.6 - Request complete capabilities list */ "+CGCLASS", /* 3GPP TS 27.007 10.1.17 - GPRS mobile station class (GPRS only) */ "+CGCLOSP", /* 3GPP TS 27.007 10.1.13 - Configure local octet stream PAD parameters (Obsolete) */ "+CGCLPAD", /* 3GPP TS 27.007 10.1.12 - Configure local triple-X PAD parameters (GPRS only) (Obsolete) */ "+CGCMOD", /* 3GPP TS 27.007 10.1.11 - PDP Context Modify */ "+CGCS", /* 3GPP TS 27.007 11.3.1 - VGCS subscriptions and GId status */ "+CGDATA", /* 3GPP TS 27.007 10.1.12 - Enter data state */ "+CGDCONT", /* 3GPP TS 27.007 10.1.1 - Define PDP Context */ "+CGDSCONT",/* 3GPP TS 27.007 10.1.2 - Define Secondary PDP Context */ "+CGEQMIN", /* 3GPP TS 27.007 10.1.7 - 3G Quality of Service Profile (Minimum acceptable) */ "+CGEQNEG", /* 3GPP TS 27.007 10.1.8 - 3G Quality of Service Profile (Negotiated) */ "+CGEQREQ", /* 3GPP TS 27.007 10.1.6 - 3G Quality of Service Profile (Requested) */ "+CGEREP", /* 3GPP TS 27.007 10.1.18 - Packet Domain event reporting */ "+CGMI", /* 3GPP TS 27.007 5.1 - Request manufacturer identification */ "+CGMM", /* 3GPP TS 27.007 5.2 - Request model identification */ "+CGMR", /* 3GPP TS 27.007 5.3 - Request revision identification */ "+CGOI", /* IS-99 5.6 - Request global object identification */ "+CGPADDR", /* 3GPP TS 27.007 10.1.14 - Show PDP address */ "+CGQMIN", /* 3GPP TS 27.007 10.1.5 - Quality of Service Profile (Minimum acceptable) */ "+CGQREQ", /* 3GPP TS 27.007 10.1.4 - Quality of Service Profile (Requested) */ "+CGREG", /* 3GPP TS 27.007 10.1.19 - GPRS network registration status */ "+CGSMS", /* 3GPP TS 27.007 10.1.20 - Select service for MO SMS messages */ "+CGSN", /* 3GPP TS 27.007 5.4 - Request product serial number identification */ "+CGTFT", /* 3GPP TS 27.007 10.1.3 - Traffic Flow Template */ "+CHLD", /* 3GPP TS 27.007 7.13 - Call related supplementary services */ "+CHSA", /* 3GPP TS 27.007 6.18 - HSCSD non-transparent asymmetry configuration */ "+CHSC", /* 3GPP TS 27.007 6.15 - HSCSD current call parameters */ "+CHSD", /* 3GPP TS 27.007 6.12 - HSCSD device parameters */ "+CHSN", /* 3GPP TS 27.007 6.14 - HSCSD non-transparent call configuration */ "+CHSR", /* 3GPP TS 27.007 6.16 - HSCSD parameters report */ "+CHST", /* 3GPP TS 27.007 6.13 - HSCSD transparent call configuration */ "+CHSU", /* 3GPP TS 27.007 6.17 - HSCSD automatic user initiated upgrading */ "+CHUP", /* 3GPP TS 27.007 6.5 - Hangup call */ "+CHV", /* IS-99 5.6 - Hang-up voice */ "+CIMI", /* 3GPP TS 27.007 5.6 - Request international mobile subscriber identity */ "+CIND", /* 3GPP TS 27.007 8.9 - Indicator control */ "+CIT", /* IS-99 5.6 - Command state inactivity timer */ "+CKPD", /* 3GPP TS 27.007 8.7 - Keypad control */ "+CLAC", /* 3GPP TS 27.007 8.37 - List all available AT commands */ "+CLAE", /* 3GPP TS 27.007 8.31 - Language Event */ "+CLAN", /* 3GPP TS 27.007 8.30 - Set Language */ "+CLCC", /* 3GPP TS 27.007 7.18 - List current calls */ "+CLCK", /* 3GPP TS 27.007 7.4 - Facility lock */ "+CLIP", /* 3GPP TS 27.007 7.6 - Calling line identification presentation */ "+CLIR", /* 3GPP TS 27.007 7.7 - Calling line identification restriction */ "+CLVL", /* 3GPP TS 27.007 8.23 - Loudspeaker volume level */ "+CMAR", /* 3GPP TS 27.007 8.36 - Master reset */ "+CMEC", /* 3GPP TS 27.007 8.6 - Mobile termination control mode */ "+CMEE", /* GSM07.07 9.1 - Report mobile equipment error */ "+CMER", /* 3GPP TS 27.007 8.10 - Mobile termination event reporting */ "+CMGC", /* GSM07.05 3.5.5/4.5 - Send command */ "+CMGD", /* GSM07.05 3.5.4 - Delete message */ "+CMGF", /* GSM07.05 3.2.3 - Message Format */ "+CMGL", /* GSM07.05 3.4.2/4.1 - List messages */ "+CMGR", /* GSM07.05 3.4.3/4.2 - Read message */ "+CMGS", /* GSM07.05 3.5.1/4.3 - Send message */ "+CMGW", /* GSM07.05 3.5.3/4.4 - Write message to memory */ "+CMIP", /* IS-99 5.6 - Mobile station IP address */ "+CMM", /* IS-135 4.1.23 - Menu map */ "+CMMS", /* GSM07.05 3.5.6 - More messages to send */ "+CMOD", /* 3GPP TS 27.007 6.4 - Call mode */ "+CMSS", /* GSM07.05 3.5.2/4.7 - Send message from storage */ "+CMUT", /* 3GPP TS 27.007 8.24 - Mute control */ "+CMUX", /* 3GPP TS 27.007 5.7 - Multiplexing mode */ "+CNMA", /* GSM07.05 3.4.4/4.6 - New message acknowledgement to terminal adapter */ "+CNMI", /* GSM07.05 3.4.1 - New message indications to terminal equipment */ "+CNUM", /* 3GPP TS 27.007 7.1 - Subscriber number */ "+COLP", /* 3GPP TS 27.007 7.8 - Connected line identification presentation */ "+COPN", /* 3GPP TS 27.007 7.21 - Read operator names */ "+COPS", /* 3GPP TS 27.007 7.3 - PLMN selection */ "+COS", /* IS-135 4.1.24 - Originating service */ "+COTDI", /* 3GPP TS 27.007 11.1.9 - Originator to Dispatcher Information */ "+CPAS", /* 3GPP TS 27.007 8.1 - Phone activity status */ "+CPBF", /* 3GPP TS 27.007 8.13 - Find phonebook entries */ "+CPBR", /* 3GPP TS 27.007 8.12 - Read phonebook entries */ "+CPBS", /* 3GPP TS 27.007 8.11 - Select phonebook memory storage */ "+CPBW", /* 3GPP TS 27.007 8.14 - Write phonebook entry */ "+CPIN", /* 3GPP TS 27.007 8.3 - Enter PIN */ "+CPLS", /* 3GPP TS 27.007 7.20 - Selection of preferred PLMN list */ "+CPMS", /* GSM07.05 3.2.2 - Preferred message storage */ "+CPOL", /* 3GPP TS 27.007 7.19 - Preferred PLMN list */ "+CPPS", /* 3GPP TS 27.007 7.23 - eMLPP subscriptions */ "+CPROT", /* 3GPP TS 27.007 8.42 - Enter protocol mode */ "+CPUC", /* 3GPP TS 27.007 8.27 - Price per unit and currency table */ "+CPWC", /* 3GPP TS 27.007 8.29 - Power class */ "+CPWD", /* 3GPP TS 27.007 7.5 - Change password */ "+CQD", /* IS-135 4.1.25 - Query disconnect timer */ "+CR", /* 3GPP TS 27.007 6.9 - Service reporting control */ "+CRC", /* 3GPP TS 27.007 6.11 - Cellular result codes */ "+CREG", /* 3GPP TS 27.007 7.2 - Network registration */ "+CRES", /* GSM07.05 3.3.6 - Restore Settings */ "+CRLP", /* 3GPP TS 27.007 6.8 - Radio link protocol */ "+CRM", /* IS-99 5.6 - Set rm interface protocol */ "+CRMC", /* 3GPP TS 27.007 8.34 - Ring Melody Control */ "+CRMP", /* 3GPP TS 27.007 8.35 - Ring Melody Playback */ "+CRSL", /* 3GPP TS 27.007 8.21 - Ringer sound level */ "+CRSM", /* 3GPP TS 27.007 8.18 - Restricted SIM access */ "+CSAS", /* GSM07.05 3.3.5 - Save settings */ "+CSCA", /* GSM07.05 3.3.1 - Service centre address */ "+CSCB", /* GSM07.05 3.3.4 - Select cell broadcast message types */ "+CSCC", /* 3GPP TS 27.007 8.19 - Secure control command */ "+CSCS", /* 3GPP TS 27.007 5.5 - Select TE character set */ "+CSDF", /* 3GPP TS 27.007 6.22 - Settings date format */ "+CSDH", /* GSM07.05 3.3.3 - Show text mode parameters */ "+CSGT", /* 3GPP TS 27.007 8.32 - Set Greeting Text */ "+CSIL", /* 3GPP TS 27.007 6.23 - Silence Command */ "+CSIM", /* 3GPP TS 27.007 8.17 - Generic SIM access */ "+CSMP", /* GSM07.05 3.3.2 - Set text mode parameters */ "+CSMS", /* GSM07.05 3.2.1 - Select Message Service */ "+CSNS", /* 3GPP TS 27.007 6.19 - Single numbering scheme */ "+CSQ", /* 3GPP TS 27.007 8.5 - Signal quality */ "+CSS", /* IS-135 4.1.28 - Serving system identification */ "+CSSN", /* 3GPP TS 27.007 7.17 - Supplementary service notifications */ "+CSTA", /* 3GPP TS 27.007 6.1 - Select type of address */ "+CSTF", /* 3GPP TS 27.007 6.24 - Settings time format */ "+CSVM", /* 3GPP TS 27.007 8.33 - Set Voice Mail Number */ "+CTA", /* IS-135 4.1.29 - MT-Terminated async. Data calls */ "+CTF", /* IS-135 4.1.30 - MT-Terminated FAX calls */ "+CTFR", /* 3GPP TS 27.007 7.14 - Call deflection */ "+CTZR", /* 3GPP TS 27.007 8.41 - Time Zone Reporting */ "+CTZU", /* 3GPP TS 27.007 8.40 - Automatic Time Zone Update */ "+CUSD", /* 3GPP TS 27.007 7.15 - Unstructured supplementary service data */ "+CUUS1", /* 3GPP TS 27.007 7.26 - User to User Signalling Service 1 */ "+CV120", /* 3GPP TS 27.007 6.21 - V.120 rate adaption protocol */ "+CVHU", /* 3GPP TS 27.007 6.20 - Voice Hangup Control */ "+CVIB", /* 3GPP TS 27.007 8.22 - Vibrator mode */ "+CXT", /* IS-99 5.6 - Cellular extension */ "+DR", /* V.250 6.6.2 - Data compression reporting */ "+DS", /* V.250 6.6.1 - Data compression */ "+DS44", /* V.250 6.6.2 - V.44 data compression */ "+EB", /* V.250 6.5.2 - Break handling in error control operation */ "+EFCS", /* V.250 6.5.4 - 32-bit frame check sequence */ "+EFRAM", /* V.250 6.5.8 - Frame length */ "+ER", /* V.250 6.5.5 - Error control reporting */ "+ES", /* V.250 6.5.1 - Error control selection */ "+ESA", /* V.80 8.2 - Synchronous access mode configuration */ "+ESR", /* V.250 6.5.3 - Selective repeat */ "+ETBM", /* V.250 6.5.6 - Call termination buffer management */ "+EWIND", /* V.250 6.5.7 - Window size */ "+F34", /* T.31 B.6.1 - Initial V.34 rate controls for FAX */ "+FAA", /* T.32 8.5.2.5 - Adaptive Answer parameter */ "+FAP", /* T.32 8.5.1.12 - Addressing and polling capabilities parameter */ "+FAR", /* T.31 8.5.1 - Adaptive reception control */ "+FBO", /* T.32 8.5.3.4 - Phase C data bit order */ "+FBS", /* T.32 8.5.3.2 - Buffer Size, read only parameter */ "+FBU", /* T.32 8.5.1.10 - HDLC Frame Reporting parameter */ "+FCC", /* T.32 8.5.1.1 - DCE capabilities parameters */ "+FCL", /* T.31 8.5.2 - Carrier loss timeout */ "+FCLASS", /* T.31 8.2 - Capabilities identification and control */ "+FCQ", /* T.32 8.5.2.3 - Copy quality checking parameter */ "+FCR", /* T.32 8.5.1.9 - Capability to receive parameter */ "+FCS", /* T.32 8.5.1.3 - Current Session Results parameters */ "+FCT", /* T.32 8.5.2.6 - DTE phase C timeout parameter */ "+FDD", /* T.31 8.5.3 - Double escape character replacement */ "+FDR", /* T.32 8.3.4 - Data reception command */ "+FDT", /* T.32 8.3.3 - Data transmission command */ "+FEA", /* T.32 8.5.3.5 - Phase C received EOL alignment parameter */ "+FFC", /* T.32 8.5.3.6 - Format conversion parameter */ "+FFD", /* T.32 8.5.1.14 - File diagnostic message parameter */ "+FHS", /* T.32 8.5.2.7 - Call termination status parameter */ "+FIE", /* T.32 8.5.2.1 - Procedure interrupt enable parameter */ "+FIP", /* T.32 8.3.6 - Initialize facsimile parameters */ "+FIS", /* T.32 8.5.1.2 - Current session parameters */ "+FIT", /* T.31 8.5.4 - DTE inactivity timeout */ "+FKS", /* T.32 8.3.5 - Session termination command */ "+FLI", /* T.32 8.5.1.5 - Local ID string parameter, TSI or CSI */ "+FLO", /* T.31 says to implement something similar to +IFC */ "+FLP", /* T.32 8.5.1.7 - Indicate document to poll parameter */ "+FMI", /* T.31 says to duplicate +GMI */ "+FMM", /* T.31 says to duplicate +GMM */ "+FMR", /* T.31 says to duplicate +GMR */ "+FMS", /* T.32 8.5.2.9 - Minimum phase C speed parameter */ "+FND", /* T.32 8.5.2.10 - Non-Standard Message Data Indication parameter */ "+FNR", /* T.32 8.5.1.11 - Negotiation message reporting control parameters */ "+FNS", /* T.32 8.5.1.6 - Non-Standard Frame FIF parameter */ "+FPA", /* T.32 8.5.1.13 - Selective polling address parameter */ "+FPI", /* T.32 8.5.1.5 - Local Polling ID String parameter */ "+FPP", /* T.32 8.5.3 - Facsimile packet protocol */ "+FPR", /* T.31 says to implement something similar to +IPR */ "+FPS", /* T.32 8.5.2.2 - Page Status parameter */ "+FPW", /* T.32 8.5.1.13 - PassWord parameter (Sending or Polling) */ "+FRH", /* T.31 8.3.6 - HDLC receive */ "+FRM", /* T.31 8.3.4 - Facsimile receive */ "+FRQ", /* T.32 8.5.2.4 - Receive Quality Thresholds parameters */ "+FRS", /* T.31 8.3.2 - Receive silence */ "+FRY", /* T.32 8.5.2.8 - ECM Retry Value parameter */ "+FSA", /* T.32 8.5.1.13 - Subaddress parameter */ "+FSP", /* T.32 8.5.1.8 - Request to poll parameter */ "+FTH", /* T.31 8.3.5 - HDLC transmit */ "+FTM", /* T.31 8.3.3 - Facsimile transmit */ "+FTS", /* T.31 8.3.1 - Transmit silence */ "+GCAP", /* V.250 6.1.9 - Request complete capabilities list */ "+GCI", /* V.250 6.1.10 - Country of installation, */ "+GMI", /* V.250 6.1.4 - Request manufacturer identification */ "+GMM", /* V.250 6.1.5 - Request model identification */ "+GMR", /* V.250 6.1.6 - Request revision identification */ "+GOI", /* V.250 6.1.8 - Request global object identification */ "+GSN", /* V.250 6.1.7 - Request product serial number identification */ "+IBC", /* V.80 7.9 - Control of in-band control */ "+IBM", /* V.80 7.10 - In-band MARK idle reporting control */ "+ICF", /* V.250 6.2.11 - DTE-DCE character framing */ "+ICLOK", /* V.250 6.2.14 - Select sync transmit clock source */ "+IDSR", /* V.250 6.2.16 - Select data set ready option */ "+IFC", /* V.250 6.2.12 - DTE-DCE local flow control */ "+ILRR", /* V.250 6.2.13 - DTE-DCE local rate reporting */ "+ILSD", /* V.250 6.2.15 - Select long space disconnect option */ "+IPR", /* V.250 6.2.10 - Fixed DTE rate */ "+IRTS", /* V.250 6.2.17 - Select synchronous mode RTS option */ "+ITF", /* V.80 8.4 - Transmit flow control thresholds */ "+MA", /* V.250 6.4.2 - Modulation automode control */ "+MR", /* V.250 6.4.3 - Modulation reporting control */ "+MS", /* V.250 6.4.1 - Modulation selection */ "+MSC", /* V.250 6.4.8 - Seamless rate change enable */ "+MV18AM", /* V.250 6.4.6 - V.18 answering message editing */ "+MV18P", /* V.250 6.4.7 - Order of probes */ "+MV18R", /* V.250 6.4.5 - V.18 reporting control */ "+MV18S", /* V.250 6.4.4 - V.18 selection */ "+PCW", /* V.250 6.8.1 - Call waiting enable (V.92 DCE) */ "+PIG", /* V.250 6.8.5 - PCM upstream ignore */ "+PMH", /* V.250 6.8.2 - Modem on hold enable */ "+PMHF", /* V.250 6.8.6 - V.92 Modem on hold hook flash */ "+PMHR", /* V.250 6.8.4 - Initiate modem on hold */ "+PMHT", /* V.250 6.8.3 - Modem on hold timer */ "+PQC", /* V.250 6.8.7 - V.92 Phase 1 and Phase 2 Control */ "+PSS", /* V.250 6.8.8 - V.92 Use Short Sequence */ "+SAC", /* V.252 3.4 - Audio transmit configuration */ "+SAM", /* V.252 3.5 - Audio receive mode */ "+SAR", /* V.252 5.3 - Audio receive channel indication */ "+SARR", /* V.252 3.9 - Audio indication reporting */ "+SAT", /* V.252 5.4 - Audio transmit channel indication */ "+SCRR", /* V.252 3.11 - Capabilities indication reporting */ "+SDC", /* V.252 3.3 - Data configuration */ "+SDI", /* V.252 5.2 - Data channel identification */ "+SDR", /* V.252 3.8 - Data indication reporting */ "+SRSC", /* V.252 5.1.2 - Remote terminal simultaneous capability indication */ "+STC", /* V.252 3.1 - Terminal configuration */ "+STH", /* V.252 3.2 - Close logical channel */ "+SVC", /* V.252 3.6 - Video transmit configuration */ "+SVM", /* V.252 3.7 - Video receive mode */ "+SVR", /* V.252 5.5 - Video receive channel indication */ "+SVRR", /* V.252 3.10 - Video indication reporting */ "+SVT", /* V.252 5.6 - Video transmit channel indication */ "+TADR", /* V.250 6.7.2.9 - Local V.54 address */ "+TAL", /* V.250 6.7.2.15 - Local analogue loop */ "+TALS", /* V.250 6.7.2.6 - Analogue loop status */ "+TDLS", /* V.250 6.7.2.7 - Local digital loop status */ "+TE140", /* V.250 6.7.2.1 - Enable ckt 140 */ "+TE141", /* V.250 6.7.2.2 - Enable ckt 141 */ "+TEPAL", /* V.250 6.7.2.5 - Enable front panel analogue loop */ "+TEPDL", /* V.250 6.7.2.4 - Enable front panel RDL */ "+TERDL", /* V.250 6.7.2.3 - Enable RDL from remote */ "+TLDL", /* V.250 6.7.2.13 - Local digital loop */ "+TMO", /* V.250 6.9 - V.59 command */ "+TMODE", /* V.250 6.7.2.10 - Set V.54 mode */ "+TNUM", /* V.250 6.7.2.12 - Errored bit and block counts */ "+TRDL", /* V.250 6.7.2.14 - Request remote digital loop */ "+TRDLS", /* V.250 6.7.2.8 - Remote digital loop status */ "+TRES", /* V.250 6.7.2.17 - Self test result */ "+TSELF", /* V.250 6.7.2.16 - Self test */ "+TTER", /* V.250 6.7.2.11 - Test error rate */ "+VAC", /* V.252 4.1 - Set audio code */ "+VACR", /* V.252 6.1 - Audio code report */ "+VBT", /* 3GPP TS 27.007 C.2.2 - Buffer threshold setting */ "+VCID", /* V.253 9.2.3 - Caller ID service */ "+VCIDR", /* V.252 6.2 - Caller ID report */ "+VDID", /* V.253 9.2.4 - DID service */ "+VDIDR", /* V.252 6.2 - DID report */ "+VDR", /* V.253 10.3.1 - Distinctive ring (ring cadence reporting) */ "+VDT", /* V.253 10.3.2 - Control tone cadence reporting */ "+VDX", /* V.253 10.5.6 - Speakerphone duplex mode */ "+VEM", /* V.253 10.5.7 - Deliver event reports */ "+VGM", /* V.253 10.5.2 - Microphone gain */ "+VGR", /* V.253 10.2.1 - Receive gain selection */ "+VGS", /* V.253 10.5.3 - Speaker gain */ "+VGT", /* V.253 10.2.2 - Volume selection */ "+VHC", /* V.252 4.12 - Telephony port hook control */ "+VIP", /* V.253 10.1.1 - Initialize voice parameters */ "+VIT", /* V.253 10.2.3 - DTE/DCE inactivity timer */ "+VLS", /* V.253 10.2.4 - Analogue source/destination selection */ "+VNH", /* V.253 9.2.5 - Automatic hangup control */ "+VPH", /* V.252 4.11 - Phone hookswitch status */ "+VPP", /* V.253 10.4.2 - Voice packet protocol */ "+VPR", /* IS-101 10.4.3 - Select DTE/DCE interface rate */ "+VRA", /* V.253 10.2.5 - Ringing tone goes away timer */ "+VRID", /* Extension - Find the originating and destination numbers */ "+VRL", /* V.253 10.1.2 - Ring local phone */ "+VRN", /* V.253 10.2.6 - Ringing tone never appeared timer */ "+VRX", /* V.253 10.1.3 - Voice receive state */ "+VSD", /* V.253 10.2.7 - Silence detection (QUIET and SILENCE) */ "+VSID", /* Extension - Set the originating number */ "+VSM", /* V.253 10.2.8 - Compression method selection */ "+VSP", /* V.253 10.5.1 - Voice speakerphone state */ "+VTA", /* V.253 10.5.4 - Train acoustic echo-canceller */ "+VTD", /* V.253 10.2.9 - Beep tone duration timer */ "+VTER", /* V.252 6.4 - Simple telephony event report */ "+VTH", /* V.253 10.5.5 - Train line echo-canceller */ "+VTR", /* V.253 10.1.4 - Voice duplex state */ "+VTS", /* V.253 10.1.5 - DTMF and tone generation in voice */ "+VTX", /* V.253 10.1.6 - Transmit data state */ "+VXT", /* IS-101 10.1.5 - Translate voice data */ "+W", /* TIA-678 5.2.4.1 - Compliance indication */ "+WBAG", /* TIA-678 C.5.6 Bias modem audio gain */ "+WCDA", /* TIA-678 B.3.2.5 Display data link address */ "+WCHG", /* TIA-678 B.3.2.4 Display battery charging status */ "+WCID", /* TIA-678 B.3.2.1 Display system ID (operator) */ "+WCLK", /* TIA-678 B.3.2.3 Lock/unlock DCE */ "+WCPN", /* TIA-678 B.3.2.2 Set personal identification number */ "+WCXF", /* TIA-678 B.3.2.6 Display supported annex B commands */ "+WDAC", /* TIA-678 C.5.1 Data over analogue cellular command query */ "+WDIR", /* TIA-678 C.5.8 Phone number directory selection */ "+WECR", /* TIA-678 C.5.3 Enable cellular result codes */ "+WFON", /* TIA-678 C.5.5 Phone specification */ "+WKPD", /* TIA-678 C.5.7 Keypad emulation */ "+WPBA", /* TIA-678 C.5.9 Phone battery query */ "+WPTH", /* TIA-678 C.5.10 Call path */ "+WRLK", /* TIA-678 C.5.4 Roam lockout */ "+WS45", /* TIA-678 5.2.4.2 DTE-side stack selection */ "+WS46", /* 3GPP TS 27.007 5.9 - PCCA STD-101 [17] select wireless network */ "+WS50", /* TIA-678 B.3.1.1 Normalized signal strength */ "+WS51", /* TIA-678 B.3.1.2 Carrier detect signal threshold */ "+WS52", /* TIA-678 B.3.1.3 Normalized battery level */ "+WS53", /* TIA-678 B.3.1.4 Normalized channel quality */ "+WS54", /* TIA-678 B.3.1.5 Carrier detect channel quality threshold */ "+WS57", /* TIA-678 B.3.1.7 Antenna preference */ "+WS58", /* TIA-678 B.3.1.8 Idle time-out value */ "+WSTL", /* TIA-678 C.5.2 Call session time limit */ ";", /* Dummy to absorb semi-colon delimiters in commands */ "A", /* V.250 6.3.5 - Answer */ "D", /* V.250 6.3.1 - Dial */ "E", /* V.250 6.2.4 - Command echo */ "H", /* V.250 6.3.6 - Hook control */ "I", /* V.250 6.1.3 - Request identification information */ "L", /* V.250 6.3.13 - Monitor speaker loudness */ "M", /* V.250 6.3.14 - Monitor speaker mode */ "O", /* V.250 6.3.7 - Return to online data state */ "P", /* V.250 6.3.3 - Select pulse dialling (command) */ "Q", /* V.250 6.2.5 - Result code suppression */ "S0", /* V.250 6.3.8 - Automatic answer */ "S10", /* V.250 6.3.12 - Automatic disconnect delay */ "S3", /* V.250 6.2.1 - Command line termination character */ "S4", /* V.250 6.2.2 - Response formatting character */ "S5", /* V.250 6.2.3 - Command line editing character */ "S6", /* V.250 6.3.9 - Pause before blind dialling */ "S7", /* V.250 6.3.10 - Connection completion timeout */ "S8", /* V.250 6.3.11 - Comma dial modifier time */ "T", /* V.250 6.3.2 - Select tone dialling (command) */ "V", /* V.250 6.2.6 - DCE response format */ "X", /* V.250 6.2.7 - Result code selection and call progress monitoring control */ "Z", /* V.250 6.1.1 - Reset to default configuration */ NULL }; int packed_ptr = 0; short int packed_trie[30000]; #define ALPHABET_SIZE 128 typedef struct trie_node_s { int first; int last; int node_no; int entry; /* Array of pointers to children */ struct trie_node_s *child_list[ALPHABET_SIZE]; } trie_node_t; typedef struct { int entries; /* The root of the trie */ trie_node_t *root; } trie_t; static trie_node_t *trie_node_create(void) { trie_node_t *s; if ((s = (trie_node_t *) malloc(sizeof(*s)))) { memset(s, 0, sizeof(*s)); s->first = ALPHABET_SIZE - 1; } return s; } /*- End of function --------------------------------------------------------*/ static trie_t *trie_create(void) { trie_t *s; if ((s = (trie_t *) malloc(sizeof(*s)))) { memset(s, 0, sizeof(*s)); s->root = trie_node_create(); } return s; } /*- End of function --------------------------------------------------------*/ static void trie_recursive_add_node_numbers(trie_node_t *t) { int index; if (t) { if (t->first <= t->last) { t->node_no = packed_ptr + 1; packed_ptr += (t->last - t->first + 1 + 3); for (index = 0; index < ALPHABET_SIZE; index++) trie_recursive_add_node_numbers(t->child_list[index]); } else { t->node_no = packed_ptr + 1; packed_ptr += 3; } } } /*- End of function --------------------------------------------------------*/ static void trie_recursive_build_packed_trie(trie_node_t *t) { int i; if (t) { if (t->first <= t->last) { packed_trie[packed_ptr++] = t->first; packed_trie[packed_ptr++] = t->last; packed_trie[packed_ptr++] = t->entry; for (i = t->first; i <= t->last; i++) packed_trie[packed_ptr++] = (t->child_list[i]) ? t->child_list[i]->node_no : 0; for (i = t->first; i <= t->last; i++) trie_recursive_build_packed_trie(t->child_list[i]); } else { packed_trie[packed_ptr++] = 1; packed_trie[packed_ptr++] = 0; packed_trie[packed_ptr++] = t->entry; } } } /*- End of function --------------------------------------------------------*/ static void trie_add(trie_t *s, const char *u, size_t len) { size_t i; int index; trie_node_t *t; s->entries++; /* Loop over the length of the string to add and traverse the trie... */ for (t = s->root, i = 0; i < len; i++) { /* The character in u we are processing... */ index = (unsigned char) u[i]; /* Is there a child node for this character? */ if (t->child_list[index] == NULL) { t->child_list[index] = trie_node_create(); if (index < t->first) t->first = index; if (index > t->last) t->last = index; } /* Move to the new node... and loop */ t = t->child_list[index]; } t->entry = s->entries; } /*- End of function --------------------------------------------------------*/ static void dump_trie(void) { int i; printf("\nstatic const at_cmd_service_t at_commands[] =\n{\n"); for (i = 0; wordlist[i]; i++) { switch (wordlist[i][0]) { case ' ': case ';': printf(" at_cmd_dummy,\n"); break; case '+': printf(" at_cmd_plus_%s,\n", wordlist[i] + 1); break; case '&': printf(" at_cmd_amp_%s,\n", wordlist[i] + 1); break; default: printf(" at_cmd_%s,\n", wordlist[i]); break; } } printf("};\n"); printf("\nstatic const uint16_t command_trie[] =\n{"); for (i = 0; i < packed_ptr; i++) { if ((i & 7) == 0) printf("\n "); printf("0x%04X, ", packed_trie[i]); } printf("\n};\n"); printf("\n#define COMMAND_TRIE_LEN %d\n", packed_ptr); } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { trie_t *s; int i; s = trie_create(); for (i = 0; wordlist[i]; i++) trie_add(s, wordlist[i], strlen(wordlist[i])); printf("// The trie contains %d entries\n", i); packed_ptr = 0; trie_recursive_add_node_numbers(s->root); packed_ptr = 0; trie_recursive_build_packed_trie(s->root); dump_trie(); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/modem_echo.c0000664000175000017500000001367411422612262013153 00000000000000/* * SpanDSP - a series of DSP components for telephony * * modem_echo.c - An echo cancellor, suitable for electrical echos in GSTN modems * * Written by Steve Underwood * * Copyright (C) 2001, 2003, 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /* The FIR taps must be adapted as 32 bit values, to get the necessary finesse in the adaption process. However, they are applied as 16 bit values (bits 30-15 of the 32 bit values) in the FIR. For the working 16 bit values, we need 4 sets. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/bit_operations.h" #include "spandsp/dc_restore.h" #include "spandsp/modem_echo.h" #include "spandsp/private/modem_echo.h" SPAN_DECLARE(void) modem_echo_can_free(modem_echo_can_state_t *ec) { fir16_free(&ec->fir_state); free(ec->fir_taps32); free(ec->fir_taps16); free(ec); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(modem_echo_can_state_t *) modem_echo_can_init(int len) { modem_echo_can_state_t *ec; if ((ec = (modem_echo_can_state_t *) malloc(sizeof(*ec))) == NULL) return NULL; memset(ec, 0, sizeof(*ec)); ec->taps = len; ec->curr_pos = ec->taps - 1; if ((ec->fir_taps32 = (int32_t *) malloc(ec->taps*sizeof(int32_t))) == NULL) { free(ec); return NULL; } memset(ec->fir_taps32, 0, ec->taps*sizeof(int32_t)); if ((ec->fir_taps16 = (int16_t *) malloc(ec->taps*sizeof(int16_t))) == NULL) { free(ec->fir_taps32); free(ec); return NULL; } memset(ec->fir_taps16, 0, ec->taps*sizeof(int16_t)); if (fir16_create(&ec->fir_state, ec->fir_taps16, ec->taps) == NULL) { free(ec->fir_taps16); free(ec->fir_taps32); free(ec); return NULL; } return ec; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) modem_echo_can_flush(modem_echo_can_state_t *ec) { ec->tx_power = 0; fir16_flush(&ec->fir_state); ec->fir_state.curr_pos = ec->taps - 1; memset(ec->fir_taps32, 0, ec->taps*sizeof(int32_t)); memset(ec->fir_taps16, 0, ec->taps*sizeof(int16_t)); ec->curr_pos = ec->taps - 1; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) modem_echo_can_adaption_mode(modem_echo_can_state_t *ec, int adapt) { ec->adapt = adapt; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int16_t) modem_echo_can_update(modem_echo_can_state_t *ec, int16_t tx, int16_t rx) { int32_t echo_value; int clean_rx; int shift; int i; int offset1; int offset2; /* Evaluate the echo - i.e. apply the FIR filter */ /* Assume the gain of the FIR does not exceed unity. Exceeding unity would seem like a rather poor thing for an echo cancellor to do :) This means we can compute the result with a total disregard for overflows. 16bits x 16bits -> 31bits, so no overflow can occur in any multiply. While accumulating we may overflow and underflow the 32 bit scale often. However, if the gain does not exceed unity, everything should work itself out, and the final result will be OK, without any saturation logic. */ /* Overflow is very much possible here, and we do nothing about it because of the compute costs */ echo_value = fir16(&ec->fir_state, tx); /* And the answer is..... */ clean_rx = rx - echo_value; //printf("%8d %8d %8d %8d\n", tx, rx, echo_value, clean_rx); if (ec->adapt) { /* Calculate short term power levels using very simple single pole IIRs */ /* TODO: Is the nasty modulus approach the fastest, or would a real tx*tx power calculation actually be faster? Using the squares makes the numbers grow a lot! */ ec->tx_power += ((tx*tx - ec->tx_power) >> 5); shift = 1; /* Update the FIR taps */ offset2 = ec->curr_pos; offset1 = ec->taps - offset2; for (i = ec->taps - 1; i >= offset1; i--) { /* Leak to avoid the coefficients drifting beyond the ability of the adaption process to bring them back under control. */ ec->fir_taps32[i] -= (ec->fir_taps32[i] >> 23); ec->fir_taps32[i] += (ec->fir_state.history[i - offset1]*clean_rx) >> shift; ec->fir_taps16[i] = (int16_t) (ec->fir_taps32[i] >> 15); } for ( ; i >= 0; i--) { ec->fir_taps32[i] -= (ec->fir_taps32[i] >> 23); ec->fir_taps32[i] += (ec->fir_state.history[i + offset2]*clean_rx) >> shift; ec->fir_taps16[i] = (int16_t) (ec->fir_taps32[i] >> 15); } } /* Roll around the rolling buffer */ if (ec->curr_pos <= 0) ec->curr_pos = ec->taps; ec->curr_pos--; return (int16_t) clean_rx; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/filter_tools.c0000664000175000017500000001421211422612261013545 00000000000000/* * SpanDSP - a series of DSP components for telephony * * filter_tools.c - A collection of routines used for filter design. * * Written by Steve Underwood * * Copyright (C) 2008 Steve Underwood * * This includes some elements based on the mkfilter package by * A.J. Fisher, University of York , November 1996 * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include #include #include "spandsp/telephony.h" #include "spandsp/complex.h" #include "filter_tools.h" #if !defined(FALSE) #define FALSE 0 #endif #if !defined(TRUE) #define TRUE (!FALSE) #endif #define MAXPZ 8192 #define SEQ_LEN 8192 #define MAX_FFT_LEN SEQ_LEN static complex_t circle[MAX_FFT_LEN/2]; static __inline__ complex_t expj(double theta) { return complex_set(cos(theta), sin(theta)); } /*- End of function --------------------------------------------------------*/ static __inline__ double fix(double x) { /* Nearest integer */ return (x >= 0.0) ? floor(0.5 + x) : -floor(0.5 - x); } /*- End of function --------------------------------------------------------*/ static void fftx(complex_t data[], complex_t temp[], int n) { int i; int h; int p; int t; int i2; complex_t wkt; if (n > 1) { h = n/2; for (i = 0; i < h; i++) { i2 = i*2; temp[i] = data[i2]; /* Even */ temp[h + i] = data[i2 + 1]; /* Odd */ } fftx(&temp[0], &data[0], h); fftx(&temp[h], &data[h], h); p = 0; t = MAX_FFT_LEN/n; for (i = 0; i < h; i++) { wkt = complex_mul(&circle[p], &temp[h + i]); data[i] = complex_add(&temp[i], &wkt); data[h + i] = complex_sub(&temp[i], &wkt); p += t; } } } /*- End of function --------------------------------------------------------*/ void ifft(complex_t data[], int len) { int i; double x; complex_t temp[MAX_FFT_LEN]; /* A very slow and clunky FFT, that's just fine for filter design. */ for (i = 0; i < MAX_FFT_LEN/2; i++) { x = (2.0*3.1415926535*i)/(double) MAX_FFT_LEN; circle[i] = expj(x); } fftx(data, temp, len); } /*- End of function --------------------------------------------------------*/ void compute_raised_cosine_filter(double coeffs[], int len, int root, int sinc_compensate, double alpha, double beta) { double f; double x; double f1; double f2; double tau; complex_t vec[SEQ_LEN]; int i; int j; int h; f1 = (1.0 - beta)*alpha; f2 = (1.0 + beta)*alpha; tau = 0.5/alpha; /* (Root) raised cosine */ for (i = 0; i <= SEQ_LEN/2; i++) { f = (double) i/(double) SEQ_LEN; if (f <= f1) vec[i] = complex_set(1.0, 0.0); else if (f <= f2) vec[i] = complex_set(0.5*(1.0 + cos((3.1415926535*tau/beta)*(f - f1))), 0.0); else vec[i] = complex_set(0.0, 0.0); } if (root) { for (i = 0; i <= SEQ_LEN/2; i++) vec[i].re = sqrt(vec[i].re); } if (sinc_compensate) { for (i = 1; i <= SEQ_LEN/2; i++) { x = 3.1415926535*(double) i/(double) SEQ_LEN; vec[i].re *= (x/sin(x)); } } for (i = 0; i <= SEQ_LEN/2; i++) vec[i].re *= tau; for (i = 1; i < SEQ_LEN/2; i++) vec[SEQ_LEN - i] = vec[i]; ifft(vec, SEQ_LEN); h = (len - 1)/2; for (i = 0; i < len; i++) { j = (SEQ_LEN - h + i)%SEQ_LEN; coeffs[i] = vec[j].re/(double) SEQ_LEN; } } /*- End of function --------------------------------------------------------*/ void compute_hilbert_transform(double coeffs[], int len) { double x; int i; int h; h = (len - 1)/2; coeffs[h] = 0.0; for (i = 1; i <= h; i++) { if ((i & 1)) { x = 1.0/(double) i; coeffs[h + i] = -x; coeffs[h - i] = x; } } } /*- End of function --------------------------------------------------------*/ void apply_hamming_window(double coeffs[], int len) { double w; int i; int h; h = (len - 1)/2; for (i = 1; i <= h; i++) { w = 0.53836 - 0.46164*cos(2.0*3.1415926535*(double) (h + i)/(double) (len - 1.0)); coeffs[h + i] *= w; coeffs[h - i] *= w; } } /*- End of function --------------------------------------------------------*/ void truncate_coeffs(double coeffs[], int len, int bits, int hilbert) { double x; double fac; double max; double scale; int h; int i; fac = pow(2.0, (double) (bits - 1.0)); h = (len - 1)/2; max = (hilbert) ? coeffs[h - 1] : coeffs[h]; /* Max coeff */ scale = (fac - 1.0)/(fac*max); for (i = 0; i < len; i++) { x = coeffs[i]*scale; /* Scale coeffs so max is (fac - 1.0)/fac */ coeffs[i] = fix(x*fac)/fac; /* Truncate */ } } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/make_modem_filter.c0000664000175000017500000003504011422612262014506 00000000000000/* * SpanDSP - a series of DSP components for telephony * * make_modem_filter.c - Create coefficient sets for pulse shaping * various modem rx and tx signals. * * Written by Steve Underwood * * Copyright (C) 2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include #include #if defined(__sunos) || defined(__solaris) || defined(__sun) #include #endif #include "spandsp/telephony.h" #include "spandsp/complex.h" #include "filter_tools.h" #if !defined(FALSE) #define FALSE 0 #endif #if !defined(TRUE) #define TRUE (!FALSE) #endif //#define SAMPLE_RATE 8000.0 #define MAX_COEFFS_PER_FILTER 128 #define MAX_COEFF_SETS 384 static void make_tx_filter(int coeff_sets, int coeffs_per_filter, double carrier, double baud_rate, double excess_bandwidth, int fixed_point, const char *tag) { int i; int j; int x; int total_coeffs; double alpha; double beta; double gain; double scaling; double peak; double coeffs[MAX_COEFF_SETS*MAX_COEFFS_PER_FILTER + 1]; total_coeffs = coeff_sets*coeffs_per_filter + 1; alpha = baud_rate/(2.0*(double) (coeff_sets*baud_rate)); beta = excess_bandwidth; compute_raised_cosine_filter(coeffs, total_coeffs, TRUE, FALSE, alpha, beta); /* Find the DC gain of the filter, and adjust the filter to unity gain. */ gain = 0.0; for (i = coeff_sets/2; i < total_coeffs; i += coeff_sets) gain += coeffs[i]; /* Normalise the gain to 1.0 */ for (i = 0; i < total_coeffs; i++) coeffs[i] /= gain; gain = 1.0; if (fixed_point) { peak = -1.0; for (i = 0; i < total_coeffs; i++) { if (fabs(coeffs[i]) > peak) peak = fabs(coeffs[i]); } scaling = 32767.0; if (peak >= 1.0) { scaling /= peak; gain = 1.0/peak; } for (i = 0; i < total_coeffs; i++) coeffs[i] *= scaling; } /* Churn out the data as a C source code header file, which can be directly included by the modem code. */ printf("#define TX_PULSESHAPER%s_GAIN %ff\n", tag, gain); printf("#define TX_PULSESHAPER%s_COEFF_SETS %d\n", tag, coeff_sets); printf("static const %s tx_pulseshaper%s[TX_PULSESHAPER%s_COEFF_SETS][%d] =\n", (fixed_point) ? "int16_t" : "float", tag, tag, coeffs_per_filter); printf("{\n"); for (j = 0; j < coeff_sets; j++) { x = j; printf(" {\n"); if (fixed_point) printf(" %8d, /* Filter %d */\n", (int) coeffs[x], j); else printf(" %15.10ff, /* Filter %d */\n", coeffs[x], j); for (i = 1; i < coeffs_per_filter - 1; i++) { x = i*coeff_sets + j; if (fixed_point) printf(" %8d,\n", (int) coeffs[x]); else printf(" %15.10ff,\n", coeffs[x]); } x = i*coeff_sets + j; if (fixed_point) printf(" %8d\n", (int) coeffs[x]); else printf(" %15.10ff\n", coeffs[x]); if (j < coeff_sets - 1) printf(" },\n"); else printf(" }\n"); } printf("};\n"); } /*- End of function --------------------------------------------------------*/ static void make_rx_filter(int coeff_sets, int coeffs_per_filter, double carrier, double baud_rate, double excess_bandwidth, int fixed_point, const char *tag) { int i; int j; int k; int m; int x; int total_coeffs; double alpha; double beta; double gain; double peak; double coeffs[MAX_COEFF_SETS*MAX_COEFFS_PER_FILTER + 1]; #if 0 complex_t co[MAX_COEFFS_PER_FILTER]; #else double cox[MAX_COEFFS_PER_FILTER]; #endif total_coeffs = coeff_sets*coeffs_per_filter + 1; alpha = baud_rate/(2.0*(double) (coeff_sets*SAMPLE_RATE)); beta = excess_bandwidth; carrier *= 2.0*3.1415926535/SAMPLE_RATE; compute_raised_cosine_filter(coeffs, total_coeffs, TRUE, FALSE, alpha, beta); /* Find the DC gain of the filter, and adjust the filter to unity gain. */ gain = 0.0; for (i = coeff_sets/2; i < total_coeffs; i += coeff_sets) gain += coeffs[i]; /* Normalise the gain to 1.0 */ for (i = 0; i < total_coeffs; i++) coeffs[i] /= gain; gain = 1.0; if (fixed_point) { peak = -1.0; for (i = 0; i < total_coeffs; i++) { if (fabs(coeffs[i]) > peak) peak = fabs(coeffs[i]); } gain = 32767.0; if (peak >= 1.0) gain /= peak; for (i = 0; i < total_coeffs; i++) coeffs[i] *= gain; } /* Churn out the data as a C source code header file, which can be directly included by the modem code. */ printf("#define RX_PULSESHAPER%s_GAIN %ff\n", tag, gain); printf("#define RX_PULSESHAPER%s_COEFF_SETS %d\n", tag, coeff_sets); #if 0 printf("static const %s rx_pulseshaper%s[RX_PULSESHAPER%s_COEFF_SETS][%d] =\n", (fixed_point) ? "complexi16_t" : "complexf_t", tag, tag, coeffs_per_filter); printf("{\n"); for (j = 0; j < coeff_sets; j++) { /* Complex modulate the filter, to make it a complex pulse shaping bandpass filter centred at the nominal carrier frequency. Use the same phase for all the coefficient sets. This means the modem can step the carrier in whole samples, and not worry about the fractional sample shift caused by selecting amongst the various coefficient sets. */ for (i = 0; i < coeffs_per_filter; i++) { m = i - (coeffs_per_filter >> 1); x = i*coeff_sets + j; co[i].re = coeffs[x]*cos(carrier*m); co[i].im = coeffs[x]*sin(carrier*m); } printf(" {\n"); if (fixed_point) printf(" {%8d, %8d}, /* Filter %d */\n", (int) co[i].re, (int) co[i].im, j); else printf(" {%15.10ff, %15.10ff}, /* Filter %d */\n", co[0].re, co[0].im, j); for (i = 1; i < coeffs_per_filter - 1; i++) { if (fixed_point) printf(" {%8d, %8d},\n", (int) co[i].re, (int) co[i].im); else printf(" {%15.10ff, %15.10ff},\n", co[i].re, co[i].im); } if (fixed_point) printf(" {%8d, %8d}\n", (int) co[i].re, (int) co[i].im); else printf(" {%15.10ff, %15.10ff}\n", co[i].re, co[i].im); if (j < coeff_sets - 1) printf(" },\n"); else printf(" }\n"); } printf("};\n"); #else for (k = 0; k < 2; k++) { printf("static const %s rx_pulseshaper%s_%s[RX_PULSESHAPER%s_COEFF_SETS][%d] =\n", (fixed_point) ? "int16_t" : "float", tag, (k == 0) ? "re" : "im", tag, coeffs_per_filter); printf("{\n"); for (j = 0; j < coeff_sets; j++) { /* Complex modulate the filter, to make it a complex pulse shaping bandpass filter centred at the nominal carrier frequency. Use the same phase for all the coefficient sets. This means the modem can step the carrier in whole samples, and not worry about the fractional sample shift caused by selecting amongst the various coefficient sets. */ for (i = 0; i < coeffs_per_filter; i++) { m = i - (coeffs_per_filter >> 1); x = i*coeff_sets + j; if (k == 0) cox[i] = coeffs[x]*cos(carrier*m); else cox[i] = coeffs[x]*sin(carrier*m); } printf(" {\n"); if (fixed_point) printf(" %8d, /* Filter %d */\n", (int) cox[0], j); else printf(" %15.10ff, /* Filter %d */\n", cox[0], j); for (i = 1; i < coeffs_per_filter - 1; i++) { if (fixed_point) printf(" %8d,\n", (int) cox[i]); else printf(" %15.10ff,\n", cox[i]); } if (fixed_point) printf(" %8d\n", (int) cox[i]); else printf(" %15.10ff\n", cox[i]); if (j < coeff_sets - 1) printf(" },\n"); else printf(" }\n"); } printf("};\n"); } #endif } /*- End of function --------------------------------------------------------*/ static void usage(void) { fprintf(stderr, "Usage: make_modem_rx_filter -m [-i] [-r] [-t]\n"); } /*- End of function --------------------------------------------------------*/ int main(int argc, char **argv) { int rx_coeff_sets; int rx_coeffs_per_filter; int tx_coeff_sets; int tx_coeffs_per_filter; int opt; int transmit_modem; int fixed_point; double carrier; double baud_rate; double rx_excess_bandwidth; double tx_excess_bandwidth; const char *rx_tag; const char *tx_tag; const char *modem; fixed_point = FALSE; transmit_modem = FALSE; modem = ""; while ((opt = getopt(argc, argv, "im:rt")) != -1) { switch (opt) { case 'i': fixed_point = TRUE; break; case 'm': modem = optarg; break; case 'r': transmit_modem = FALSE; break; case 't': transmit_modem = TRUE; break; default: usage(); exit(2); break; } } if (strcmp(modem, "V.17") == 0 || strcmp(modem, "V.32bis") == 0) { /* This applies to V.32bis as well as V.17 */ rx_coeff_sets = 192; rx_coeffs_per_filter = 27; rx_excess_bandwidth = 0.5; tx_coeff_sets = 10; tx_coeffs_per_filter = 9; tx_excess_bandwidth = 0.25; carrier = 1800.0; baud_rate = 2400.0; rx_tag = ""; tx_tag = ""; } else if (strcmp(modem, "V.22bis") == 0) { /* This is only intended to apply to transmit. */ rx_coeff_sets = 12; rx_coeffs_per_filter = 27; rx_excess_bandwidth = 0.75; tx_coeff_sets = 40; tx_coeffs_per_filter = 9; tx_excess_bandwidth = 0.75; carrier = 1200.0; baud_rate = 600.0; rx_tag = ""; tx_tag = ""; } else if (strcmp(modem, "V.22bis1200") == 0) { /* This is only intended to apply to receive. */ rx_coeff_sets = 12; rx_coeffs_per_filter = 27; rx_excess_bandwidth = 0.75; tx_coeff_sets = 40; tx_coeffs_per_filter = 9; tx_excess_bandwidth = 0.75; carrier = 1200.0; baud_rate = 600.0; rx_tag = "_1200"; tx_tag = "_1200"; } else if (strcmp(modem, "V.22bis2400") == 0) { /* This is only intended to apply to receive. */ rx_coeff_sets = 12; rx_coeffs_per_filter = 27; rx_excess_bandwidth = 0.75; tx_coeff_sets = 40; tx_coeffs_per_filter = 9; tx_excess_bandwidth = 0.75; carrier = 2400.0; baud_rate = 600.0; rx_tag = "_2400"; tx_tag = "_2400"; } else if (strcmp(modem, "V.27ter2400") == 0) { rx_coeff_sets = 12; rx_coeffs_per_filter = 27; rx_excess_bandwidth = 0.5; tx_coeff_sets = 20; tx_coeffs_per_filter = 9; tx_excess_bandwidth = 0.5; carrier = 1800.0; baud_rate = 1200.0; rx_tag = "_2400"; tx_tag = "_2400"; } else if (strcmp(modem, "V.27ter4800") == 0) { rx_coeff_sets = 8; rx_coeffs_per_filter = 27; rx_excess_bandwidth = 0.5; tx_coeff_sets = 5; tx_coeffs_per_filter = 9; tx_excess_bandwidth = 0.5; carrier = 1800.0; baud_rate = 1600.0; rx_tag = "_4800"; tx_tag = "_4800"; } else if (strcmp(modem, "V.29") == 0) { rx_coeff_sets = 48; rx_coeffs_per_filter = 27; rx_excess_bandwidth = 0.5; tx_coeff_sets = 10; tx_coeffs_per_filter = 9; tx_excess_bandwidth = 0.25; carrier = 1700.0; baud_rate = 2400.0; rx_tag = ""; tx_tag = ""; } else { usage(); exit(2); } if (transmit_modem) { make_tx_filter(tx_coeff_sets, tx_coeffs_per_filter, carrier, baud_rate, tx_excess_bandwidth, fixed_point, tx_tag); } else { make_rx_filter(rx_coeff_sets, rx_coeffs_per_filter, carrier, baud_rate, rx_excess_bandwidth, fixed_point, rx_tag); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/logging.c0000664000175000017500000002035011422612262012467 00000000000000/* * SpanDSP - a series of DSP components for telephony * * logging.c - error and debug logging. * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/private/logging.h" static void default_message_handler(int level, const char *text); static message_handler_func_t __span_message = &default_message_handler; static error_handler_func_t __span_error = NULL; /* Note that this list *must* match the enum definition in logging.h */ static const char *severities[] = { "NONE", "ERROR", "WARNING", "PROTOCOL_ERROR", "PROTOCOL_WARNING", "FLOW", "FLOW 2", "FLOW 3", "DEBUG 1", "DEBUG 2", "DEBUG 3" }; static void default_message_handler(int level, const char *text) { fprintf(stderr, "%s", text); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) span_log_test(logging_state_t *s, int level) { if (s && (s->level & SPAN_LOG_SEVERITY_MASK) >= (level & SPAN_LOG_SEVERITY_MASK)) return TRUE; return FALSE; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) span_log(logging_state_t *s, int level, const char *format, ...) { char msg[1024 + 1]; va_list arg_ptr; int len; struct tm *tim; struct timeval nowx; time_t now; if (span_log_test(s, level)) { va_start(arg_ptr, format); len = 0; if ((level & SPAN_LOG_SUPPRESS_LABELLING) == 0) { if ((s->level & SPAN_LOG_SHOW_DATE)) { gettimeofday(&nowx, NULL); now = nowx.tv_sec; tim = gmtime(&now); len += snprintf(msg + len, 1024 - len, "%04d/%02d/%02d %02d:%02d:%02d.%03d ", tim->tm_year + 1900, tim->tm_mon + 1, tim->tm_mday, tim->tm_hour, tim->tm_min, tim->tm_sec, (int) nowx.tv_usec/1000); } /*endif*/ if ((s->level & SPAN_LOG_SHOW_SAMPLE_TIME)) { now = s->elapsed_samples/s->samples_per_second; tim = gmtime(&now); len += snprintf(msg + len, 1024 - len, "%02d:%02d:%02d.%03d ", tim->tm_hour, tim->tm_min, tim->tm_sec, (int) (s->elapsed_samples%s->samples_per_second)*1000/s->samples_per_second); } /*endif*/ if ((s->level & SPAN_LOG_SHOW_SEVERITY) && (level & SPAN_LOG_SEVERITY_MASK) <= SPAN_LOG_DEBUG_3) len += snprintf(msg + len, 1024 - len, "%s ", severities[level & SPAN_LOG_SEVERITY_MASK]); /*endif*/ if ((s->level & SPAN_LOG_SHOW_PROTOCOL) && s->protocol) len += snprintf(msg + len, 1024 - len, "%s ", s->protocol); /*endif*/ if ((s->level & SPAN_LOG_SHOW_TAG) && s->tag) len += snprintf(msg + len, 1024 - len, "%s ", s->tag); /*endif*/ } /*endif*/ len += vsnprintf(msg + len, 1024 - len, format, arg_ptr); if (s->span_error && level == SPAN_LOG_ERROR) s->span_error(msg); else if (__span_error && level == SPAN_LOG_ERROR) __span_error(msg); else if (s->span_message) s->span_message(level, msg); else if (__span_message) __span_message(level, msg); /*endif*/ va_end(arg_ptr); return 1; } /*endif*/ return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) span_log_buf(logging_state_t *s, int level, const char *tag, const uint8_t *buf, int len) { char msg[1024]; int i; int msg_len; if (span_log_test(s, level)) { msg_len = 0; if (tag) msg_len += snprintf(msg + msg_len, 1024 - msg_len, "%s", tag); for (i = 0; i < len && msg_len < 800; i++) msg_len += snprintf(msg + msg_len, 1024 - msg_len, " %02x", buf[i]); msg_len += snprintf(msg + msg_len, 1024 - msg_len, "\n"); return span_log(s, level, msg); } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) span_log_set_level(logging_state_t *s, int level) { s->level = level; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) span_log_set_tag(logging_state_t *s, const char *tag) { s->tag = tag; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) span_log_set_protocol(logging_state_t *s, const char *protocol) { s->protocol = protocol; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) span_log_set_sample_rate(logging_state_t *s, int samples_per_second) { s->samples_per_second = samples_per_second; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) span_log_bump_samples(logging_state_t *s, int samples) { s->elapsed_samples += samples; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) span_log_set_message_handler(logging_state_t *s, message_handler_func_t func) { s->span_message = func; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) span_log_set_error_handler(logging_state_t *s, error_handler_func_t func) { s->span_error = func; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) span_set_message_handler(message_handler_func_t func) { __span_message = func; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) span_set_error_handler(error_handler_func_t func) { __span_error = func; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) span_log_init(logging_state_t *s, int level, const char *tag) { if (s == NULL) { if ((s = (logging_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } s->span_error = __span_error; s->span_message = __span_message; s->level = level; s->tag = tag; s->protocol = NULL; s->samples_per_second = SAMPLE_RATE; s->elapsed_samples = 0; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) span_log_release(logging_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) span_log_free(logging_state_t *s) { if (s) free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/v17_v32bis_rx_constellation_maps.h0000664000175000017500000124065111422612263017354 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v17rx_v32bis_constellation_maps.h - ITU V.17 and V.32bis modems * receive part. * Constellation mapping. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* The following table maps the 8 soft-decisions associated with every possible point in the constellation space. If you look at the constellations carefully, all 4 can be accurately mapped at 0.5 unit resolution. */ static const uint8_t constel_maps[4][36][36][8] = { { /* 14,400bps map */ { {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x7a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x7a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x7a, 0x73, 0x4c, 0x05, 0x66, 0x7f}, {0x00, 0x49, 0x7a, 0x73, 0x4c, 0x05, 0x66, 0x7f}, {0x08, 0x49, 0x7a, 0x73, 0x4c, 0x05, 0x76, 0x7f}, {0x08, 0x49, 0x7a, 0x73, 0x4c, 0x05, 0x76, 0x7f}, {0x08, 0x41, 0x7a, 0x73, 0x4c, 0x0d, 0x76, 0x7f}, {0x08, 0x41, 0x7a, 0x73, 0x4c, 0x0d, 0x76, 0x7f}, {0x08, 0x41, 0x6a, 0x73, 0x44, 0x0d, 0x76, 0x7f}, {0x08, 0x41, 0x6a, 0x73, 0x44, 0x0d, 0x76, 0x7f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x76, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x76, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x56, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x56, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x56, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x56, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x56, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f} }, { {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x7a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x7a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x7a, 0x73, 0x4c, 0x05, 0x66, 0x7f}, {0x00, 0x49, 0x7a, 0x73, 0x4c, 0x05, 0x66, 0x7f}, {0x08, 0x49, 0x7a, 0x73, 0x4c, 0x05, 0x76, 0x7f}, {0x08, 0x49, 0x7a, 0x73, 0x4c, 0x05, 0x76, 0x7f}, {0x08, 0x41, 0x7a, 0x73, 0x4c, 0x0d, 0x76, 0x7f}, {0x08, 0x41, 0x7a, 0x73, 0x4c, 0x0d, 0x76, 0x7f}, {0x08, 0x41, 0x6a, 0x73, 0x44, 0x0d, 0x76, 0x7f}, {0x08, 0x41, 0x6a, 0x73, 0x44, 0x0d, 0x76, 0x7f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x76, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x76, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x56, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x56, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x56, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x56, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f} }, { {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x7a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x7a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x7a, 0x73, 0x4c, 0x05, 0x66, 0x7f}, {0x00, 0x49, 0x7a, 0x73, 0x4c, 0x05, 0x66, 0x7f}, {0x08, 0x49, 0x7a, 0x73, 0x4c, 0x05, 0x76, 0x7f}, {0x08, 0x49, 0x7a, 0x73, 0x4c, 0x05, 0x76, 0x7f}, {0x08, 0x41, 0x7a, 0x73, 0x4c, 0x0d, 0x76, 0x7f}, {0x08, 0x41, 0x7a, 0x73, 0x4c, 0x0d, 0x76, 0x7f}, {0x08, 0x41, 0x6a, 0x73, 0x44, 0x0d, 0x76, 0x7f}, {0x08, 0x41, 0x6a, 0x73, 0x44, 0x0d, 0x76, 0x7f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x76, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x76, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x56, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x56, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x56, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f} }, { {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x7a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x7a, 0x63, 0x4c, 0x05, 0x66, 0x5f}, {0x00, 0x49, 0x7a, 0x73, 0x4c, 0x05, 0x66, 0x7f}, {0x00, 0x49, 0x7a, 0x73, 0x4c, 0x05, 0x66, 0x7f}, {0x08, 0x49, 0x7a, 0x73, 0x4c, 0x05, 0x76, 0x7f}, {0x08, 0x49, 0x7a, 0x73, 0x4c, 0x05, 0x76, 0x7f}, {0x08, 0x41, 0x7a, 0x73, 0x4c, 0x0d, 0x76, 0x7f}, {0x08, 0x41, 0x7a, 0x73, 0x4c, 0x0d, 0x76, 0x7f}, {0x08, 0x41, 0x6a, 0x73, 0x44, 0x0d, 0x76, 0x7f}, {0x08, 0x41, 0x6a, 0x73, 0x44, 0x0d, 0x76, 0x7f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x76, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x76, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x56, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x56, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x0d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f} }, { {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x15, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x4c, 0x15, 0x66, 0x5f}, {0x00, 0x49, 0x7a, 0x63, 0x4c, 0x15, 0x66, 0x5f}, {0x00, 0x49, 0x7a, 0x63, 0x4c, 0x15, 0x66, 0x5f}, {0x00, 0x49, 0x7a, 0x73, 0x4c, 0x15, 0x66, 0x7f}, {0x00, 0x49, 0x7a, 0x73, 0x4c, 0x15, 0x66, 0x7f}, {0x08, 0x49, 0x7a, 0x73, 0x4c, 0x15, 0x76, 0x7f}, {0x08, 0x49, 0x7a, 0x73, 0x4c, 0x15, 0x76, 0x7f}, {0x08, 0x41, 0x7a, 0x73, 0x4c, 0x1d, 0x76, 0x7f}, {0x08, 0x41, 0x7a, 0x73, 0x4c, 0x1d, 0x76, 0x7f}, {0x08, 0x41, 0x6a, 0x73, 0x44, 0x1d, 0x76, 0x7f}, {0x08, 0x41, 0x6a, 0x73, 0x44, 0x1d, 0x76, 0x7f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x1d, 0x76, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x1d, 0x76, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x1d, 0x56, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x1d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f} }, { {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x15, 0x66, 0x5f}, {0x00, 0x49, 0x5a, 0x63, 0x6c, 0x15, 0x66, 0x5f}, {0x00, 0x49, 0x7a, 0x63, 0x4c, 0x15, 0x66, 0x5f}, {0x00, 0x49, 0x7a, 0x63, 0x4c, 0x15, 0x66, 0x5f}, {0x00, 0x49, 0x7a, 0x73, 0x4c, 0x15, 0x66, 0x7f}, {0x00, 0x49, 0x7a, 0x73, 0x4c, 0x15, 0x66, 0x7f}, {0x08, 0x49, 0x7a, 0x73, 0x4c, 0x15, 0x76, 0x7f}, {0x08, 0x49, 0x7a, 0x73, 0x4c, 0x15, 0x76, 0x7f}, {0x08, 0x41, 0x7a, 0x73, 0x4c, 0x1d, 0x76, 0x7f}, {0x08, 0x41, 0x7a, 0x73, 0x4c, 0x1d, 0x76, 0x7f}, {0x08, 0x41, 0x6a, 0x73, 0x44, 0x1d, 0x76, 0x7f}, {0x08, 0x41, 0x6a, 0x73, 0x44, 0x1d, 0x76, 0x7f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x1d, 0x76, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x1d, 0x76, 0x6f}, {0x08, 0x41, 0x6a, 0x53, 0x44, 0x1d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x1d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x44, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f} }, { {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x10, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x10, 0x49, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x10, 0x49, 0x5a, 0x63, 0x6c, 0x15, 0x66, 0x5f}, {0x10, 0x49, 0x5a, 0x63, 0x6c, 0x15, 0x66, 0x5f}, {0x10, 0x49, 0x7a, 0x63, 0x2c, 0x15, 0x66, 0x5f}, {0x10, 0x49, 0x7a, 0x63, 0x2c, 0x15, 0x66, 0x5f}, {0x10, 0x49, 0x7a, 0x73, 0x2c, 0x15, 0x66, 0x7f}, {0x10, 0x49, 0x7a, 0x73, 0x2c, 0x15, 0x66, 0x7f}, {0x18, 0x49, 0x7a, 0x73, 0x2c, 0x15, 0x76, 0x7f}, {0x18, 0x49, 0x7a, 0x73, 0x2c, 0x15, 0x76, 0x7f}, {0x18, 0x41, 0x7a, 0x73, 0x2c, 0x1d, 0x76, 0x7f}, {0x18, 0x41, 0x7a, 0x73, 0x2c, 0x1d, 0x76, 0x7f}, {0x18, 0x41, 0x6a, 0x73, 0x24, 0x1d, 0x76, 0x7f}, {0x18, 0x41, 0x6a, 0x73, 0x24, 0x1d, 0x76, 0x7f}, {0x18, 0x41, 0x6a, 0x53, 0x24, 0x1d, 0x76, 0x6f}, {0x18, 0x41, 0x6a, 0x53, 0x24, 0x1d, 0x76, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x24, 0x1d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x24, 0x1d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x24, 0x5d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x24, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f} }, { {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x55, 0x46, 0x0f}, {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x10, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x10, 0x69, 0x5a, 0x63, 0x6c, 0x55, 0x66, 0x5f}, {0x10, 0x49, 0x5a, 0x63, 0x6c, 0x15, 0x66, 0x5f}, {0x10, 0x49, 0x5a, 0x63, 0x6c, 0x15, 0x66, 0x5f}, {0x10, 0x49, 0x7a, 0x63, 0x2c, 0x15, 0x66, 0x5f}, {0x10, 0x49, 0x7a, 0x63, 0x2c, 0x15, 0x66, 0x5f}, {0x10, 0x49, 0x7a, 0x73, 0x2c, 0x15, 0x66, 0x7f}, {0x10, 0x49, 0x7a, 0x73, 0x2c, 0x15, 0x66, 0x7f}, {0x18, 0x49, 0x7a, 0x73, 0x2c, 0x15, 0x76, 0x7f}, {0x18, 0x49, 0x7a, 0x73, 0x2c, 0x15, 0x76, 0x7f}, {0x18, 0x41, 0x7a, 0x73, 0x2c, 0x1d, 0x76, 0x7f}, {0x18, 0x41, 0x7a, 0x73, 0x2c, 0x1d, 0x76, 0x7f}, {0x18, 0x41, 0x6a, 0x73, 0x24, 0x1d, 0x76, 0x7f}, {0x18, 0x41, 0x6a, 0x73, 0x24, 0x1d, 0x76, 0x7f}, {0x18, 0x41, 0x6a, 0x53, 0x24, 0x1d, 0x76, 0x6f}, {0x18, 0x41, 0x6a, 0x53, 0x24, 0x1d, 0x76, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x24, 0x1d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x24, 0x1d, 0x56, 0x6f}, {0x58, 0x41, 0x6a, 0x53, 0x24, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x24, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x53, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x06, 0x4f} }, { {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x55, 0x46, 0x0f}, {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x55, 0x46, 0x0f}, {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x23, 0x6c, 0x55, 0x66, 0x5f}, {0x50, 0x69, 0x5a, 0x23, 0x6c, 0x55, 0x66, 0x5f}, {0x10, 0x69, 0x5a, 0x23, 0x6c, 0x55, 0x66, 0x5f}, {0x10, 0x69, 0x5a, 0x23, 0x6c, 0x55, 0x66, 0x5f}, {0x10, 0x29, 0x5a, 0x23, 0x6c, 0x15, 0x66, 0x5f}, {0x10, 0x29, 0x5a, 0x23, 0x6c, 0x15, 0x66, 0x5f}, {0x10, 0x29, 0x7a, 0x23, 0x2c, 0x15, 0x66, 0x5f}, {0x10, 0x29, 0x7a, 0x23, 0x2c, 0x15, 0x66, 0x5f}, {0x10, 0x29, 0x7a, 0x33, 0x2c, 0x15, 0x66, 0x7f}, {0x10, 0x29, 0x7a, 0x33, 0x2c, 0x15, 0x66, 0x7f}, {0x18, 0x29, 0x7a, 0x33, 0x2c, 0x15, 0x76, 0x7f}, {0x18, 0x29, 0x7a, 0x33, 0x2c, 0x15, 0x76, 0x7f}, {0x18, 0x21, 0x7a, 0x33, 0x2c, 0x1d, 0x76, 0x7f}, {0x18, 0x21, 0x7a, 0x33, 0x2c, 0x1d, 0x76, 0x7f}, {0x18, 0x21, 0x6a, 0x33, 0x24, 0x1d, 0x76, 0x7f}, {0x18, 0x21, 0x6a, 0x33, 0x24, 0x1d, 0x76, 0x7f}, {0x18, 0x21, 0x6a, 0x13, 0x24, 0x1d, 0x76, 0x6f}, {0x18, 0x21, 0x6a, 0x13, 0x24, 0x1d, 0x76, 0x6f}, {0x58, 0x21, 0x6a, 0x13, 0x24, 0x1d, 0x56, 0x6f}, {0x58, 0x21, 0x6a, 0x13, 0x24, 0x1d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x13, 0x24, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x13, 0x24, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x13, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x13, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x06, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x06, 0x4f} }, { {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x55, 0x46, 0x0f}, {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x55, 0x46, 0x0f}, {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x55, 0x46, 0x0f}, {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x23, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x5a, 0x23, 0x6c, 0x55, 0x66, 0x5f}, {0x10, 0x69, 0x5a, 0x23, 0x6c, 0x55, 0x66, 0x5f}, {0x10, 0x69, 0x5a, 0x23, 0x6c, 0x55, 0x66, 0x5f}, {0x10, 0x29, 0x5a, 0x23, 0x6c, 0x15, 0x66, 0x5f}, {0x10, 0x29, 0x5a, 0x23, 0x6c, 0x15, 0x66, 0x5f}, {0x10, 0x29, 0x7a, 0x23, 0x2c, 0x15, 0x66, 0x5f}, {0x10, 0x29, 0x7a, 0x23, 0x2c, 0x15, 0x66, 0x5f}, {0x10, 0x29, 0x7a, 0x33, 0x2c, 0x15, 0x66, 0x7f}, {0x10, 0x29, 0x7a, 0x33, 0x2c, 0x15, 0x66, 0x7f}, {0x18, 0x29, 0x7a, 0x33, 0x2c, 0x15, 0x76, 0x7f}, {0x18, 0x29, 0x7a, 0x33, 0x2c, 0x15, 0x76, 0x7f}, {0x18, 0x21, 0x7a, 0x33, 0x2c, 0x1d, 0x76, 0x7f}, {0x18, 0x21, 0x7a, 0x33, 0x2c, 0x1d, 0x76, 0x7f}, {0x18, 0x21, 0x6a, 0x33, 0x24, 0x1d, 0x76, 0x7f}, {0x18, 0x21, 0x6a, 0x33, 0x24, 0x1d, 0x76, 0x7f}, {0x18, 0x21, 0x6a, 0x13, 0x24, 0x1d, 0x76, 0x6f}, {0x18, 0x21, 0x6a, 0x13, 0x24, 0x1d, 0x76, 0x6f}, {0x58, 0x21, 0x6a, 0x13, 0x24, 0x1d, 0x56, 0x6f}, {0x58, 0x21, 0x6a, 0x13, 0x24, 0x1d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x13, 0x24, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x13, 0x24, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x6a, 0x13, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x13, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x56, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x06, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x06, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x06, 0x4f} }, { {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x55, 0x46, 0x0f}, {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x55, 0x46, 0x0f}, {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x55, 0x46, 0x0f}, {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x55, 0x46, 0x0f}, {0x50, 0x69, 0x1a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x1a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x1a, 0x23, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x1a, 0x23, 0x6c, 0x55, 0x46, 0x5f}, {0x10, 0x69, 0x1a, 0x23, 0x6c, 0x55, 0x26, 0x5f}, {0x10, 0x69, 0x1a, 0x23, 0x6c, 0x55, 0x26, 0x5f}, {0x10, 0x29, 0x1a, 0x23, 0x6c, 0x15, 0x26, 0x5f}, {0x10, 0x29, 0x1a, 0x23, 0x6c, 0x15, 0x26, 0x5f}, {0x10, 0x29, 0x3a, 0x23, 0x2c, 0x15, 0x26, 0x5f}, {0x10, 0x29, 0x3a, 0x23, 0x2c, 0x15, 0x26, 0x5f}, {0x10, 0x29, 0x3a, 0x33, 0x2c, 0x15, 0x26, 0x7f}, {0x10, 0x29, 0x3a, 0x33, 0x2c, 0x15, 0x26, 0x7f}, {0x18, 0x29, 0x3a, 0x33, 0x2c, 0x15, 0x36, 0x7f}, {0x18, 0x29, 0x3a, 0x33, 0x2c, 0x15, 0x36, 0x7f}, {0x18, 0x21, 0x3a, 0x33, 0x2c, 0x1d, 0x36, 0x7f}, {0x18, 0x21, 0x3a, 0x33, 0x2c, 0x1d, 0x36, 0x7f}, {0x18, 0x21, 0x2a, 0x33, 0x24, 0x1d, 0x36, 0x7f}, {0x18, 0x21, 0x2a, 0x33, 0x24, 0x1d, 0x36, 0x7f}, {0x18, 0x21, 0x2a, 0x13, 0x24, 0x1d, 0x36, 0x6f}, {0x18, 0x21, 0x2a, 0x13, 0x24, 0x1d, 0x36, 0x6f}, {0x58, 0x21, 0x2a, 0x13, 0x24, 0x1d, 0x16, 0x6f}, {0x58, 0x21, 0x2a, 0x13, 0x24, 0x1d, 0x16, 0x6f}, {0x58, 0x61, 0x2a, 0x13, 0x24, 0x5d, 0x16, 0x6f}, {0x58, 0x61, 0x2a, 0x13, 0x24, 0x5d, 0x16, 0x6f}, {0x58, 0x61, 0x4a, 0x13, 0x64, 0x5d, 0x16, 0x6f}, {0x58, 0x61, 0x4a, 0x13, 0x64, 0x5d, 0x16, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x16, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x16, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x06, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x06, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x06, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x06, 0x4f} }, { {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x55, 0x46, 0x0f}, {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x55, 0x46, 0x0f}, {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x55, 0x46, 0x0f}, {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x55, 0x46, 0x0f}, {0x50, 0x69, 0x1a, 0x43, 0x6c, 0x55, 0x46, 0x0f}, {0x50, 0x69, 0x1a, 0x43, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x1a, 0x23, 0x6c, 0x55, 0x46, 0x5f}, {0x50, 0x69, 0x1a, 0x23, 0x6c, 0x55, 0x46, 0x5f}, {0x10, 0x69, 0x1a, 0x23, 0x6c, 0x55, 0x26, 0x5f}, {0x10, 0x69, 0x1a, 0x23, 0x6c, 0x55, 0x26, 0x5f}, {0x10, 0x29, 0x1a, 0x23, 0x6c, 0x15, 0x26, 0x5f}, {0x10, 0x29, 0x1a, 0x23, 0x6c, 0x15, 0x26, 0x5f}, {0x10, 0x29, 0x3a, 0x23, 0x2c, 0x15, 0x26, 0x5f}, {0x10, 0x29, 0x3a, 0x23, 0x2c, 0x15, 0x26, 0x5f}, {0x10, 0x29, 0x3a, 0x33, 0x2c, 0x15, 0x26, 0x7f}, {0x10, 0x29, 0x3a, 0x33, 0x2c, 0x15, 0x26, 0x7f}, {0x18, 0x29, 0x3a, 0x33, 0x2c, 0x15, 0x36, 0x7f}, {0x18, 0x29, 0x3a, 0x33, 0x2c, 0x15, 0x36, 0x7f}, {0x18, 0x21, 0x3a, 0x33, 0x2c, 0x1d, 0x36, 0x7f}, {0x18, 0x21, 0x3a, 0x33, 0x2c, 0x1d, 0x36, 0x7f}, {0x18, 0x21, 0x2a, 0x33, 0x24, 0x1d, 0x36, 0x7f}, {0x18, 0x21, 0x2a, 0x33, 0x24, 0x1d, 0x36, 0x7f}, {0x18, 0x21, 0x2a, 0x13, 0x24, 0x1d, 0x36, 0x6f}, {0x18, 0x21, 0x2a, 0x13, 0x24, 0x1d, 0x36, 0x6f}, {0x58, 0x21, 0x2a, 0x13, 0x24, 0x1d, 0x16, 0x6f}, {0x58, 0x21, 0x2a, 0x13, 0x24, 0x1d, 0x16, 0x6f}, {0x58, 0x61, 0x2a, 0x13, 0x24, 0x5d, 0x16, 0x6f}, {0x58, 0x61, 0x2a, 0x13, 0x24, 0x5d, 0x16, 0x6f}, {0x58, 0x61, 0x4a, 0x13, 0x64, 0x5d, 0x16, 0x6f}, {0x58, 0x61, 0x4a, 0x13, 0x64, 0x5d, 0x16, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x16, 0x6f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x16, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x06, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x06, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x06, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x5d, 0x06, 0x4f} }, { {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x75, 0x46, 0x0f}, {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x75, 0x46, 0x0f}, {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x75, 0x46, 0x0f}, {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x75, 0x46, 0x0f}, {0x50, 0x69, 0x1a, 0x43, 0x6c, 0x75, 0x46, 0x0f}, {0x50, 0x69, 0x1a, 0x43, 0x6c, 0x75, 0x46, 0x0f}, {0x50, 0x69, 0x1a, 0x23, 0x6c, 0x75, 0x46, 0x1f}, {0x50, 0x69, 0x1a, 0x23, 0x6c, 0x75, 0x46, 0x1f}, {0x10, 0x69, 0x1a, 0x23, 0x6c, 0x75, 0x26, 0x1f}, {0x10, 0x69, 0x1a, 0x23, 0x6c, 0x75, 0x26, 0x1f}, {0x10, 0x29, 0x1a, 0x23, 0x6c, 0x35, 0x26, 0x1f}, {0x10, 0x29, 0x1a, 0x23, 0x6c, 0x35, 0x26, 0x1f}, {0x10, 0x29, 0x3a, 0x23, 0x2c, 0x35, 0x26, 0x1f}, {0x10, 0x29, 0x3a, 0x23, 0x2c, 0x35, 0x26, 0x1f}, {0x10, 0x29, 0x3a, 0x33, 0x2c, 0x35, 0x26, 0x3f}, {0x10, 0x29, 0x3a, 0x33, 0x2c, 0x35, 0x26, 0x3f}, {0x18, 0x29, 0x3a, 0x33, 0x2c, 0x35, 0x36, 0x3f}, {0x18, 0x29, 0x3a, 0x33, 0x2c, 0x35, 0x36, 0x3f}, {0x18, 0x21, 0x3a, 0x33, 0x2c, 0x3d, 0x36, 0x3f}, {0x18, 0x21, 0x3a, 0x33, 0x2c, 0x3d, 0x36, 0x3f}, {0x18, 0x21, 0x2a, 0x33, 0x24, 0x3d, 0x36, 0x3f}, {0x18, 0x21, 0x2a, 0x33, 0x24, 0x3d, 0x36, 0x3f}, {0x18, 0x21, 0x2a, 0x13, 0x24, 0x3d, 0x36, 0x2f}, {0x18, 0x21, 0x2a, 0x13, 0x24, 0x3d, 0x36, 0x2f}, {0x58, 0x21, 0x2a, 0x13, 0x24, 0x3d, 0x16, 0x2f}, {0x58, 0x21, 0x2a, 0x13, 0x24, 0x3d, 0x16, 0x2f}, {0x58, 0x61, 0x2a, 0x13, 0x24, 0x7d, 0x16, 0x2f}, {0x58, 0x61, 0x2a, 0x13, 0x24, 0x7d, 0x16, 0x2f}, {0x58, 0x61, 0x4a, 0x13, 0x64, 0x7d, 0x16, 0x2f}, {0x58, 0x61, 0x4a, 0x13, 0x64, 0x7d, 0x16, 0x2f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x7d, 0x16, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x7d, 0x16, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x7d, 0x06, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x7d, 0x06, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x7d, 0x06, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x7d, 0x06, 0x4f} }, { {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x75, 0x46, 0x0f}, {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x75, 0x46, 0x0f}, {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x75, 0x46, 0x0f}, {0x50, 0x69, 0x0a, 0x43, 0x6c, 0x75, 0x46, 0x0f}, {0x50, 0x69, 0x1a, 0x43, 0x6c, 0x75, 0x46, 0x0f}, {0x50, 0x69, 0x1a, 0x43, 0x6c, 0x75, 0x46, 0x0f}, {0x50, 0x69, 0x1a, 0x23, 0x6c, 0x75, 0x46, 0x1f}, {0x50, 0x69, 0x1a, 0x23, 0x6c, 0x75, 0x46, 0x1f}, {0x10, 0x69, 0x1a, 0x23, 0x6c, 0x75, 0x26, 0x1f}, {0x10, 0x69, 0x1a, 0x23, 0x6c, 0x75, 0x26, 0x1f}, {0x10, 0x29, 0x1a, 0x23, 0x6c, 0x35, 0x26, 0x1f}, {0x10, 0x29, 0x1a, 0x23, 0x6c, 0x35, 0x26, 0x1f}, {0x10, 0x29, 0x3a, 0x23, 0x2c, 0x35, 0x26, 0x1f}, {0x10, 0x29, 0x3a, 0x23, 0x2c, 0x35, 0x26, 0x1f}, {0x10, 0x29, 0x3a, 0x33, 0x2c, 0x35, 0x26, 0x3f}, {0x10, 0x29, 0x3a, 0x33, 0x2c, 0x35, 0x26, 0x3f}, {0x18, 0x29, 0x3a, 0x33, 0x2c, 0x35, 0x36, 0x3f}, {0x18, 0x29, 0x3a, 0x33, 0x2c, 0x35, 0x36, 0x3f}, {0x18, 0x21, 0x3a, 0x33, 0x2c, 0x3d, 0x36, 0x3f}, {0x18, 0x21, 0x3a, 0x33, 0x2c, 0x3d, 0x36, 0x3f}, {0x18, 0x21, 0x2a, 0x33, 0x24, 0x3d, 0x36, 0x3f}, {0x18, 0x21, 0x2a, 0x33, 0x24, 0x3d, 0x36, 0x3f}, {0x18, 0x21, 0x2a, 0x13, 0x24, 0x3d, 0x36, 0x2f}, {0x18, 0x21, 0x2a, 0x13, 0x24, 0x3d, 0x36, 0x2f}, {0x58, 0x21, 0x2a, 0x13, 0x24, 0x3d, 0x16, 0x2f}, {0x58, 0x21, 0x2a, 0x13, 0x24, 0x3d, 0x16, 0x2f}, {0x58, 0x61, 0x2a, 0x13, 0x24, 0x7d, 0x16, 0x2f}, {0x58, 0x61, 0x2a, 0x13, 0x24, 0x7d, 0x16, 0x2f}, {0x58, 0x61, 0x4a, 0x13, 0x64, 0x7d, 0x16, 0x2f}, {0x58, 0x61, 0x4a, 0x13, 0x64, 0x7d, 0x16, 0x2f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x7d, 0x16, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x7d, 0x16, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x7d, 0x06, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x7d, 0x06, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x7d, 0x06, 0x4f}, {0x58, 0x61, 0x4a, 0x03, 0x64, 0x7d, 0x06, 0x4f} }, { {0x70, 0x69, 0x0a, 0x43, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x69, 0x0a, 0x43, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x69, 0x0a, 0x43, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x69, 0x0a, 0x43, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x69, 0x1a, 0x43, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x69, 0x1a, 0x43, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x69, 0x1a, 0x23, 0x7c, 0x75, 0x46, 0x1f}, {0x70, 0x69, 0x1a, 0x23, 0x7c, 0x75, 0x46, 0x1f}, {0x30, 0x69, 0x1a, 0x23, 0x7c, 0x75, 0x26, 0x1f}, {0x30, 0x69, 0x1a, 0x23, 0x7c, 0x75, 0x26, 0x1f}, {0x30, 0x29, 0x1a, 0x23, 0x7c, 0x35, 0x26, 0x1f}, {0x30, 0x29, 0x1a, 0x23, 0x7c, 0x35, 0x26, 0x1f}, {0x30, 0x29, 0x3a, 0x23, 0x3c, 0x35, 0x26, 0x1f}, {0x30, 0x29, 0x3a, 0x23, 0x3c, 0x35, 0x26, 0x1f}, {0x30, 0x29, 0x3a, 0x33, 0x3c, 0x35, 0x26, 0x3f}, {0x30, 0x29, 0x3a, 0x33, 0x3c, 0x35, 0x26, 0x3f}, {0x38, 0x29, 0x3a, 0x33, 0x3c, 0x35, 0x36, 0x3f}, {0x38, 0x29, 0x3a, 0x33, 0x3c, 0x35, 0x36, 0x3f}, {0x38, 0x21, 0x3a, 0x33, 0x3c, 0x3d, 0x36, 0x3f}, {0x38, 0x21, 0x3a, 0x33, 0x3c, 0x3d, 0x36, 0x3f}, {0x38, 0x21, 0x2a, 0x33, 0x34, 0x3d, 0x36, 0x3f}, {0x38, 0x21, 0x2a, 0x33, 0x34, 0x3d, 0x36, 0x3f}, {0x38, 0x21, 0x2a, 0x13, 0x34, 0x3d, 0x36, 0x2f}, {0x38, 0x21, 0x2a, 0x13, 0x34, 0x3d, 0x36, 0x2f}, {0x78, 0x21, 0x2a, 0x13, 0x34, 0x3d, 0x16, 0x2f}, {0x78, 0x21, 0x2a, 0x13, 0x34, 0x3d, 0x16, 0x2f}, {0x78, 0x61, 0x2a, 0x13, 0x34, 0x7d, 0x16, 0x2f}, {0x78, 0x61, 0x2a, 0x13, 0x34, 0x7d, 0x16, 0x2f}, {0x78, 0x61, 0x4a, 0x13, 0x74, 0x7d, 0x16, 0x2f}, {0x78, 0x61, 0x4a, 0x13, 0x74, 0x7d, 0x16, 0x2f}, {0x78, 0x61, 0x4a, 0x03, 0x74, 0x7d, 0x16, 0x4f}, {0x78, 0x61, 0x4a, 0x03, 0x74, 0x7d, 0x16, 0x4f}, {0x78, 0x61, 0x4a, 0x03, 0x74, 0x7d, 0x06, 0x4f}, {0x78, 0x61, 0x4a, 0x03, 0x74, 0x7d, 0x06, 0x4f}, {0x78, 0x61, 0x4a, 0x03, 0x74, 0x7d, 0x06, 0x4f}, {0x78, 0x61, 0x4a, 0x03, 0x74, 0x7d, 0x06, 0x4f} }, { {0x70, 0x69, 0x0a, 0x43, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x69, 0x0a, 0x43, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x69, 0x0a, 0x43, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x69, 0x0a, 0x43, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x69, 0x1a, 0x43, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x69, 0x1a, 0x43, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x69, 0x1a, 0x23, 0x7c, 0x75, 0x46, 0x1f}, {0x70, 0x69, 0x1a, 0x23, 0x7c, 0x75, 0x46, 0x1f}, {0x30, 0x69, 0x1a, 0x23, 0x7c, 0x75, 0x26, 0x1f}, {0x30, 0x69, 0x1a, 0x23, 0x7c, 0x75, 0x26, 0x1f}, {0x30, 0x29, 0x1a, 0x23, 0x7c, 0x35, 0x26, 0x1f}, {0x30, 0x29, 0x1a, 0x23, 0x7c, 0x35, 0x26, 0x1f}, {0x30, 0x29, 0x3a, 0x23, 0x3c, 0x35, 0x26, 0x1f}, {0x30, 0x29, 0x3a, 0x23, 0x3c, 0x35, 0x26, 0x1f}, {0x30, 0x29, 0x3a, 0x33, 0x3c, 0x35, 0x26, 0x3f}, {0x30, 0x29, 0x3a, 0x33, 0x3c, 0x35, 0x26, 0x3f}, {0x38, 0x29, 0x3a, 0x33, 0x3c, 0x35, 0x36, 0x3f}, {0x38, 0x29, 0x3a, 0x33, 0x3c, 0x35, 0x36, 0x3f}, {0x38, 0x21, 0x3a, 0x33, 0x3c, 0x3d, 0x36, 0x3f}, {0x38, 0x21, 0x3a, 0x33, 0x3c, 0x3d, 0x36, 0x3f}, {0x38, 0x21, 0x2a, 0x33, 0x34, 0x3d, 0x36, 0x3f}, {0x38, 0x21, 0x2a, 0x33, 0x34, 0x3d, 0x36, 0x3f}, {0x38, 0x21, 0x2a, 0x13, 0x34, 0x3d, 0x36, 0x2f}, {0x38, 0x21, 0x2a, 0x13, 0x34, 0x3d, 0x36, 0x2f}, {0x78, 0x21, 0x2a, 0x13, 0x34, 0x3d, 0x16, 0x2f}, {0x78, 0x21, 0x2a, 0x13, 0x34, 0x3d, 0x16, 0x2f}, {0x78, 0x61, 0x2a, 0x13, 0x34, 0x7d, 0x16, 0x2f}, {0x78, 0x61, 0x2a, 0x13, 0x34, 0x7d, 0x16, 0x2f}, {0x78, 0x61, 0x4a, 0x13, 0x74, 0x7d, 0x16, 0x2f}, {0x78, 0x61, 0x4a, 0x13, 0x74, 0x7d, 0x16, 0x2f}, {0x78, 0x61, 0x4a, 0x03, 0x74, 0x7d, 0x16, 0x4f}, {0x78, 0x61, 0x4a, 0x03, 0x74, 0x7d, 0x16, 0x4f}, {0x78, 0x61, 0x4a, 0x03, 0x74, 0x7d, 0x06, 0x4f}, {0x78, 0x61, 0x4a, 0x03, 0x74, 0x7d, 0x06, 0x4f}, {0x78, 0x61, 0x4a, 0x03, 0x74, 0x7d, 0x06, 0x4f}, {0x78, 0x61, 0x4a, 0x03, 0x74, 0x7d, 0x06, 0x4f} }, { {0x70, 0x79, 0x0a, 0x4b, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x79, 0x0a, 0x4b, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x79, 0x0a, 0x4b, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x79, 0x0a, 0x4b, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x79, 0x1a, 0x4b, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x79, 0x1a, 0x4b, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x79, 0x1a, 0x2b, 0x7c, 0x75, 0x46, 0x1f}, {0x70, 0x79, 0x1a, 0x2b, 0x7c, 0x75, 0x46, 0x1f}, {0x30, 0x79, 0x1a, 0x2b, 0x7c, 0x75, 0x26, 0x1f}, {0x30, 0x79, 0x1a, 0x2b, 0x7c, 0x75, 0x26, 0x1f}, {0x30, 0x39, 0x1a, 0x2b, 0x7c, 0x35, 0x26, 0x1f}, {0x30, 0x39, 0x1a, 0x2b, 0x7c, 0x35, 0x26, 0x1f}, {0x30, 0x39, 0x3a, 0x2b, 0x3c, 0x35, 0x26, 0x1f}, {0x30, 0x39, 0x3a, 0x2b, 0x3c, 0x35, 0x26, 0x1f}, {0x30, 0x39, 0x3a, 0x3b, 0x3c, 0x35, 0x26, 0x3f}, {0x30, 0x39, 0x3a, 0x3b, 0x3c, 0x35, 0x26, 0x3f}, {0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x35, 0x36, 0x3f}, {0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x35, 0x36, 0x3f}, {0x38, 0x31, 0x3a, 0x3b, 0x3c, 0x3d, 0x36, 0x3f}, {0x38, 0x31, 0x3a, 0x3b, 0x3c, 0x3d, 0x36, 0x3f}, {0x38, 0x31, 0x2a, 0x3b, 0x34, 0x3d, 0x36, 0x3f}, {0x38, 0x31, 0x2a, 0x3b, 0x34, 0x3d, 0x36, 0x3f}, {0x38, 0x31, 0x2a, 0x1b, 0x34, 0x3d, 0x36, 0x2f}, {0x38, 0x31, 0x2a, 0x1b, 0x34, 0x3d, 0x36, 0x2f}, {0x78, 0x31, 0x2a, 0x1b, 0x34, 0x3d, 0x16, 0x2f}, {0x78, 0x31, 0x2a, 0x1b, 0x34, 0x3d, 0x16, 0x2f}, {0x78, 0x71, 0x2a, 0x1b, 0x34, 0x7d, 0x16, 0x2f}, {0x78, 0x71, 0x2a, 0x1b, 0x34, 0x7d, 0x16, 0x2f}, {0x78, 0x71, 0x4a, 0x1b, 0x74, 0x7d, 0x16, 0x2f}, {0x78, 0x71, 0x4a, 0x1b, 0x74, 0x7d, 0x16, 0x2f}, {0x78, 0x71, 0x4a, 0x0b, 0x74, 0x7d, 0x16, 0x4f}, {0x78, 0x71, 0x4a, 0x0b, 0x74, 0x7d, 0x16, 0x4f}, {0x78, 0x71, 0x4a, 0x0b, 0x74, 0x7d, 0x06, 0x4f}, {0x78, 0x71, 0x4a, 0x0b, 0x74, 0x7d, 0x06, 0x4f}, {0x78, 0x71, 0x4a, 0x0b, 0x74, 0x7d, 0x06, 0x4f}, {0x78, 0x71, 0x4a, 0x0b, 0x74, 0x7d, 0x06, 0x4f} }, { {0x70, 0x79, 0x0a, 0x4b, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x79, 0x0a, 0x4b, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x79, 0x0a, 0x4b, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x79, 0x0a, 0x4b, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x79, 0x1a, 0x4b, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x79, 0x1a, 0x4b, 0x7c, 0x75, 0x46, 0x0f}, {0x70, 0x79, 0x1a, 0x2b, 0x7c, 0x75, 0x46, 0x1f}, {0x70, 0x79, 0x1a, 0x2b, 0x7c, 0x75, 0x46, 0x1f}, {0x30, 0x79, 0x1a, 0x2b, 0x7c, 0x75, 0x26, 0x1f}, {0x30, 0x79, 0x1a, 0x2b, 0x7c, 0x75, 0x26, 0x1f}, {0x30, 0x39, 0x1a, 0x2b, 0x7c, 0x35, 0x26, 0x1f}, {0x30, 0x39, 0x1a, 0x2b, 0x7c, 0x35, 0x26, 0x1f}, {0x30, 0x39, 0x3a, 0x2b, 0x3c, 0x35, 0x26, 0x1f}, {0x30, 0x39, 0x3a, 0x2b, 0x3c, 0x35, 0x26, 0x1f}, {0x30, 0x39, 0x3a, 0x3b, 0x3c, 0x35, 0x26, 0x3f}, {0x30, 0x39, 0x3a, 0x3b, 0x3c, 0x35, 0x26, 0x3f}, {0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x35, 0x36, 0x3f}, {0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x35, 0x36, 0x3f}, {0x38, 0x31, 0x3a, 0x3b, 0x3c, 0x3d, 0x36, 0x3f}, {0x38, 0x31, 0x3a, 0x3b, 0x3c, 0x3d, 0x36, 0x3f}, {0x38, 0x31, 0x2a, 0x3b, 0x34, 0x3d, 0x36, 0x3f}, {0x38, 0x31, 0x2a, 0x3b, 0x34, 0x3d, 0x36, 0x3f}, {0x38, 0x31, 0x2a, 0x1b, 0x34, 0x3d, 0x36, 0x2f}, {0x38, 0x31, 0x2a, 0x1b, 0x34, 0x3d, 0x36, 0x2f}, {0x78, 0x31, 0x2a, 0x1b, 0x34, 0x3d, 0x16, 0x2f}, {0x78, 0x31, 0x2a, 0x1b, 0x34, 0x3d, 0x16, 0x2f}, {0x78, 0x71, 0x2a, 0x1b, 0x34, 0x7d, 0x16, 0x2f}, {0x78, 0x71, 0x2a, 0x1b, 0x34, 0x7d, 0x16, 0x2f}, {0x78, 0x71, 0x4a, 0x1b, 0x74, 0x7d, 0x16, 0x2f}, {0x78, 0x71, 0x4a, 0x1b, 0x74, 0x7d, 0x16, 0x2f}, {0x78, 0x71, 0x4a, 0x0b, 0x74, 0x7d, 0x16, 0x4f}, {0x78, 0x71, 0x4a, 0x0b, 0x74, 0x7d, 0x16, 0x4f}, {0x78, 0x71, 0x4a, 0x0b, 0x74, 0x7d, 0x06, 0x4f}, {0x78, 0x71, 0x4a, 0x0b, 0x74, 0x7d, 0x06, 0x4f}, {0x78, 0x71, 0x4a, 0x0b, 0x74, 0x7d, 0x06, 0x4f}, {0x78, 0x71, 0x4a, 0x0b, 0x74, 0x7d, 0x06, 0x4f} }, { {0x70, 0x79, 0x02, 0x4b, 0x7c, 0x75, 0x4e, 0x0f}, {0x70, 0x79, 0x02, 0x4b, 0x7c, 0x75, 0x4e, 0x0f}, {0x70, 0x79, 0x02, 0x4b, 0x7c, 0x75, 0x4e, 0x0f}, {0x70, 0x79, 0x02, 0x4b, 0x7c, 0x75, 0x4e, 0x0f}, {0x70, 0x79, 0x12, 0x4b, 0x7c, 0x75, 0x4e, 0x0f}, {0x70, 0x79, 0x12, 0x4b, 0x7c, 0x75, 0x4e, 0x0f}, {0x70, 0x79, 0x12, 0x2b, 0x7c, 0x75, 0x4e, 0x1f}, {0x70, 0x79, 0x12, 0x2b, 0x7c, 0x75, 0x4e, 0x1f}, {0x30, 0x79, 0x12, 0x2b, 0x7c, 0x75, 0x2e, 0x1f}, {0x30, 0x79, 0x12, 0x2b, 0x7c, 0x75, 0x2e, 0x1f}, {0x30, 0x39, 0x12, 0x2b, 0x7c, 0x35, 0x2e, 0x1f}, {0x30, 0x39, 0x12, 0x2b, 0x7c, 0x35, 0x2e, 0x1f}, {0x30, 0x39, 0x32, 0x2b, 0x3c, 0x35, 0x2e, 0x1f}, {0x30, 0x39, 0x32, 0x2b, 0x3c, 0x35, 0x2e, 0x1f}, {0x30, 0x39, 0x32, 0x3b, 0x3c, 0x35, 0x2e, 0x3f}, {0x30, 0x39, 0x32, 0x3b, 0x3c, 0x35, 0x2e, 0x3f}, {0x38, 0x39, 0x32, 0x3b, 0x3c, 0x35, 0x3e, 0x3f}, {0x38, 0x39, 0x32, 0x3b, 0x3c, 0x35, 0x3e, 0x3f}, {0x38, 0x31, 0x32, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f}, {0x38, 0x31, 0x32, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f}, {0x38, 0x31, 0x22, 0x3b, 0x34, 0x3d, 0x3e, 0x3f}, {0x38, 0x31, 0x22, 0x3b, 0x34, 0x3d, 0x3e, 0x3f}, {0x38, 0x31, 0x22, 0x1b, 0x34, 0x3d, 0x3e, 0x2f}, {0x38, 0x31, 0x22, 0x1b, 0x34, 0x3d, 0x3e, 0x2f}, {0x78, 0x31, 0x22, 0x1b, 0x34, 0x3d, 0x1e, 0x2f}, {0x78, 0x31, 0x22, 0x1b, 0x34, 0x3d, 0x1e, 0x2f}, {0x78, 0x71, 0x22, 0x1b, 0x34, 0x7d, 0x1e, 0x2f}, {0x78, 0x71, 0x22, 0x1b, 0x34, 0x7d, 0x1e, 0x2f}, {0x78, 0x71, 0x42, 0x1b, 0x74, 0x7d, 0x1e, 0x2f}, {0x78, 0x71, 0x42, 0x1b, 0x74, 0x7d, 0x1e, 0x2f}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x7d, 0x1e, 0x4f}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x7d, 0x1e, 0x4f}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x7d, 0x0e, 0x4f}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x7d, 0x0e, 0x4f}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x7d, 0x0e, 0x4f}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x7d, 0x0e, 0x4f} }, { {0x70, 0x79, 0x02, 0x4b, 0x7c, 0x75, 0x4e, 0x0f}, {0x70, 0x79, 0x02, 0x4b, 0x7c, 0x75, 0x4e, 0x0f}, {0x70, 0x79, 0x02, 0x4b, 0x7c, 0x75, 0x4e, 0x0f}, {0x70, 0x79, 0x02, 0x4b, 0x7c, 0x75, 0x4e, 0x0f}, {0x70, 0x79, 0x12, 0x4b, 0x7c, 0x75, 0x4e, 0x0f}, {0x70, 0x79, 0x12, 0x4b, 0x7c, 0x75, 0x4e, 0x0f}, {0x70, 0x79, 0x12, 0x2b, 0x7c, 0x75, 0x4e, 0x1f}, {0x70, 0x79, 0x12, 0x2b, 0x7c, 0x75, 0x4e, 0x1f}, {0x30, 0x79, 0x12, 0x2b, 0x7c, 0x75, 0x2e, 0x1f}, {0x30, 0x79, 0x12, 0x2b, 0x7c, 0x75, 0x2e, 0x1f}, {0x30, 0x39, 0x12, 0x2b, 0x7c, 0x35, 0x2e, 0x1f}, {0x30, 0x39, 0x12, 0x2b, 0x7c, 0x35, 0x2e, 0x1f}, {0x30, 0x39, 0x32, 0x2b, 0x3c, 0x35, 0x2e, 0x1f}, {0x30, 0x39, 0x32, 0x2b, 0x3c, 0x35, 0x2e, 0x1f}, {0x30, 0x39, 0x32, 0x3b, 0x3c, 0x35, 0x2e, 0x3f}, {0x30, 0x39, 0x32, 0x3b, 0x3c, 0x35, 0x2e, 0x3f}, {0x38, 0x39, 0x32, 0x3b, 0x3c, 0x35, 0x3e, 0x3f}, {0x38, 0x39, 0x32, 0x3b, 0x3c, 0x35, 0x3e, 0x3f}, {0x38, 0x31, 0x32, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f}, {0x38, 0x31, 0x32, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f}, {0x38, 0x31, 0x22, 0x3b, 0x34, 0x3d, 0x3e, 0x3f}, {0x38, 0x31, 0x22, 0x3b, 0x34, 0x3d, 0x3e, 0x3f}, {0x38, 0x31, 0x22, 0x1b, 0x34, 0x3d, 0x3e, 0x2f}, {0x38, 0x31, 0x22, 0x1b, 0x34, 0x3d, 0x3e, 0x2f}, {0x78, 0x31, 0x22, 0x1b, 0x34, 0x3d, 0x1e, 0x2f}, {0x78, 0x31, 0x22, 0x1b, 0x34, 0x3d, 0x1e, 0x2f}, {0x78, 0x71, 0x22, 0x1b, 0x34, 0x7d, 0x1e, 0x2f}, {0x78, 0x71, 0x22, 0x1b, 0x34, 0x7d, 0x1e, 0x2f}, {0x78, 0x71, 0x42, 0x1b, 0x74, 0x7d, 0x1e, 0x2f}, {0x78, 0x71, 0x42, 0x1b, 0x74, 0x7d, 0x1e, 0x2f}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x7d, 0x1e, 0x4f}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x7d, 0x1e, 0x4f}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x7d, 0x0e, 0x4f}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x7d, 0x0e, 0x4f}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x7d, 0x0e, 0x4f}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x7d, 0x0e, 0x4f} }, { {0x70, 0x79, 0x02, 0x4b, 0x7c, 0x65, 0x4e, 0x07}, {0x70, 0x79, 0x02, 0x4b, 0x7c, 0x65, 0x4e, 0x07}, {0x70, 0x79, 0x02, 0x4b, 0x7c, 0x65, 0x4e, 0x07}, {0x70, 0x79, 0x02, 0x4b, 0x7c, 0x65, 0x4e, 0x07}, {0x70, 0x79, 0x12, 0x4b, 0x7c, 0x65, 0x4e, 0x07}, {0x70, 0x79, 0x12, 0x4b, 0x7c, 0x65, 0x4e, 0x07}, {0x70, 0x79, 0x12, 0x2b, 0x7c, 0x65, 0x4e, 0x17}, {0x70, 0x79, 0x12, 0x2b, 0x7c, 0x65, 0x4e, 0x17}, {0x30, 0x79, 0x12, 0x2b, 0x7c, 0x65, 0x2e, 0x17}, {0x30, 0x79, 0x12, 0x2b, 0x7c, 0x65, 0x2e, 0x17}, {0x30, 0x39, 0x12, 0x2b, 0x7c, 0x25, 0x2e, 0x17}, {0x30, 0x39, 0x12, 0x2b, 0x7c, 0x25, 0x2e, 0x17}, {0x30, 0x39, 0x32, 0x2b, 0x3c, 0x25, 0x2e, 0x17}, {0x30, 0x39, 0x32, 0x2b, 0x3c, 0x25, 0x2e, 0x17}, {0x30, 0x39, 0x32, 0x3b, 0x3c, 0x25, 0x2e, 0x37}, {0x30, 0x39, 0x32, 0x3b, 0x3c, 0x25, 0x2e, 0x37}, {0x38, 0x39, 0x32, 0x3b, 0x3c, 0x25, 0x3e, 0x37}, {0x38, 0x39, 0x32, 0x3b, 0x3c, 0x25, 0x3e, 0x37}, {0x38, 0x31, 0x32, 0x3b, 0x3c, 0x2d, 0x3e, 0x37}, {0x38, 0x31, 0x32, 0x3b, 0x3c, 0x2d, 0x3e, 0x37}, {0x38, 0x31, 0x22, 0x3b, 0x34, 0x2d, 0x3e, 0x37}, {0x38, 0x31, 0x22, 0x3b, 0x34, 0x2d, 0x3e, 0x37}, {0x38, 0x31, 0x22, 0x1b, 0x34, 0x2d, 0x3e, 0x27}, {0x38, 0x31, 0x22, 0x1b, 0x34, 0x2d, 0x3e, 0x27}, {0x78, 0x31, 0x22, 0x1b, 0x34, 0x2d, 0x1e, 0x27}, {0x78, 0x31, 0x22, 0x1b, 0x34, 0x2d, 0x1e, 0x27}, {0x78, 0x71, 0x22, 0x1b, 0x34, 0x6d, 0x1e, 0x27}, {0x78, 0x71, 0x22, 0x1b, 0x34, 0x6d, 0x1e, 0x27}, {0x78, 0x71, 0x42, 0x1b, 0x74, 0x6d, 0x1e, 0x27}, {0x78, 0x71, 0x42, 0x1b, 0x74, 0x6d, 0x1e, 0x27}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x6d, 0x1e, 0x47}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x6d, 0x1e, 0x47}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x6d, 0x0e, 0x47}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x6d, 0x0e, 0x47}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x6d, 0x0e, 0x47}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x6d, 0x0e, 0x47} }, { {0x70, 0x79, 0x02, 0x4b, 0x7c, 0x65, 0x4e, 0x07}, {0x70, 0x79, 0x02, 0x4b, 0x7c, 0x65, 0x4e, 0x07}, {0x70, 0x79, 0x02, 0x4b, 0x7c, 0x65, 0x4e, 0x07}, {0x70, 0x79, 0x02, 0x4b, 0x7c, 0x65, 0x4e, 0x07}, {0x70, 0x79, 0x12, 0x4b, 0x7c, 0x65, 0x4e, 0x07}, {0x70, 0x79, 0x12, 0x4b, 0x7c, 0x65, 0x4e, 0x07}, {0x70, 0x79, 0x12, 0x2b, 0x7c, 0x65, 0x4e, 0x17}, {0x70, 0x79, 0x12, 0x2b, 0x7c, 0x65, 0x4e, 0x17}, {0x30, 0x79, 0x12, 0x2b, 0x7c, 0x65, 0x2e, 0x17}, {0x30, 0x79, 0x12, 0x2b, 0x7c, 0x65, 0x2e, 0x17}, {0x30, 0x39, 0x12, 0x2b, 0x7c, 0x25, 0x2e, 0x17}, {0x30, 0x39, 0x12, 0x2b, 0x7c, 0x25, 0x2e, 0x17}, {0x30, 0x39, 0x32, 0x2b, 0x3c, 0x25, 0x2e, 0x17}, {0x30, 0x39, 0x32, 0x2b, 0x3c, 0x25, 0x2e, 0x17}, {0x30, 0x39, 0x32, 0x3b, 0x3c, 0x25, 0x2e, 0x37}, {0x30, 0x39, 0x32, 0x3b, 0x3c, 0x25, 0x2e, 0x37}, {0x38, 0x39, 0x32, 0x3b, 0x3c, 0x25, 0x3e, 0x37}, {0x38, 0x39, 0x32, 0x3b, 0x3c, 0x25, 0x3e, 0x37}, {0x38, 0x31, 0x32, 0x3b, 0x3c, 0x2d, 0x3e, 0x37}, {0x38, 0x31, 0x32, 0x3b, 0x3c, 0x2d, 0x3e, 0x37}, {0x38, 0x31, 0x22, 0x3b, 0x34, 0x2d, 0x3e, 0x37}, {0x38, 0x31, 0x22, 0x3b, 0x34, 0x2d, 0x3e, 0x37}, {0x38, 0x31, 0x22, 0x1b, 0x34, 0x2d, 0x3e, 0x27}, {0x38, 0x31, 0x22, 0x1b, 0x34, 0x2d, 0x3e, 0x27}, {0x78, 0x31, 0x22, 0x1b, 0x34, 0x2d, 0x1e, 0x27}, {0x78, 0x31, 0x22, 0x1b, 0x34, 0x2d, 0x1e, 0x27}, {0x78, 0x71, 0x22, 0x1b, 0x34, 0x6d, 0x1e, 0x27}, {0x78, 0x71, 0x22, 0x1b, 0x34, 0x6d, 0x1e, 0x27}, {0x78, 0x71, 0x42, 0x1b, 0x74, 0x6d, 0x1e, 0x27}, {0x78, 0x71, 0x42, 0x1b, 0x74, 0x6d, 0x1e, 0x27}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x6d, 0x1e, 0x47}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x6d, 0x1e, 0x47}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x6d, 0x0e, 0x47}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x6d, 0x0e, 0x47}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x6d, 0x0e, 0x47}, {0x78, 0x71, 0x42, 0x0b, 0x74, 0x6d, 0x0e, 0x47} }, { {0x60, 0x79, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x79, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x79, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x79, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x79, 0x12, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x79, 0x12, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x79, 0x12, 0x2b, 0x5c, 0x65, 0x4e, 0x17}, {0x60, 0x79, 0x12, 0x2b, 0x5c, 0x65, 0x4e, 0x17}, {0x20, 0x79, 0x12, 0x2b, 0x5c, 0x65, 0x2e, 0x17}, {0x20, 0x79, 0x12, 0x2b, 0x5c, 0x65, 0x2e, 0x17}, {0x20, 0x39, 0x12, 0x2b, 0x5c, 0x25, 0x2e, 0x17}, {0x20, 0x39, 0x12, 0x2b, 0x5c, 0x25, 0x2e, 0x17}, {0x20, 0x39, 0x32, 0x2b, 0x1c, 0x25, 0x2e, 0x17}, {0x20, 0x39, 0x32, 0x2b, 0x1c, 0x25, 0x2e, 0x17}, {0x20, 0x39, 0x32, 0x3b, 0x1c, 0x25, 0x2e, 0x37}, {0x20, 0x39, 0x32, 0x3b, 0x1c, 0x25, 0x2e, 0x37}, {0x28, 0x39, 0x32, 0x3b, 0x1c, 0x25, 0x3e, 0x37}, {0x28, 0x39, 0x32, 0x3b, 0x1c, 0x25, 0x3e, 0x37}, {0x28, 0x31, 0x32, 0x3b, 0x1c, 0x2d, 0x3e, 0x37}, {0x28, 0x31, 0x32, 0x3b, 0x1c, 0x2d, 0x3e, 0x37}, {0x28, 0x31, 0x22, 0x3b, 0x14, 0x2d, 0x3e, 0x37}, {0x28, 0x31, 0x22, 0x3b, 0x14, 0x2d, 0x3e, 0x37}, {0x28, 0x31, 0x22, 0x1b, 0x14, 0x2d, 0x3e, 0x27}, {0x28, 0x31, 0x22, 0x1b, 0x14, 0x2d, 0x3e, 0x27}, {0x68, 0x31, 0x22, 0x1b, 0x14, 0x2d, 0x1e, 0x27}, {0x68, 0x31, 0x22, 0x1b, 0x14, 0x2d, 0x1e, 0x27}, {0x68, 0x71, 0x22, 0x1b, 0x14, 0x6d, 0x1e, 0x27}, {0x68, 0x71, 0x22, 0x1b, 0x14, 0x6d, 0x1e, 0x27}, {0x68, 0x71, 0x42, 0x1b, 0x54, 0x6d, 0x1e, 0x27}, {0x68, 0x71, 0x42, 0x1b, 0x54, 0x6d, 0x1e, 0x27}, {0x68, 0x71, 0x42, 0x0b, 0x54, 0x6d, 0x1e, 0x47}, {0x68, 0x71, 0x42, 0x0b, 0x54, 0x6d, 0x1e, 0x47}, {0x68, 0x71, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47}, {0x68, 0x71, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47}, {0x68, 0x71, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47}, {0x68, 0x71, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47} }, { {0x60, 0x79, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x79, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x79, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x79, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x79, 0x12, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x79, 0x12, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x79, 0x12, 0x2b, 0x5c, 0x65, 0x4e, 0x17}, {0x60, 0x79, 0x12, 0x2b, 0x5c, 0x65, 0x4e, 0x17}, {0x20, 0x79, 0x12, 0x2b, 0x5c, 0x65, 0x2e, 0x17}, {0x20, 0x79, 0x12, 0x2b, 0x5c, 0x65, 0x2e, 0x17}, {0x20, 0x39, 0x12, 0x2b, 0x5c, 0x25, 0x2e, 0x17}, {0x20, 0x39, 0x12, 0x2b, 0x5c, 0x25, 0x2e, 0x17}, {0x20, 0x39, 0x32, 0x2b, 0x1c, 0x25, 0x2e, 0x17}, {0x20, 0x39, 0x32, 0x2b, 0x1c, 0x25, 0x2e, 0x17}, {0x20, 0x39, 0x32, 0x3b, 0x1c, 0x25, 0x2e, 0x37}, {0x20, 0x39, 0x32, 0x3b, 0x1c, 0x25, 0x2e, 0x37}, {0x28, 0x39, 0x32, 0x3b, 0x1c, 0x25, 0x3e, 0x37}, {0x28, 0x39, 0x32, 0x3b, 0x1c, 0x25, 0x3e, 0x37}, {0x28, 0x31, 0x32, 0x3b, 0x1c, 0x2d, 0x3e, 0x37}, {0x28, 0x31, 0x32, 0x3b, 0x1c, 0x2d, 0x3e, 0x37}, {0x28, 0x31, 0x22, 0x3b, 0x14, 0x2d, 0x3e, 0x37}, {0x28, 0x31, 0x22, 0x3b, 0x14, 0x2d, 0x3e, 0x37}, {0x28, 0x31, 0x22, 0x1b, 0x14, 0x2d, 0x3e, 0x27}, {0x28, 0x31, 0x22, 0x1b, 0x14, 0x2d, 0x3e, 0x27}, {0x68, 0x31, 0x22, 0x1b, 0x14, 0x2d, 0x1e, 0x27}, {0x68, 0x31, 0x22, 0x1b, 0x14, 0x2d, 0x1e, 0x27}, {0x68, 0x71, 0x22, 0x1b, 0x14, 0x6d, 0x1e, 0x27}, {0x68, 0x71, 0x22, 0x1b, 0x14, 0x6d, 0x1e, 0x27}, {0x68, 0x71, 0x42, 0x1b, 0x54, 0x6d, 0x1e, 0x27}, {0x68, 0x71, 0x42, 0x1b, 0x54, 0x6d, 0x1e, 0x27}, {0x68, 0x71, 0x42, 0x0b, 0x54, 0x6d, 0x1e, 0x47}, {0x68, 0x71, 0x42, 0x0b, 0x54, 0x6d, 0x1e, 0x47}, {0x68, 0x71, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47}, {0x68, 0x71, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47}, {0x68, 0x71, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47}, {0x68, 0x71, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47} }, { {0x60, 0x59, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x12, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x12, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x12, 0x6b, 0x5c, 0x65, 0x4e, 0x17}, {0x60, 0x59, 0x12, 0x6b, 0x5c, 0x65, 0x4e, 0x17}, {0x20, 0x59, 0x12, 0x6b, 0x5c, 0x65, 0x2e, 0x17}, {0x20, 0x59, 0x12, 0x6b, 0x5c, 0x65, 0x2e, 0x17}, {0x20, 0x19, 0x12, 0x6b, 0x5c, 0x25, 0x2e, 0x17}, {0x20, 0x19, 0x12, 0x6b, 0x5c, 0x25, 0x2e, 0x17}, {0x20, 0x19, 0x32, 0x6b, 0x1c, 0x25, 0x2e, 0x17}, {0x20, 0x19, 0x32, 0x6b, 0x1c, 0x25, 0x2e, 0x17}, {0x20, 0x19, 0x32, 0x7b, 0x1c, 0x25, 0x2e, 0x37}, {0x20, 0x19, 0x32, 0x7b, 0x1c, 0x25, 0x2e, 0x37}, {0x28, 0x19, 0x32, 0x7b, 0x1c, 0x25, 0x3e, 0x37}, {0x28, 0x19, 0x32, 0x7b, 0x1c, 0x25, 0x3e, 0x37}, {0x28, 0x11, 0x32, 0x7b, 0x1c, 0x2d, 0x3e, 0x37}, {0x28, 0x11, 0x32, 0x7b, 0x1c, 0x2d, 0x3e, 0x37}, {0x28, 0x11, 0x22, 0x7b, 0x14, 0x2d, 0x3e, 0x37}, {0x28, 0x11, 0x22, 0x7b, 0x14, 0x2d, 0x3e, 0x37}, {0x28, 0x11, 0x22, 0x5b, 0x14, 0x2d, 0x3e, 0x27}, {0x28, 0x11, 0x22, 0x5b, 0x14, 0x2d, 0x3e, 0x27}, {0x68, 0x11, 0x22, 0x5b, 0x14, 0x2d, 0x1e, 0x27}, {0x68, 0x11, 0x22, 0x5b, 0x14, 0x2d, 0x1e, 0x27}, {0x68, 0x51, 0x22, 0x5b, 0x14, 0x6d, 0x1e, 0x27}, {0x68, 0x51, 0x22, 0x5b, 0x14, 0x6d, 0x1e, 0x27}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x1e, 0x27}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x1e, 0x27}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x1e, 0x47}, {0x68, 0x51, 0x42, 0x0b, 0x54, 0x6d, 0x1e, 0x47}, {0x68, 0x51, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47}, {0x68, 0x51, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47}, {0x68, 0x51, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47}, {0x68, 0x51, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47} }, { {0x60, 0x59, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x12, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x12, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x12, 0x6b, 0x5c, 0x65, 0x4e, 0x17}, {0x60, 0x59, 0x12, 0x6b, 0x5c, 0x65, 0x4e, 0x17}, {0x20, 0x59, 0x12, 0x6b, 0x5c, 0x65, 0x2e, 0x17}, {0x20, 0x59, 0x12, 0x6b, 0x5c, 0x65, 0x2e, 0x17}, {0x20, 0x19, 0x12, 0x6b, 0x5c, 0x25, 0x2e, 0x17}, {0x20, 0x19, 0x12, 0x6b, 0x5c, 0x25, 0x2e, 0x17}, {0x20, 0x19, 0x32, 0x6b, 0x1c, 0x25, 0x2e, 0x17}, {0x20, 0x19, 0x32, 0x6b, 0x1c, 0x25, 0x2e, 0x17}, {0x20, 0x19, 0x32, 0x7b, 0x1c, 0x25, 0x2e, 0x37}, {0x20, 0x19, 0x32, 0x7b, 0x1c, 0x25, 0x2e, 0x37}, {0x28, 0x19, 0x32, 0x7b, 0x1c, 0x25, 0x3e, 0x37}, {0x28, 0x19, 0x32, 0x7b, 0x1c, 0x25, 0x3e, 0x37}, {0x28, 0x11, 0x32, 0x7b, 0x1c, 0x2d, 0x3e, 0x37}, {0x28, 0x11, 0x32, 0x7b, 0x1c, 0x2d, 0x3e, 0x37}, {0x28, 0x11, 0x22, 0x7b, 0x14, 0x2d, 0x3e, 0x37}, {0x28, 0x11, 0x22, 0x7b, 0x14, 0x2d, 0x3e, 0x37}, {0x28, 0x11, 0x22, 0x5b, 0x14, 0x2d, 0x3e, 0x27}, {0x28, 0x11, 0x22, 0x5b, 0x14, 0x2d, 0x3e, 0x27}, {0x68, 0x11, 0x22, 0x5b, 0x14, 0x2d, 0x1e, 0x27}, {0x68, 0x11, 0x22, 0x5b, 0x14, 0x2d, 0x1e, 0x27}, {0x68, 0x51, 0x22, 0x5b, 0x14, 0x6d, 0x1e, 0x27}, {0x68, 0x51, 0x22, 0x5b, 0x14, 0x6d, 0x1e, 0x27}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x1e, 0x27}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x1e, 0x27}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x1e, 0x47}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x1e, 0x47}, {0x68, 0x51, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47}, {0x68, 0x51, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47}, {0x68, 0x51, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47}, {0x68, 0x51, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47} }, { {0x60, 0x59, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x17}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x17}, {0x20, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x17}, {0x20, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x17}, {0x20, 0x19, 0x52, 0x6b, 0x5c, 0x25, 0x6e, 0x17}, {0x20, 0x19, 0x52, 0x6b, 0x5c, 0x25, 0x6e, 0x17}, {0x20, 0x19, 0x72, 0x6b, 0x1c, 0x25, 0x6e, 0x17}, {0x20, 0x19, 0x72, 0x6b, 0x1c, 0x25, 0x6e, 0x17}, {0x20, 0x19, 0x72, 0x7b, 0x1c, 0x25, 0x6e, 0x37}, {0x20, 0x19, 0x72, 0x7b, 0x1c, 0x25, 0x6e, 0x37}, {0x28, 0x19, 0x72, 0x7b, 0x1c, 0x25, 0x7e, 0x37}, {0x28, 0x19, 0x72, 0x7b, 0x1c, 0x25, 0x7e, 0x37}, {0x28, 0x11, 0x72, 0x7b, 0x1c, 0x2d, 0x7e, 0x37}, {0x28, 0x11, 0x72, 0x7b, 0x1c, 0x2d, 0x7e, 0x37}, {0x28, 0x11, 0x62, 0x7b, 0x14, 0x2d, 0x7e, 0x37}, {0x28, 0x11, 0x62, 0x7b, 0x14, 0x2d, 0x7e, 0x37}, {0x28, 0x11, 0x62, 0x5b, 0x14, 0x2d, 0x7e, 0x27}, {0x28, 0x11, 0x62, 0x5b, 0x14, 0x2d, 0x7e, 0x27}, {0x68, 0x11, 0x62, 0x5b, 0x14, 0x2d, 0x5e, 0x27}, {0x68, 0x11, 0x62, 0x5b, 0x14, 0x2d, 0x5e, 0x27}, {0x68, 0x51, 0x62, 0x5b, 0x14, 0x6d, 0x5e, 0x27}, {0x68, 0x51, 0x62, 0x5b, 0x14, 0x6d, 0x5e, 0x27}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x27}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x27}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47}, {0x68, 0x51, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47}, {0x68, 0x51, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47}, {0x68, 0x51, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47} }, { {0x60, 0x59, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x17}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x17}, {0x20, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x17}, {0x20, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x17}, {0x20, 0x19, 0x52, 0x6b, 0x5c, 0x25, 0x6e, 0x17}, {0x20, 0x19, 0x52, 0x6b, 0x5c, 0x25, 0x6e, 0x17}, {0x20, 0x19, 0x72, 0x6b, 0x1c, 0x25, 0x6e, 0x17}, {0x20, 0x19, 0x72, 0x6b, 0x1c, 0x25, 0x6e, 0x17}, {0x20, 0x19, 0x72, 0x7b, 0x1c, 0x25, 0x6e, 0x37}, {0x20, 0x19, 0x72, 0x7b, 0x1c, 0x25, 0x6e, 0x37}, {0x28, 0x19, 0x72, 0x7b, 0x1c, 0x25, 0x7e, 0x37}, {0x28, 0x19, 0x72, 0x7b, 0x1c, 0x25, 0x7e, 0x37}, {0x28, 0x11, 0x72, 0x7b, 0x1c, 0x2d, 0x7e, 0x37}, {0x28, 0x11, 0x72, 0x7b, 0x1c, 0x2d, 0x7e, 0x37}, {0x28, 0x11, 0x62, 0x7b, 0x14, 0x2d, 0x7e, 0x37}, {0x28, 0x11, 0x62, 0x7b, 0x14, 0x2d, 0x7e, 0x37}, {0x28, 0x11, 0x62, 0x5b, 0x14, 0x2d, 0x7e, 0x27}, {0x28, 0x11, 0x62, 0x5b, 0x14, 0x2d, 0x7e, 0x27}, {0x68, 0x11, 0x62, 0x5b, 0x14, 0x2d, 0x5e, 0x27}, {0x68, 0x11, 0x62, 0x5b, 0x14, 0x2d, 0x5e, 0x27}, {0x68, 0x51, 0x62, 0x5b, 0x14, 0x6d, 0x5e, 0x27}, {0x68, 0x51, 0x62, 0x5b, 0x14, 0x6d, 0x5e, 0x27}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x27}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x27}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47}, {0x68, 0x51, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47}, {0x68, 0x51, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47} }, { {0x60, 0x59, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x20, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x20, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x20, 0x19, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x20, 0x19, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x20, 0x19, 0x72, 0x6b, 0x1c, 0x45, 0x6e, 0x57}, {0x20, 0x19, 0x72, 0x6b, 0x1c, 0x45, 0x6e, 0x57}, {0x20, 0x19, 0x72, 0x7b, 0x1c, 0x45, 0x6e, 0x77}, {0x20, 0x19, 0x72, 0x7b, 0x1c, 0x45, 0x6e, 0x77}, {0x28, 0x19, 0x72, 0x7b, 0x1c, 0x45, 0x7e, 0x77}, {0x28, 0x19, 0x72, 0x7b, 0x1c, 0x45, 0x7e, 0x77}, {0x28, 0x11, 0x72, 0x7b, 0x1c, 0x4d, 0x7e, 0x77}, {0x28, 0x11, 0x72, 0x7b, 0x1c, 0x4d, 0x7e, 0x77}, {0x28, 0x11, 0x62, 0x7b, 0x14, 0x4d, 0x7e, 0x77}, {0x28, 0x11, 0x62, 0x7b, 0x14, 0x4d, 0x7e, 0x77}, {0x28, 0x11, 0x62, 0x5b, 0x14, 0x4d, 0x7e, 0x67}, {0x28, 0x11, 0x62, 0x5b, 0x14, 0x4d, 0x7e, 0x67}, {0x68, 0x11, 0x62, 0x5b, 0x14, 0x4d, 0x5e, 0x67}, {0x68, 0x11, 0x62, 0x5b, 0x14, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x14, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x14, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47}, {0x68, 0x51, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47}, {0x68, 0x51, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47} }, { {0x60, 0x59, 0x02, 0x4b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x20, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x20, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x20, 0x19, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x20, 0x19, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x20, 0x19, 0x72, 0x6b, 0x1c, 0x45, 0x6e, 0x57}, {0x20, 0x19, 0x72, 0x6b, 0x1c, 0x45, 0x6e, 0x57}, {0x20, 0x19, 0x72, 0x7b, 0x1c, 0x45, 0x6e, 0x77}, {0x20, 0x19, 0x72, 0x7b, 0x1c, 0x45, 0x6e, 0x77}, {0x28, 0x19, 0x72, 0x7b, 0x1c, 0x45, 0x7e, 0x77}, {0x28, 0x19, 0x72, 0x7b, 0x1c, 0x45, 0x7e, 0x77}, {0x28, 0x11, 0x72, 0x7b, 0x1c, 0x4d, 0x7e, 0x77}, {0x28, 0x11, 0x72, 0x7b, 0x1c, 0x4d, 0x7e, 0x77}, {0x28, 0x11, 0x62, 0x7b, 0x14, 0x4d, 0x7e, 0x77}, {0x28, 0x11, 0x62, 0x7b, 0x14, 0x4d, 0x7e, 0x77}, {0x28, 0x11, 0x62, 0x5b, 0x14, 0x4d, 0x7e, 0x67}, {0x28, 0x11, 0x62, 0x5b, 0x14, 0x4d, 0x7e, 0x67}, {0x68, 0x11, 0x62, 0x5b, 0x14, 0x4d, 0x5e, 0x67}, {0x68, 0x11, 0x62, 0x5b, 0x14, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x14, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x14, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47}, {0x68, 0x51, 0x42, 0x0b, 0x54, 0x6d, 0x0e, 0x47} }, { {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x19, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x19, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x19, 0x72, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x19, 0x72, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x19, 0x72, 0x7b, 0x0c, 0x45, 0x6e, 0x77}, {0x40, 0x19, 0x72, 0x7b, 0x0c, 0x45, 0x6e, 0x77}, {0x48, 0x19, 0x72, 0x7b, 0x0c, 0x45, 0x7e, 0x77}, {0x48, 0x19, 0x72, 0x7b, 0x0c, 0x45, 0x7e, 0x77}, {0x48, 0x11, 0x72, 0x7b, 0x0c, 0x4d, 0x7e, 0x77}, {0x48, 0x11, 0x72, 0x7b, 0x0c, 0x4d, 0x7e, 0x77}, {0x48, 0x11, 0x62, 0x7b, 0x04, 0x4d, 0x7e, 0x77}, {0x48, 0x11, 0x62, 0x7b, 0x04, 0x4d, 0x7e, 0x77}, {0x48, 0x11, 0x62, 0x5b, 0x04, 0x4d, 0x7e, 0x67}, {0x48, 0x11, 0x62, 0x5b, 0x04, 0x4d, 0x7e, 0x67}, {0x68, 0x11, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x11, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47} }, { {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x19, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x19, 0x52, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x19, 0x72, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x19, 0x72, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x19, 0x72, 0x7b, 0x0c, 0x45, 0x6e, 0x77}, {0x40, 0x19, 0x72, 0x7b, 0x0c, 0x45, 0x6e, 0x77}, {0x48, 0x19, 0x72, 0x7b, 0x0c, 0x45, 0x7e, 0x77}, {0x48, 0x19, 0x72, 0x7b, 0x0c, 0x45, 0x7e, 0x77}, {0x48, 0x11, 0x72, 0x7b, 0x0c, 0x4d, 0x7e, 0x77}, {0x48, 0x11, 0x72, 0x7b, 0x0c, 0x4d, 0x7e, 0x77}, {0x48, 0x11, 0x62, 0x7b, 0x04, 0x4d, 0x7e, 0x77}, {0x48, 0x11, 0x62, 0x7b, 0x04, 0x4d, 0x7e, 0x77}, {0x48, 0x11, 0x62, 0x5b, 0x04, 0x4d, 0x7e, 0x67}, {0x48, 0x11, 0x62, 0x5b, 0x04, 0x4d, 0x7e, 0x67}, {0x48, 0x11, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x11, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47} }, { {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x52, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x52, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x72, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x72, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x72, 0x7b, 0x0c, 0x45, 0x6e, 0x77}, {0x40, 0x09, 0x72, 0x7b, 0x0c, 0x45, 0x6e, 0x77}, {0x48, 0x09, 0x72, 0x7b, 0x0c, 0x45, 0x7e, 0x77}, {0x48, 0x09, 0x72, 0x7b, 0x0c, 0x45, 0x7e, 0x77}, {0x48, 0x01, 0x72, 0x7b, 0x0c, 0x4d, 0x7e, 0x77}, {0x48, 0x01, 0x72, 0x7b, 0x0c, 0x4d, 0x7e, 0x77}, {0x48, 0x01, 0x62, 0x7b, 0x04, 0x4d, 0x7e, 0x77}, {0x48, 0x01, 0x62, 0x7b, 0x04, 0x4d, 0x7e, 0x77}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x7e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x7e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47} }, { {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x4e, 0x07}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x52, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x52, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x52, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x72, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x72, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x72, 0x7b, 0x0c, 0x45, 0x6e, 0x77}, {0x40, 0x09, 0x72, 0x7b, 0x0c, 0x45, 0x6e, 0x77}, {0x48, 0x09, 0x72, 0x7b, 0x0c, 0x45, 0x7e, 0x77}, {0x48, 0x09, 0x72, 0x7b, 0x0c, 0x45, 0x7e, 0x77}, {0x48, 0x01, 0x72, 0x7b, 0x0c, 0x4d, 0x7e, 0x77}, {0x48, 0x01, 0x72, 0x7b, 0x0c, 0x4d, 0x7e, 0x77}, {0x48, 0x01, 0x62, 0x7b, 0x04, 0x4d, 0x7e, 0x77}, {0x48, 0x01, 0x62, 0x7b, 0x04, 0x4d, 0x7e, 0x77}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x7e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x7e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x42, 0x5b, 0x54, 0x6d, 0x5e, 0x47} }, { {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x52, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x52, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x52, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x52, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x72, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x72, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x72, 0x7b, 0x0c, 0x45, 0x6e, 0x77}, {0x40, 0x09, 0x72, 0x7b, 0x0c, 0x45, 0x6e, 0x77}, {0x48, 0x09, 0x72, 0x7b, 0x0c, 0x45, 0x7e, 0x77}, {0x48, 0x09, 0x72, 0x7b, 0x0c, 0x45, 0x7e, 0x77}, {0x48, 0x01, 0x72, 0x7b, 0x0c, 0x4d, 0x7e, 0x77}, {0x48, 0x01, 0x72, 0x7b, 0x0c, 0x4d, 0x7e, 0x77}, {0x48, 0x01, 0x62, 0x7b, 0x04, 0x4d, 0x7e, 0x77}, {0x48, 0x01, 0x62, 0x7b, 0x04, 0x4d, 0x7e, 0x77}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x7e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x7e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67} }, { {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x60, 0x59, 0x52, 0x6b, 0x5c, 0x65, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x59, 0x52, 0x6b, 0x5c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x52, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x52, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x52, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x52, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x52, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x72, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x72, 0x6b, 0x0c, 0x45, 0x6e, 0x57}, {0x40, 0x09, 0x72, 0x7b, 0x0c, 0x45, 0x6e, 0x77}, {0x40, 0x09, 0x72, 0x7b, 0x0c, 0x45, 0x6e, 0x77}, {0x48, 0x09, 0x72, 0x7b, 0x0c, 0x45, 0x7e, 0x77}, {0x48, 0x09, 0x72, 0x7b, 0x0c, 0x45, 0x7e, 0x77}, {0x48, 0x01, 0x72, 0x7b, 0x0c, 0x4d, 0x7e, 0x77}, {0x48, 0x01, 0x72, 0x7b, 0x0c, 0x4d, 0x7e, 0x77}, {0x48, 0x01, 0x62, 0x7b, 0x04, 0x4d, 0x7e, 0x77}, {0x48, 0x01, 0x62, 0x7b, 0x04, 0x4d, 0x7e, 0x77}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x7e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x7e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x48, 0x01, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x04, 0x4d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67}, {0x68, 0x51, 0x62, 0x5b, 0x54, 0x6d, 0x5e, 0x67} } }, { /* 12,000bps map */ { {0x38, 0x21, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27} }, { {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27} }, { {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27} }, { {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27} }, { {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27} }, { {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x0b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x0b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x0e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x1e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x2d, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x2d, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x35, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x0c, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x0c, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07} }, { {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x0b, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x0b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x0b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x0b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x0e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x0e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x2d, 0x1e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x2d, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x2d, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x2d, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x0c, 0x35, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x0c, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x0c, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x0c, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07} }, { {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x13, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x0b, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x0b, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x0b, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x0b, 0x04, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x22, 0x0b, 0x04, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x22, 0x0b, 0x04, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x3d, 0x0e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x2d, 0x0e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x2d, 0x0e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x2d, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x04, 0x2d, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x0c, 0x2d, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x0c, 0x2d, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x0c, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x1b, 0x0c, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x0c, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x0c, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x14, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07} }, { {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x0b, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x0b, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x0b, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x0b, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x2a, 0x0b, 0x24, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x22, 0x0b, 0x04, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x22, 0x0b, 0x04, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x22, 0x0b, 0x04, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x2d, 0x0e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x2d, 0x0e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x2d, 0x0e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x2d, 0x0e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x0c, 0x2d, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x0c, 0x2d, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x0c, 0x2d, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x0c, 0x2d, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x0c, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x0c, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x0c, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x0c, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07} }, { {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x0b, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x0b, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x0b, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x32, 0x0b, 0x24, 0x3d, 0x16, 0x37}, {0x38, 0x01, 0x2a, 0x0b, 0x24, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x2a, 0x0b, 0x24, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x2a, 0x0b, 0x24, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x22, 0x0b, 0x04, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x22, 0x0b, 0x04, 0x2d, 0x0e, 0x2f}, {0x38, 0x01, 0x22, 0x0b, 0x04, 0x2d, 0x0e, 0x2f}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x2d, 0x0e, 0x27}, {0x38, 0x01, 0x22, 0x1b, 0x04, 0x2d, 0x0e, 0x27}, {0x28, 0x01, 0x22, 0x1b, 0x0c, 0x2d, 0x0e, 0x27}, {0x28, 0x01, 0x22, 0x1b, 0x0c, 0x2d, 0x0e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x0c, 0x2d, 0x1e, 0x27}, {0x30, 0x01, 0x22, 0x1b, 0x0c, 0x2d, 0x1e, 0x27}, {0x30, 0x09, 0x22, 0x3b, 0x0c, 0x2d, 0x1e, 0x27}, {0x30, 0x09, 0x22, 0x3b, 0x0c, 0x2d, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x0c, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x22, 0x3b, 0x0c, 0x35, 0x1e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x0c, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x0c, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07} }, { {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x0b, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x0b, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x0b, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x0b, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x2a, 0x0b, 0x24, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x2a, 0x0b, 0x24, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x2a, 0x0b, 0x24, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x2a, 0x0b, 0x24, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x22, 0x0b, 0x04, 0x2d, 0x0e, 0x2f}, {0x38, 0x01, 0x22, 0x0b, 0x04, 0x2d, 0x0e, 0x2f}, {0x38, 0x01, 0x22, 0x0b, 0x04, 0x2d, 0x0e, 0x2f}, {0x38, 0x01, 0x22, 0x0b, 0x04, 0x2d, 0x0e, 0x2f}, {0x28, 0x01, 0x22, 0x1b, 0x0c, 0x2d, 0x0e, 0x27}, {0x28, 0x01, 0x22, 0x1b, 0x0c, 0x2d, 0x0e, 0x27}, {0x28, 0x01, 0x22, 0x1b, 0x0c, 0x2d, 0x0e, 0x27}, {0x28, 0x01, 0x22, 0x1b, 0x0c, 0x2d, 0x0e, 0x27}, {0x30, 0x09, 0x22, 0x3b, 0x0c, 0x2d, 0x1e, 0x27}, {0x30, 0x09, 0x22, 0x3b, 0x0c, 0x2d, 0x1e, 0x27}, {0x30, 0x09, 0x22, 0x3b, 0x0c, 0x2d, 0x1e, 0x27}, {0x30, 0x09, 0x22, 0x3b, 0x0c, 0x2d, 0x1e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x0c, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x0c, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x0c, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x0c, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07} }, { {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x13, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x0b, 0x24, 0x1d, 0x16, 0x37}, {0x18, 0x21, 0x32, 0x0b, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x0b, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x32, 0x0b, 0x24, 0x1d, 0x16, 0x37}, {0x38, 0x21, 0x2a, 0x0b, 0x24, 0x1d, 0x0e, 0x37}, {0x38, 0x21, 0x2a, 0x0b, 0x24, 0x1d, 0x0e, 0x37}, {0x38, 0x21, 0x2a, 0x0b, 0x24, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x2a, 0x0b, 0x24, 0x3d, 0x0e, 0x37}, {0x38, 0x01, 0x2a, 0x0b, 0x24, 0x2d, 0x0e, 0x2f}, {0x38, 0x01, 0x2a, 0x0b, 0x24, 0x2d, 0x0e, 0x2f}, {0x38, 0x01, 0x22, 0x0b, 0x04, 0x2d, 0x0e, 0x2f}, {0x38, 0x01, 0x22, 0x0b, 0x04, 0x2d, 0x0e, 0x2f}, {0x28, 0x01, 0x22, 0x0b, 0x0c, 0x2d, 0x0e, 0x2f}, {0x28, 0x01, 0x22, 0x0b, 0x0c, 0x2d, 0x0e, 0x2f}, {0x28, 0x01, 0x22, 0x1b, 0x0c, 0x2d, 0x0e, 0x27}, {0x28, 0x01, 0x22, 0x1b, 0x0c, 0x2d, 0x0e, 0x27}, {0x28, 0x09, 0x22, 0x3b, 0x0c, 0x2d, 0x0e, 0x27}, {0x28, 0x09, 0x22, 0x3b, 0x0c, 0x2d, 0x0e, 0x27}, {0x30, 0x09, 0x22, 0x3b, 0x0c, 0x2d, 0x1e, 0x27}, {0x30, 0x09, 0x22, 0x3b, 0x0c, 0x2d, 0x1e, 0x27}, {0x30, 0x09, 0x02, 0x3b, 0x0c, 0x2d, 0x3e, 0x27}, {0x30, 0x09, 0x02, 0x3b, 0x0c, 0x2d, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x0c, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x0c, 0x35, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x0c, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x0c, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x14, 0x35, 0x3e, 0x07} }, { {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x0b, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x0b, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x0b, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x0b, 0x24, 0x1d, 0x06, 0x37}, {0x38, 0x21, 0x2a, 0x0b, 0x24, 0x1d, 0x0e, 0x37}, {0x38, 0x21, 0x2a, 0x0b, 0x24, 0x1d, 0x0e, 0x37}, {0x38, 0x21, 0x2a, 0x0b, 0x24, 0x1d, 0x0e, 0x37}, {0x38, 0x21, 0x2a, 0x0b, 0x24, 0x1d, 0x0e, 0x37}, {0x38, 0x21, 0x2a, 0x0b, 0x24, 0x2d, 0x0e, 0x2f}, {0x38, 0x01, 0x2a, 0x0b, 0x24, 0x2d, 0x0e, 0x2f}, {0x38, 0x01, 0x2a, 0x0b, 0x24, 0x2d, 0x0e, 0x2f}, {0x38, 0x01, 0x2a, 0x0b, 0x24, 0x2d, 0x0e, 0x2f}, {0x28, 0x01, 0x22, 0x0b, 0x0c, 0x2d, 0x0e, 0x2f}, {0x28, 0x01, 0x22, 0x0b, 0x0c, 0x2d, 0x0e, 0x2f}, {0x28, 0x01, 0x22, 0x0b, 0x0c, 0x2d, 0x0e, 0x2f}, {0x28, 0x01, 0x22, 0x0b, 0x0c, 0x2d, 0x0e, 0x2f}, {0x28, 0x09, 0x22, 0x3b, 0x0c, 0x2d, 0x0e, 0x27}, {0x28, 0x09, 0x22, 0x3b, 0x0c, 0x2d, 0x0e, 0x27}, {0x28, 0x09, 0x22, 0x3b, 0x0c, 0x2d, 0x0e, 0x27}, {0x28, 0x09, 0x22, 0x3b, 0x0c, 0x2d, 0x0e, 0x27}, {0x30, 0x09, 0x02, 0x3b, 0x0c, 0x2d, 0x3e, 0x27}, {0x30, 0x09, 0x02, 0x3b, 0x0c, 0x2d, 0x3e, 0x27}, {0x30, 0x09, 0x02, 0x3b, 0x0c, 0x2d, 0x3e, 0x27}, {0x30, 0x09, 0x02, 0x3b, 0x0c, 0x2d, 0x3e, 0x27}, {0x30, 0x11, 0x02, 0x3b, 0x0c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x0c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x0c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x0c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07} }, { {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x0b, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x0b, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x2a, 0x0b, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x2a, 0x0b, 0x24, 0x1d, 0x06, 0x37}, {0x38, 0x21, 0x2a, 0x0b, 0x24, 0x1d, 0x0e, 0x37}, {0x38, 0x21, 0x2a, 0x0b, 0x24, 0x1d, 0x0e, 0x37}, {0x38, 0x21, 0x2a, 0x0b, 0x24, 0x0d, 0x0e, 0x2f}, {0x38, 0x21, 0x2a, 0x0b, 0x24, 0x0d, 0x0e, 0x2f}, {0x38, 0x21, 0x2a, 0x0b, 0x24, 0x2d, 0x0e, 0x2f}, {0x38, 0x01, 0x2a, 0x0b, 0x24, 0x2d, 0x0e, 0x2f}, {0x28, 0x01, 0x2a, 0x0b, 0x2c, 0x2d, 0x0e, 0x2f}, {0x28, 0x01, 0x2a, 0x0b, 0x2c, 0x2d, 0x0e, 0x2f}, {0x28, 0x01, 0x22, 0x0b, 0x0c, 0x2d, 0x0e, 0x2f}, {0x28, 0x01, 0x22, 0x0b, 0x0c, 0x2d, 0x0e, 0x2f}, {0x28, 0x09, 0x22, 0x2b, 0x0c, 0x2d, 0x0e, 0x2f}, {0x28, 0x09, 0x22, 0x2b, 0x0c, 0x2d, 0x0e, 0x2f}, {0x28, 0x09, 0x22, 0x3b, 0x0c, 0x2d, 0x0e, 0x27}, {0x28, 0x09, 0x22, 0x3b, 0x0c, 0x2d, 0x0e, 0x27}, {0x28, 0x09, 0x02, 0x3b, 0x0c, 0x2d, 0x2e, 0x27}, {0x28, 0x09, 0x02, 0x3b, 0x0c, 0x2d, 0x2e, 0x27}, {0x30, 0x09, 0x02, 0x3b, 0x0c, 0x2d, 0x3e, 0x27}, {0x30, 0x09, 0x02, 0x3b, 0x0c, 0x2d, 0x3e, 0x27}, {0x30, 0x09, 0x02, 0x3b, 0x0c, 0x25, 0x3e, 0x07}, {0x30, 0x09, 0x02, 0x3b, 0x0c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x0c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x0c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07} }, { {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x2a, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x2a, 0x0b, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x2a, 0x0b, 0x24, 0x1d, 0x06, 0x37}, {0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c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07} }, { {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x32, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x2a, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x2a, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x2a, 0x03, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x2a, 0x0b, 0x24, 0x1d, 0x06, 0x37}, {0x18, 0x21, 0x2a, 0x0b, 0x24, 0x0d, 0x06, 0x2f}, {0x18, 0x21, 0x2a, 0x0b, 0x24, 0x0d, 0x06, 0x2f}, {0x18, 0x21, 0x2a, 0x0b, 0x24, 0x0d, 0x06, 0x2f}, {0x38, 0x21, 0x2a, 0x0b, 0x24, 0x0d, 0x0e, 0x2f}, {0x28, 0x21, 0x2a, 0x0b, 0x2c, 0x0d, 0x0e, 0x2f}, {0x28, 0x21, 0x2a, 0x0b, 0x2c, 0x0d, 0x0e, 0x2f}, {0x28, 0x21, 0x2a, 0x0b, 0x2c, 0x2d, 0x0e, 0x2f}, {0x28, 0x01, 0x2a, 0x0b, 0x2c, 0x2d, 0x0e, 0x2f}, {0x28, 0x09, 0x2a, 0x2b, 0x2c, 0x2d, 0x0e, 0x2f}, {0x28, 0x09, 0x2a, 0x2b, 0x2c, 0x2d, 0x0e, 0x2f}, {0x28, 0x09, 0x2a, 0x2b, 0x2c, 0x2d, 0x0e, 0x2f}, {0x28, 0x09, 0x22, 0x2b, 0x0c, 0x2d, 0x0e, 0x2f}, {0x28, 0x09, 0x02, 0x2b, 0x0c, 0x2d, 0x2e, 0x2f}, {0x28, 0x09, 0x02, 0x2b, 0x0c, 0x2d, 0x2e, 0x2f}, {0x28, 0x09, 0x02, 0x2b, 0x0c, 0x2d, 0x2e, 0x2f}, {0x28, 0x09, 0x02, 0x3b, 0x0c, 0x2d, 0x2e, 0x27}, {0x28, 0x09, 0x02, 0x3b, 0x0c, 0x25, 0x2e, 0x07}, {0x28, 0x09, 0x02, 0x3b, 0x0c, 0x25, 0x2e, 0x07}, {0x28, 0x09, 0x02, 0x3b, 0x0c, 0x25, 0x2e, 0x07}, {0x30, 0x09, 0x02, 0x3b, 0x0c, 0x25, 0x3e, 0x07}, {0x30, 0x09, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x30, 0x09, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x30, 0x09, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x30, 0x11, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07} }, { {0x18, 0x21, 0x3a, 0x03, 0x24, 0x1d, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x24, 0x1d, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x24, 0x1d, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x24, 0x1d, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x24, 0x1d, 0x06, 0x3f}, {0x18, 0x21, 0x2a, 0x03, 0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, {0x20, 0x09, 0x02, 0x3b, 0x1c, 0x25, 0x2e, 0x07}, {0x20, 0x09, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x20, 0x09, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x20, 0x09, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x20, 0x19, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x20, 0x19, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x20, 0x19, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x20, 0x19, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07} }, { {0x18, 0x21, 0x3a, 0x03, 0x24, 0x1d, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x24, 0x1d, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x24, 0x1d, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x24, 0x1d, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x24, 0x1d, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x24, 0x1d, 0x06, 0x3f}, {0x18, 0x21, 0x2a, 0x03, 0x24, 0x1d, 0x06, 0x3f}, {0x18, 0x21, 0x2a, 0x03, 0x24, 0x0d, 0x06, 0x3f}, {0x18, 0x21, 0x2a, 0x03, 0x24, 0x0d, 0x06, 0x3f}, {0x18, 0x21, 0x2a, 0x03, 0x24, 0x0d, 0x06, 0x3f}, {0x18, 0x21, 0x2a, 0x0b, 0x24, 0x0d, 0x06, 0x2f}, {0x08, 0x21, 0x2a, 0x0b, 0x2c, 0x0d, 0x06, 0x2f}, {0x08, 0x21, 0x2a, 0x0b, 0x2c, 0x0d, 0x06, 0x2f}, {0x08, 0x21, 0x2a, 0x0b, 0x2c, 0x0d, 0x06, 0x2f}, {0x28, 0x21, 0x2a, 0x0b, 0x2c, 0x0d, 0x0e, 0x2f}, {0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x0d, 0x0e, 0x2f}, {0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x0d, 0x0e, 0x2f}, {0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x0e, 0x2f}, {0x28, 0x09, 0x2a, 0x2b, 0x2c, 0x2d, 0x0e, 0x2f}, {0x28, 0x09, 0x0a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, {0x28, 0x09, 0x0a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, {0x28, 0x09, 0x0a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}, {0x28, 0x09, 0x02, 0x2b, 0x0c, 0x2d, 0x2e, 0x2f}, {0x28, 0x09, 0x02, 0x2b, 0x0c, 0x25, 0x2e, 0x0f}, {0x28, 0x09, 0x02, 0x2b, 0x0c, 0x25, 0x2e, 0x0f}, {0x28, 0x09, 0x02, 0x2b, 0x0c, 0x25, 0x2e, 0x0f}, {0x28, 0x09, 0x02, 0x3b, 0x0c, 0x25, 0x2e, 0x07}, {0x20, 0x09, 0x02, 0x3b, 0x1c, 0x25, 0x2e, 0x07}, {0x20, 0x09, 0x02, 0x3b, 0x1c, 0x25, 0x2e, 0x07}, {0x20, 0x09, 0x02, 0x3b, 0x1c, 0x25, 0x2e, 0x07}, {0x20, 0x09, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x20, 0x19, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x20, 0x19, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x20, 0x19, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x20, 0x19, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x20, 0x19, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07} }, { {0x18, 0x21, 0x3a, 0x03, 0x24, 0x1d, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x24, 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 0x09, 0x02, 0x2b, 0x0c, 0x25, 0x2e, 0x0f}, {0x28, 0x09, 0x02, 0x2b, 0x0c, 0x25, 0x2e, 0x0f}, {0x20, 0x09, 0x02, 0x2b, 0x1c, 0x25, 0x2e, 0x0f}, {0x20, 0x09, 0x02, 0x3b, 0x1c, 0x25, 0x2e, 0x07}, {0x20, 0x09, 0x02, 0x3b, 0x1c, 0x25, 0x2e, 0x07}, {0x20, 0x09, 0x02, 0x3b, 0x1c, 0x25, 0x2e, 0x07}, {0x20, 0x19, 0x02, 0x3b, 0x1c, 0x25, 0x2e, 0x07}, {0x20, 0x19, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x20, 0x19, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x20, 0x19, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x20, 0x19, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x20, 0x19, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07} }, { {0x18, 0x21, 0x3a, 0x03, 0x24, 0x1d, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x24, 0x1d, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x24, 0x1d, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x24, 0x1d, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x24, 0x1d, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x24, 0x0d, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x24, 0x0d, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x24, 0x0d, 0x06, 0x3f}, {0x18, 0x21, 0x2a, 0x03, 0x24, 0x0d, 0x06, 0x3f}, {0x08, 0x21, 0x2a, 0x03, 0x2c, 0x0d, 0x06, 0x3f}, {0x08, 0x21, 0x2a, 0x03, 0x2c, 0x0d, 0x06, 0x3f}, {0x08, 0x21,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, 0x3e, 0x07}, {0x20, 0x19, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07}, {0x20, 0x19, 0x02, 0x3b, 0x1c, 0x25, 0x3e, 0x07} }, { {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x0d, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x0d, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x0d, 0x06, 0x3f}, {0x08, 0x21, 0x3a, 0x03, 0x34, 0x0d, 0x06, 0x3f}, {0x08, 0x21, 0x2a, 0x03, 0x2c, 0x0d, 0x06, 0x3f}, {0x08, 0x21, 0x2a, 0x03, 0x2c, 0x0d, 0x06, 0x3f}, {0x08, 0x21, 0x2a, 0x03, 0x2c, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x2a, 0x23, 0x2c, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x2a, 0x2b, 0x2c, 0x0d, 0x06, 0x2f}, {0x08, 0x29, 0x2a, 0x2b, 0x2c, 0x0d, 0x06, 0x2f}, {0x08, 0x29, 0x2a, 0x2b, 0x2c, 0x0d, 0x06, 0x2f}, {0x28, 0x29, 0x0a, 0x2b, 0x2c, 0x0d, 0x2e, 0x2f}, {0x28, 0x29, 0x0a, 0x2b, 0x2c, 0x0d, 0x2e, 0x2f}, {0x28, 0x29, 0x0a, 0x2b, 0x2c, 0x0d, 0x2e, 0x2f}, {0x28, 0x29, 0x0a, 0x2b, 0x2c, 0x0d, 0x2e, 0x2f}, {0x28, 0x29, 0x0a, 0x2b, 0x2c, 0x25, 0x2e, 0x0f}, {0x28, 0x09, 0x0a, 0x2b, 0x2c, 0x25, 0x2e, 0x0f}, {0x28, 0x09, 0x0a, 0x2b, 0x2c, 0x25, 0x2e, 0x0f}, {0x28, 0x09, 0x0a, 0x2b, 0x2c, 0x25, 0x2e, 0x0f}, {0x20, 0x09, 0x0a, 0x2b, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x09, 0x02, 0x2b, 0x1c, 0x25, 0x2e, 0x0f}, {0x20, 0x09, 0x02, 0x2b, 0x1c, 0x25, 0x2e, 0x0f}, {0x20, 0x09, 0x02, 0x2b, 0x1c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x2e, 0x07}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x2e, 0x07}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x2e, 0x07}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x07}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x07}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x07}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x07} }, { {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x0d, 0x06, 0x3f}, {0x08, 0x21, 0x3a, 0x03, 0x34, 0x0d, 0x06, 0x3f}, {0x08, 0x21, 0x3a, 0x03, 0x34, 0x0d, 0x06, 0x3f}, {0x08, 0x21, 0x3a, 0x03, 0x34, 0x0d, 0x06, 0x3f}, {0x08, 0x21, 0x2a, 0x03, 0x2c, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x2a, 0x23, 0x2c, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x2a, 0x23, 0x2c, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x2a, 0x23, 0x2c, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x2a, 0x2b, 0x2c, 0x0d, 0x06, 0x2f}, {0x08, 0x29, 0x0a, 0x2b, 0x2c, 0x0d, 0x26, 0x2f}, {0x08, 0x29, 0x0a, 0x2b, 0x2c, 0x0d, 0x26, 0x2f}, {0x28, 0x29, 0x0a, 0x2b, 0x2c, 0x0d, 0x2e, 0x2f}, {0x28, 0x29, 0x0a, 0x2b, 0x2c, 0x0d, 0x2e, 0x2f}, {0x28, 0x29, 0x0a, 0x2b, 0x2c, 0x05, 0x2e, 0x0f}, {0x28, 0x29, 0x0a, 0x2b, 0x2c, 0x05, 0x2e, 0x0f}, {0x28, 0x29, 0x0a, 0x2b, 0x2c, 0x25, 0x2e, 0x0f}, {0x28, 0x09, 0x0a, 0x2b, 0x2c, 0x25, 0x2e, 0x0f}, {0x20, 0x09, 0x0a, 0x2b, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x09, 0x0a, 0x2b, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x09, 0x0a, 0x2b, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x09, 0x02, 0x2b, 0x1c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x2e, 0x07}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x07}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x07}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x07}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x07}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x07} }, { {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x21, 0x3a, 0x03, 0x34, 0x0d, 0x06, 0x3f}, {0x08, 0x21, 0x3a, 0x03, 0x34, 0x0d, 0x06, 0x3f}, {0x08, 0x21, 0x3a, 0x03, 0x34, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x3a, 0x23, 0x34, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x2a, 0x23, 0x2c, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x2a, 0x23, 0x2c, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x2a, 0x23, 0x2c, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x0a, 0x2b, 0x2c, 0x0d, 0x26, 0x2f}, {0x08, 0x29, 0x0a, 0x2b, 0x2c, 0x0d, 0x26, 0x2f}, {0x08, 0x29, 0x0a, 0x2b, 0x2c, 0x0d, 0x26, 0x2f}, {0x08, 0x29, 0x0a, 0x2b, 0x2c, 0x0d, 0x26, 0x2f}, {0x28, 0x29, 0x0a, 0x2b, 0x2c, 0x05, 0x2e, 0x0f}, {0x28, 0x29, 0x0a, 0x2b, 0x2c, 0x05, 0x2e, 0x0f}, {0x28, 0x29, 0x0a, 0x2b, 0x2c, 0x05, 0x2e, 0x0f}, {0x28, 0x29, 0x0a, 0x2b, 0x2c, 0x05, 0x2e, 0x0f}, {0x20, 0x29, 0x0a, 0x2b, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x09, 0x0a, 0x2b, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x09, 0x0a, 0x2b, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x09, 0x0a, 0x2b, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x0a, 0x33, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x0f}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x07}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x07}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x07}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x07}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x07} }, { {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x18, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x21, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x21, 0x3a, 0x03, 0x34, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x3a, 0x23, 0x34, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x3a, 0x23, 0x34, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x3a, 0x23, 0x34, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x2a, 0x23, 0x2c, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x0a, 0x23, 0x2c, 0x0d, 0x26, 0x3f}, {0x08, 0x29, 0x0a, 0x23, 0x2c, 0x0d, 0x26, 0x3f}, {0x08, 0x29, 0x0a, 0x2b, 0x2c, 0x0d, 0x26, 0x2f}, {0x08, 0x29, 0x0a, 0x2b, 0x2c, 0x0d, 0x26, 0x2f}, {0x08, 0x29, 0x0a, 0x2b, 0x2c, 0x05, 0x26, 0x0f}, {0x08, 0x29, 0x0a, 0x2b, 0x2c, 0x05, 0x26, 0x0f}, {0x28, 0x29, 0x0a, 0x2b, 0x2c, 0x05, 0x2e, 0x0f}, {0x28, 0x29, 0x0a, 0x2b, 0x2c, 0x05, 0x2e, 0x0f}, {0x20, 0x29, 0x0a, 0x2b, 0x3c, 0x05, 0x2e, 0x0f}, {0x20, 0x29, 0x0a, 0x2b, 0x3c, 0x05, 0x2e, 0x0f}, {0x20, 0x29, 0x0a, 0x2b, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x09, 0x0a, 0x2b, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x0a, 0x33, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x0a, 0x33, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x0a, 0x33, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x0f}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x0f}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x0f}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x07}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x07}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x07}, {0x20, 0x19, 0x02, 0x33, 0x1c, 0x25, 0x36, 0x07} }, { {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x29, 0x3a, 0x23, 0x34, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x3a, 0x23, 0x34, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x3a, 0x23, 0x34, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x1a, 0x23, 0x34, 0x0d, 0x26, 0x3f}, {0x08, 0x29, 0x0a, 0x23, 0x2c, 0x0d, 0x26, 0x3f}, {0x08, 0x29, 0x0a, 0x23, 0x2c, 0x0d, 0x26, 0x3f}, {0x08, 0x29, 0x0a, 0x23, 0x2c, 0x0d, 0x26, 0x3f}, {0x08, 0x29, 0x0a, 0x2b, 0x2c, 0x05, 0x26, 0x0f}, {0x08, 0x29, 0x0a, 0x2b, 0x2c, 0x05, 0x26, 0x0f}, {0x08, 0x29, 0x0a, 0x2b, 0x2c, 0x05, 0x26, 0x0f}, {0x08, 0x29, 0x0a, 0x2b, 0x2c, 0x05, 0x26, 0x0f}, {0x20, 0x29, 0x0a, 0x2b, 0x3c, 0x05, 0x2e, 0x0f}, {0x20, 0x29, 0x0a, 0x2b, 0x3c, 0x05, 0x2e, 0x0f}, {0x20, 0x29, 0x0a, 0x2b, 0x3c, 0x05, 0x2e, 0x0f}, {0x20, 0x29, 0x0a, 0x2b, 0x3c, 0x05, 0x2e, 0x0f}, {0x20, 0x39, 0x0a, 0x33, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x0a, 0x33, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x0a, 0x33, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x0a, 0x33, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x0f}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x0f}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x0f}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x0f}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17} }, { {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x29, 0x3a, 0x23, 0x34, 0x0d, 0x06, 0x3f}, {0x08, 0x29, 0x1a, 0x23, 0x34, 0x0d, 0x26, 0x3f}, {0x08, 0x29, 0x1a, 0x23, 0x34, 0x0d, 0x26, 0x3f}, {0x08, 0x29, 0x1a, 0x23, 0x34, 0x0d, 0x26, 0x3f}, {0x08, 0x29, 0x0a, 0x23, 0x2c, 0x0d, 0x26, 0x3f}, {0x08, 0x29, 0x0a, 0x23, 0x2c, 0x05, 0x26, 0x1f}, {0x08, 0x29, 0x0a, 0x23, 0x2c, 0x05, 0x26, 0x1f}, {0x08, 0x29, 0x0a, 0x2b, 0x2c, 0x05, 0x26, 0x0f}, {0x08, 0x29, 0x0a, 0x2b, 0x2c, 0x05, 0x26, 0x0f}, {0x00, 0x29, 0x0a, 0x2b, 0x3c, 0x05, 0x26, 0x0f}, {0x00, 0x29, 0x0a, 0x2b, 0x3c, 0x05, 0x26, 0x0f}, {0x20, 0x29, 0x0a, 0x2b, 0x3c, 0x05, 0x2e, 0x0f}, {0x20, 0x29, 0x0a, 0x2b, 0x3c, 0x05, 0x2e, 0x0f}, {0x20, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x2e, 0x0f}, {0x20, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x2e, 0x0f}, {0x20, 0x39, 0x0a, 0x33, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x0a, 0x33, 0x3c, 0x25, 0x2e, 0x0f}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x0f}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x0f}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x0f}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x0f}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17} }, { {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x08, 0x29, 0x1a, 0x23, 0x34, 0x0d, 0x26, 0x3f}, {0x08, 0x29, 0x1a, 0x23, 0x34, 0x0d, 0x26, 0x3f}, {0x08, 0x29, 0x1a, 0x23, 0x34, 0x0d, 0x26, 0x3f}, {0x08, 0x29, 0x0a, 0x23, 0x2c, 0x05, 0x26, 0x1f}, {0x08, 0x29, 0x0a, 0x23, 0x2c, 0x05, 0x26, 0x1f}, {0x08, 0x29, 0x0a, 0x23, 0x2c, 0x05, 0x26, 0x1f}, {0x08, 0x29, 0x0a, 0x23, 0x2c, 0x05, 0x26, 0x1f}, {0x00, 0x29, 0x0a, 0x2b, 0x3c, 0x05, 0x26, 0x0f}, {0x00, 0x29, 0x0a, 0x2b, 0x3c, 0x05, 0x26, 0x0f}, {0x00, 0x29, 0x0a, 0x2b, 0x3c, 0x05, 0x26, 0x0f}, {0x00, 0x29, 0x0a, 0x2b, 0x3c, 0x05, 0x26, 0x0f}, {0x20, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x2e, 0x0f}, {0x20, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x2e, 0x0f}, {0x20, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x2e, 0x0f}, {0x20, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x2e, 0x0f}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x0f}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x0f}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x0f}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x0f}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17} }, { {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x08, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x08, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x08, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x08, 0x29, 0x1a, 0x23, 0x34, 0x0d, 0x26, 0x3f}, {0x08, 0x29, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x08, 0x29, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x08, 0x29, 0x0a, 0x23, 0x2c, 0x05, 0x26, 0x1f}, {0x08, 0x29, 0x0a, 0x23, 0x2c, 0x05, 0x26, 0x1f}, {0x00, 0x29, 0x0a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x29, 0x0a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x29, 0x0a, 0x2b, 0x3c, 0x05, 0x26, 0x0f}, {0x00, 0x29, 0x0a, 0x2b, 0x3c, 0x05, 0x26, 0x0f}, {0x00, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x26, 0x0f}, {0x00, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x26, 0x0f}, {0x20, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x2e, 0x0f}, {0x20, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x2e, 0x0f}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x0f}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x0f}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x0f}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x0f}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17} }, { {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x08, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x08, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x08, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x08, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x08, 0x29, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x08, 0x29, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x08, 0x29, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x29, 0x0a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x29, 0x0a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x29, 0x0a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x29, 0x0a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x26, 0x0f}, {0x00, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x26, 0x0f}, {0x00, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x26, 0x0f}, {0x00, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x26, 0x0f}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x0f}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x0f}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x0f}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x0f}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17} }, { {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x08, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x08, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x08, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x08, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x08, 0x29, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x29, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x29, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x29, 0x0a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x29, 0x0a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x0a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x26, 0x0f}, {0x00, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x26, 0x0f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x0f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x0f}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x0f}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x0f}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17} }, { {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x08, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x08, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x08, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x29, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x29, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x29, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x29, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x0a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x0a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x0f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x0f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x0f}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17} }, { {0x10, 0x31, 0x3a, 0x03, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x08, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x29, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x29, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x0a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x0a, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x0f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x1c, 0x25, 0x36, 0x17} }, { {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x00, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17} }, { {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x00, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17} }, { {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x00, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17}, {0x20, 0x19, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17} }, { {0x10, 0x31, 0x3a, 0x23, 0x34, 0x15, 0x06, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x3f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x10, 0x31, 0x1a, 0x23, 0x34, 0x15, 0x26, 0x1f}, {0x00, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x31, 0x1a, 0x23, 0x34, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x1a, 0x23, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x26, 0x1f}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x00, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x05, 0x36, 0x17}, {0x20, 0x39, 0x12, 0x33, 0x3c, 0x25, 0x36, 0x17} } }, { /* 9,600bps map */ { {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f} }, { {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f} }, { {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f} }, { {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f} }, { {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f} }, { {0x10, 0x01, 0x12, 0x1b, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f} }, { {0x10, 0x01, 0x12, 0x1b, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f} }, { {0x10, 0x01, 0x12, 0x1b, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f} }, { {0x10, 0x01, 0x12, 0x1b, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f} }, { {0x10, 0x01, 0x12, 0x1b, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x10, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x0e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x01, 0x12, 0x13, 0x1c, 0x1d, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x12, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x1c, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x00, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f} }, { {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x0f}, {0x08, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x09, 0x12, 0x13, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x12, 0x13, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x12, 0x13, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x12, 0x13, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f} }, { {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x0f}, {0x08, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x09, 0x12, 0x13, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x12, 0x13, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x12, 0x13, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x12, 0x13, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f} }, { {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x0f}, {0x08, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x09, 0x12, 0x13, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x12, 0x13, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x12, 0x13, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x12, 0x13, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f} }, { {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x0e, 0x0f}, {0x08, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x01, 0x12, 0x13, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x09, 0x12, 0x13, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x12, 0x13, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x12, 0x13, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x12, 0x13, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x09, 0x02, 0x13, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x09, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f} }, { {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x0e, 0x0f}, {0x08, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x19, 0x12, 0x0b, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x12, 0x0b, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x12, 0x0b, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x12, 0x0b, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x0b, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x0b, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x0b, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x0b, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f} }, { {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x0e, 0x0f}, {0x08, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x19, 0x12, 0x0b, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x12, 0x0b, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x12, 0x0b, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x12, 0x0b, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x0b, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x0b, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x0b, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x0b, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f} }, { {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x0e, 0x0f}, {0x08, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x19, 0x12, 0x0b, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x12, 0x0b, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x12, 0x0b, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x12, 0x0b, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x0b, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x0b, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x0b, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x0b, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f} }, { {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x1b, 0x0c, 0x1d, 0x0e, 0x07}, {0x10, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x0e, 0x0f}, {0x10, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x0e, 0x0f}, {0x08, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x11, 0x12, 0x0b, 0x0c, 0x1d, 0x1e, 0x0f}, {0x08, 0x19, 0x12, 0x0b, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x12, 0x0b, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x12, 0x0b, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x12, 0x0b, 0x0c, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x0b, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x0b, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x0b, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x0b, 0x14, 0x15, 0x1e, 0x0f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f}, {0x08, 0x19, 0x02, 0x03, 0x14, 0x15, 0x1e, 0x1f} }, { {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x06, 0x0f}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x06, 0x0f}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x06, 0x0f}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x06, 0x0f}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x16, 0x0f}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x16, 0x0f}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x16, 0x0f}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x16, 0x0f}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f} }, { {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x06, 0x0f}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x06, 0x0f}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x06, 0x0f}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x06, 0x0f}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x16, 0x0f}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x16, 0x0f}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x16, 0x0f}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x16, 0x0f}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f} }, { {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x06, 0x0f}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x06, 0x0f}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x06, 0x0f}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x06, 0x0f}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x16, 0x0f}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x16, 0x0f}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x16, 0x0f}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x16, 0x0f}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f} }, { {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x1d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x06, 0x0f}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x06, 0x0f}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x06, 0x0f}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x06, 0x0f}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x16, 0x0f}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x16, 0x0f}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x16, 0x0f}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x1d, 0x16, 0x0f}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x15, 0x16, 0x0f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x15, 0x16, 0x1f} }, { {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x06, 0x17}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x16, 0x17}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x16, 0x17}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x16, 0x17}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x16, 0x17}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f} }, { {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x06, 0x17}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x16, 0x17}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x16, 0x17}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x16, 0x17}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x16, 0x17}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f} }, { {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x06, 0x17}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x16, 0x17}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x16, 0x17}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x16, 0x17}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x16, 0x17}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f} }, { {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x0c, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x06, 0x17}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x16, 0x17}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x16, 0x17}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x16, 0x17}, {0x08, 0x11, 0x1a, 0x0b, 0x0c, 0x0d, 0x16, 0x17}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x1a, 0x0b, 0x0c, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x08, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f} }, { {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f} }, { {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f} }, { {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f} }, { {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f} }, { {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f} }, { {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x07}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x1f} }, { {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17} }, { {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17} }, { {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17} }, { {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x10, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x1b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x06, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x11, 0x1a, 0x0b, 0x04, 0x0d, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x1a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x0b, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x04, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17}, {0x18, 0x19, 0x0a, 0x03, 0x14, 0x05, 0x16, 0x17} } }, { /* 7,200bps map */ { {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f} }, { {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f} }, { {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f} }, { {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f} }, { {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f} }, { {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f} }, { {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f} }, { {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f} }, { {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f} }, { {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x03, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x04, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x0a, 0x0b, 0x0c, 0x0d, 0x06, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x03, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x04, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07}, {0x08, 0x01, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07} }, { {0x00, 0x09, 0x0a, 0x0b, 0x0c, 0x05, 0x06, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x0f}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x00, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x05, 0x0e, 0x07}, {0x08, 0x09, 0x02, 0x0b, 0x0c, 0x0d, 0x0e, 0x07} } } }; static const uint8_t constel_map_4800[36][36] = { /* 4,800bps map - No trellis. V.32/V.32bis only */ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x01, 0x01, 0x01 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x01 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 }, { 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03 } }; /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/Makefile.am0000664000175000017500000005504312343627334012751 00000000000000## ## SpanDSP - a series of DSP components for telephony ## ## Makefile.am - Process this file with automake to produce Makefile.in ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU Lesser General Public License version 2.1, ## as published by the Free Software Foundation. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU Lesser General Public License for more details. ## ## You should have received a copy of the GNU Lesser General Public ## License along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. AM_CFLAGS = $(COMP_VENDOR_CFLAGS) AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS) MAINTAINERCLEANFILES = Makefile.in DISTCLEANFILES = $(srcdir)/at_interpreter_dictionary.h \ $(srcdir)/math_fixed_tables.h \ $(srcdir)/v17_v32bis_rx_fixed_rrc.h \ $(srcdir)/v17_v32bis_rx_floating_rrc.h \ $(srcdir)/v17_v32bis_tx_fixed_rrc.h \ $(srcdir)/v17_v32bis_tx_floating_rrc.h \ $(srcdir)/v22bis_rx_1200_fixed_rrc.h \ $(srcdir)/v22bis_rx_2400_fixed_rrc.h \ $(srcdir)/v22bis_rx_1200_floating_rrc.h \ $(srcdir)/v22bis_rx_2400_floating_rrc.h \ $(srcdir)/v22bis_tx_fixed_rrc.h \ $(srcdir)/v22bis_tx_floating_rrc.h \ $(srcdir)/v27ter_rx_2400_fixed_rrc.h \ $(srcdir)/v27ter_rx_4800_fixed_rrc.h \ $(srcdir)/v27ter_rx_2400_floating_rrc.h \ $(srcdir)/v27ter_rx_4800_floating_rrc.h \ $(srcdir)/v27ter_tx_2400_fixed_rrc.h \ $(srcdir)/v27ter_tx_4800_fixed_rrc.h \ $(srcdir)/v27ter_tx_2400_floating_rrc.h \ $(srcdir)/v27ter_tx_4800_floating_rrc.h \ $(srcdir)/v29rx_fixed_rrc.h \ $(srcdir)/v29rx_floating_rrc.h \ $(srcdir)/v29tx_fixed_rrc.h \ $(srcdir)/v29tx_floating_rrc.h EXTRA_DIST = floating_fudge.h \ libspandsp.dsp \ libspandsp.2005.sln \ libspandsp.2008.sln \ libspandsp.2005.vcproj \ libspandsp.2008.vcproj \ libtiff.2005.vcproj \ libtiff.2008.vcproj \ filter_tools.c \ make_at_dictionary.c \ make_math_fixed_tables.c \ make_modem_filter.c \ msvc/config.h \ msvc/Download_TIFF.2005.vcproj \ msvc/Download_TIFF.2008.vcproj \ msvc/getopt.c \ msvc/gettimeofday.c \ msvc/inttypes.h \ msvc/make_at_dictionary.2005.vcproj \ msvc/make_at_dictionary.2008.vcproj \ msvc/make_modem_filter.2005.vcproj \ msvc/make_modem_filter.2008.vcproj \ msvc/msvcproj.head \ msvc/msvcproj.foot \ msvc/spandsp.h \ msvc/tgmath.h \ msvc/tiff/cleancount \ msvc/unistd.h \ msvc/util.vbs \ msvc/vc8proj.foot \ msvc/vc8proj.head \ msvc/vc9proj.foot \ msvc/vc9proj.head \ msvc/sys/time.h \ spandsp/private/README \ spandsp/version.h.in AM_CPPFLAGS = -I$(top_builddir) lib_LTLIBRARIES = libspandsp.la libspandsp_la_SOURCES = ademco_contactid.c \ adsi.c \ async.c \ at_interpreter.c \ awgn.c \ bell_r2_mf.c \ bert.c \ bit_operations.c \ bitstream.c \ complex_filters.c \ complex_vector_float.c \ complex_vector_int.c \ crc.c \ dds_float.c \ dds_int.c \ dtmf.c \ echo.c \ fax.c \ fax_modems.c \ fsk.c \ g711.c \ g722.c \ g726.c \ gsm0610_decode.c \ gsm0610_encode.c \ gsm0610_long_term.c \ gsm0610_lpc.c \ gsm0610_preprocess.c \ gsm0610_rpe.c \ gsm0610_short_term.c \ hdlc.c \ ima_adpcm.c \ image_translate.c \ logging.c \ lpc10_analyse.c \ lpc10_decode.c \ lpc10_encode.c \ lpc10_placev.c \ lpc10_voicing.c \ math_fixed.c \ modem_echo.c \ modem_connect_tones.c \ noise.c \ oki_adpcm.c \ playout.c \ plc.c \ power_meter.c \ queue.c \ schedule.c \ sig_tone.c \ silence_gen.c \ super_tone_rx.c \ super_tone_tx.c \ swept_tone.c \ t4_rx.c \ t4_tx.c \ t30.c \ t30_api.c \ t30_logging.c \ t31.c \ t35.c \ t38_core.c \ t38_gateway.c \ t38_non_ecm_buffer.c \ t38_terminal.c \ testcpuid.c \ time_scale.c \ timezone.c \ tone_detect.c \ tone_generate.c \ v17rx.c \ v17tx.c \ v18.c \ v22bis_rx.c \ v22bis_tx.c \ v27ter_rx.c \ v27ter_tx.c \ v29rx.c \ v29tx.c \ v42.c \ v42bis.c \ v8.c \ vector_float.c \ vector_int.c libspandsp_la_LDFLAGS = -version-info @SPANDSP_LT_CURRENT@:@SPANDSP_LT_REVISION@:@SPANDSP_LT_AGE@ $(COMP_VENDOR_LDFLAGS) nobase_include_HEADERS = spandsp/ademco_contactid.h \ spandsp/adsi.h \ spandsp/async.h \ spandsp/arctan2.h \ spandsp/at_interpreter.h \ spandsp/awgn.h \ spandsp/bell_r2_mf.h \ spandsp/bert.h \ spandsp/biquad.h \ spandsp/bit_operations.h \ spandsp/bitstream.h \ spandsp/crc.h \ spandsp/complex.h \ spandsp/complex_filters.h \ spandsp/complex_vector_float.h \ spandsp/complex_vector_int.h \ spandsp/dc_restore.h \ spandsp/dds.h \ spandsp/dtmf.h \ spandsp/echo.h \ spandsp/fast_convert.h \ spandsp/fax.h \ spandsp/fax_modems.h \ spandsp/fir.h \ spandsp/fsk.h \ spandsp/g168models.h \ spandsp/g711.h \ spandsp/g722.h \ spandsp/g726.h \ spandsp/gsm0610.h \ spandsp/hdlc.h \ spandsp/ima_adpcm.h \ spandsp/image_translate.h \ spandsp/logging.h \ spandsp/lpc10.h \ spandsp/math_fixed.h \ spandsp/modem_echo.h \ spandsp/modem_connect_tones.h \ spandsp/noise.h \ spandsp/oki_adpcm.h \ spandsp/playout.h \ spandsp/plc.h \ spandsp/power_meter.h \ spandsp/queue.h \ spandsp/saturated.h \ spandsp/schedule.h \ spandsp/stdbool.h \ spandsp/sig_tone.h \ spandsp/silence_gen.h \ spandsp/super_tone_rx.h \ spandsp/super_tone_tx.h \ spandsp/swept_tone.h \ spandsp/t30.h \ spandsp/t30_api.h \ spandsp/t30_fcf.h \ spandsp/t30_logging.h \ spandsp/t31.h \ spandsp/t35.h \ spandsp/t38_core.h \ spandsp/t38_gateway.h \ spandsp/t38_non_ecm_buffer.h \ spandsp/t38_terminal.h \ spandsp/t4_rx.h \ spandsp/t4_tx.h \ spandsp/t4_t6_decode.h \ spandsp/t4_t6_encode.h \ spandsp/telephony.h \ spandsp/time_scale.h \ spandsp/timezone.h \ spandsp/timing.h \ spandsp/tone_detect.h \ spandsp/tone_generate.h \ spandsp/v17rx.h \ spandsp/v17tx.h \ spandsp/v18.h \ spandsp/v22bis.h \ spandsp/v27ter_rx.h \ spandsp/v27ter_tx.h \ spandsp/v29rx.h \ spandsp/v29tx.h \ spandsp/v42.h \ spandsp/v42bis.h \ spandsp/v8.h \ spandsp/vector_float.h \ spandsp/vector_int.h \ spandsp/version.h \ spandsp/private/ademco_contactid.h \ spandsp/private/adsi.h \ spandsp/private/async.h \ spandsp/private/at_interpreter.h \ spandsp/private/awgn.h \ spandsp/private/bell_r2_mf.h \ spandsp/private/bert.h \ spandsp/private/bitstream.h \ spandsp/private/dtmf.h \ spandsp/private/echo.h \ spandsp/private/fax.h \ spandsp/private/fax_modems.h \ spandsp/private/fsk.h \ spandsp/private/g711.h \ spandsp/private/g722.h \ spandsp/private/g726.h \ spandsp/private/gsm0610.h \ spandsp/private/hdlc.h \ spandsp/private/ima_adpcm.h \ spandsp/private/image_translate.h \ spandsp/private/logging.h \ spandsp/private/lpc10.h \ spandsp/private/modem_connect_tones.h \ spandsp/private/modem_echo.h \ spandsp/private/noise.h \ spandsp/private/oki_adpcm.h \ spandsp/private/queue.h \ spandsp/private/schedule.h \ spandsp/private/sig_tone.h \ spandsp/private/silence_gen.h \ spandsp/private/super_tone_rx.h \ spandsp/private/super_tone_tx.h \ spandsp/private/swept_tone.h \ spandsp/private/t30.h \ spandsp/private/t30_dis_dtc_dcs_bits.h \ spandsp/private/t31.h \ spandsp/private/t38_core.h \ spandsp/private/t38_gateway.h \ spandsp/private/t38_non_ecm_buffer.h \ spandsp/private/t38_terminal.h \ spandsp/private/t4_rx.h \ spandsp/private/t4_tx.h \ spandsp/private/t4_t6_decode.h \ spandsp/private/t4_t6_encode.h \ spandsp/private/time_scale.h \ spandsp/private/timezone.h \ spandsp/private/tone_detect.h \ spandsp/private/tone_generate.h \ spandsp/private/v17rx.h \ spandsp/private/v17tx.h \ spandsp/private/v18.h \ spandsp/private/v22bis.h \ spandsp/private/v27ter_rx.h \ spandsp/private/v27ter_tx.h \ spandsp/private/v29rx.h \ spandsp/private/v29tx.h \ spandsp/private/v42.h \ spandsp/private/v42bis.h \ spandsp/private/v8.h \ spandsp/expose.h nodist_include_HEADERS = spandsp.h noinst_HEADERS = cielab_luts.h \ faxfont.h \ filter_tools.h \ gsm0610_local.h \ lpc10_encdecs.h \ mmx_sse_decs.h \ t30_local.h \ t4_t6_decode_states.h \ v17_v32bis_rx_constellation_maps.h \ v17_v32bis_tx_constellation_maps.h \ v29tx_constellation_maps.h make_at_dictionary$(EXEEXT): $(top_srcdir)/src/make_at_dictionary.c $(CC_FOR_BUILD) -o make_at_dictionary$(EXEEXT) $(top_srcdir)/src/make_at_dictionary.c -DHAVE_CONFIG_H -I$(top_builddir)/src make_math_fixed_tables$(EXEEXT): $(top_srcdir)/src/make_math_fixed_tables.c $(CC_FOR_BUILD) -o make_math_fixed_tables$(EXEEXT) $(top_srcdir)/src/make_math_fixed_tables.c -DHAVE_CONFIG_H -I$(top_builddir)/src -lm make_modem_filter$(EXEEXT): $(top_srcdir)/src/make_modem_filter.c $(top_srcdir)/src/filter_tools.c $(CC_FOR_BUILD) -o make_modem_filter$(EXEEXT) $(top_srcdir)/src/make_modem_filter.c $(top_srcdir)/src/filter_tools.c -DHAVE_CONFIG_H -I$(top_builddir)/src -lm # We need to run make_at_dictionary, so it generates the # at_interpreter_dictionary.h file at_interpreter.$(OBJEXT): at_interpreter_dictionary.h at_interpreter.lo: at_interpreter_dictionary.h at_interpreter_dictionary.h: make_at_dictionary$(EXEEXT) ./make_at_dictionary$(EXEEXT) >at_interpreter_dictionary.h math_fixed.$(OBJEXT): math_fixed_tables.h math_fixed.lo: math_fixed_tables.h math_fixed_tables.h: make_math_fixed_tables$(EXEEXT) ./make_math_fixed_tables$(EXEEXT) >math_fixed_tables.h t4_rx.$(OBJEXT): spandsp/version.h t4_rx.lo: spandsp/version.h V17_V32BIS_RX_INCL = v17_v32bis_rx_fixed_rrc.h \ v17_v32bis_rx_floating_rrc.h v17rx.$(OBJEXT): ${V17_V32BIS_RX_INCL} v17rx.lo: ${V17_V32BIS_RX_INCL} v17_v32bis_rx_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.17 -i -r >v17_v32bis_rx_fixed_rrc.h v17_v32bis_rx_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.17 -r >v17_v32bis_rx_floating_rrc.h V17_V32BIS_TX_INCL = v17_v32bis_tx_fixed_rrc.h \ v17_v32bis_tx_floating_rrc.h v17tx.$(OBJEXT): ${V17_V32BIS_TX_INCL} v17tx.lo: ${V17_V32BIS_TX_INCL} v17_v32bis_tx_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.17 -i -t >v17_v32bis_tx_fixed_rrc.h v17_v32bis_tx_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.17 -t >v17_v32bis_tx_floating_rrc.h V22BIS_RX_INCL = v22bis_rx_1200_fixed_rrc.h \ v22bis_rx_2400_fixed_rrc.h \ v22bis_rx_1200_floating_rrc.h \ v22bis_rx_2400_floating_rrc.h v22bis_rx.$(OBJEXT): ${V22BIS_RX_INCL} v22bis_rx.lo: ${V22BIS_RX_INCL} v22bis_rx_1200_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.22bis1200 -i -r >v22bis_rx_1200_fixed_rrc.h v22bis_rx_2400_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.22bis2400 -i -r >v22bis_rx_2400_fixed_rrc.h v22bis_rx_1200_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.22bis1200 -r >v22bis_rx_1200_floating_rrc.h v22bis_rx_2400_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.22bis2400 -r >v22bis_rx_2400_floating_rrc.h V22BIS_TX_INCL = v22bis_tx_fixed_rrc.h \ v22bis_tx_floating_rrc.h v22bis_tx.$(OBJEXT): ${V22BIS_TX_INCL} v22bis_tx.lo: ${V22BIS_TX_INCL} v22bis_tx_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.22bis -i -t >v22bis_tx_fixed_rrc.h v22bis_tx_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.22bis -t >v22bis_tx_floating_rrc.h V27_RX_INCL = v27ter_rx_2400_fixed_rrc.h \ v27ter_rx_4800_fixed_rrc.h \ v27ter_rx_2400_floating_rrc.h \ v27ter_rx_4800_floating_rrc.h v27ter_rx.$(OBJEXT): ${V27_RX_INCL} v27ter_rx.lo: ${V27_RX_INCL} v27ter_rx_2400_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.27ter2400 -i -r >v27ter_rx_2400_fixed_rrc.h v27ter_rx_4800_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.27ter4800 -i -r >v27ter_rx_4800_fixed_rrc.h v27ter_rx_2400_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.27ter2400 -r >v27ter_rx_2400_floating_rrc.h v27ter_rx_4800_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.27ter4800 -r >v27ter_rx_4800_floating_rrc.h V27TER_TX_INCL = v27ter_tx_2400_fixed_rrc.h \ v27ter_tx_4800_fixed_rrc.h \ v27ter_tx_2400_floating_rrc.h \ v27ter_tx_4800_floating_rrc.h v27ter_tx_.$(OBJEXT): ${V27TER_TX_INCL} v27ter_tx.lo: ${V27TER_TX_INCL} v27ter_tx_2400_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.27ter2400 -i -t >v27ter_tx_2400_fixed_rrc.h v27ter_tx_4800_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.27ter4800 -i -t >v27ter_tx_4800_fixed_rrc.h v27ter_tx_2400_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.27ter2400 -t >v27ter_tx_2400_floating_rrc.h v27ter_tx_4800_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.27ter4800 -t >v27ter_tx_4800_floating_rrc.h V29_RX_INCL = v29rx_fixed_rrc.h \ v29rx_floating_rrc.h v29rx.$(OBJEXT): ${V29_RX_INCL} v29rx.lo: ${V29_RX_INCL} v29rx_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.29 -i -r >v29rx_fixed_rrc.h v29rx_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.29 -r >v29rx_floating_rrc.h V29_TX_INCL = v29tx_fixed_rrc.h \ v29tx_floating_rrc.h v29tx.$(OBJEXT): ${V29_TX_INCL} v29tx.lo: ${V29_TX_INCL} v29tx_fixed_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.29 -i -t >v29tx_fixed_rrc.h v29tx_floating_rrc.h: make_modem_filter$(EXEEXT) ./make_modem_filter$(EXEEXT) -m V.29 -t >v29tx_floating_rrc.h DSP = libspandsp.dsp VCPROJ8 = libspandsp.2005.vcproj VCPROJ9 = libspandsp.2008.vcproj WIN32SOURCES = $(libspandsp_la_SOURCES) .\\msvc\\gettimeofday.c WIN32HEADERS = $(nobase_include_HEADERS) spandsp.h DSPOUT = | awk '{printf("%s\r\n", $$0)}' >> $(DSP) VCPROJOUT8 = | awk '{printf("%s\r\n", $$0)}' >> $(VCPROJ8) VCPROJOUT9 = | awk '{printf("%s\r\n", $$0)}' >> $(VCPROJ9) $(DSP): msvc/msvcproj.head msvc/msvcproj.foot Makefile.am echo "creating $(DSP)" @(cp $(srcdir)/msvc/msvcproj.head $(DSP); \ echo "# Begin Group \"Source Files\"" $(DSPOUT); \ for file in $(WIN32SOURCES); do \ echo "# Begin Source File" $(DSPOUT); \ echo "" $(DSPOUT); \ echo "SOURCE=.\\"$$file $(DSPOUT); \ echo "# End Source File" $(DSPOUT); \ done; \ echo "# End Group" $(DSPOUT); \ echo "# Begin Group \"Header Files\"" $(DSPOUT); \ for file in $(WIN32HEADERS); do \ echo "# Begin Source File" $(DSPOUT); \ echo "" $(DSPOUT); \ echo "SOURCE=.\\"$$file $(DSPOUT); \ echo "# End Source File" $(DSPOUT); \ done; \ echo "# End Group" $(DSPOUT); \ cat $(srcdir)/msvc/msvcproj.foot $(DSPOUT) ) $(VCPROJ8): msvc/vc8proj.head msvc/vc8proj.foot Makefile.am echo "creating $(VCPROJ8)" @(cp $(srcdir)/msvc/vc8proj.head $(VCPROJ8); \ for file in $(WIN32SOURCES); do \ echo "" $(VCPROJOUT8); \ done; \ echo "" $(VCPROJOUT8); \ for file in $(WIN32HEADERS); do \ echo "" $(VCPROJOUT8); \ done; \ cat $(srcdir)/msvc/vc8proj.foot $(VCPROJOUT8) ) $(VCPROJ9): msvc/vc9proj.head msvc/vc9proj.foot Makefile.am echo "creating $(VCPROJ9)" @(cp $(srcdir)/msvc/vc9proj.head $(VCPROJ9); \ for file in $(WIN32SOURCES); do \ echo "" $(VCPROJOUT9); \ done; \ echo "" $(VCPROJOUT9); \ for file in $(WIN32HEADERS); do \ echo "" $(VCPROJOUT9); \ done; \ cat $(srcdir)/msvc/vc9proj.foot $(VCPROJOUT9) ) $(srcdir)/msvc/spandsp.h: spandsp.h.in echo "creating $(srcdir)/msvc/spandsp.h" @sed -e "s/#define _SPANDSP_H_/#define _SPANDSP_H_\n\n#define __inline__ __inline\n#pragma warning(disable:4200)/" \ -e "s/\@SPANDSP_USE_FIXED_POINT\@/#undef SPANDSP_USE_FIXED_POINT/" \ -e "s/\@SPANDSP_MISALIGNED_ACCESS_FAILS\@/#undef SPANDSP_MISALIGNED_ACCESS_FAILS/" \ -e "s/\@SPANDSP_USE_EXPORT_CAPABILITY\@/#define SPANDSP_USE_EXPORT_CAPABILITY 1/" \ -e "s/\@INSERT_INTTYPES_HEADER\@/#include /" \ -e "s/\@INSERT_MATH_HEADER\@/#include /" $(srcdir)/spandsp.h.in > $(srcdir)/msvc/spandsp.h dist-hook: spandsp/version.h spandsp/version.h: mkdir -p $(@D) NOWDATE=`date --utc +"%Y%m%d"` ; \ NOWTIME=`date --utc +"%H%M%S"` ; \ sed 's/$$SPANDSP_RELEASE_DATE/'$$NOWDATE'/;s/$$SPANDSP_RELEASE_TIME/'$$NOWTIME'/' \ <$(srcdir)/spandsp/version.h.in >$@ spandsp-0.0.6/src/adsi.c0000664000175000017500000007736112343627535012013 00000000000000/* * SpanDSP - a series of DSP components for telephony * * adsi.c - Analogue display service interfaces of various types, including * ADSI, TDD and most caller ID formats. * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #if defined(HAVE_STDBOOL_H) #include #else #include "spandsp/stdbool.h" #endif #include "floating_fudge.h" #include #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/logging.h" #include "spandsp/queue.h" #include "spandsp/complex.h" #include "spandsp/dds.h" #include "spandsp/power_meter.h" #include "spandsp/async.h" #include "spandsp/crc.h" #include "spandsp/fsk.h" #include "spandsp/tone_detect.h" #include "spandsp/tone_generate.h" #include "spandsp/super_tone_rx.h" #include "spandsp/dtmf.h" #include "spandsp/adsi.h" #include "spandsp/private/logging.h" #include "spandsp/private/queue.h" #include "spandsp/private/tone_generate.h" #include "spandsp/private/async.h" #include "spandsp/private/fsk.h" #include "spandsp/private/dtmf.h" #include "spandsp/private/adsi.h" /*! The baudot code to shift from alpha to digits and symbols */ #define BAUDOT_FIGURE_SHIFT 0x1B /*! The baudot code to shift from digits and symbols to alpha */ #define BAUDOT_LETTER_SHIFT 0x1F enum { SOH = 0x01, STX = 0x02, ETX = 0x03, DLE = 0x10, SUB = 0x1A }; static uint16_t adsi_encode_baudot(adsi_tx_state_t *s, uint8_t ch); static uint8_t adsi_decode_baudot(adsi_rx_state_t *s, uint8_t ch); static int adsi_tx_get_bit(void *user_data) { int bit; adsi_tx_state_t *s; s = (adsi_tx_state_t *) user_data; /* This is similar to the async. handling code in fsk.c, but a few special things are needed in the preamble, and postamble of an ADSI message. */ if (s->bit_no < s->preamble_len) { /* Alternating bit preamble */ bit = s->bit_no & 1; s->bit_no++; } else if (s->bit_no < s->preamble_len + s->preamble_ones_len) { /* All 1s for receiver conditioning */ /* NB: The receiver is an async one. It needs a rest after the alternating 1/0 sequence so it can reliably pick up on the next start bit, and sync to the byte stream. */ /* The length of this period varies with the circumstance */ bit = 1; s->bit_no++; } else if (s->bit_no <= s->preamble_len + s->preamble_ones_len) { /* Push out the 8 bit async. chars, with an appropriate number of stop bits */ if (s->bit_pos == 0) { /* Start bit */ bit = 0; s->bit_pos++; } else if (s->bit_pos < 1 + 8) { bit = (s->msg[s->byte_no] >> (s->bit_pos - 1)) & 1; s->bit_pos++; } else if (s->bit_pos < 1 + 8 + s->stop_bits - 1) { /* Stop bit */ bit = 1; s->bit_pos++; } else { /* Stop bit */ bit = 1; s->bit_pos = 0; if (++s->byte_no >= s->msg_len) s->bit_no++; } } else if (s->bit_no <= s->preamble_len + s->preamble_ones_len + s->postamble_ones_len) { /* Extra stop bits beyond the last character, to meet the specs., and ensure all bits are out of the DSP before we shut off the FSK modem. */ bit = 1; s->bit_no++; } else { bit = SIG_STATUS_END_OF_DATA; if (s->tx_signal_on) { /* The FSK should now be switched off. */ s->tx_signal_on = false; s->msg_len = 0; } } //printf("Tx bit %d\n", bit); return bit; } /*- End of function --------------------------------------------------------*/ static int adsi_tdd_get_async_byte(void *user_data) { adsi_tx_state_t *s; s = (adsi_tx_state_t *) user_data; if (s->byte_no < s->msg_len) return s->msg[s->byte_no++]; if (s->tx_signal_on) { /* The FSK should now be switched off. */ s->tx_signal_on = false; s->msg_len = 0; } return 0x1F; } /*- End of function --------------------------------------------------------*/ static void adsi_rx_put_bit(void *user_data, int bit) { adsi_rx_state_t *s; int i; int sum; s = (adsi_rx_state_t *) user_data; if (bit < 0) { /* Special conditions */ span_log(&s->logging, SPAN_LOG_FLOW, "ADSI signal status is %s (%d)\n", signal_status_to_str(bit), bit); switch (bit) { case SIG_STATUS_CARRIER_UP: s->consecutive_ones = 0; s->bit_pos = 0; s->in_progress = 0; s->msg_len = 0; break; case SIG_STATUS_CARRIER_DOWN: break; default: span_log(&s->logging, SPAN_LOG_WARNING, "Unexpected special put bit value - %d!\n", bit); break; } return; } bit &= 1; if (s->bit_pos == 0) { if (bit == 0) { /* Start bit */ s->bit_pos++; if (s->consecutive_ones > 10) { /* This is a line idle condition, which means we should restart message acquisition */ s->msg_len = 0; } s->consecutive_ones = 0; } else { s->consecutive_ones++; } } else if (s->bit_pos <= 8) { s->in_progress >>= 1; if (bit) s->in_progress |= 0x80; s->bit_pos++; } else { /* Stop bit */ if (bit) { if (s->msg_len < 256) { if (s->standard == ADSI_STANDARD_JCLIP) { if (s->msg_len == 0) { /* A message should start DLE SOH, but let's just check we are starting with a DLE for now */ if (s->in_progress == (0x80 | DLE)) s->msg[s->msg_len++] = (uint8_t) s->in_progress; } else { s->msg[s->msg_len++] = (uint8_t) s->in_progress; } if (s->msg_len >= 11 && s->msg_len == ((s->msg[6] & 0x7F) + 11)) { /* Test the CRC-16 */ if (crc_itu16_calc(s->msg + 2, s->msg_len - 2, 0) == 0) { /* Strip off the parity bits. It doesn't seem worthwhile actually checking the parity if a CRC check has succeeded. */ for (i = 0; i < s->msg_len - 2; i++) s->msg[i] &= 0x7F; /* Put everything, except the CRC octets */ s->put_msg(s->user_data, s->msg, s->msg_len - 2); } else { span_log(&s->logging, SPAN_LOG_WARNING, "CRC failed\n"); } s->msg_len = 0; } } else { s->msg[s->msg_len++] = (uint8_t) s->in_progress; if (s->msg_len >= 3 && s->msg_len == (s->msg[1] + 3)) { /* Test the checksum */ sum = 0; for (i = 0; i < s->msg_len - 1; i++) sum += s->msg[i]; if ((-sum & 0xFF) == s->msg[i]) s->put_msg(s->user_data, s->msg, s->msg_len - 1); else span_log(&s->logging, SPAN_LOG_WARNING, "Sumcheck failed\n"); s->msg_len = 0; } } } } else { s->framing_errors++; } s->bit_pos = 0; s->in_progress = 0; } } /*- End of function --------------------------------------------------------*/ static void adsi_tdd_put_async_byte(void *user_data, int byte) { adsi_rx_state_t *s; uint8_t octet; s = (adsi_rx_state_t *) user_data; //printf("Rx bit %x\n", bit); if (byte < 0) { /* Special conditions */ span_log(&s->logging, SPAN_LOG_FLOW, "ADSI signal status is %s (%d)\n", signal_status_to_str(byte), byte); switch (byte) { case SIG_STATUS_CARRIER_UP: s->consecutive_ones = 0; s->bit_pos = 0; s->in_progress = 0; s->msg_len = 0; break; case SIG_STATUS_CARRIER_DOWN: if (s->msg_len > 0) { /* Whatever we have to date constitutes the message */ s->put_msg(s->user_data, s->msg, s->msg_len); s->msg_len = 0; } break; default: span_log(&s->logging, SPAN_LOG_WARNING, "Unexpected special put byte value - %d!\n", byte); break; } return; } if ((octet = adsi_decode_baudot(s, (uint8_t) (byte & 0x1F)))) s->msg[s->msg_len++] = octet; if (s->msg_len >= 256) { s->put_msg(s->user_data, s->msg, s->msg_len); s->msg_len = 0; } } /*- End of function --------------------------------------------------------*/ static void adsi_rx_dtmf(void *user_data, const char *digits, int len) { adsi_rx_state_t *s; s = (adsi_rx_state_t *) user_data; if (s->msg_len == 0) { /* Message starting. Start a 10s timeout, to make things more noise tolerant for a detector running continuously when on hook. */ s->in_progress = 80000; } /* It seems all the DTMF variants are a string of digits and letters, terminated by a "#", or a "C". It appears these are unambiguous, and non-conflicting. */ for ( ; len && s->msg_len < 256; len--) { s->msg[s->msg_len++] = *digits; if (*digits == '#' || *digits == 'C') { s->put_msg(s->user_data, s->msg, s->msg_len); s->msg_len = 0; } digits++; } } /*- End of function --------------------------------------------------------*/ static void start_tx(adsi_tx_state_t *s) { switch (s->standard) { case ADSI_STANDARD_CLASS: fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_BELL202], adsi_tx_get_bit, s); break; case ADSI_STANDARD_CLIP: case ADSI_STANDARD_ACLIP: case ADSI_STANDARD_JCLIP: fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_V23CH1], adsi_tx_get_bit, s); break; case ADSI_STANDARD_CLIP_DTMF: dtmf_tx_init(&s->dtmftx); break; case ADSI_STANDARD_TDD: fsk_tx_init(&s->fsktx, &preset_fsk_specs[FSK_WEITBRECHT], async_tx_get_bit, &s->asynctx); async_tx_init(&s->asynctx, 5, ASYNC_PARITY_NONE, 2, false, adsi_tdd_get_async_byte, s); /* Schedule an explicit shift at the start of baudot transmission */ s->baudot_shift = 2; break; } s->tx_signal_on = true; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) adsi_rx(adsi_rx_state_t *s, const int16_t amp[], int len) { switch (s->standard) { case ADSI_STANDARD_CLIP_DTMF: /* Apply a message timeout. */ s->in_progress -= len; if (s->in_progress <= 0) s->msg_len = 0; dtmf_rx(&s->dtmfrx, amp, len); break; default: fsk_rx(&s->fskrx, amp, len); break; } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) adsi_rx_get_logging_state(adsi_rx_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(adsi_rx_state_t *) adsi_rx_init(adsi_rx_state_t *s, int standard, put_msg_func_t put_msg, void *user_data) { if (s == NULL) { if ((s = (adsi_rx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); s->put_msg = put_msg; s->user_data = user_data; switch (standard) { case ADSI_STANDARD_CLASS: fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_BELL202], FSK_FRAME_MODE_ASYNC, adsi_rx_put_bit, s); break; case ADSI_STANDARD_CLIP: case ADSI_STANDARD_ACLIP: case ADSI_STANDARD_JCLIP: fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_V23CH1], FSK_FRAME_MODE_ASYNC, adsi_rx_put_bit, s); break; case ADSI_STANDARD_CLIP_DTMF: dtmf_rx_init(&s->dtmfrx, adsi_rx_dtmf, s); break; case ADSI_STANDARD_TDD: /* TDD uses 5 bit data, no parity and 1.5 stop bits. We scan for the first stop bit, and ride over the fraction. */ fsk_rx_init(&s->fskrx, &preset_fsk_specs[FSK_WEITBRECHT], FSK_FRAME_MODE_5N1_FRAMES, adsi_tdd_put_async_byte, s); break; } s->standard = standard; span_log_init(&s->logging, SPAN_LOG_NONE, NULL); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) adsi_rx_release(adsi_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) adsi_rx_free(adsi_rx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) adsi_tx(adsi_tx_state_t *s, int16_t amp[], int max_len) { int len; int lenx; len = tone_gen(&s->alert_tone_gen, amp, max_len); if (s->tx_signal_on) { switch (s->standard) { case ADSI_STANDARD_CLIP_DTMF: if (len < max_len) len += dtmf_tx(&s->dtmftx, amp, max_len - len); break; default: if (len < max_len) { if ((lenx = fsk_tx(&s->fsktx, amp + len, max_len - len)) <= 0) s->tx_signal_on = false; len += lenx; } break; } } return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) adsi_tx_send_alert_tone(adsi_tx_state_t *s) { tone_gen_init(&s->alert_tone_gen, &s->alert_tone_desc); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) adsi_tx_set_preamble(adsi_tx_state_t *s, int preamble_len, int preamble_ones_len, int postamble_ones_len, int stop_bits) { if (preamble_len < 0) { if (s->standard == ADSI_STANDARD_JCLIP) s->preamble_len = 0; else s->preamble_len = 300; } else { s->preamble_len = preamble_len; } if (preamble_ones_len < 0) { if (s->standard == ADSI_STANDARD_JCLIP) s->preamble_ones_len = 75; else s->preamble_ones_len = 80; } else { s->preamble_ones_len = preamble_ones_len; } if (postamble_ones_len < 0) { if (s->standard == ADSI_STANDARD_JCLIP) s->postamble_ones_len = 5; else s->postamble_ones_len = 5; } else { s->postamble_ones_len = postamble_ones_len; } if (stop_bits < 0) { if (s->standard == ADSI_STANDARD_JCLIP) s->stop_bits = 4; else s->stop_bits = 1; } else { s->stop_bits = stop_bits; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) adsi_tx_put_message(adsi_tx_state_t *s, const uint8_t *msg, int len) { int i; int j; int k; int byte; int parity; int sum; size_t ii; uint16_t crc_value; /* Don't inject a new message when a previous one is still in progress */ if (s->msg_len > 0) return 0; if (!s->tx_signal_on) { /* We need to restart the modem */ start_tx(s); } switch (s->standard) { case ADSI_STANDARD_CLIP_DTMF: if (len >= 128) return -1; len -= (int) dtmf_tx_put(&s->dtmftx, (char *) msg, len); break; case ADSI_STANDARD_JCLIP: if (len > 128 - 9) return -1; i = 0; s->msg[i++] = DLE; s->msg[i++] = SOH; s->msg[i++] = 0x07; //header s->msg[i++] = DLE; s->msg[i++] = STX; s->msg[i++] = msg[0]; s->msg[i++] = (uint8_t) (len - 2); /* We might need to byte stuff the overall length, but the rest of the message should already be stuffed. */ if (len - 2 == DLE) s->msg[i++] = DLE; memcpy(&s->msg[i], &msg[2], len - 2); i += len - 2; s->msg[i++] = DLE; s->msg[i++] = ETX; /* Set the parity bits */ for (j = 0; j < i; j++) { byte = s->msg[j]; parity = 0; for (k = 1; k <= 7; k++) parity ^= (byte << k); s->msg[j] = (s->msg[j] & 0x7F) | ((uint8_t) parity & 0x80); } crc_value = crc_itu16_calc(s->msg + 2, i - 2, 0); s->msg[i++] = (uint8_t) (crc_value & 0xFF); s->msg[i++] = (uint8_t) ((crc_value >> 8) & 0xFF); s->msg_len = i; break; case ADSI_STANDARD_TDD: if (len > 255) return -1; memcpy(s->msg, msg, len); s->msg_len = len; break; default: if (len > 255) return -1; memcpy(s->msg, msg, len); /* Force the length in case it is wrong */ s->msg[1] = (uint8_t) (len - 2); /* Add the sumcheck */ sum = 0; for (ii = 0; ii < (size_t) len; ii++) sum += s->msg[ii]; s->msg[len] = (uint8_t) ((-sum) & 0xFF); s->msg_len = len + 1; break; } /* Prepare the bit sequencing */ s->byte_no = 0; s->bit_pos = 0; s->bit_no = 0; return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) adsi_tx_get_logging_state(adsi_tx_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(adsi_tx_state_t *) adsi_tx_init(adsi_tx_state_t *s, int standard) { if (s == NULL) { if ((s = (adsi_tx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); tone_gen_descriptor_init(&s->alert_tone_desc, 2130, -13, 2750, -13, 110, 60, 0, 0, false); s->standard = standard; adsi_tx_set_preamble(s, -1, -1, -1, -1); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); start_tx(s); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) adsi_tx_release(adsi_tx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) adsi_tx_free(adsi_tx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ static uint16_t adsi_encode_baudot(adsi_tx_state_t *s, uint8_t ch) { static const uint8_t conv[128] = { 0x00, /* NUL */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0x42, /* LF */ 0xFF, /* */ 0xFF, /* */ 0x48, /* CR */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0xFF, /* */ 0x44, /* */ 0xFF, /* ! */ 0xFF, /* " */ 0x94, /* # */ 0x89, /* $ */ 0xFF, /* % */ 0xFF, /* & */ 0x85, /* ' */ 0x8F, /* ( */ 0x92, /* ) */ 0x8B, /* * */ 0x91, /* + */ 0x8C, /* , */ 0x83, /* - */ 0x9C, /* . */ 0x9D, /* / */ 0x96, /* 0 */ 0x97, /* 1 */ 0x93, /* 2 */ 0x81, /* 3 */ 0x8A, /* 4 */ 0x90, /* 5 */ 0x95, /* 6 */ 0x87, /* 7 */ 0x86, /* 8 */ 0x98, /* 9 */ 0x8E, /* : */ 0xFF, /* ; */ 0xFF, /* < */ 0x9E, /* = */ 0xFF, /* > */ 0x99, /* ? */ 0xFF, /* @ */ 0x03, /* A */ 0x19, /* B */ 0x0E, /* C */ 0x09, /* D */ 0x01, /* E */ 0x0D, /* F */ 0x1A, /* G */ 0x14, /* H */ 0x06, /* I */ 0x0B, /* J */ 0x0F, /* K */ 0x12, /* L */ 0x1C, /* M */ 0x0C, /* N */ 0x18, /* O */ 0x16, /* P */ 0x17, /* Q */ 0x0A, /* R */ 0x05, /* S */ 0x10, /* T */ 0x07, /* U */ 0x1E, /* V */ 0x13, /* W */ 0x1D, /* X */ 0x15, /* Y */ 0x11, /* Z */ 0xFF, /* [ */ 0xFF, /* \ */ 0xFF, /* ] */ 0x9B, /* ^ */ 0xFF, /* _ */ 0xFF, /* ` */ 0x03, /* a */ 0x19, /* b */ 0x0E, /* c */ 0x09, /* d */ 0x01, /* e */ 0x0D, /* f */ 0x1A, /* g */ 0x14, /* h */ 0x06, /* i */ 0x0B, /* j */ 0x0F, /* k */ 0x12, /* l */ 0x1C, /* m */ 0x0C, /* n */ 0x18, /* o */ 0x16, /* p */ 0x17, /* q */ 0x0A, /* r */ 0x05, /* s */ 0x10, /* t */ 0x07, /* u */ 0x1E, /* v */ 0x13, /* w */ 0x1D, /* x */ 0x15, /* y */ 0x11, /* z */ 0xFF, /* { */ 0xFF, /* | */ 0xFF, /* } */ 0xFF, /* ~ */ 0xFF, /* DEL */ }; uint16_t shift; ch = conv[ch]; if (ch == 0xFF) return 0; if ((ch & 0x40)) return ch & 0x1F; if ((ch & 0x80)) { if (s->baudot_shift == 1) return ch & 0x1F; s->baudot_shift = 1; shift = BAUDOT_FIGURE_SHIFT; } else { if (s->baudot_shift == 0) return ch & 0x1F; s->baudot_shift = 0; shift = BAUDOT_LETTER_SHIFT; } return (shift << 5) | (ch & 0x1F); } /*- End of function --------------------------------------------------------*/ static uint8_t adsi_decode_baudot(adsi_rx_state_t *s, uint8_t ch) { static const uint8_t conv[2][32] = { {"\000E\nA SIU\rDRJNFCKTZLWHYPQOBG^MXV^"}, {"\0003\n- '87\r$4*,*:(5+)2#6019?*^./=^"} }; switch (ch) { case BAUDOT_FIGURE_SHIFT: s->baudot_shift = 1; break; case BAUDOT_LETTER_SHIFT: s->baudot_shift = 0; break; default: return conv[s->baudot_shift][ch]; } /* return 0 if we did not produce a character */ return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) adsi_next_field(adsi_rx_state_t *s, const uint8_t *msg, int msg_len, int pos, uint8_t *field_type, uint8_t const **field_body, int *field_len) { int i; /* Return -1 for no more fields. Return -2 for message structure corrupt. */ switch (s->standard) { case ADSI_STANDARD_CLASS: case ADSI_STANDARD_CLIP: case ADSI_STANDARD_ACLIP: if (pos >= msg_len) return -1; /* For MDMF type messages, these standards all use "IE" type fields - type, length, contents - and similar headers */ if (pos <= 0) { /* Return the message type */ *field_type = msg[0]; *field_len = 0; *field_body = NULL; pos = 2; } else { if ((msg[0] & 0x80)) { /* MDMF messages seem to always have a message type with the MSB set. Is that guaranteed? */ *field_type = msg[pos++]; *field_len = msg[pos++]; *field_body = msg + pos; } else { /* SDMF */ *field_type = 0; *field_len = msg_len - pos; *field_body = msg + pos; } pos += *field_len; } if (pos > msg_len) return -2; break; case ADSI_STANDARD_JCLIP: if (pos >= msg_len - 2) return -1; if (pos <= 0) { /* Return the message type */ pos = 5; *field_type = msg[pos++]; if (*field_type == DLE) pos++; if (msg[pos++] == DLE) pos++; *field_len = 0; *field_body = NULL; } else { *field_type = msg[pos++]; if (*field_type == DLE) pos++; *field_len = msg[pos++]; if (*field_len == DLE) pos++; /* TODO: we assume here that the body contains no DLE's that would have been stuffed */ *field_body = msg + pos; pos += *field_len; } if (pos > msg_len - 2) return -2; break; case ADSI_STANDARD_CLIP_DTMF: if (pos > msg_len) return -1; if (pos <= 0) { pos = 1; *field_type = msg[msg_len - 1]; *field_len = 0; *field_body = NULL; } else { /* Remove bias on the pos value */ pos--; if (msg[pos] >= '0' && msg[pos] <= '9') *field_type = CLIP_DTMF_HASH_UNSPECIFIED; else *field_type = msg[pos++]; *field_body = msg + pos; i = pos; while (i < msg_len && msg[i] >= '0' && msg[i] <= '9') i++; *field_len = i - pos; pos = i; /* Check if we have reached the end of message marker. */ if (msg[pos] == '#' || msg[pos] == 'C') pos++; if (pos > msg_len) return -2; /* Bias the pos value, so we don't return 0 inappropriately */ pos++; } break; case ADSI_STANDARD_TDD: if (pos >= msg_len) return -1; *field_type = 0; *field_body = msg; *field_len = msg_len; pos = msg_len; break; } return pos; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) adsi_add_field(adsi_tx_state_t *s, uint8_t *msg, int len, uint8_t field_type, uint8_t const *field_body, int field_len) { int i; int x; switch (s->standard) { case ADSI_STANDARD_CLASS: case ADSI_STANDARD_CLIP: case ADSI_STANDARD_ACLIP: /* These standards all use "IE" type fields - type, length, value - and similar headers */ if (len <= 0) { /* Initialise a new message. The field type is actually the message type. */ msg[0] = field_type; msg[1] = 0; len = 2; } else { /* Add to a message in progress. */ if (field_type) { msg[len++] = field_type; msg[len++] = (uint8_t) field_len; if (field_len == DLE) msg[len++] = (uint8_t) field_len; memcpy(&msg[len], field_body, field_len); len += field_len; } else { /* No field type or length, for restricted single message formats */ memcpy(&msg[len], field_body, field_len); len += field_len; } } break; case ADSI_STANDARD_JCLIP: /* This standard uses "IE" type fields - type, length, value - but escapes DLE characters, to prevent immitation of a control octet. */ if (len <= 0) { /* Initialise a new message. The field type is actually the message type. */ msg[0] = field_type; msg[1] = 0; len = 2; } else { /* Add to a message in progress. */ msg[len++] = field_type; if (field_type == DLE) msg[len++] = field_type; msg[len++] = (uint8_t) field_len; if (field_len == DLE) msg[len++] = (uint8_t) field_len; for (i = 0; i < field_len; i++) { msg[len++] = field_body[i]; if (field_body[i] == DLE) msg[len++] = field_body[i]; } } break; case ADSI_STANDARD_CLIP_DTMF: if (len <= 0) { /* Initialise a new message. The field type is actually the message type. */ msg[0] = field_type; len = 1; } else { /* Save and reuse the terminator/message type */ x = msg[--len]; if (field_type != CLIP_DTMF_HASH_UNSPECIFIED) msg[len++] = field_type; memcpy(&msg[len], field_body, field_len); msg[len + field_len] = (uint8_t) x; len += (field_len + 1); } break; case ADSI_STANDARD_TDD: if (len < 0) len = 0; for (i = 0; i < field_len; i++) { if ((x = adsi_encode_baudot(s, field_body[i]))) { if ((x & 0x3E0)) msg[len++] = (uint8_t) ((x >> 5) & 0x1F); msg[len++] = (uint8_t) (x & 0x1F); } } break; } return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(const char *) adsi_standard_to_str(int standard) { switch (standard) { case ADSI_STANDARD_CLASS: return "CLASS"; case ADSI_STANDARD_CLIP: return "CLIP"; case ADSI_STANDARD_ACLIP: return "A-CLIP"; case ADSI_STANDARD_JCLIP: return "J-CLIP"; case ADSI_STANDARD_CLIP_DTMF: return "CLIP-DTMF"; case ADSI_STANDARD_TDD: return "TDD"; } return "???"; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/libspandsp.2005.sln0000664000175000017500000001035311210514156014137 00000000000000 Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_at_dictionary", "msvc\make_at_dictionary.2005.vcproj", "{DEE932AB-5911-4700-9EEB-8C7090A0A330}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_modem_filter", "msvc\make_modem_filter.2005.vcproj", "{329A6FA0-0FCC-4435-A950-E670AEFA9838}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspandsp", "libspandsp.2005.vcproj", "{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}" ProjectSection(ProjectDependencies) = postProject {329A6FA0-0FCC-4435-A950-E670AEFA9838} = {329A6FA0-0FCC-4435-A950-E670AEFA9838} {DEE932AB-5911-4700-9EEB-8C7090A0A330} = {DEE932AB-5911-4700-9EEB-8C7090A0A330} {401A40CD-5DB4-4E34-AC68-FA99E9FAC014} = {401A40CD-5DB4-4E34-AC68-FA99E9FAC014} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspandsp_sim", "..\spandsp-sim\libspandsp_sim.2005.vcproj", "{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}" ProjectSection(ProjectDependencies) = postProject {329A6FA0-0FCC-4435-A950-E670AEFA9838} = {329A6FA0-0FCC-4435-A950-E670AEFA9838} {DEE932AB-5911-4700-9EEB-8C7090A0A330} = {DEE932AB-5911-4700-9EEB-8C7090A0A330} {401A40CD-5DB4-4E34-AC68-FA99E9FAC014} = {401A40CD-5DB4-4E34-AC68-FA99E9FAC014} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtiff", "libtiff.2005.vcproj", "{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}" ProjectSection(ProjectDependencies) = postProject {2B8A45C9-FEB4-4734-AB37-8DB9DB899917} = {2B8A45C9-FEB4-4734-AB37-8DB9DB899917} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download TIFF", "msvc\Download_TIFF.2005.vcproj", "{2B8A45C9-FEB4-4734-AB37-8DB9DB899917}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution All|Win32 = All|Win32 Debug|Win32 = Debug|Win32 Release|Win32 = Release|Win32 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|Win32.ActiveCfg = All|Win32 {DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|Win32.Build.0 = All|Win32 {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|Win32.ActiveCfg = All|Win32 {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|Win32.Build.0 = All|Win32 {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Release|Win32.ActiveCfg = All|Win32 {329A6FA0-0FCC-4435-A950-E670AEFA9838}.All|Win32.ActiveCfg = All|Win32 {329A6FA0-0FCC-4435-A950-E670AEFA9838}.All|Win32.Build.0 = All|Win32 {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|Win32.ActiveCfg = All|Win32 {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|Win32.Build.0 = All|Win32 {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Release|Win32.ActiveCfg = All|Win32 {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.All|Win32.ActiveCfg = Release|Win32 {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.All|Win32.Build.0 = Release|Win32 {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|Win32.ActiveCfg = Debug|Win32 {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|Win32.Build.0 = Debug|Win32 {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|Win32.ActiveCfg = Release|Win32 {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|Win32.Build.0 = Release|Win32 {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.All|Win32.ActiveCfg = Release|Win32 {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.All|Win32.Build.0 = Release|Win32 {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|Win32.ActiveCfg = Debug|Win32 {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|Win32.Build.0 = Debug|Win32 {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|Win32.ActiveCfg = Release|Win32 {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|Win32.Build.0 = Release|Win32 {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.All|Win32.ActiveCfg = All|Win32 {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.All|Win32.Build.0 = All|Win32 {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Debug|Win32.ActiveCfg = All|Win32 {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Debug|Win32.Build.0 = All|Win32 {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Release|Win32.ActiveCfg = All|Win32 {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Release|Win32.Build.0 = All|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal spandsp-0.0.6/src/g722.c0000664000175000017500000004227311422612261011531 00000000000000/* * SpanDSP - a series of DSP components for telephony * * g722.c - The ITU G.722 codec. * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Based in part on a single channel G.722 codec which is: * * Copyright (c) CMU 1993 * Computer Science, Speech Group * Chengxiang Lu and Alex Hauptmann */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/saturated.h" #include "spandsp/vector_int.h" #include "spandsp/g722.h" #include "spandsp/private/g722.h" static const int16_t qmf_coeffs_fwd[12] = { 3, -11, 12, 32, -210, 951, 3876, -805, 362, -156, 53, -11, }; static const int16_t qmf_coeffs_rev[12] = { -11, 53, -156, 362, -805, 3876, 951, -210, 32, 12, -11, 3 }; static const int16_t qm2[4] = { -7408, -1616, 7408, 1616 }; static const int16_t qm4[16] = { 0, -20456, -12896, -8968, -6288, -4240, -2584, -1200, 20456, 12896, 8968, 6288, 4240, 2584, 1200, 0 }; static const int16_t qm5[32] = { -280, -280, -23352, -17560, -14120, -11664, -9752, -8184, -6864, -5712, -4696, -3784, -2960, -2208, -1520, -880, 23352, 17560, 14120, 11664, 9752, 8184, 6864, 5712, 4696, 3784, 2960, 2208, 1520, 880, 280, -280 }; static const int16_t qm6[64] = { -136, -136, -136, -136, -24808, -21904, -19008, -16704, -14984, -13512, -12280, -11192, -10232, -9360, -8576, -7856, -7192, -6576, -6000, -5456, -4944, -4464, -4008, -3576, -3168, -2776, -2400, -2032, -1688, -1360, -1040, -728, 24808, 21904, 19008, 16704, 14984, 13512, 12280, 11192, 10232, 9360, 8576, 7856, 7192, 6576, 6000, 5456, 4944, 4464, 4008, 3576, 3168, 2776, 2400, 2032, 1688, 1360, 1040, 728, 432, 136, -432, -136 }; static const int16_t q6[32] = { 0, 35, 72, 110, 150, 190, 233, 276, 323, 370, 422, 473, 530, 587, 650, 714, 786, 858, 940, 1023, 1121, 1219, 1339, 1458, 1612, 1765, 1980, 2195, 2557, 2919, 0, 0 }; static const int16_t ilb[32] = { 2048, 2093, 2139, 2186, 2233, 2282, 2332, 2383, 2435, 2489, 2543, 2599, 2656, 2714, 2774, 2834, 2896, 2960, 3025, 3091, 3158, 3228, 3298, 3371, 3444, 3520, 3597, 3676, 3756, 3838, 3922, 4008 }; static const int16_t iln[32] = { 0, 63, 62, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 0 }; static const int16_t ilp[32] = { 0, 61, 60, 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, 39, 38, 37, 36, 35, 34, 33, 32, 0 }; static const int16_t ihn[3] = { 0, 1, 0 }; static const int16_t ihp[3] = { 0, 3, 2 }; static const int16_t wl[8] = { -60, -30, 58, 172, 334, 538, 1198, 3042 }; static const int16_t rl42[16] = { 0, 7, 6, 5, 4, 3, 2, 1, 7, 6, 5, 4, 3, 2, 1, 0 }; static const int16_t wh[3] = { 0, -214, 798 }; static const int16_t rh2[4] = { 2, 1, 2, 1 }; static void block4(g722_band_t *s, int16_t dx) { int16_t wd1; int16_t wd2; int16_t wd3; int16_t sp; int16_t r; int16_t p; int16_t ap[2]; int32_t wd32; int32_t sz; int i; /* RECONS */ r = saturated_add16(s->s, dx); /* PARREC */ p = saturated_add16(s->sz, dx); /* UPPOL2 */ wd1 = saturate((int32_t) s->a[0] << 2); wd32 = ((p ^ s->p[0]) & 0x8000) ? wd1 : -wd1; if (wd32 > 32767) wd32 = 32767; wd3 = (int16_t) ((((p ^ s->p[1]) & 0x8000) ? -128 : 128) + (wd32 >> 7) + (((int32_t) s->a[1]*(int32_t) 32512) >> 15)); if (abs(wd3) > 12288) wd3 = (wd3 < 0) ? -12288 : 12288; ap[1] = wd3; /* UPPOL1 */ wd1 = ((p ^ s->p[0]) & 0x8000) ? -192 : 192; wd2 = (int16_t) (((int32_t) s->a[0]*(int32_t) 32640) >> 15); ap[0] = saturated_add16(wd1, wd2); wd3 = saturated_sub16(15360, ap[1]); if (abs(ap[0]) > wd3) ap[0] = (ap[0] < 0) ? -wd3 : wd3; /* FILTEP */ wd1 = saturated_add16(r, r); wd1 = (int16_t) (((int32_t) ap[0]*(int32_t) wd1) >> 15); wd2 = saturated_add16(s->r, s->r); wd2 = (int16_t) (((int32_t) ap[1]*(int32_t) wd2) >> 15); sp = saturated_add16(wd1, wd2); s->r = r; s->a[1] = ap[1]; s->a[0] = ap[0]; s->p[1] = s->p[0]; s->p[0] = p; /* UPZERO */ /* DELAYA */ /* FILTEZ */ wd1 = (dx == 0) ? 0 : 128; s->d[0] = dx; sz = 0; for (i = 5; i >= 0; i--) { wd2 = ((s->d[i + 1] ^ dx) & 0x8000) ? -wd1 : wd1; wd3 = (int16_t) (((int32_t) s->b[i]*(int32_t) 32640) >> 15); s->b[i] = saturated_add16(wd2, wd3); wd3 = saturated_add16(s->d[i], s->d[i]); sz += ((int32_t) s->b[i]*(int32_t) wd3) >> 15; s->d[i + 1] = s->d[i]; } s->sz = saturate(sz); /* PREDIC */ s->s = saturated_add16(sp, s->sz); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(g722_decode_state_t *) g722_decode_init(g722_decode_state_t *s, int rate, int options) { if (s == NULL) { if ((s = (g722_decode_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); if (rate == 48000) s->bits_per_sample = 6; else if (rate == 56000) s->bits_per_sample = 7; else s->bits_per_sample = 8; if ((options & G722_SAMPLE_RATE_8000)) s->eight_k = TRUE; if ((options & G722_PACKED) && s->bits_per_sample != 8) s->packed = TRUE; else s->packed = FALSE; s->band[0].det = 32; s->band[1].det = 8; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g722_decode_release(g722_decode_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g722_decode_free(g722_decode_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g722_decode(g722_decode_state_t *s, int16_t amp[], const uint8_t g722_data[], int len) { int rlow; int ihigh; int16_t dlow; int16_t dhigh; int rhigh; int wd1; int wd2; int wd3; int code; int outlen; int j; outlen = 0; rhigh = 0; for (j = 0; j < len; ) { if (s->packed) { /* Unpack the code bits */ if (s->in_bits < s->bits_per_sample) { s->in_buffer |= (g722_data[j++] << s->in_bits); s->in_bits += 8; } code = s->in_buffer & ((1 << s->bits_per_sample) - 1); s->in_buffer >>= s->bits_per_sample; s->in_bits -= s->bits_per_sample; } else { code = g722_data[j++]; } switch (s->bits_per_sample) { default: case 8: wd1 = code & 0x3F; ihigh = (code >> 6) & 0x03; wd2 = qm6[wd1]; wd1 >>= 2; break; case 7: wd1 = code & 0x1F; ihigh = (code >> 5) & 0x03; wd2 = qm5[wd1]; wd1 >>= 1; break; case 6: wd1 = code & 0x0F; ihigh = (code >> 4) & 0x03; wd2 = qm4[wd1]; break; } /* Block 5L, LOW BAND INVQBL */ wd2 = ((int32_t) s->band[0].det*(int32_t) wd2) >> 15; /* Block 5L, RECONS */ /* Block 6L, LIMIT */ rlow = saturate15(s->band[0].s + wd2); /* Block 2L, INVQAL */ wd2 = qm4[wd1]; dlow = (int16_t) (((int32_t) s->band[0].det*(int32_t) wd2) >> 15); /* Block 3L, LOGSCL */ wd2 = rl42[wd1]; wd1 = ((int32_t) s->band[0].nb*(int32_t) 127) >> 7; wd1 += wl[wd2]; if (wd1 < 0) wd1 = 0; else if (wd1 > 18432) wd1 = 18432; s->band[0].nb = (int16_t) wd1; /* Block 3L, SCALEL */ wd1 = (s->band[0].nb >> 6) & 31; wd2 = 8 - (s->band[0].nb >> 11); wd3 = (wd2 < 0) ? (ilb[wd1] << -wd2) : (ilb[wd1] >> wd2); s->band[0].det = (int16_t) (wd3 << 2); block4(&s->band[0], dlow); if (!s->eight_k) { /* Block 2H, INVQAH */ wd2 = qm2[ihigh]; dhigh = (int16_t) (((int32_t) s->band[1].det*(int32_t) wd2) >> 15); /* Block 5H, RECONS */ /* Block 6H, LIMIT */ rhigh = saturate15(dhigh + s->band[1].s); /* Block 2H, INVQAH */ wd2 = rh2[ihigh]; wd1 = ((int32_t) s->band[1].nb*(int32_t) 127) >> 7; wd1 += wh[wd2]; if (wd1 < 0) wd1 = 0; else if (wd1 > 22528) wd1 = 22528; s->band[1].nb = (int16_t) wd1; /* Block 3H, SCALEH */ wd1 = (s->band[1].nb >> 6) & 31; wd2 = 10 - (s->band[1].nb >> 11); wd3 = (wd2 < 0) ? (ilb[wd1] << -wd2) : (ilb[wd1] >> wd2); s->band[1].det = (int16_t) (wd3 << 2); block4(&s->band[1], dhigh); } if (s->itu_test_mode) { amp[outlen++] = (int16_t) (rlow << 1); amp[outlen++] = (int16_t) (rhigh << 1); } else { if (s->eight_k) { /* We shift by 1 to allow for the 15 bit input to the G.722 algorithm. */ amp[outlen++] = (int16_t) (rlow << 1); } else { /* Apply the QMF to build the final signal */ s->x[s->ptr] = (int16_t) (rlow + rhigh); s->y[s->ptr] = (int16_t) (rlow - rhigh); if (++s->ptr >= 12) s->ptr = 0; /* We shift by 12 to allow for the QMF filters (DC gain = 4096), less 1 to allow for the 15 bit input to the G.722 algorithm. */ amp[outlen++] = (int16_t) (vec_circular_dot_prodi16(s->y, qmf_coeffs_rev, 12, s->ptr) >> 11); amp[outlen++] = (int16_t) (vec_circular_dot_prodi16(s->x, qmf_coeffs_fwd, 12, s->ptr) >> 11); } } } return outlen; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(g722_encode_state_t *) g722_encode_init(g722_encode_state_t *s, int rate, int options) { if (s == NULL) { if ((s = (g722_encode_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); if (rate == 48000) s->bits_per_sample = 6; else if (rate == 56000) s->bits_per_sample = 7; else s->bits_per_sample = 8; if ((options & G722_SAMPLE_RATE_8000)) s->eight_k = TRUE; if ((options & G722_PACKED) && s->bits_per_sample != 8) s->packed = TRUE; else s->packed = FALSE; s->band[0].det = 32; s->band[1].det = 8; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g722_encode_release(g722_encode_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g722_encode_free(g722_encode_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) g722_encode(g722_encode_state_t *s, uint8_t g722_data[], const int16_t amp[], int len) { int16_t dlow; int16_t dhigh; int el; int wd; int wd1; int ril; int wd2; int il4; int ih2; int wd3; int eh; int g722_bytes; int ihigh; int ilow; int code; /* Low and high band PCM from the QMF */ int16_t xlow; int16_t xhigh; int32_t sumeven; int32_t sumodd; int mih; int i; int j; g722_bytes = 0; xhigh = 0; for (j = 0; j < len; ) { if (s->itu_test_mode) { xlow = xhigh = amp[j++] >> 1; } else { if (s->eight_k) { /* We shift by 1 to allow for the 15 bit input to the G.722 algorithm. */ xlow = amp[j++] >> 1; } else { /* Apply the transmit QMF */ s->x[s->ptr] = amp[j++]; s->y[s->ptr] = amp[j++]; if (++s->ptr >= 12) s->ptr = 0; sumodd = vec_circular_dot_prodi16(s->x, qmf_coeffs_fwd, 12, s->ptr); sumeven = vec_circular_dot_prodi16(s->y, qmf_coeffs_rev, 12, s->ptr); /* We shift by 12 to allow for the QMF filters (DC gain = 4096), plus 1 to allow for us summing two filters, plus 1 to allow for the 15 bit input to the G.722 algorithm. */ xlow = (int16_t) ((sumeven + sumodd) >> 14); xhigh = (int16_t) ((sumeven - sumodd) >> 14); } } /* Block 1L, SUBTRA */ el = saturated_sub16(xlow, s->band[0].s); /* Block 1L, QUANTL */ wd = (el >= 0) ? el : ~el; for (i = 1; i < 30; i++) { wd1 = ((int32_t) q6[i]*(int32_t) s->band[0].det) >> 12; if (wd < wd1) break; } ilow = (el < 0) ? iln[i] : ilp[i]; /* Block 2L, INVQAL */ ril = ilow >> 2; wd2 = qm4[ril]; dlow = (int16_t) (((int32_t) s->band[0].det*(int32_t) wd2) >> 15); /* Block 3L, LOGSCL */ il4 = rl42[ril]; wd = ((int32_t) s->band[0].nb*(int32_t) 127) >> 7; s->band[0].nb = (int16_t) (wd + wl[il4]); if (s->band[0].nb < 0) s->band[0].nb = 0; else if (s->band[0].nb > 18432) s->band[0].nb = 18432; /* Block 3L, SCALEL */ wd1 = (s->band[0].nb >> 6) & 31; wd2 = 8 - (s->band[0].nb >> 11); wd3 = (wd2 < 0) ? (ilb[wd1] << -wd2) : (ilb[wd1] >> wd2); s->band[0].det = (int16_t) (wd3 << 2); block4(&s->band[0], dlow); if (s->eight_k) { /* Just leave the high bits as zero */ code = (0xC0 | ilow) >> (8 - s->bits_per_sample); } else { /* Block 1H, SUBTRA */ eh = saturated_sub16(xhigh, s->band[1].s); /* Block 1H, QUANTH */ wd = (eh >= 0) ? eh : ~eh; wd1 = (564*s->band[1].det) >> 12; mih = (wd >= wd1) ? 2 : 1; ihigh = (eh < 0) ? ihn[mih] : ihp[mih]; /* Block 2H, INVQAH */ wd2 = qm2[ihigh]; dhigh = (int16_t) (((int32_t) s->band[1].det*(int32_t) wd2) >> 15); /* Block 3H, LOGSCH */ ih2 = rh2[ihigh]; wd = ((int32_t) s->band[1].nb*(int32_t) 127) >> 7; s->band[1].nb = (int16_t) (wd + wh[ih2]); if (s->band[1].nb < 0) s->band[1].nb = 0; else if (s->band[1].nb > 22528) s->band[1].nb = 22528; /* Block 3H, SCALEH */ wd1 = (s->band[1].nb >> 6) & 31; wd2 = 10 - (s->band[1].nb >> 11); wd3 = (wd2 < 0) ? (ilb[wd1] << -wd2) : (ilb[wd1] >> wd2); s->band[1].det = (int16_t) (wd3 << 2); block4(&s->band[1], dhigh); code = ((ihigh << 6) | ilow) >> (8 - s->bits_per_sample); } if (s->packed) { /* Pack the code bits */ s->out_buffer |= (code << s->out_bits); s->out_bits += s->bits_per_sample; if (s->out_bits >= 8) { g722_data[g722_bytes++] = (uint8_t) (s->out_buffer & 0xFF); s->out_bits -= 8; s->out_buffer >>= 8; } } else { g722_data[g722_bytes++] = (uint8_t) code; } } return g722_bytes; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/power_meter.c0000664000175000017500000001405512101035230013363 00000000000000/* * SpanDSP - a series of DSP components for telephony * * power_meter.c * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include "spandsp/telephony.h" #include "spandsp/power_meter.h" SPAN_DECLARE(power_meter_t *) power_meter_init(power_meter_t *s, int shift) { if (s == NULL) { if ((s = (power_meter_t *) malloc(sizeof(*s))) == NULL) return NULL; } s->shift = shift; s->reading = 0; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) power_meter_release(power_meter_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) power_meter_free(power_meter_t *s) { if (s) free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(power_meter_t *) power_meter_damping(power_meter_t *s, int shift) { s->shift = shift; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int32_t) power_meter_update(power_meter_t *s, int16_t amp) { s->reading += ((amp*amp - s->reading) >> s->shift); return s->reading; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int32_t) power_meter_level_dbm0(float level) { float l; level -= DBM0_MAX_POWER; if (level > 0.0) level = 0.0; l = powf(10.0f, level/10.0f)*(32767.0f*32767.0f); return (int32_t) l; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int32_t) power_meter_level_dbov(float level) { float l; if (level > 0.0) level = 0.0; l = powf(10.0f, level/10.0f)*(32767.0f*32767.0f); return (int32_t) l; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int32_t) power_meter_current(power_meter_t *s) { return s->reading; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) power_meter_current_dbm0(power_meter_t *s) { if (s->reading <= 0) return -96.329f + DBM0_MAX_POWER; /* This is based on A-law, but u-law is only 0.03dB different, so don't worry. */ return 10.0f*log10f((float) s->reading/(32767.0f*32767.0f) + 1.0e-10f) + DBM0_MAX_POWER; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) power_meter_current_dbov(power_meter_t *s) { if (s->reading <= 0) return -96.329f; return 10.0f*log10f((float) s->reading/(32767.0f*32767.0f) + 1.0e-10f); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int32_t) power_surge_detector(power_surge_detector_state_t *s, int16_t amp) { int32_t pow_short; int32_t pow_medium; pow_short = power_meter_update(&s->short_term, amp); pow_medium = power_meter_update(&s->medium_term, amp); if (pow_medium < s->min) return 0; if (!s->signal_present) { if (pow_short <= s->surge*(pow_medium >> 10)) return 0; s->signal_present = TRUE; s->medium_term.reading = s->short_term.reading; } else { if (pow_short < s->sag*(pow_medium >> 10)) { s->signal_present = FALSE; s->medium_term.reading = s->short_term.reading; return 0; } } return pow_short; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) power_surge_detector_current_dbm0(power_surge_detector_state_t *s) { return power_meter_current_dbm0(&s->short_term); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) power_surge_detector_current_dbov(power_surge_detector_state_t *s) { return power_meter_current_dbov(&s->short_term); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(power_surge_detector_state_t *) power_surge_detector_init(power_surge_detector_state_t *s, float min, float surge) { float ratio; if (s == NULL) { if ((s = (power_surge_detector_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); power_meter_init(&s->short_term, 4); power_meter_init(&s->medium_term, 7); ratio = powf(10.0f, surge/10.0f); s->surge = 1024.0f*ratio; s->sag = 1024.0f/ratio; s->min = power_meter_level_dbm0(min); s->medium_term.reading = s->min + 1; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) power_surge_detector_release(power_surge_detector_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) power_surge_detector_free(power_surge_detector_state_t *s) { if (s) free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/v29rx.c0000664000175000017500000013147512101413352012040 00000000000000#define IAXMODEM_STUFF /* * SpanDSP - a series of DSP components for telephony * * v29rx.c - ITU V.29 modem receive part * * Written by Steve Underwood * * Copyright (C) 2003, 2004, 2005, 2006, 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/complex.h" #include "spandsp/vector_float.h" #include "spandsp/complex_vector_float.h" #include "spandsp/vector_int.h" #include "spandsp/complex_vector_int.h" #include "spandsp/async.h" #include "spandsp/power_meter.h" #include "spandsp/arctan2.h" #include "spandsp/dds.h" #include "spandsp/complex_filters.h" #include "spandsp/v29rx.h" #include "spandsp/private/logging.h" #include "spandsp/private/v29rx.h" #include "v29tx_constellation_maps.h" #if defined(SPANDSP_USE_FIXED_POINT) #include "v29rx_fixed_rrc.h" #else #include "v29rx_floating_rrc.h" #endif /*! The nominal frequency of the carrier, in Hertz */ #define CARRIER_NOMINAL_FREQ 1700.0f /*! The nominal baud or symbol rate */ #define BAUD_RATE 2400 /*! The adaption rate coefficient for the equalizer */ #define EQUALIZER_DELTA 0.21f #if defined(SPANDSP_USE_FIXED_POINT) #define FP_FACTOR 4096 #define FP_SHIFT_FACTOR 12 #endif /* Segments of the training sequence */ /*! The length of training segment 2, in symbols */ #define V29_TRAINING_SEG_2_LEN 128 /*! The length of training segment 3, in symbols */ #define V29_TRAINING_SEG_3_LEN 384 /*! The length of training segment 4, in symbols */ #define V29_TRAINING_SEG_4_LEN 48 enum { TRAINING_STAGE_NORMAL_OPERATION = 0, TRAINING_STAGE_SYMBOL_ACQUISITION, TRAINING_STAGE_LOG_PHASE, TRAINING_STAGE_WAIT_FOR_CDCD, TRAINING_STAGE_TRAIN_ON_CDCD, TRAINING_STAGE_TRAIN_ON_CDCD_AND_TEST, TRAINING_STAGE_TEST_ONES, TRAINING_STAGE_PARKED }; static const uint8_t space_map_9600[20][20] = { {13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11}, {13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11}, {13, 13, 13, 13, 13, 13, 13, 4, 4, 4, 4, 4, 4, 11, 11, 11, 11, 11, 11, 11}, {13, 13, 13, 13, 13, 13, 13, 4, 4, 4, 4, 4, 4, 11, 11, 11, 11, 11, 11, 11}, {13, 13, 13, 13, 13, 13, 13, 4, 4, 4, 4, 4, 4, 11, 11, 11, 11, 11, 11, 11}, {13, 13, 13, 13, 13, 13, 13, 5, 4, 4, 4, 4, 3, 11, 11, 11, 11, 11, 11, 11}, {14, 13, 13, 13, 13, 13, 5, 5, 5, 5, 3, 3, 3, 3, 11, 11, 11, 11, 11, 10}, {14, 14, 6, 6, 6, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 2, 2, 2, 10, 10}, {14, 14, 6, 6, 6, 6, 5, 5, 5, 5, 3, 3, 3, 3, 2, 2, 2, 2, 10, 10}, {14, 14, 6, 6, 6, 6, 5, 5, 5, 5, 3, 3, 3, 3, 2, 2, 2, 2, 10, 10}, {14, 14, 6, 6, 6, 6, 7, 7, 7, 7, 1, 1, 1, 1, 2, 2, 2, 2, 10, 10}, {14, 14, 6, 6, 6, 6, 7, 7, 7, 7, 1, 1, 1, 1, 2, 2, 2, 2, 10, 10}, {14, 14, 6, 6, 6, 7, 7, 7, 7, 7, 1, 1, 1, 1, 1, 2, 2, 2, 10, 10}, {14, 15, 15, 15, 15, 15, 7, 7, 7, 7, 1, 1, 1, 1, 9, 9, 9, 9, 9, 10}, {15, 15, 15, 15, 15, 15, 15, 7, 0, 0, 0, 0, 1, 9, 9, 9, 9, 9, 9, 9}, {15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9}, {15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9}, {15, 15, 15, 15, 15, 15, 15, 0, 0, 0, 0, 0, 0, 9, 9, 9, 9, 9, 9, 9}, {15, 15, 15, 15, 15, 15, 15, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9}, {15, 15, 15, 15, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9} }; /* Coefficients for the band edge symbol timing synchroniser (alpha = 0.99) */ /* low_edge = 2.0f*M_PI*(CARRIER_NOMINAL_FREQ - BAUD_RATE/2.0f)/SAMPLE_RATE; */ /* high_edge = 2.0f*M_PI*(CARRIER_NOMINAL_FREQ + BAUD_RATE/2.0f)/SAMPLE_RATE; */ #define SIN_LOW_BAND_EDGE 0.382683432f #define COS_LOW_BAND_EDGE 0.923879533f #define SIN_HIGH_BAND_EDGE 0.760405966f #define COS_HIGH_BAND_EDGE -0.649448048f #define ALPHA 0.99f #if defined(SPANDSP_USE_FIXED_POINT) #define SYNC_LOW_BAND_EDGE_COEFF_0 ((int)(FP_FACTOR*(2.0f*ALPHA*COS_LOW_BAND_EDGE))) #define SYNC_LOW_BAND_EDGE_COEFF_1 ((int)(FP_FACTOR*(-ALPHA*ALPHA))) #define SYNC_LOW_BAND_EDGE_COEFF_2 ((int)(FP_FACTOR*(-ALPHA*SIN_LOW_BAND_EDGE))) #define SYNC_HIGH_BAND_EDGE_COEFF_0 ((int)(FP_FACTOR*(2.0f*ALPHA*COS_HIGH_BAND_EDGE))) #define SYNC_HIGH_BAND_EDGE_COEFF_1 ((int)(FP_FACTOR*(-ALPHA*ALPHA))) #define SYNC_HIGH_BAND_EDGE_COEFF_2 ((int)(FP_FACTOR*(-ALPHA*SIN_HIGH_BAND_EDGE))) #define SYNC_MIXED_EDGES_COEFF_3 ((int)(FP_FACTOR*(-ALPHA*ALPHA*(SIN_HIGH_BAND_EDGE*COS_LOW_BAND_EDGE - SIN_LOW_BAND_EDGE*COS_HIGH_BAND_EDGE)))) #else #define SYNC_LOW_BAND_EDGE_COEFF_0 (2.0f*ALPHA*COS_LOW_BAND_EDGE) #define SYNC_LOW_BAND_EDGE_COEFF_1 (-ALPHA*ALPHA) #define SYNC_LOW_BAND_EDGE_COEFF_2 (-ALPHA*SIN_LOW_BAND_EDGE) #define SYNC_HIGH_BAND_EDGE_COEFF_0 (2.0f*ALPHA*COS_HIGH_BAND_EDGE) #define SYNC_HIGH_BAND_EDGE_COEFF_1 (-ALPHA*ALPHA) #define SYNC_HIGH_BAND_EDGE_COEFF_2 (-ALPHA*SIN_HIGH_BAND_EDGE) #define SYNC_MIXED_EDGES_COEFF_3 (-ALPHA*ALPHA*(SIN_HIGH_BAND_EDGE*COS_LOW_BAND_EDGE - SIN_LOW_BAND_EDGE*COS_HIGH_BAND_EDGE)) #endif SPAN_DECLARE(float) v29_rx_carrier_frequency(v29_rx_state_t *s) { return dds_frequencyf(s->carrier_phase_rate); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) v29_rx_symbol_timing_correction(v29_rx_state_t *s) { return (float) s->total_baud_timing_correction/((float) RX_PULSESHAPER_COEFF_SETS*10.0f/3.0f); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) v29_rx_signal_power(v29_rx_state_t *s) { return power_meter_current_dbm0(&s->power) + 3.98f; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v29_rx_signal_cutoff(v29_rx_state_t *s, float cutoff) { /* The 0.4 factor allows for the gain of the DC blocker */ s->carrier_on_power = (int32_t) (power_meter_level_dbm0(cutoff + 2.5f)*0.4f); s->carrier_off_power = (int32_t) (power_meter_level_dbm0(cutoff - 2.5f)*0.4f); } /*- End of function --------------------------------------------------------*/ static void report_status_change(v29_rx_state_t *s, int status) { if (s->status_handler) s->status_handler(s->status_user_data, status); else if (s->put_bit) s->put_bit(s->put_bit_user_data, status); } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINT) SPAN_DECLARE(int) v29_rx_equalizer_state(v29_rx_state_t *s, complexi16_t **coeffs) #else SPAN_DECLARE(int) v29_rx_equalizer_state(v29_rx_state_t *s, complexf_t **coeffs) #endif { *coeffs = s->eq_coeff; return V29_EQUALIZER_LEN; } /*- End of function --------------------------------------------------------*/ static void equalizer_save(v29_rx_state_t *s) { #if defined(SPANDSP_USE_FIXED_POINT) cvec_copyi16(s->eq_coeff_save, s->eq_coeff, V29_EQUALIZER_LEN); #else cvec_copyf(s->eq_coeff_save, s->eq_coeff, V29_EQUALIZER_LEN); #endif } /*- End of function --------------------------------------------------------*/ static void equalizer_restore(v29_rx_state_t *s) { #if defined(SPANDSP_USE_FIXED_POINT) cvec_copyi16(s->eq_coeff, s->eq_coeff_save, V29_EQUALIZER_LEN); cvec_zeroi16(s->eq_buf, V29_EQUALIZER_LEN); s->eq_delta = 32768.0f*EQUALIZER_DELTA/V29_EQUALIZER_LEN; #else cvec_copyf(s->eq_coeff, s->eq_coeff_save, V29_EQUALIZER_LEN); cvec_zerof(s->eq_buf, V29_EQUALIZER_LEN); s->eq_delta = EQUALIZER_DELTA/V29_EQUALIZER_LEN; #endif s->eq_put_step = RX_PULSESHAPER_COEFF_SETS*10/(3*2) - 1; s->eq_step = 0; } /*- End of function --------------------------------------------------------*/ static void equalizer_reset(v29_rx_state_t *s) { /* Start with an equalizer based on everything being perfect */ #if defined(SPANDSP_USE_FIXED_POINT) static const complexi16_t x = {3*FP_FACTOR, 0*FP_FACTOR}; cvec_zeroi16(s->eq_coeff, V29_EQUALIZER_LEN); s->eq_coeff[V29_EQUALIZER_PRE_LEN] = x; cvec_zeroi16(s->eq_buf, V29_EQUALIZER_LEN); s->eq_delta = 32768.0f*EQUALIZER_DELTA/V29_EQUALIZER_LEN; #else static const complexf_t x = {3.0f, 0.0f}; cvec_zerof(s->eq_coeff, V29_EQUALIZER_LEN); s->eq_coeff[V29_EQUALIZER_PRE_LEN] = x; cvec_zerof(s->eq_buf, V29_EQUALIZER_LEN); s->eq_delta = EQUALIZER_DELTA/V29_EQUALIZER_LEN; #endif s->eq_put_step = RX_PULSESHAPER_COEFF_SETS*10/(3*2) - 1; s->eq_step = 0; } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINT) static __inline__ complexi16_t complex_mul_q4_12(const complexi16_t *x, const complexi16_t *y) { complexi16_t z; z.re = ((int32_t) x->re*(int32_t) y->re - (int32_t) x->im*(int32_t) y->im) >> FP_SHIFT_FACTOR; z.im = ((int32_t) x->re*(int32_t) y->im + (int32_t) x->im*(int32_t) y->re) >> FP_SHIFT_FACTOR; return z; } /*- End of function --------------------------------------------------------*/ #endif #if defined(SPANDSP_USE_FIXED_POINT) static __inline__ complexi16_t equalizer_get(v29_rx_state_t *s) #else static __inline__ complexf_t equalizer_get(v29_rx_state_t *s) #endif { #if defined(SPANDSP_USE_FIXED_POINT) complexi32_t zz; complexi16_t z; /* Get the next equalized value. */ zz = cvec_circular_dot_prodi16(s->eq_buf, s->eq_coeff, V29_EQUALIZER_LEN, s->eq_step); z.re = zz.re >> FP_SHIFT_FACTOR; z.im = zz.im >> FP_SHIFT_FACTOR; return z; #else /* Get the next equalized value. */ return cvec_circular_dot_prodf(s->eq_buf, s->eq_coeff, V29_EQUALIZER_LEN, s->eq_step); #endif } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINT) static void tune_equalizer(v29_rx_state_t *s, const complexi16_t *z, const complexi16_t *target) { complexi16_t err; /* Find the x and y mismatch from the exact constellation position. */ err.re = target->re*FP_FACTOR - z->re; err.im = target->im*FP_FACTOR - z->im; err.re = ((int32_t) err.re*(int32_t) s->eq_delta) >> 15; err.im = ((int32_t) err.im*(int32_t) s->eq_delta) >> 15; cvec_circular_lmsi16(s->eq_buf, s->eq_coeff, V29_EQUALIZER_LEN, s->eq_step, &err); } #else static void tune_equalizer(v29_rx_state_t *s, const complexf_t *z, const complexf_t *target) { complexf_t err; /* Find the x and y mismatch from the exact constellation position. */ err = complex_subf(target, z); err.re *= s->eq_delta; err.im *= s->eq_delta; cvec_circular_lmsf(s->eq_buf, s->eq_coeff, V29_EQUALIZER_LEN, s->eq_step, &err); } #endif /*- End of function --------------------------------------------------------*/ static int scrambled_training_bit(v29_rx_state_t *s) { int bit; /* Segment 3 of the training sequence - the scrambled CDCD part. */ /* Apply the 1 + x^-6 + x^-7 scrambler */ bit = s->training_scramble_reg & 1; s->training_scramble_reg >>= 1; if (bit ^ (s->training_scramble_reg & 1)) s->training_scramble_reg |= 0x40; return bit; } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINT) static __inline__ int find_quadrant(const complexi16_t *z) #else static __inline__ int find_quadrant(const complexf_t *z) #endif { int b1; int b2; /* Split the space along the two diagonals. */ b1 = (z->im > z->re); b2 = (z->im < -z->re); return (b2 << 1) | (b1 ^ b2); } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINT) static __inline__ void track_carrier(v29_rx_state_t *s, const complexi16_t *z, const complexi16_t *target) #else static __inline__ void track_carrier(v29_rx_state_t *s, const complexf_t *z, const complexf_t *target) #endif { #if defined(SPANDSP_USE_FIXED_POINT) int32_t error; #else float error; #endif /* The initial coarse carrier frequency and phase estimation should have got us in the right ballpark. Now we need to fine tune fairly quickly, to get the receovered carrier more precisely on target. Then we need to fine tune in a more damped way to keep us on target. The goal is to have things running really well by the time the training is complete. We assume the frequency of the oscillators at the two ends drift only very slowly. The PSTN has rather limited doppler problems. :-) Any remaining FDM in the network should also drift slowly. */ /* For small errors the imaginary part of the difference between the actual and the target positions is proportional to the phase error, for any particular target. However, the different amplitudes of the various target positions scale things. This isn't all bad, as the angular error for the larger amplitude constellation points is probably a more reliable indicator, and we are weighting it as such. */ error = z->im*target->re - z->re*target->im; /* Use a proportional-integral approach to tracking the carrier. The PI parameters are coarser at first, until we get precisely on target. Then, the filter will be damped more to keep us on target. */ #if defined(SPANDSP_USE_FIXED_POINT) s->carrier_phase_rate += ((s->carrier_track_i*error) >> FP_SHIFT_FACTOR); s->carrier_phase += ((s->carrier_track_p*error) >> FP_SHIFT_FACTOR); #else s->carrier_phase_rate += (int32_t) (s->carrier_track_i*error); s->carrier_phase += (int32_t) (s->carrier_track_p*error); //span_log(&s->logging, SPAN_LOG_FLOW, "Im = %15.5f f = %15.5f\n", error, dds_frequencyf(s->carrier_phase_rate)); #endif } /*- End of function --------------------------------------------------------*/ static __inline__ void put_bit(v29_rx_state_t *s, int bit) { int out_bit; bit &= 1; /* Descramble the bit */ out_bit = (bit ^ (s->scramble_reg >> (18 - 1)) ^ (s->scramble_reg >> (23 - 1))) & 1; s->scramble_reg = (s->scramble_reg << 1) | bit; /* We need to strip the last part of the training - the test period of all 1s - before we let data go to the application. */ if (s->training_stage == TRAINING_STAGE_NORMAL_OPERATION) { s->put_bit(s->put_bit_user_data, out_bit); } else { /* The bits during the final stage of training should be all ones. However, buggy modems mean you cannot rely on this. Therefore we don't bother testing for ones, but just rely on a constellation mismatch measurement. */ } } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINT) static void decode_baud(v29_rx_state_t *s, complexi16_t *z) #else static void decode_baud(v29_rx_state_t *s, complexf_t *z) #endif { static const uint8_t phase_steps_9600[8] = { 4, 0, 2, 6, 7, 3, 1, 5 }; static const uint8_t phase_steps_4800[4] = { 0, 2, 3, 1 }; int nearest; int raw_bits; int i; int re; int im; if (s->bit_rate == 4800) { /* 4800 is a special case. */ nearest = find_quadrant(z) << 1; raw_bits = phase_steps_4800[((nearest - s->constellation_state) >> 1) & 3]; put_bit(s, raw_bits); put_bit(s, raw_bits >> 1); } else { /* 9600 and 7200 are quite similar. */ #if defined(SPANDSP_USE_FIXED_POINT) re = (z->re + 5*FP_FACTOR) >> (FP_SHIFT_FACTOR - 1); im = (z->im + 5*FP_FACTOR) >> (FP_SHIFT_FACTOR - 1); #else re = (int) ((z->re + 5.0f)*2.0f); im = (int) ((z->im + 5.0f)*2.0f); #endif if (re > 19) re = 19; else if (re < 0) re = 0; if (im > 19) im = 19; else if (im < 0) im = 0; nearest = space_map_9600[re][im]; if (s->bit_rate == 9600) { /* Send out the top (amplitude) bit. */ put_bit(s, nearest >> 3); } else { /* We can reuse the space map for 9600, but drop the top bit. */ nearest &= 7; } raw_bits = phase_steps_9600[(nearest - s->constellation_state) & 7]; for (i = 0; i < 3; i++) { put_bit(s, raw_bits); raw_bits >>= 1; } } track_carrier(s, z, &v29_9600_constellation[nearest]); if (--s->eq_skip <= 0) { /* Once we are in the data the equalization should not need updating. However, the line characteristics may slowly drift. We, therefore, tune up on the occassional sample, keeping the compute down. */ s->eq_skip = 10; tune_equalizer(s, z, &v29_9600_constellation[nearest]); } s->constellation_state = nearest; } /*- End of function --------------------------------------------------------*/ static __inline__ void symbol_sync(v29_rx_state_t *s) { int i; #if defined(SPANDSP_USE_FIXED_POINT) int32_t v; int32_t p; #else float v; float p; #endif /* This routine adapts the position of the half baud samples entering the equalizer. */ /* This symbol sync scheme is based on the technique first described by Dominique Godard in Passband Timing Recovery in an All-Digital Modem Receiver IEEE TRANSACTIONS ON COMMUNICATIONS, VOL. COM-26, NO. 5, MAY 1978 */ /* This is slightly rearranged from figure 3b of the Godard paper, as this saves a couple of maths operations */ #if defined(SPANDSP_USE_FIXED_POINT) /* TODO: The scalings used here need more thorough evaluation, to see if overflows are possible. */ /* Cross correlate */ v = (((s->symbol_sync_low[1] >> 5)*(s->symbol_sync_high[0] >> 4)) >> 15)*SYNC_LOW_BAND_EDGE_COEFF_2 - (((s->symbol_sync_low[0] >> 5)*(s->symbol_sync_high[1] >> 4)) >> 15)*SYNC_HIGH_BAND_EDGE_COEFF_2 + (((s->symbol_sync_low[1] >> 5)*(s->symbol_sync_high[1] >> 4)) >> 15)*SYNC_MIXED_EDGES_COEFF_3; /* Filter away any DC component */ p = v - s->symbol_sync_dc_filter[1]; s->symbol_sync_dc_filter[1] = s->symbol_sync_dc_filter[0]; s->symbol_sync_dc_filter[0] = v; /* A little integration will now filter away much of the HF noise */ s->baud_phase -= p; v = labs(s->baud_phase); if (v > 30*FP_FACTOR) { i = (v > 1000*FP_FACTOR) ? 5 : 1; if (s->baud_phase < 0) i = -i; //printf("v = %10.5f %5d - %f %f %d %d\n", v, i, p, s->baud_phase, s->total_baud_timing_correction); s->eq_put_step += i; s->total_baud_timing_correction += i; } #else /* Cross correlate */ v = s->symbol_sync_low[1]*s->symbol_sync_high[0]*SYNC_LOW_BAND_EDGE_COEFF_2 - s->symbol_sync_low[0]*s->symbol_sync_high[1]*SYNC_HIGH_BAND_EDGE_COEFF_2 + s->symbol_sync_low[1]*s->symbol_sync_high[1]*SYNC_MIXED_EDGES_COEFF_3; /* Filter away any DC component */ p = v - s->symbol_sync_dc_filter[1]; s->symbol_sync_dc_filter[1] = s->symbol_sync_dc_filter[0]; s->symbol_sync_dc_filter[0] = v; /* A little integration will now filter away much of the HF noise */ s->baud_phase -= p; v = fabsf(s->baud_phase); if (v > 30.0f) { i = (v > 1000.0f) ? 5 : 1; if (s->baud_phase < 0.0f) i = -i; //printf("v = %10.5f %5d - %f %f %d %d\n", v, i, p, s->baud_phase, s->total_baud_timing_correction); s->eq_put_step += i; s->total_baud_timing_correction += i; } #endif } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINT) static void process_half_baud(v29_rx_state_t *s, complexi16_t *sample) #else static void process_half_baud(v29_rx_state_t *s, complexf_t *sample) #endif { static const int cdcd_pos[6] = { 0, 11, 0, 3, 0, 2 }; complexf_t zz; #if defined(SPANDSP_USE_FIXED_POINT) complexf_t z1; complexi16_t z; const complexi16_t *target; static const complexi16_t zero = {0, 0}; #else complexf_t z; const complexf_t *target; static const complexf_t zero = {0.0f, 0.0f}; #endif float p; int bit; int i; int j; int32_t angle; int32_t ang; /* This routine processes every half a baud, as we put things into the equalizer at the T/2 rate. */ /* Add a sample to the equalizer's circular buffer, but don't calculate anything at this time. */ s->eq_buf[s->eq_step] = *sample; if (++s->eq_step >= V29_EQUALIZER_LEN) s->eq_step = 0; /* On alternate insertions we have a whole baud, and must process it. */ if ((s->baud_half ^= 1)) return; /* Symbol timing synchronisation */ symbol_sync(s); z = equalizer_get(s); switch (s->training_stage) { case TRAINING_STAGE_NORMAL_OPERATION: /* Normal operation. */ decode_baud(s, &z); target = &v29_9600_constellation[s->constellation_state]; break; case TRAINING_STAGE_SYMBOL_ACQUISITION: /* Allow time for symbol synchronisation to settle the symbol timing. */ target = &zero; if (++s->training_count >= 60) { /* Record the current phase angle */ s->training_stage = TRAINING_STAGE_LOG_PHASE; s->angles[0] = s->start_angles[0] = arctan2(z.im, z.re); #if defined(SPANDSP_USE_FIXED_POINT) if (s->agc_scaling_save == 0) s->agc_scaling_save = s->agc_scaling; #else if (s->agc_scaling_save == 0.0f) s->agc_scaling_save = s->agc_scaling; #endif } break; case TRAINING_STAGE_LOG_PHASE: /* Record the current alternate phase angle */ target = &zero; s->angles[1] = s->start_angles[1] = arctan2(z.im, z.re); s->training_count = 1; s->training_stage = TRAINING_STAGE_WAIT_FOR_CDCD; break; case TRAINING_STAGE_WAIT_FOR_CDCD: target = &zero; angle = arctan2(z.im, z.re); /* Look for the initial ABAB sequence to display a phase reversal, which will signal the start of the scrambled CDCD segment */ ang = angle - s->angles[(s->training_count - 1) & 0xF]; s->angles[(s->training_count + 1) & 0xF] = angle; if ((ang > DDS_PHASE(45.0f) || ang < DDS_PHASE(-45.0f)) && s->training_count >= 13) { /* We seem to have a phase reversal */ /* Slam the carrier frequency into line, based on the total phase drift over the last section. Use the shift from the odd bits and the shift from the even bits to get better jitter suppression. We need to scale here, or at the maximum specified frequency deviation we could overflow, and get a silly answer. */ /* Step back a few symbols so we don't get ISI distorting things. */ i = (s->training_count - 8) & ~1; /* Avoid the possibility of a divide by zero */ if (i) { j = i & 0xF; ang = (s->angles[j] - s->start_angles[0])/i + (s->angles[j | 0x1] - s->start_angles[1])/i; s->carrier_phase_rate += 3*(ang/20); } span_log(&s->logging, SPAN_LOG_FLOW, "Coarse carrier frequency %7.2f\n", dds_frequencyf(s->carrier_phase_rate)); /* Check if the carrier frequency is plausible */ if (s->carrier_phase_rate < DDS_PHASE_RATE(CARRIER_NOMINAL_FREQ - 20.0f) || s->carrier_phase_rate > DDS_PHASE_RATE(CARRIER_NOMINAL_FREQ + 20.0f)) { span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (sequence failed)\n"); /* Park this modem */ #if defined(SPANDSP_USE_FIXED_POINT) s->agc_scaling_save = 0; #else s->agc_scaling_save = 0.0f; #endif s->training_stage = TRAINING_STAGE_PARKED; report_status_change(s, SIG_STATUS_TRAINING_FAILED); break; } /* Make a step shift in the phase, to pull it into line. We need to rotate the equalizer buffer, as well as the carrier phase, for this to play out nicely. */ p = angle*2.0f*3.14159f/(65536.0f*65536.0f); #if defined(SPANDSP_USE_FIXED_POINT) zz = complex_setf(cosf(p), -sinf(p)); for (i = 0; i < V29_EQUALIZER_LEN; i++) { z1 = complex_setf(s->eq_buf[i].re, s->eq_buf[i].im); z1 = complex_mulf(&z1, &zz); s->eq_buf[i].re = z1.re; s->eq_buf[i].im = z1.im; } #else zz = complex_setf(cosf(p), -sinf(p)); for (i = 0; i < V29_EQUALIZER_LEN; i++) s->eq_buf[i] = complex_mulf(&s->eq_buf[i], &zz); #endif s->carrier_phase += angle; /* We have just seen the first bit of the scrambled sequence, so skip it. */ bit = scrambled_training_bit(s); s->constellation_state = cdcd_pos[s->training_cd + bit]; target = &v29_9600_constellation[s->constellation_state]; s->training_count = 1; s->training_stage = TRAINING_STAGE_TRAIN_ON_CDCD; report_status_change(s, SIG_STATUS_TRAINING_IN_PROGRESS); break; } if (++s->training_count > V29_TRAINING_SEG_2_LEN) { /* This is bogus. There are not this many bauds in this section of a real training sequence. */ span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (sequence failed)\n"); /* Park this modem */ #if defined(SPANDSP_USE_FIXED_POINT) s->agc_scaling_save = 0; #else s->agc_scaling_save = 0.0f; #endif s->training_stage = TRAINING_STAGE_PARKED; report_status_change(s, SIG_STATUS_TRAINING_FAILED); } break; case TRAINING_STAGE_TRAIN_ON_CDCD: /* Train on the scrambled CDCD section. */ bit = scrambled_training_bit(s); //span_log(&s->logging, SPAN_LOG_FLOW, "%5d %15.5f, %15.5f %15.5f, %15.5f\n", s->training_count, z.re, z.im, v29_9600_constellation[cdcd_pos[s->training_cd + bit]].re, v29_9600_constellation[cdcd_pos[s->training_cd + bit]].im); s->constellation_state = cdcd_pos[s->training_cd + bit]; target = &v29_9600_constellation[s->constellation_state]; track_carrier(s, &z, target); tune_equalizer(s, &z, target); if (++s->training_count >= V29_TRAINING_SEG_3_LEN - 48) { s->training_stage = TRAINING_STAGE_TRAIN_ON_CDCD_AND_TEST; s->training_error = 0.0f; #if defined(SPANDSP_USE_FIXED_POINT) s->carrier_track_i = 200; s->carrier_track_p = 1000000; #else s->carrier_track_i = 200.0f; s->carrier_track_p = 1000000.0f; #endif } break; case TRAINING_STAGE_TRAIN_ON_CDCD_AND_TEST: /* Continue training on the scrambled CDCD section, but measure the quality of training too. */ bit = scrambled_training_bit(s); //span_log(&s->logging, SPAN_LOG_FLOW, "%5d %15.5f, %15.5f %15.5f, %15.5f\n", s->training_count, z.re, z.im, v29_9600_constellation[cdcd_pos[s->training_cd + bit]].re, v29_9600_constellation[cdcd_pos[s->training_cd + bit]].im); s->constellation_state = cdcd_pos[s->training_cd + bit]; target = &v29_9600_constellation[s->constellation_state]; track_carrier(s, &z, target); tune_equalizer(s, &z, target); /* Measure the training error */ #if defined(SPANDSP_USE_FIXED_POINT) z1.re = z.re/(float) FP_FACTOR; z1.im = z.im/(float) FP_FACTOR; zz.re = target->re; zz.im = target->im; zz = complex_subf(&z1, &zz); s->training_error += powerf(&zz); #else zz = complex_subf(&z, target); s->training_error += powerf(&zz); #endif if (++s->training_count >= V29_TRAINING_SEG_3_LEN) { span_log(&s->logging, SPAN_LOG_FLOW, "Constellation mismatch %f\n", s->training_error); if (s->training_error < 48.0f*2.0f) { s->training_count = 0; s->training_error = 0.0f; s->constellation_state = 0; s->training_stage = TRAINING_STAGE_TEST_ONES; } else { span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (convergence failed)\n"); /* Park this modem */ #if defined(SPANDSP_USE_FIXED_POINT) s->agc_scaling_save = 0; #else s->agc_scaling_save = 0.0f; #endif s->training_stage = TRAINING_STAGE_PARKED; report_status_change(s, SIG_STATUS_TRAINING_FAILED); } } break; case TRAINING_STAGE_TEST_ONES: /* We are in the test phase, where we check that we can receive reliably. We should get a run of 1's, 48 symbols (192 bits at 9600bps) long. */ //span_log(&s->logging, SPAN_LOG_FLOW, "%5d %15.5f, %15.5f\n", s->training_count, z.re, z.im); decode_baud(s, &z); target = &v29_9600_constellation[s->constellation_state]; /* Measure the training error */ #if defined(SPANDSP_USE_FIXED_POINT) z1.re = z.re/(float) FP_FACTOR; z1.im = z.im/(float) FP_FACTOR; zz.re = target->re; zz.im = target->im; zz = complex_subf(&z1, &zz); s->training_error += powerf(&zz); #else zz = complex_subf(&z, target); s->training_error += powerf(&zz); #endif if (++s->training_count >= V29_TRAINING_SEG_4_LEN) { if (s->training_error < 48.0f) { /* We are up and running */ span_log(&s->logging, SPAN_LOG_FLOW, "Training succeeded at %dbps (constellation mismatch %f)\n", s->bit_rate, s->training_error); report_status_change(s, SIG_STATUS_TRAINING_SUCCEEDED); /* Apply some lag to the carrier off condition, to ensure the last few bits get pushed through the processing. */ s->signal_present = 60; s->training_stage = TRAINING_STAGE_NORMAL_OPERATION; equalizer_save(s); s->carrier_phase_rate_save = s->carrier_phase_rate; s->agc_scaling_save = s->agc_scaling; } else { /* Training has failed */ span_log(&s->logging, SPAN_LOG_FLOW, "Training failed (constellation mismatch %f)\n", s->training_error); /* Park this modem */ #if defined(SPANDSP_USE_FIXED_POINT) s->agc_scaling_save = 0; #else s->agc_scaling_save = 0.0f; #endif s->training_stage = TRAINING_STAGE_PARKED; report_status_change(s, SIG_STATUS_TRAINING_FAILED); } } break; case TRAINING_STAGE_PARKED: default: /* We failed to train! */ /* Park here until the carrier drops. */ target = &zero; break; } if (s->qam_report) { #if defined(SPANDSP_USE_FIXED_POINT) z1.re = z.re/(float) FP_FACTOR; z1.im = z.im/(float) FP_FACTOR; zz.re = target->re; zz.im = target->im; s->qam_report(s->qam_user_data, &z1, &zz, s->constellation_state); #else s->qam_report(s->qam_user_data, &z, target, s->constellation_state); #endif } } /*- End of function --------------------------------------------------------*/ static __inline__ int signal_detect(v29_rx_state_t *s, int16_t amp) { int16_t diff; int16_t x; int32_t power; /* There should be no DC in the signal, but sometimes there is. We need to measure the power with the DC blocked, but not using a slow to respond DC blocker. Use the most elementary HPF. */ x = amp >> 1; /* There could be overflow here, but it isn't a problem in practice */ diff = x - s->last_sample; s->last_sample = x; power = power_meter_update(&s->power, diff); #if defined(IAXMODEM_STUFF) /* Quick power drop fudge */ diff = abs(diff); if (10*diff < s->high_sample) { if (++s->low_samples > 120) { power_meter_init(&s->power, 4); s->high_sample = 0; s->low_samples = 0; } } else { s->low_samples = 0; if (diff > s->high_sample) s->high_sample = diff; } #endif if (s->signal_present > 0) { /* Look for power below turn-off threshold to turn the carrier off */ #if defined(IAXMODEM_STUFF) if (s->carrier_drop_pending || power < s->carrier_off_power) #else if (power < s->carrier_off_power) #endif { if (--s->signal_present <= 0) { /* Count down a short delay, to ensure we push the last few bits through the filters before stopping. */ v29_rx_restart(s, s->bit_rate, FALSE); report_status_change(s, SIG_STATUS_CARRIER_DOWN); return 0; } #if defined(IAXMODEM_STUFF) /* Carrier has dropped, but the put_bit is pending the signal_present delay. */ s->carrier_drop_pending = TRUE; #endif } } else { /* Look for power exceeding turn-on threshold to turn the carrier on */ if (power < s->carrier_on_power) return 0; s->signal_present = 1; #if defined(IAXMODEM_STUFF) s->carrier_drop_pending = FALSE; #endif report_status_change(s, SIG_STATUS_CARRIER_UP); } return power; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) v29_rx(v29_rx_state_t *s, const int16_t amp[], int len) { int i; int step; #if defined(SPANDSP_USE_FIXED_POINT) complexi16_t z; complexi16_t zz; complexi16_t sample; int32_t v; #else complexf_t z; complexf_t zz; complexf_t sample; float v; #endif int32_t power; for (i = 0; i < len; i++) { s->rrc_filter[s->rrc_filter_step] = amp[i]; if (++s->rrc_filter_step >= V29_RX_FILTER_STEPS) s->rrc_filter_step = 0; if ((power = signal_detect(s, amp[i])) == 0) continue; if (s->training_stage == TRAINING_STAGE_PARKED) continue; /* Only spend effort processing this data if the modem is not parked, after training failure. */ s->eq_put_step -= RX_PULSESHAPER_COEFF_SETS; step = -s->eq_put_step; if (step > RX_PULSESHAPER_COEFF_SETS - 1) step = RX_PULSESHAPER_COEFF_SETS - 1; if (step < 0) step += RX_PULSESHAPER_COEFF_SETS; #if defined(SPANDSP_USE_FIXED_POINT) v = vec_circular_dot_prodi16(s->rrc_filter, rx_pulseshaper_re[step], V29_RX_FILTER_STEPS, s->rrc_filter_step); sample.re = (v*s->agc_scaling) >> 15; #else v = vec_circular_dot_prodf(s->rrc_filter, rx_pulseshaper_re[step], V29_RX_FILTER_STEPS, s->rrc_filter_step); sample.re = v*s->agc_scaling; #endif /* Symbol timing synchronisation band edge filters */ #if defined(SPANDSP_USE_FIXED_POINT) /* Low Nyquist band edge filter */ v = ((s->symbol_sync_low[0]*SYNC_LOW_BAND_EDGE_COEFF_0) >> FP_SHIFT_FACTOR) + ((s->symbol_sync_low[1]*SYNC_LOW_BAND_EDGE_COEFF_1) >> FP_SHIFT_FACTOR) + sample.re; s->symbol_sync_low[1] = s->symbol_sync_low[0]; s->symbol_sync_low[0] = v; /* High Nyquist band edge filter */ v = ((s->symbol_sync_high[0]*SYNC_HIGH_BAND_EDGE_COEFF_0) >> FP_SHIFT_FACTOR) + ((s->symbol_sync_high[1]*SYNC_HIGH_BAND_EDGE_COEFF_1) >> FP_SHIFT_FACTOR) + sample.re; s->symbol_sync_high[1] = s->symbol_sync_high[0]; s->symbol_sync_high[0] = v; #else /* Low Nyquist band edge filter */ v = s->symbol_sync_low[0]*SYNC_LOW_BAND_EDGE_COEFF_0 + s->symbol_sync_low[1]*SYNC_LOW_BAND_EDGE_COEFF_1 + sample.re; s->symbol_sync_low[1] = s->symbol_sync_low[0]; s->symbol_sync_low[0] = v; /* High Nyquist band edge filter */ v = s->symbol_sync_high[0]*SYNC_HIGH_BAND_EDGE_COEFF_0 + s->symbol_sync_high[1]*SYNC_HIGH_BAND_EDGE_COEFF_1 + sample.re; s->symbol_sync_high[1] = s->symbol_sync_high[0]; s->symbol_sync_high[0] = v; #endif /* Put things into the equalization buffer at T/2 rate. The symbol synchronisation will fiddle the step to align this with the symbols. */ if (s->eq_put_step <= 0) { /* Only AGC until we have locked down the setting. */ #if defined(SPANDSP_USE_FIXED_POINT) if (s->agc_scaling_save == 0) s->agc_scaling = (float) FP_FACTOR*32768.0f*(1.0f/RX_PULSESHAPER_GAIN)*5.0f*0.25f/sqrtf(power); #else if (s->agc_scaling_save == 0.0f) s->agc_scaling = (1.0f/RX_PULSESHAPER_GAIN)*5.0f*0.25f/sqrtf(power); #endif /* Pulse shape while still at the carrier frequency, using a quadrature pair of filters. This results in a properly bandpass filtered complex signal, which can be brought directly to baseband by complex mixing. No further filtering, to remove mixer harmonics, is needed. */ s->eq_put_step += RX_PULSESHAPER_COEFF_SETS*10/(3*2); #if defined(SPANDSP_USE_FIXED_POINT) v = vec_circular_dot_prodi16(s->rrc_filter, rx_pulseshaper_im[step], V29_RX_FILTER_STEPS, s->rrc_filter_step); sample.im = (v*s->agc_scaling) >> 15; z = dds_lookup_complexi16(s->carrier_phase); zz.re = ((int32_t) sample.re*(int32_t) z.re - (int32_t) sample.im*(int32_t) z.im) >> 15; zz.im = ((int32_t) -sample.re*(int32_t) z.im - (int32_t) sample.im*(int32_t) z.re) >> 15; #else v = vec_circular_dot_prodf(s->rrc_filter, rx_pulseshaper_im[step], V29_RX_FILTER_STEPS, s->rrc_filter_step); sample.im = v*s->agc_scaling; z = dds_lookup_complexf(s->carrier_phase); zz.re = sample.re*z.re - sample.im*z.im; zz.im = -sample.re*z.im - sample.im*z.re; #endif process_half_baud(s, &zz); } #if defined(SPANDSP_USE_FIXED_POINT) dds_advance(&s->carrier_phase, s->carrier_phase_rate); #else dds_advancef(&s->carrier_phase, s->carrier_phase_rate); #endif } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) v29_rx_fillin(v29_rx_state_t *s, int len) { int i; /* We want to sustain the current state (i.e carrier on<->carrier off), and try to sustain the carrier phase. We should probably push the filters, as well */ span_log(&s->logging, SPAN_LOG_FLOW, "Fill-in %d samples\n", len); if (s->signal_present <= 0) return 0; if (s->training_stage == TRAINING_STAGE_PARKED) return 0; for (i = 0; i < len; i++) { #if defined(SPANDSP_USE_FIXED_POINT) dds_advance(&s->carrier_phase, s->carrier_phase_rate); #else dds_advancef(&s->carrier_phase, s->carrier_phase_rate); #endif /* Advance the symbol phase the appropriate amount */ s->eq_put_step -= RX_PULSESHAPER_COEFF_SETS; if (s->eq_put_step <= 0) s->eq_put_step += RX_PULSESHAPER_COEFF_SETS*10/(3*2); /* TODO: Should we rotate any buffers */ } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v29_rx_set_put_bit(v29_rx_state_t *s, put_bit_func_t put_bit, void *user_data) { s->put_bit = put_bit; s->put_bit_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v29_rx_set_modem_status_handler(v29_rx_state_t *s, modem_status_func_t handler, void *user_data) { s->status_handler = handler; s->status_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(logging_state_t *) v29_rx_get_logging_state(v29_rx_state_t *s) { return &s->logging; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v29_rx_restart(v29_rx_state_t *s, int bit_rate, int old_train) { int i; switch (bit_rate) { case 9600: s->training_cd = 0; break; case 7200: s->training_cd = 2; break; case 4800: s->training_cd = 4; break; default: return -1; } s->bit_rate = bit_rate; #if defined(SPANDSP_USE_FIXED_POINT) vec_zeroi16(s->rrc_filter, sizeof(s->rrc_filter)/sizeof(s->rrc_filter[0])); #else vec_zerof(s->rrc_filter, sizeof(s->rrc_filter)/sizeof(s->rrc_filter[0])); #endif s->rrc_filter_step = 0; s->scramble_reg = 0; s->training_scramble_reg = 0x2A; s->training_stage = TRAINING_STAGE_SYMBOL_ACQUISITION; s->training_count = 0; s->signal_present = 0; #if defined(IAXMODEM_STUFF) s->high_sample = 0; s->low_samples = 0; s->carrier_drop_pending = FALSE; #endif s->old_train = old_train; s->carrier_phase = 0; power_meter_init(&s->power, 4); s->constellation_state = 0; if (s->old_train) { s->carrier_phase_rate = s->carrier_phase_rate_save; equalizer_restore(s); s->agc_scaling = s->agc_scaling_save; } else { s->carrier_phase_rate = DDS_PHASE_RATE(CARRIER_NOMINAL_FREQ); equalizer_reset(s); #if defined(SPANDSP_USE_FIXED_POINT) s->agc_scaling_save = 0; s->agc_scaling = (float) FP_FACTOR*32768.0f*0.0017f/RX_PULSESHAPER_GAIN; #else s->agc_scaling_save = 0.0f; s->agc_scaling = 0.0017f/RX_PULSESHAPER_GAIN; #endif } #if defined(SPANDSP_USE_FIXED_POINT) s->carrier_track_i = 8000; s->carrier_track_p = 8000000; #else s->carrier_track_i = 8000.0f; s->carrier_track_p = 8000000.0f; #endif s->last_sample = 0; s->eq_skip = 0; /* Initialise the working data for symbol timing synchronisation */ #if defined(SPANDSP_USE_FIXED_POINT) for (i = 0; i < 2; i++) { s->symbol_sync_low[i] = 0; s->symbol_sync_high[i] = 0; s->symbol_sync_dc_filter[i] = 0; } s->baud_phase = 0; #else for (i = 0; i < 2; i++) { s->symbol_sync_low[i] = 0.0f; s->symbol_sync_high[i] = 0.0f; s->symbol_sync_dc_filter[i] = 0.0f; } s->baud_phase = 0.0f; #endif s->baud_half = 0; s->total_baud_timing_correction = 0; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(v29_rx_state_t *) v29_rx_init(v29_rx_state_t *s, int bit_rate, put_bit_func_t put_bit, void *user_data) { switch (bit_rate) { case 9600: case 7200: case 4800: break; default: return NULL; } if (s == NULL) { if ((s = (v29_rx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "V.29 RX"); s->put_bit = put_bit; s->put_bit_user_data = user_data; /* The V.29 spec says the thresholds should be -31dBm and -26dBm, but that makes little sense. V.17 uses -48dBm and -43dBm, and there seems no good reason to cut off at a higher level (though at 9600bps and 7200bps, TCM should put V.17 sensitivity several dB ahead of V.29). */ /* The thresholds should be on at -26dBm0 and off at -31dBm0 */ v29_rx_signal_cutoff(s, -28.5f); v29_rx_restart(s, bit_rate, FALSE); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v29_rx_release(v29_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) v29_rx_free(v29_rx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) v29_rx_set_qam_report_handler(v29_rx_state_t *s, qam_report_handler_t handler, void *user_data) { s->qam_report = handler; s->qam_user_data = user_data; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/filter_tools.h0000664000175000017500000000340511422612261013554 00000000000000/* * SpanDSP - a series of DSP components for telephony * * filter_tools.h - A collection of routines used for filter design. * * Written by Steve Underwood * * Copyright (C) 2008 Steve Underwood * * Based on: * mkshape -- design raised cosine FIR filter * A.J. Fisher, University of York , November 1996 * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_FILTER_TOOLS_H_) #define _FILTER_TOOLS_H_ #if defined(__cplusplus) extern "C" { #endif void ifft(complex_t data[], int len); void apply_hamming_window(double coeffs[], int len); void truncate_coeffs(double coeffs[], int len, int bits, int hilbert); void compute_raised_cosine_filter(double coeffs[], int len, int root, int sinc_compensate, double alpha, double beta); void compute_hilbert_transform(double coeffs[], int len); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/libtiff.2005.vcproj0000664000175000017500000002116411203772526014141 00000000000000 spandsp-0.0.6/src/crc.c0000664000175000017500000002205611422612261011614 00000000000000/* * SpanDSP - a series of DSP components for telephony * * crc.c * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include "spandsp/telephony.h" #include "spandsp/crc.h" #include "spandsp/bit_operations.h" static const uint32_t crc_itu32_table[] = { 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F, 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D, 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9, 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B, 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45, 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D }; SPAN_DECLARE(uint32_t) crc_itu32_calc(const uint8_t *buf, int len, uint32_t crc) { int i; for (i = 0; i < len; i++) crc = ((crc >> 8) & 0x00FFFFFF) ^ crc_itu32_table[(crc ^ buf[i]) & 0xFF]; return crc; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) crc_itu32_append(uint8_t *buf, int len) { uint32_t crc; int new_len; int i; crc = 0xFFFFFFFF; new_len = len + 4; for (i = 0; i < len; i++) crc = ((crc >> 8) & 0x00FFFFFF) ^ crc_itu32_table[(crc ^ buf[i]) & 0xFF]; crc ^= 0xFFFFFFFF; buf[i++] = (uint8_t) crc; buf[i++] = (uint8_t) (crc >> 8); buf[i++] = (uint8_t) (crc >> 16); buf[i++] = (uint8_t) (crc >> 24); return new_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) crc_itu32_check(const uint8_t *buf, int len) { uint32_t crc; int i; crc = 0xFFFFFFFF; for (i = 0; i < len; i++) crc = ((crc >> 8) & 0x00FFFFFF) ^ crc_itu32_table[(crc ^ buf[i]) & 0xFF]; return (crc == 0xDEBB20E3); } /*- End of function --------------------------------------------------------*/ static const uint16_t crc_itu16_table[] = { 0x0000, 0x1189, 0x2312, 0x329B, 0x4624, 0x57AD, 0x6536, 0x74BF, 0x8C48, 0x9DC1, 0xAF5A, 0xBED3, 0xCA6C, 0xDBE5, 0xE97E, 0xF8F7, 0x1081, 0x0108, 0x3393, 0x221A, 0x56A5, 0x472C, 0x75B7, 0x643E, 0x9CC9, 0x8D40, 0xBFDB, 0xAE52, 0xDAED, 0xCB64, 0xF9FF, 0xE876, 0x2102, 0x308B, 0x0210, 0x1399, 0x6726, 0x76AF, 0x4434, 0x55BD, 0xAD4A, 0xBCC3, 0x8E58, 0x9FD1, 0xEB6E, 0xFAE7, 0xC87C, 0xD9F5, 0x3183, 0x200A, 0x1291, 0x0318, 0x77A7, 0x662E, 0x54B5, 0x453C, 0xBDCB, 0xAC42, 0x9ED9, 0x8F50, 0xFBEF, 0xEA66, 0xD8FD, 0xC974, 0x4204, 0x538D, 0x6116, 0x709F, 0x0420, 0x15A9, 0x2732, 0x36BB, 0xCE4C, 0xDFC5, 0xED5E, 0xFCD7, 0x8868, 0x99E1, 0xAB7A, 0xBAF3, 0x5285, 0x430C, 0x7197, 0x601E, 0x14A1, 0x0528, 0x37B3, 0x263A, 0xDECD, 0xCF44, 0xFDDF, 0xEC56, 0x98E9, 0x8960, 0xBBFB, 0xAA72, 0x6306, 0x728F, 0x4014, 0x519D, 0x2522, 0x34AB, 0x0630, 0x17B9, 0xEF4E, 0xFEC7, 0xCC5C, 0xDDD5, 0xA96A, 0xB8E3, 0x8A78, 0x9BF1, 0x7387, 0x620E, 0x5095, 0x411C, 0x35A3, 0x242A, 0x16B1, 0x0738, 0xFFCF, 0xEE46, 0xDCDD, 0xCD54, 0xB9EB, 0xA862, 0x9AF9, 0x8B70, 0x8408, 0x9581, 0xA71A, 0xB693, 0xC22C, 0xD3A5, 0xE13E, 0xF0B7, 0x0840, 0x19C9, 0x2B52, 0x3ADB, 0x4E64, 0x5FED, 0x6D76, 0x7CFF, 0x9489, 0x8500, 0xB79B, 0xA612, 0xD2AD, 0xC324, 0xF1BF, 0xE036, 0x18C1, 0x0948, 0x3BD3, 0x2A5A, 0x5EE5, 0x4F6C, 0x7DF7, 0x6C7E, 0xA50A, 0xB483, 0x8618, 0x9791, 0xE32E, 0xF2A7, 0xC03C, 0xD1B5, 0x2942, 0x38CB, 0x0A50, 0x1BD9, 0x6F66, 0x7EEF, 0x4C74, 0x5DFD, 0xB58B, 0xA402, 0x9699, 0x8710, 0xF3AF, 0xE226, 0xD0BD, 0xC134, 0x39C3, 0x284A, 0x1AD1, 0x0B58, 0x7FE7, 0x6E6E, 0x5CF5, 0x4D7C, 0xC60C, 0xD785, 0xE51E, 0xF497, 0x8028, 0x91A1, 0xA33A, 0xB2B3, 0x4A44, 0x5BCD, 0x6956, 0x78DF, 0x0C60, 0x1DE9, 0x2F72, 0x3EFB, 0xD68D, 0xC704, 0xF59F, 0xE416, 0x90A9, 0x8120, 0xB3BB, 0xA232, 0x5AC5, 0x4B4C, 0x79D7, 0x685E, 0x1CE1, 0x0D68, 0x3FF3, 0x2E7A, 0xE70E, 0xF687, 0xC41C, 0xD595, 0xA12A, 0xB0A3, 0x8238, 0x93B1, 0x6B46, 0x7ACF, 0x4854, 0x59DD, 0x2D62, 0x3CEB, 0x0E70, 0x1FF9, 0xF78F, 0xE606, 0xD49D, 0xC514, 0xB1AB, 0xA022, 0x92B9, 0x8330, 0x7BC7, 0x6A4E, 0x58D5, 0x495C, 0x3DE3, 0x2C6A, 0x1EF1, 0x0F78 }; SPAN_DECLARE(uint16_t) crc_itu16_calc(const uint8_t *buf, int len, uint16_t crc) { int i; for (i = 0; i < len; i++) crc = (crc >> 8) ^ crc_itu16_table[(crc ^ buf[i]) & 0xFF]; return crc; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(uint16_t) crc_itu16_bits(uint8_t buf, int len, uint16_t crc) { int i; for (i = 0; i < len; i++) { if (((buf ^ crc) & 1)) crc = (crc >> 1) ^ 0x8408; else crc = crc >> 1; buf >>= 1; } return crc; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) crc_itu16_append(uint8_t *buf, int len) { uint16_t crc; int new_len; int i; crc = 0xFFFF; new_len = len + 2; for (i = 0; i < len; i++) crc = (crc >> 8) ^ crc_itu16_table[(crc ^ buf[i]) & 0xFF]; crc ^= 0xFFFF; buf[i++] = (uint8_t) crc; buf[i++] = (uint8_t) (crc >> 8); return new_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) crc_itu16_check(const uint8_t *buf, int len) { uint16_t crc; int i; crc = 0xFFFF; for (i = 0; i < len; i++) crc = (crc >> 8) ^ crc_itu16_table[(crc ^ buf[i]) & 0xFF]; return (crc & 0xFFFF) == 0xF0B8; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/modem_connect_tones.c0000664000175000017500000007163312343630334015100 00000000000000/* * SpanDSP - a series of DSP components for telephony * * modem_connect_tones.c - Generation and detection of tones * associated with modems calling and answering calls. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /* CNG is 0.5s+-15% of 1100+-38Hz, 3s+-15% off, repeating. CED is 0.2s silence, 3.3+-0.7s of 2100+-15Hz, and 75+-20ms of silence. Calling tone is 0.5s-0.7s of 1300Hz+-15Hz, 1.5s-2.0s off, repeating. ANS is 3.3+-0.7s of 2100+-15Hz. ANS/ is 3.3+-0.7s of 2100+-15Hz, with phase reversals (180+-10 degrees, hopping in <1ms) every 450+-25ms. ANSam/ is 2100+-1Hz, with phase reversals (180+-10 degrees, hopping in <1ms) every 450+-25ms, and AM with a sinewave of 15+-0.1Hz. The modulated envelope ranges in amplitude between (0.8+-0.01) and (1.2+-0.01) times its average amplitude. It lasts up to 5s, but will be stopped early if the V.8 protocol proceeds. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/logging.h" #include "spandsp/complex.h" #include "spandsp/dds.h" #include "spandsp/tone_detect.h" #include "spandsp/tone_generate.h" #include "spandsp/super_tone_rx.h" #include "spandsp/power_meter.h" #include "spandsp/async.h" #include "spandsp/fsk.h" #include "spandsp/modem_connect_tones.h" #include "spandsp/private/fsk.h" #include "spandsp/private/modem_connect_tones.h" #define HDLC_FRAMING_OK_THRESHOLD 5 SPAN_DECLARE(const char *) modem_connect_tone_to_str(int tone) { switch (tone) { case MODEM_CONNECT_TONES_NONE: return "No tone"; case MODEM_CONNECT_TONES_FAX_CNG: return "FAX CNG"; case MODEM_CONNECT_TONES_ANS: return "ANS or FAX CED"; case MODEM_CONNECT_TONES_ANS_PR: return "ANS/"; case MODEM_CONNECT_TONES_ANSAM: return "ANSam"; case MODEM_CONNECT_TONES_ANSAM_PR: return "ANSam/"; case MODEM_CONNECT_TONES_FAX_PREAMBLE: return "FAX preamble"; case MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE: return "FAX CED or preamble"; case MODEM_CONNECT_TONES_BELL_ANS: return "Bell ANS"; case MODEM_CONNECT_TONES_CALLING_TONE: return "Calling tone"; } return "???"; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) modem_connect_tones_tx(modem_connect_tones_tx_state_t *s, int16_t amp[], int len) { int16_t mod; int i; int xlen; i = 0; switch (s->tone_type) { case MODEM_CONNECT_TONES_FAX_CNG: for ( ; i < len; i++) { if (s->duration_timer > ms_to_samples(3000)) { if ((xlen = i + s->duration_timer - ms_to_samples(3000)) > len) xlen = len; s->duration_timer -= (xlen - i); for ( ; i < xlen; i++) amp[i] = dds_mod(&s->tone_phase, s->tone_phase_rate, s->level, 0); } if (s->duration_timer > 0) { if ((xlen = i + s->duration_timer) > len) xlen = len; s->duration_timer -= (xlen - i); memset(amp + i, 0, sizeof(int16_t)*(xlen - i)); i = xlen; } if (s->duration_timer == 0) s->duration_timer = ms_to_samples(500 + 3000); } break; case MODEM_CONNECT_TONES_ANS: if (s->duration_timer < len) len = s->duration_timer; if (s->duration_timer > ms_to_samples(2600)) { /* There is some initial silence to be generated. */ if ((i = s->duration_timer - ms_to_samples(2600)) > len) i = len; memset(amp, 0, sizeof(int16_t)*i); } for ( ; i < len; i++) amp[i] = dds_mod(&s->tone_phase, s->tone_phase_rate, s->level, 0); s->duration_timer -= len; break; case MODEM_CONNECT_TONES_ANS_PR: if (s->duration_timer < len) len = s->duration_timer; if (s->duration_timer > ms_to_samples(3300)) { if ((i = s->duration_timer - ms_to_samples(3300)) > len) i = len; memset(amp, 0, sizeof(int16_t)*i); } for ( ; i < len; i++) { if (--s->hop_timer <= 0) { s->hop_timer = ms_to_samples(450); s->tone_phase += 0x80000000; } amp[i] = dds_mod(&s->tone_phase, s->tone_phase_rate, s->level, 0); } s->duration_timer -= len; break; case MODEM_CONNECT_TONES_ANSAM: if (s->duration_timer < len) len = s->duration_timer; if (s->duration_timer > ms_to_samples(5000)) { if ((i = s->duration_timer - ms_to_samples(5000)) > len) i = len; memset(amp, 0, sizeof(int16_t)*i); } for ( ; i < len; i++) { mod = (int16_t) (s->level + dds_mod(&s->mod_phase, s->mod_phase_rate, s->mod_level, 0)); amp[i] = dds_mod(&s->tone_phase, s->tone_phase_rate, mod, 0); } s->duration_timer -= len; break; case MODEM_CONNECT_TONES_ANSAM_PR: if (s->duration_timer < len) len = s->duration_timer; if (s->duration_timer > ms_to_samples(5000)) { if ((i = s->duration_timer - ms_to_samples(5000)) > len) i = len; memset(amp, 0, sizeof(int16_t)*i); } for ( ; i < len; i++) { if (--s->hop_timer <= 0) { s->hop_timer = ms_to_samples(450); s->tone_phase += 0x80000000; } mod = (int16_t) (s->level + dds_mod(&s->mod_phase, s->mod_phase_rate, s->mod_level, 0)); amp[i] = dds_mod(&s->tone_phase, s->tone_phase_rate, mod, 0); } s->duration_timer -= len; break; case MODEM_CONNECT_TONES_BELL_ANS: if (s->duration_timer < len) len = s->duration_timer; if (s->duration_timer > ms_to_samples(2600)) { /* There is some initial silence to be generated. */ if ((i = s->duration_timer - ms_to_samples(2600)) > len) i = len; memset(amp, 0, sizeof(int16_t)*i); } for ( ; i < len; i++) amp[i] = dds_mod(&s->tone_phase, s->tone_phase_rate, s->level, 0); s->duration_timer -= len; break; case MODEM_CONNECT_TONES_CALLING_TONE: for ( ; i < len; i++) { if (s->duration_timer > ms_to_samples(2000)) { if ((xlen = i + s->duration_timer - ms_to_samples(2000)) > len) xlen = len; s->duration_timer -= (xlen - i); for ( ; i < xlen; i++) amp[i] = dds_mod(&s->tone_phase, s->tone_phase_rate, s->level, 0); } if (s->duration_timer > 0) { if ((xlen = i + s->duration_timer) > len) xlen = len; s->duration_timer -= (xlen - i); memset(amp + i, 0, sizeof(int16_t)*(xlen - i)); i = xlen; } if (s->duration_timer == 0) s->duration_timer = ms_to_samples(600 + 2000); } break; } return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(modem_connect_tones_tx_state_t *) modem_connect_tones_tx_init(modem_connect_tones_tx_state_t *s, int tone_type) { int alloced; alloced = FALSE; if (s == NULL) { if ((s = (modem_connect_tones_tx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; alloced = TRUE; } s->tone_type = tone_type; switch (s->tone_type) { case MODEM_CONNECT_TONES_FAX_CNG: /* 0.5s of 1100Hz+-38Hz + 3.0s of silence repeating. Timing +-15% */ s->tone_phase_rate = dds_phase_rate(1100.0); s->level = dds_scaling_dbm0(-11); s->duration_timer = ms_to_samples(500 + 3000); s->mod_phase_rate = 0; s->tone_phase = 0; s->mod_phase = 0; s->mod_level = 0; s->hop_timer = 0; break; case MODEM_CONNECT_TONES_ANS: case MODEM_CONNECT_TONES_ANSAM: /* 0.2s of silence, then 2.6s to 4s of 2100Hz+-15Hz tone, then 75ms of silence. */ s->tone_phase_rate = dds_phase_rate(2100.0); s->level = dds_scaling_dbm0(-11); if (s->tone_type == MODEM_CONNECT_TONES_ANSAM) { s->mod_phase_rate = dds_phase_rate(15.0); s->mod_level = s->level/5; s->duration_timer = ms_to_samples(200 + 5000); } else { s->mod_phase_rate = 0; s->mod_level = 0; s->duration_timer = ms_to_samples(200 + 2600); } s->tone_phase = 0; s->mod_phase = 0; s->hop_timer = 0; break; case MODEM_CONNECT_TONES_ANS_PR: case MODEM_CONNECT_TONES_ANSAM_PR: s->tone_phase_rate = dds_phase_rate(2100.0); s->level = dds_scaling_dbm0(-12); if (s->tone_type == MODEM_CONNECT_TONES_ANSAM_PR) { s->mod_phase_rate = dds_phase_rate(15.0); s->mod_level = s->level/5; s->duration_timer = ms_to_samples(200 + 5000); } else { s->mod_phase_rate = 0; s->mod_level = 0; s->duration_timer = ms_to_samples(200 + 3300); } s->tone_phase = 0; s->mod_phase = 0; s->hop_timer = ms_to_samples(450); break; case MODEM_CONNECT_TONES_BELL_ANS: /* 0.2s of silence, then 2.6s to 4s of 2225Hz+-15Hz tone, then 75ms of silence. */ s->tone_phase_rate = dds_phase_rate(2225.0); s->level = dds_scaling_dbm0(-11); s->mod_phase_rate = 0; s->mod_level = 0; s->duration_timer = ms_to_samples(200 + 2600); s->tone_phase = 0; s->mod_phase = 0; s->hop_timer = 0; break; case MODEM_CONNECT_TONES_CALLING_TONE: /* 0.6s of 1300Hz+-15Hz + 2.0s of silence repeating. */ s->tone_phase_rate = dds_phase_rate(1300.0); s->level = dds_scaling_dbm0(-11); s->duration_timer = ms_to_samples(600 + 2000); s->mod_phase_rate = 0; s->tone_phase = 0; s->mod_phase = 0; s->mod_level = 0; s->hop_timer = 0; break; default: if (alloced) free(s); return NULL; } return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) modem_connect_tones_tx_release(modem_connect_tones_tx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) modem_connect_tones_tx_free(modem_connect_tones_tx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ static void report_tone_state(modem_connect_tones_rx_state_t *s, int tone, int level) { if (tone != s->tone_present) { if (s->tone_callback) { s->tone_callback(s->callback_data, tone, level, 0); } else { if (tone != MODEM_CONNECT_TONES_NONE) s->hit = tone; } s->tone_present = tone; } } /*- End of function --------------------------------------------------------*/ static void v21_put_bit(void *user_data, int bit) { modem_connect_tones_rx_state_t *s; s = (modem_connect_tones_rx_state_t *) user_data; if (bit < 0) { /* Special conditions. */ switch (bit) { case SIG_STATUS_CARRIER_DOWN: /* Only declare tone off, if we were the one to declare tone on. */ if (s->tone_present == MODEM_CONNECT_TONES_FAX_PREAMBLE) report_tone_state(s, MODEM_CONNECT_TONES_NONE, -99); /* Fall through */ case SIG_STATUS_CARRIER_UP: s->raw_bit_stream = 0; s->num_bits = 0; s->flags_seen = 0; s->framing_ok_announced = FALSE; break; } return; } /* Look for enough FAX V.21 message preamble (back to back HDLC flag octets) to be sure we are really seeing preamble, and declare the signal to be present. Any change from preamble declares the signal to not be present, though it will probably be the body of the messages following the preamble. */ s->raw_bit_stream = (s->raw_bit_stream << 1) | ((bit << 8) & 0x100); s->num_bits++; if ((s->raw_bit_stream & 0x7F00) == 0x7E00) { if ((s->raw_bit_stream & 0x8000)) { /* Hit HDLC abort */ s->flags_seen = 0; } else { /* Hit HDLC flag */ if (s->flags_seen < HDLC_FRAMING_OK_THRESHOLD) { /* Check the flags are back-to-back when testing for valid preamble. This greatly reduces the chances of false preamble detection, and anything which doesn't send them back-to-back is badly broken. */ if (s->num_bits != 8) s->flags_seen = 0; if (++s->flags_seen >= HDLC_FRAMING_OK_THRESHOLD && !s->framing_ok_announced) { report_tone_state(s, MODEM_CONNECT_TONES_FAX_PREAMBLE, lfastrintf(fsk_rx_signal_power(&s->v21rx))); s->framing_ok_announced = TRUE; } } } s->num_bits = 0; } else { if (s->flags_seen >= HDLC_FRAMING_OK_THRESHOLD) { if (s->num_bits == 8) { s->framing_ok_announced = FALSE; s->flags_seen = 0; } } } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) modem_connect_tones_rx(modem_connect_tones_rx_state_t *s, const int16_t amp[], int len) { int i; int16_t notched; float v1; float famp; float filtered; switch (s->tone_type) { case MODEM_CONNECT_TONES_FAX_CNG: for (i = 0; i < len; i++) { famp = amp[i]; /* A Cauer notch at 1100Hz, spread just wide enough to meet our detection bandwidth criteria. */ /* Poles 0.736618498*exp(+-1047/4000 * PI * j) Zeroes exp(+-1099.5/4000 * PI * j) */ v1 = 0.792928f*famp + 1.0018744927985f*s->znotch_1 - 0.54196833412465f*s->znotch_2; famp = v1 - 1.2994747954630f*s->znotch_1 + s->znotch_2; s->znotch_2 = s->znotch_1; s->znotch_1 = v1; notched = (int16_t) lfastrintf(famp); /* Estimate the overall energy in the channel, and the energy in the notch (i.e. overall channel energy - tone energy => noise). Use abs instead of multiply for speed (is it really faster?). */ s->channel_level += ((abs(amp[i]) - s->channel_level) >> 5); s->notch_level += ((abs(notched) - s->notch_level) >> 5); if (s->channel_level > 70 && s->notch_level*6 < s->channel_level) { /* There is adequate energy in the channel, and it is mostly at 1100Hz. */ if (s->tone_present != MODEM_CONNECT_TONES_FAX_CNG) { if (++s->tone_cycle_duration >= ms_to_samples(415)) report_tone_state(s, MODEM_CONNECT_TONES_FAX_CNG, lfastrintf(log10f(s->channel_level/32768.0f)*20.0f + DBM0_MAX_POWER + 0.8f)); } } else { /* If the signal looks wrong, even for a moment, we consider this the end of the tone. */ if (s->tone_present == MODEM_CONNECT_TONES_FAX_CNG) report_tone_state(s, MODEM_CONNECT_TONES_NONE, -99); s->tone_cycle_duration = 0; } } break; case MODEM_CONNECT_TONES_FAX_PREAMBLE: /* Ignore any CED tone, and just look for V.21 preamble. */ fsk_rx(&s->v21rx, amp, len); break; case MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE: /* Also look for V.21 preamble. A lot of machines don't send the 2100Hz burst. It might also not be seen all the way through the channel, due to switching delays. */ fsk_rx(&s->v21rx, amp, len); /* Now fall through and look for a 2100Hz tone */ case MODEM_CONNECT_TONES_ANS: for (i = 0; i < len; i++) { famp = amp[i]; /* A Cauer bandpass at 15Hz, with which we demodulate the AM signal. */ /* Poles 0.9983989*exp(+-15/4000 * PI * j) Zeroes exp(0/4000 * PI * j) */ v1 = fabs(famp) + 1.996667f*s->z15hz_1 - 0.9968004f*s->z15hz_2; filtered = 0.001599787f*(v1 - s->z15hz_2); s->z15hz_2 = s->z15hz_1; s->z15hz_1 = v1; s->am_level += abs(lfastrintf(filtered)) - (s->am_level >> 8); //printf("%9.1f %10.4f %9d %9d\n", famp, filtered, s->am_level, s->channel_level); /* A Cauer notch at 2100Hz, spread just wide enough to meet our detection bandwidth criteria. */ /* Poles 0.7144255*exp(+-2105.612/4000 * PI * j) Zeroes exp(+-2099.9/4000 * PI * j) */ v1 = 0.7552f*famp - 0.1183852f*s->znotch_1 - 0.5104039f*s->znotch_2; famp = v1 + 0.1567596f*s->znotch_1 + s->znotch_2; s->znotch_2 = s->znotch_1; s->znotch_1 = v1; notched = (int16_t) lfastrintf(famp); /* Estimate the overall energy in the channel, and the energy in the notch (i.e. overall channel energy - tone energy => noise). Use abs instead of multiply for speed (is it really faster?). Damp the overall energy a little more for a stable result. Damp the notch energy a little less, so we don't damp out the blip every time the phase reverses. */ s->channel_level += ((abs(amp[i]) - s->channel_level) >> 5); s->notch_level += ((abs(notched) - s->notch_level) >> 4); /* This should cut off at about -43dBm0 */ if (s->channel_level <= 70) { /* If the energy level is low, even for a moment, we consider this the end of the tone. */ if (s->tone_present != MODEM_CONNECT_TONES_NONE) report_tone_state(s, MODEM_CONNECT_TONES_NONE, -99); s->tone_cycle_duration = 0; s->good_cycles = 0; s->tone_on = FALSE; continue; } /* There is adequate energy in the channel. Is it mostly at 2100Hz? */ s->tone_cycle_duration++; if (s->notch_level*6 < s->channel_level) { /* The notch test says yes, so we have the tone. */ /* We should get a kick from the notch filter every 450+-25ms, as the phase reverses, for an EC disable tone. For a simple answer tone, the tone should persist unbroken for longer. */ if (!s->tone_on) { if (s->tone_cycle_duration >= ms_to_samples(450 - 25)) { if (++s->good_cycles == 3) { report_tone_state(s, (s->am_level*15/256 > s->channel_level) ? MODEM_CONNECT_TONES_ANSAM_PR : MODEM_CONNECT_TONES_ANS_PR, lfastrintf(log10f(s->channel_level/32768.0f)*20.0f + DBM0_MAX_POWER + 0.8f)); } } else { s->good_cycles = 0; } /* Cycles are timed from rising edge to rising edge */ s->tone_cycle_duration = 0; } else { if (s->tone_cycle_duration >= ms_to_samples(450 + 100)) { if (s->tone_present == MODEM_CONNECT_TONES_NONE) { report_tone_state(s, (s->am_level*15/256 > s->channel_level) ? MODEM_CONNECT_TONES_ANSAM : MODEM_CONNECT_TONES_ANS, lfastrintf(log10f(s->channel_level/32768.0f)*20.0f + DBM0_MAX_POWER + 0.8f)); } s->good_cycles = 0; s->tone_cycle_duration = ms_to_samples(450 + 100); } } s->tone_on = TRUE; } else if (s->notch_level*5 > s->channel_level) { if (s->tone_present == MODEM_CONNECT_TONES_ANS) { report_tone_state(s, MODEM_CONNECT_TONES_NONE, -99); s->good_cycles = 0; } else { if (s->tone_cycle_duration >= ms_to_samples(450 + 25)) { /* The change came too late for a cycle of ANS_PR tone */ if (s->tone_present == MODEM_CONNECT_TONES_ANS_PR || s->tone_present == MODEM_CONNECT_TONES_ANSAM_PR) report_tone_state(s, MODEM_CONNECT_TONES_NONE, -99); s->good_cycles = 0; } } s->tone_on = FALSE; } } break; case MODEM_CONNECT_TONES_BELL_ANS: for (i = 0; i < len; i++) { famp = amp[i]; /* A Cauer notch at 2225Hz, spread just wide enough to meet our detection bandwidth criteria. */ /* Poles 0.7144255*exp(+-2230.612/4000 * PI * j) Zeroes exp(+-2224.9/4000 * PI * j) */ v1 = 0.739651f*famp - 0.257384f*s->znotch_1 - 0.510404f*s->znotch_2; famp = v1 + 0.351437f*s->znotch_1 + s->znotch_2; s->znotch_2 = s->znotch_1; s->znotch_1 = v1; notched = (int16_t) lfastrintf(famp); /* Estimate the overall energy in the channel, and the energy in the notch (i.e. overall channel energy - tone energy => noise). Use abs instead of multiply for speed (is it really faster?). */ s->channel_level += ((abs(amp[i]) - s->channel_level) >> 5); s->notch_level += ((abs(notched) - s->notch_level) >> 5); if (s->channel_level > 70 && s->notch_level*6 < s->channel_level) { /* There is adequate energy in the channel, and it is mostly at 2225Hz. */ if (s->tone_present != MODEM_CONNECT_TONES_BELL_ANS) { if (++s->tone_cycle_duration >= ms_to_samples(415)) report_tone_state(s, MODEM_CONNECT_TONES_BELL_ANS, lfastrintf(log10f(s->channel_level/32768.0f)*20.0f + DBM0_MAX_POWER + 0.8f)); } } else { /* If the signal looks wrong, even for a moment, we consider this the end of the tone. */ if (s->tone_present == MODEM_CONNECT_TONES_BELL_ANS) report_tone_state(s, MODEM_CONNECT_TONES_NONE, -99); s->tone_cycle_duration = 0; } } break; case MODEM_CONNECT_TONES_CALLING_TONE: for (i = 0; i < len; i++) { famp = amp[i]; /* A Cauer notch at 1300Hz, spread just wide enough to meet our detection bandwidth criteria. */ /* Poles 0.736618498*exp(+-1247/4000 * PI * j) Zeroes exp(+-1299.5/4000 * PI * j) */ v1 = 0.755582f*famp + 0.820887174515f*s->znotch_1 - 0.541968324778f*s->znotch_2; famp = v1 - 1.0456667108f*s->znotch_1 + s->znotch_2; s->znotch_2 = s->znotch_1; s->znotch_1 = v1; notched = (int16_t) lfastrintf(famp); /* Estimate the overall energy in the channel, and the energy in the notch (i.e. overall channel energy - tone energy => noise). Use abs instead of multiply for speed (is it really faster?). */ s->channel_level += ((abs(amp[i]) - s->channel_level) >> 5); s->notch_level += ((abs(notched) - s->notch_level) >> 5); if (s->channel_level > 70 && s->notch_level*6 < s->channel_level) { /* There is adequate energy in the channel, and it is mostly at 1300Hz. */ if (s->tone_present != MODEM_CONNECT_TONES_CALLING_TONE) { if (++s->tone_cycle_duration >= ms_to_samples(415)) report_tone_state(s, MODEM_CONNECT_TONES_CALLING_TONE, lfastrintf(log10f(s->channel_level/32768.0f)*20.0f + DBM0_MAX_POWER + 0.8f)); } } else { /* If the signal looks wrong, even for a moment, we consider this the end of the tone. */ if (s->tone_present == MODEM_CONNECT_TONES_CALLING_TONE) report_tone_state(s, MODEM_CONNECT_TONES_NONE, -99); s->tone_cycle_duration = 0; } } break; } return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) modem_connect_tones_rx_get(modem_connect_tones_rx_state_t *s) { int x; x = s->hit; s->hit = MODEM_CONNECT_TONES_NONE; return x; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(modem_connect_tones_rx_state_t *) modem_connect_tones_rx_init(modem_connect_tones_rx_state_t *s, int tone_type, tone_report_func_t tone_callback, void *user_data) { if (s == NULL) { if ((s = (modem_connect_tones_rx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } s->tone_type = tone_type; switch (s->tone_type) { case MODEM_CONNECT_TONES_FAX_PREAMBLE: case MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE: fsk_rx_init(&s->v21rx, &preset_fsk_specs[FSK_V21CH2], FSK_FRAME_MODE_SYNC, v21_put_bit, s); fsk_rx_signal_cutoff(&s->v21rx, -45.5f); break; case MODEM_CONNECT_TONES_ANS_PR: case MODEM_CONNECT_TONES_ANSAM: case MODEM_CONNECT_TONES_ANSAM_PR: /* Treat these all the same for receive purposes */ s->tone_type = MODEM_CONNECT_TONES_ANS; break; } s->channel_level = 0; s->notch_level = 0; s->am_level = 0; s->tone_present = MODEM_CONNECT_TONES_NONE; s->tone_cycle_duration = 0; s->good_cycles = 0; s->hit = MODEM_CONNECT_TONES_NONE; s->tone_on = FALSE; s->tone_callback = tone_callback; s->callback_data = user_data; s->znotch_1 = 0.0f; s->znotch_2 = 0.0f; s->z15hz_1 = 0.0f; s->z15hz_2 = 0.0f; s->num_bits = 0; s->flags_seen = 0; s->framing_ok_announced = FALSE; s->raw_bit_stream = 0; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) modem_connect_tones_rx_release(modem_connect_tones_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) modem_connect_tones_rx_free(modem_connect_tones_rx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/gsm0610_rpe.c0000664000175000017500000003721011422612262013007 00000000000000/* * SpanDSP - a series of DSP components for telephony * * gsm0610_rpe.c - GSM 06.10 full rate speech codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * This code is based on the widely used GSM 06.10 code available from * http://kbs.cs.tu-berlin.de/~jutta/toast.html */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include "mmx_sse_decs.h" #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/bitstream.h" #include "spandsp/saturated.h" #include "spandsp/gsm0610.h" #include "gsm0610_local.h" /* 4.2.13 .. 4.2.17 RPE ENCODING SECTION */ /* 4.2.13 */ static void weighting_filter(int16_t x[40], const int16_t *e) // signal [-5..0.39.44] IN) { #if defined(__GNUC__) && defined(SPANDSP_USE_MMX) && defined(__x86_64__) /* Table 4.4 Coefficients of the weighting filter */ /* This must be padded to a multiple of 4 for MMX to work */ static const union { int16_t gsm_H[12]; __m64 x[3]; } gsm_H = { { -134, -374, 0, 2054, 5741, 8192, 5741, 2054, 0, -374, -134, 0 } }; __asm__ __volatile__( " emms;\n" " addq $-10,%%rcx;\n" " leaq %[gsm_H],%%rax;\n" " movq (%%rax),%%mm1;\n" " movq 8(%%rax),%%mm2;\n" " movq 16(%%rax),%%mm3;\n" " movq $0x1000,%%rax;\n" " movq %%rax,%%mm5;\n" /* For rounding */ " xorq %%rsi,%%rsi;\n" " .p2align 2;\n" "1:\n" " movq (%%rcx,%%rsi,2),%%mm0;\n" " pmaddwd %%mm1,%%mm0;\n" " movq 8(%%rcx,%%rsi,2),%%mm4;\n" " pmaddwd %%mm2,%%mm4;\n" " paddd %%mm4,%%mm0;\n" " movq 16(%%rcx,%%rsi,2),%%mm4;\n" " pmaddwd %%mm3,%%mm4;\n" " paddd %%mm4,%%mm0;\n" " movq %%mm0,%%mm4;\n" " punpckhdq %%mm0,%%mm4;\n" /* mm4 has high int32 of mm0 dup'd */ " paddd %%mm4,%%mm0;\n" " paddd %%mm5,%%mm0;\n" /* Add for roundoff */ " psrad $13,%%mm0;\n" " packssdw %%mm0,%%mm0;\n" " movd %%mm0,%%eax;\n" /* eax has result */ " movw %%ax,(%%rdi,%%rsi,2);\n" " incq %%rsi;\n" " cmpq $39,%%rsi;\n" " jle 1b;\n" " emms;\n" : : "c" (e), "D" (x), [gsm_H] "X" (gsm_H) : "rax", "rdx", "rsi", "memory" ); #elif defined(__GNUC__) && defined(SPANDSP_USE_MMX) && defined(__i386__) /* Table 4.4 Coefficients of the weighting filter */ /* This must be padded to a multiple of 4 for MMX to work */ static const union { int16_t gsm_H[12]; __m64 x[3]; } gsm_H = { { -134, -374, 0, 2054, 5741, 8192, 5741, 2054, 0, -374, -134, 0 } }; __asm__ __volatile__( " emms;\n" " addl $-10,%%ecx;\n" " leal %[gsm_H],%%eax;\n" " movq (%%eax),%%mm1;\n" " movq 8(%%eax),%%mm2;\n" " movq 16(%%eax),%%mm3;\n" " movl $0x1000,%%eax;\n" " movd %%eax,%%mm5;\n" /* For rounding */ " xorl %%esi,%%esi;\n" " .p2align 2;\n" "1:\n" " movq (%%ecx,%%esi,2),%%mm0;\n" " pmaddwd %%mm1,%%mm0;\n" " movq 8(%%ecx,%%esi,2),%%mm4;\n" " pmaddwd %%mm2,%%mm4;\n" " paddd %%mm4,%%mm0;\n" " movq 16(%%ecx,%%esi,2),%%mm4;\n" " pmaddwd %%mm3,%%mm4;\n" " paddd %%mm4,%%mm0;\n" " movq %%mm0,%%mm4;\n" " punpckhdq %%mm0,%%mm4;\n" /* mm4 has high int32 of mm0 dup'd */ " paddd %%mm4,%%mm0;\n" " paddd %%mm5,%%mm0;\n" /* Add for roundoff */ " psrad $13,%%mm0;\n" " packssdw %%mm0,%%mm0;\n" " movd %%mm0,%%eax;\n" /* eax has result */ " movw %%ax,(%%edi,%%esi,2);\n" " incl %%esi;\n" " cmpl $39,%%esi;\n" " jle 1b;\n" " emms;\n" : : "c" (e), "D" (x), [gsm_H] "X" (gsm_H) : "eax", "edx", "esi", "memory" ); #else int32_t result; int k; /* The coefficients of the weighting filter are stored in a table (see table 4.4). The following scaling is used: H[0..10] = integer(real_H[0..10] * 8192); */ /* Initialization of a temporary working array wt[0...49] */ /* for (k = 0; k <= 4; k++) wt[k] = 0; * for (k = 5; k <= 44; k++) wt[k] = *e++; * for (k = 45; k <= 49; k++) wt[k] = 0; * * (e[-5..-1] and e[40..44] are allocated by the caller, * are initially zero and are not written anywhere.) */ e -= 5; /* Compute the signal x[0..39] */ for (k = 0; k < 40; k++) { result = 8192 >> 1; /* for (i = 0; i <= 10; i++) * { * temp = saturated_mul16_32(wt[k + i], gsm_H[i]); * result = saturated_add32(result, temp); * } */ #undef STEP #define STEP(i,H) (e[k + i] * (int32_t) H) /* Every one of these multiplications is done twice, but I don't see an elegant way to optimize this. Do you? */ result += STEP( 0, -134); result += STEP( 1, -374); /* += STEP( 2, 0 ); */ result += STEP( 3, 2054); result += STEP( 4, 5741); result += STEP( 5, 8192); result += STEP( 6, 5741); result += STEP( 7, 2054); /* += STEP( 8, 0 ); */ result += STEP( 9, -374); result += STEP(10, -134); /* 2 adds vs. >> 16 => 14, minus one shift to compensate for those we lost when replacing L_MULT by '*'. */ result >>= 13; x[k] = saturate(result); } /*endfor*/ #endif } /*- End of function --------------------------------------------------------*/ /* 4.2.14 */ static void rpe_grid_selection(int16_t x[40], int16_t xM[13], int16_t *Mc_out) { int i; int32_t L_result; int32_t L_temp; int32_t EM; /* xxx should be L_EM? */ int16_t Mc; int32_t L_common_0_3; /* The signal x[0..39] is used to select the RPE grid which is represented by Mc. */ EM = 0; Mc = 0; #undef STEP #define STEP(m,i) \ L_temp = x[m + 3*i] >> 2; \ L_result += L_temp*L_temp; /* Common part of 0 and 3 */ L_result = 0; STEP(0, 1); STEP(0, 2); STEP(0, 3); STEP(0, 4); STEP(0, 5); STEP(0, 6); STEP(0, 7); STEP(0, 8); STEP(0, 9); STEP(0, 10); STEP(0, 11); STEP(0, 12); L_common_0_3 = L_result; /* i = 0 */ STEP(0, 0); L_result <<= 1; /* implicit in L_MULT */ EM = L_result; /* i = 1 */ L_result = 0; STEP(1, 0); STEP(1, 1); STEP(1, 2); STEP(1, 3); STEP(1, 4); STEP(1, 5); STEP(1, 6); STEP(1, 7); STEP(1, 8); STEP(1, 9); STEP(1, 10); STEP(1, 11); STEP(1, 12); L_result <<= 1; if (L_result > EM) { Mc = 1; EM = L_result; } /*endif*/ /* i = 2 */ L_result = 0; STEP(2, 0); STEP(2, 1); STEP(2, 2); STEP(2, 3); STEP(2, 4); STEP(2, 5); STEP(2, 6); STEP(2, 7); STEP(2, 8); STEP(2, 9); STEP(2, 10); STEP(2, 11); STEP(2, 12); L_result <<= 1; if (L_result > EM) { Mc = 2; EM = L_result; } /*endif*/ /* i = 3 */ L_result = L_common_0_3; STEP(3, 12); L_result <<= 1; if (L_result > EM) { Mc = 3; EM = L_result; } /*endif*/ /* Down-sampling by a factor 3 to get the selected xM[0..12] RPE sequence. */ for (i = 0; i < 13; i++) xM[i] = x[Mc + 3*i]; /*endfor*/ *Mc_out = Mc; } /*- End of function --------------------------------------------------------*/ /* 4.12.15 */ static void apcm_quantization_xmaxc_to_exp_mant(int16_t xmaxc, int16_t *exp_out, int16_t *mant_out) { int16_t exp; int16_t mant; /* Compute exponent and mantissa of the decoded version of xmaxc */ exp = 0; if (xmaxc > 15) exp = (int16_t) ((xmaxc >> 3) - 1); /*endif*/ mant = xmaxc - (exp << 3); if (mant == 0) { exp = -4; mant = 7; } else { while (mant <= 7) { mant = (int16_t) (mant << 1 | 1); exp--; } /*endwhile*/ mant -= 8; } /*endif*/ assert(exp >= -4 && exp <= 6); assert(mant >= 0 && mant <= 7); *exp_out = exp; *mant_out = mant; } /*- End of function --------------------------------------------------------*/ static void apcm_quantization(int16_t xM[13], int16_t xMc[13], int16_t *mant_out, int16_t *exp_out, int16_t *xmaxc_out) { /* Table 4.5 Normalized inverse mantissa used to compute xM/xmax */ static const int16_t gsm_NRFAC[8] = { 29128, 26215, 23832, 21846, 20165, 18725, 17476, 16384 }; int i; int itest; int16_t xmax; int16_t xmaxc; int16_t temp; int16_t temp1; int16_t temp2; int16_t exp; int16_t mant; /* Find the maximum absolute value xmax of xM[0..12]. */ xmax = 0; for (i = 0; i < 13; i++) { temp = xM[i]; temp = saturated_abs16(temp); if (temp > xmax) xmax = temp; /*endif*/ } /*endfor*/ /* Quantizing and coding of xmax to get xmaxc. */ exp = 0; temp = xmax >> 9; itest = 0; for (i = 0; i <= 5; i++) { itest |= (temp <= 0); temp >>= 1; assert(exp <= 5); if (itest == 0) exp++; /*endif*/ } /*endfor*/ assert(exp <= 6 && exp >= 0); temp = (int16_t) (exp + 5); assert(temp <= 11 && temp >= 0); xmaxc = saturated_add16((xmax >> temp), exp << 3); /* Quantizing and coding of the xM[0..12] RPE sequence to get the xMc[0..12] */ apcm_quantization_xmaxc_to_exp_mant(xmaxc, &exp, &mant); /* This computation uses the fact that the decoded version of xmaxc can be calculated by using the exponent and the mantissa part of xmaxc (logarithmic table). So, this method avoids any division and uses only a scaling of the RPE samples by a function of the exponent. A direct multiplication by the inverse of the mantissa (NRFAC[0..7] found in table 4.5) gives the 3 bit coded version xMc[0..12] of the RPE samples. */ /* Direct computation of xMc[0..12] using table 4.5 */ assert(exp <= 4096 && exp >= -4096); assert(mant >= 0 && mant <= 7); temp1 = (int16_t) (6 - exp); /* Normalization by the exponent */ temp2 = gsm_NRFAC[mant]; /* Inverse mantissa */ for (i = 0; i < 13; i++) { assert(temp1 >= 0 && temp1 < 16); temp = xM[i] << temp1; temp = saturated_mul16(temp, temp2); temp >>= 12; xMc[i] = (int16_t) (temp + 4); /* See note below */ } /*endfor*/ /* NOTE: This equation is used to make all the xMc[i] positive. */ *mant_out = mant; *exp_out = exp; *xmaxc_out = xmaxc; } /*- End of function --------------------------------------------------------*/ /* 4.2.16 */ static void apcm_inverse_quantization(int16_t xMc[13], int16_t mant, int16_t exp, int16_t xMp[13]) { /* Table 4.6 Normalized direct mantissa used to compute xM/xmax */ static const int16_t gsm_FAC[8] = { 18431, 20479, 22527, 24575, 26623, 28671, 30719, 32767 }; int i; int16_t temp; int16_t temp1; int16_t temp2; int16_t temp3; /* This part is for decoding the RPE sequence of coded xMc[0..12] samples to obtain the xMp[0..12] array. Table 4.6 is used to get the mantissa of xmaxc (FAC[0..7]). */ #if 0 assert(mant >= 0 && mant <= 7); #endif temp1 = gsm_FAC[mant]; /* See 4.2-15 for mant */ temp2 = saturated_sub16(6, exp); /* See 4.2-15 for exp */ temp3 = gsm_asl(1, saturated_sub16(temp2, 1)); for (i = 0; i < 13; i++) { assert(xMc[i] >= 0 && xMc[i] <= 7); /* 3 bit unsigned */ temp = (int16_t) ((xMc[i] << 1) - 7); /* Restore sign */ assert(temp <= 7 && temp >= -7); /* 4 bit signed */ temp <<= 12; /* 16 bit signed */ temp = gsm_mult_r(temp1, temp); temp = saturated_add16(temp, temp3); xMp[i] = gsm_asr(temp, temp2); } /*endfor*/ } /*- End of function --------------------------------------------------------*/ /* 4.2.17 */ static void rpe_grid_positioning(int16_t Mc, int16_t xMp[13], int16_t ep[40]) { int i = 13; /* This procedure computes the reconstructed long term residual signal ep[0..39] for the LTP analysis filter. The inputs are the Mc which is the grid position selection and the xMp[0..12] decoded RPE samples which are upsampled by a factor of 3 by inserting zero values. */ assert(0 <= Mc && Mc <= 3); switch (Mc) { case 3: *ep++ = 0; case 2: do { *ep++ = 0; case 1: *ep++ = 0; case 0: *ep++ = *xMp++; } while (--i); } /*endswitch*/ while (++Mc < 4) *ep++ = 0; /*endwhile*/ } /*- End of function --------------------------------------------------------*/ void gsm0610_rpe_encoding(gsm0610_state_t *s, int16_t *e, // [-5..-1][0..39][40..44] int16_t *xmaxc, int16_t *Mc, int16_t xMc[13]) { int16_t x[40]; int16_t xM[13]; int16_t xMp[13]; int16_t mant; int16_t exp; weighting_filter(x, e); rpe_grid_selection(x, xM, Mc); apcm_quantization(xM, xMc, &mant, &exp, xmaxc); apcm_inverse_quantization(xMc, mant, exp, xMp); rpe_grid_positioning(*Mc, xMp, e); } /*- End of function --------------------------------------------------------*/ void gsm0610_rpe_decoding(gsm0610_state_t *s, int16_t xmaxc, int16_t Mcr, int16_t xMcr[13], int16_t erp[40]) { int16_t exp; int16_t mant; int16_t xMp[13]; apcm_quantization_xmaxc_to_exp_mant(xmaxc, &exp, &mant); apcm_inverse_quantization(xMcr, mant, exp, xMp); rpe_grid_positioning(Mcr, xMp, erp); } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/fsk.c0000664000175000017500000004603512343630276011644 00000000000000/* * SpanDSP - a series of DSP components for telephony * * fsk.c - FSK modem transmit and receive parts * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include "spandsp/telephony.h" #include "spandsp/complex.h" #include "spandsp/dds.h" #include "spandsp/power_meter.h" #include "spandsp/async.h" #include "spandsp/fsk.h" #include "spandsp/private/fsk.h" const fsk_spec_t preset_fsk_specs[] = { { "V21 ch 1", 1080 + 100, 1080 - 100, -14, -30, 300*100 }, { "V21 ch 2", 1750 + 100, 1750 - 100, -14, -30, 300*100 }, { "V23 ch 1", 2100, 1300, -14, -30, 1200*100 }, { "V23 ch 2", 450, 390, -14, -30, 75*100 }, { "Bell103 ch 1", 2125 - 100, 2125 + 100, -14, -30, 300*100 }, { "Bell103 ch 2", 1170 - 100, 1170 + 100, -14, -30, 300*100 }, { "Bell202", 2200, 1200, -14, -30, 1200*100 }, { "Weitbrecht 45.45", /* Used for US TDD (Telecoms Device for the Deaf) */ 1800, 1400, -14, -30, 4545 }, { "Weitbrecht 50", /* Used for international TDD (Telecoms Device for the Deaf) */ 1800, 1400, -14, -30, 50*100 }, { "V21 (110bps) ch 1", 1080 + 100, 1080 - 100, -14, -30, 110*100 } }; SPAN_DECLARE(int) fsk_tx_restart(fsk_tx_state_t *s, const fsk_spec_t *spec) { s->baud_rate = spec->baud_rate; s->phase_rates[0] = dds_phase_rate((float) spec->freq_zero); s->phase_rates[1] = dds_phase_rate((float) spec->freq_one); s->scaling = dds_scaling_dbm0((float) spec->tx_level); /* Initialise fractional sample baud generation. */ s->phase_acc = 0; s->baud_frac = 0; s->current_phase_rate = s->phase_rates[1]; s->shutdown = FALSE; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(fsk_tx_state_t *) fsk_tx_init(fsk_tx_state_t *s, const fsk_spec_t *spec, get_bit_func_t get_bit, void *user_data) { if (s == NULL) { if ((s = (fsk_tx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); s->get_bit = get_bit; s->get_bit_user_data = user_data; fsk_tx_restart(s, spec); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) fsk_tx_release(fsk_tx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) fsk_tx_free(fsk_tx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) fsk_tx(fsk_tx_state_t *s, int16_t amp[], int len) { int sample; int bit; if (s->shutdown) return 0; /* Make the transitions between 0 and 1 phase coherent, but instantaneous jumps. There is currently no interpolation for bauds that end mid-sample. Mainstream users will not care. Some specialist users might have a problem with them, if they care about accurate transition timing. */ for (sample = 0; sample < len; sample++) { if ((s->baud_frac += s->baud_rate) >= SAMPLE_RATE*100) { s->baud_frac -= SAMPLE_RATE*100; if ((bit = s->get_bit(s->get_bit_user_data)) == SIG_STATUS_END_OF_DATA) { if (s->status_handler) s->status_handler(s->status_user_data, SIG_STATUS_END_OF_DATA); if (s->status_handler) s->status_handler(s->status_user_data, SIG_STATUS_SHUTDOWN_COMPLETE); s->shutdown = TRUE; break; } s->current_phase_rate = s->phase_rates[bit & 1]; } amp[sample] = dds_mod(&s->phase_acc, s->current_phase_rate, s->scaling, 0); } return sample; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) fsk_tx_power(fsk_tx_state_t *s, float power) { s->scaling = dds_scaling_dbm0(power); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) fsk_tx_set_get_bit(fsk_tx_state_t *s, get_bit_func_t get_bit, void *user_data) { s->get_bit = get_bit; s->get_bit_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) fsk_tx_set_modem_status_handler(fsk_tx_state_t *s, modem_status_func_t handler, void *user_data) { s->status_handler = handler; s->status_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) fsk_rx_signal_cutoff(fsk_rx_state_t *s, float cutoff) { /* The 6.04 allows for the gain of the DC blocker */ s->carrier_on_power = (int32_t) (power_meter_level_dbm0(cutoff + 2.5f - 6.04f)); s->carrier_off_power = (int32_t) (power_meter_level_dbm0(cutoff - 2.5f - 6.04f)); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(float) fsk_rx_signal_power(fsk_rx_state_t *s) { return power_meter_current_dbm0(&s->power); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) fsk_rx_set_put_bit(fsk_rx_state_t *s, put_bit_func_t put_bit, void *user_data) { s->put_bit = put_bit; s->put_bit_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) fsk_rx_set_modem_status_handler(fsk_rx_state_t *s, modem_status_func_t handler, void *user_data) { s->status_handler = handler; s->status_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) fsk_rx_restart(fsk_rx_state_t *s, const fsk_spec_t *spec, int framing_mode) { int chop; s->baud_rate = spec->baud_rate; s->framing_mode = framing_mode; fsk_rx_signal_cutoff(s, (float) spec->min_level); /* Detect by correlating against the tones we want, over a period of one baud. The correlation must be quadrature. */ /* First we need the quadrature tone generators to correlate against. */ s->phase_rate[0] = dds_phase_rate((float) spec->freq_zero); s->phase_rate[1] = dds_phase_rate((float) spec->freq_one); s->phase_acc[0] = 0; s->phase_acc[1] = 0; s->last_sample = 0; /* The correlation should be over one baud. */ s->correlation_span = SAMPLE_RATE*100/spec->baud_rate; /* But limit it for very slow baud rates, so we do not overflow our buffer. */ if (s->correlation_span > FSK_MAX_WINDOW_LEN) s->correlation_span = FSK_MAX_WINDOW_LEN; /* We need to scale, to avoid overflow in the correlation. */ s->scaling_shift = 0; chop = s->correlation_span; while (chop != 0) { s->scaling_shift++; chop >>= 1; } /* Initialise the baud/bit rate tracking. */ s->baud_phase = 0; s->frame_state = 0; s->frame_bits = 0; s->last_bit = 0; /* Initialise a power detector, so sense when a signal is present. */ power_meter_init(&s->power, 4); s->signal_present = 0; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(fsk_rx_state_t *) fsk_rx_init(fsk_rx_state_t *s, const fsk_spec_t *spec, int framing_mode, put_bit_func_t put_bit, void *user_data) { if (s == NULL) { if ((s = (fsk_rx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); s->put_bit = put_bit; s->put_bit_user_data = user_data; fsk_rx_restart(s, spec, framing_mode); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) fsk_rx_release(fsk_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) fsk_rx_free(fsk_rx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ static void report_status_change(fsk_rx_state_t *s, int status) { if (s->status_handler) s->status_handler(s->status_user_data, status); else if (s->put_bit) s->put_bit(s->put_bit_user_data, status); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) fsk_rx(fsk_rx_state_t *s, const int16_t *amp, int len) { int buf_ptr; int baudstate; int i; int j; int16_t x; int32_t dot; int32_t sum[2]; int32_t power; complexi_t ph; buf_ptr = s->buf_ptr; for (i = 0; i < len; i++) { /* The *totally* asynchronous character to character behaviour of these modems, when carrying async. data, seems to force a sample by sample approach. */ for (j = 0; j < 2; j++) { s->dot[j].re -= s->window[j][buf_ptr].re; s->dot[j].im -= s->window[j][buf_ptr].im; ph = dds_complexi(&s->phase_acc[j], s->phase_rate[j]); s->window[j][buf_ptr].re = (ph.re*amp[i]) >> s->scaling_shift; s->window[j][buf_ptr].im = (ph.im*amp[i]) >> s->scaling_shift; s->dot[j].re += s->window[j][buf_ptr].re; s->dot[j].im += s->window[j][buf_ptr].im; dot = s->dot[j].re >> 15; sum[j] = dot*dot; dot = s->dot[j].im >> 15; sum[j] += dot*dot; } /* If there isn't much signal, don't demodulate - it will only produce useless junk results. */ /* There should be no DC in the signal, but sometimes there is. We need to measure the power with the DC blocked, but not using a slow to respond DC blocker. Use the most elementary HPF. */ x = amp[i] >> 1; power = power_meter_update(&s->power, x - s->last_sample); s->last_sample = x; if (s->signal_present) { /* Look for power below turn-off threshold to turn the carrier off */ if (power < s->carrier_off_power) { if (--s->signal_present <= 0) { /* Count down a short delay, to ensure we push the last few bits through the filters before stopping. */ report_status_change(s, SIG_STATUS_CARRIER_DOWN); s->baud_phase = 0; continue; } } } else { /* Look for power exceeding turn-on threshold to turn the carrier on */ if (power < s->carrier_on_power) { s->baud_phase = 0; continue; } if (s->baud_phase < (s->correlation_span >> 1) - 30) { s->baud_phase++; continue; } s->signal_present = 1; /* Initialise the baud/bit rate tracking. */ s->baud_phase = 0; s->frame_state = 0; s->frame_bits = 0; s->last_bit = 0; report_status_change(s, SIG_STATUS_CARRIER_UP); } /* Non-coherent FSK demodulation by correlation with the target tones over a one baud interval. The slow V.xx specs. are too open ended to allow anything fancier to be used. The dot products are calculated using a sliding window approach, so the compute load is not that great. */ baudstate = (sum[0] < sum[1]); switch (s->framing_mode) { case FSK_FRAME_MODE_SYNC: /* Synchronous serial operation - e.g. for HDLC */ if (s->last_bit != baudstate) { /* On a transition we check our timing */ s->last_bit = baudstate; /* For synchronous use (e.g. HDLC channels in FAX modems), nudge the baud phase gently, trying to keep it centred on the bauds. */ if (s->baud_phase < (SAMPLE_RATE*50)) s->baud_phase += (s->baud_rate >> 3); else s->baud_phase -= (s->baud_rate >> 3); } if ((s->baud_phase += s->baud_rate) >= (SAMPLE_RATE*100)) { /* We should be in the middle of a baud now, so report the current state as the next bit */ s->baud_phase -= (SAMPLE_RATE*100); s->put_bit(s->put_bit_user_data, baudstate); } break; case FSK_FRAME_MODE_ASYNC: /* Fully asynchronous mode */ if (s->last_bit != baudstate) { /* On a transition we check our timing */ s->last_bit = baudstate; /* For async. operation, believe transitions completely, and sample appropriately. This allows instant start on the first transition. */ /* We must now be about half way to a sampling point. We do not do any fractional sample estimation of the transitions, so this is the most accurate baud alignment we can do. */ s->baud_phase = SAMPLE_RATE*50; } if ((s->baud_phase += s->baud_rate) >= (SAMPLE_RATE*100)) { /* We should be in the middle of a baud now, so report the current state as the next bit */ s->baud_phase -= (SAMPLE_RATE*100); s->put_bit(s->put_bit_user_data, baudstate); } break; case FSK_FRAME_MODE_5N1_FRAMES: case FSK_FRAME_MODE_7N1_FRAMES: case FSK_FRAME_MODE_7E1_FRAMES: case FSK_FRAME_MODE_7E2_FRAMES: default: /* Gather the specified number of bits, with robust checking to ensure reasonable voice immunity. The first bit should be a start bit (0), and the last bit should be a stop bit (1) */ if (s->frame_state == 0) { /* Looking for the start of a zero bit, which hopefully the start of a start bit */ if (baudstate == 0) { s->baud_phase = SAMPLE_RATE*(100 - 40)/2; s->frame_state = -1; s->frame_bits = 0; s->last_bit = -1; } } else if (s->frame_state == -1) { /* Look for a continuous zero from the start of the start bit until beyond the middle */ if (baudstate != 0) { /* If we aren't looking at a stable start bit, restart */ s->frame_state = 0; } else { s->baud_phase += s->baud_rate; if (s->baud_phase >= SAMPLE_RATE*100) { s->frame_state = 1; s->last_bit = baudstate; } } } else { s->baud_phase += s->baud_rate; if (s->baud_phase >= SAMPLE_RATE*(100 - 40)) { if (s->last_bit < 0) s->last_bit = baudstate; /* Look for the bit being consistent over the central 20% of the bit time. */ if (s->last_bit != baudstate) { s->frame_state = 0; } else if (s->baud_phase >= SAMPLE_RATE*100) { /* We should be in the middle of a baud now, so report the current state as the next bit */ if (s->last_bit == baudstate) { if (++s->frame_state > s->framing_mode) { /* Check we have a stop bit and a start bit */ if (baudstate == 1 && (s->frame_bits & 0x02) == 0) { /* Drop the start bit, and pass the rest back */ s->put_bit(s->put_bit_user_data, s->frame_bits >> 2); } s->frame_state = 0; } else { s->frame_bits |= (baudstate << s->framing_mode); s->frame_bits >>= 1; } s->baud_phase -= (SAMPLE_RATE*100); } else { s->frame_state = 0; } s->last_bit = -1; } } } break; } if (++buf_ptr >= s->correlation_span) buf_ptr = 0; } s->buf_ptr = buf_ptr; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) fsk_rx_fillin(fsk_rx_state_t *s, int len) { /* The valid choice here is probably to do nothing. We don't change state (i.e carrier on<->carrier off), and we'll just output less bits than we should. */ /* TODO: Advance the symbol phase the appropriate amount */ return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/msvc/0000775000175000017500000000000012357123347011736 500000000000000spandsp-0.0.6/src/msvc/sys/0000775000175000017500000000000012357123347012554 500000000000000spandsp-0.0.6/src/msvc/sys/time.h0000664000175000017500000000061111151262015013564 00000000000000/* * SpanDSP - a series of DSP components for telephony * * sys/time.h - a fudge for MSVC, which lacks this header * * Written by Steve Underwood * * Copyright (C) 2006 Michael Jerris * * * This file is released in the public domain. * */ struct timeval { long int tv_sec; long int tv_usec; }; extern void gettimeofday(struct timeval *tv, void *tz); spandsp-0.0.6/src/msvc/unistd.h0000664000175000017500000000121711151262015013321 00000000000000/* * SpanDSP - a series of DSP components for telephony * * unistd.h - a fudge for MSVC, which lacks this header * * Written by Steve Underwood * * Copyright (C) 2006 Michael Jerris * * * This file is released in the public domain. * */ #if !defined(_UNISTD_H_) #define _UNISTD_H_ #ifdef __cplusplus extern "C" { #endif // Declare this so we don't have to include winsock.h, it causes numerous conflicts. extern int __stdcall gethostname(char * name, int namelen); #pragma comment(lib, "ws2_32.lib") extern int getopt(int argc, char *argv[], char *opstring); extern char *optarg; #ifdef __cplusplus } #endif #endif spandsp-0.0.6/src/msvc/inttypes.h0000664000175000017500000000260211372545130013700 00000000000000/* * SpanDSP - a series of DSP components for telephony * * inttypes.h - a fudge for MSVC, which lacks this header * * Written by Steve Underwood * * Copyright (C) 2006 Michael Jerris * * * This file is released in the public domain. * */ #if !defined(_INTTYPES_H_) #define _INTTYPES_H_ #ifdef __cplusplus extern "C" { #endif typedef __int8 __int8_t; typedef __int16 __int16_t; typedef __int32 __int32_t; typedef __int64 __int64_t; typedef unsigned __int8 uint8_t; typedef unsigned __int16 uint16_t; typedef unsigned __int32 uint32_t; typedef unsigned __int64 uint64_t; typedef __int8 int8_t; typedef __int16 int16_t; typedef __int32 int32_t; typedef __int64 int64_t; #if !defined(INFINITY) #define INFINITY 0x7FFFFFFF #endif #if !defined(UINT8_MAX) #define UINT8_MAX 0xFF #endif #if !defined(UINT16_MAX) #define UINT16_MAX 0xFFFF #endif #if !defined(INT16_MAX) #define INT16_MAX 0x7FFF #endif #if !defined(INT16_MIN) #define INT16_MIN (-INT16_MAX - 1) #endif #if !defined(INT32_MAX) #define INT32_MAX (2147483647) #endif #if !defined(INT32_MIN) #define INT32_MIN (-2147483647 - 1) #endif #define PRId8 "d" #define PRId16 "d" #define PRId32 "ld" #define PRId64 "lld" #define PRIu8 "u" #define PRIu16 "u" #define PRIu32 "lu" #define PRIu64 "llu" #ifdef __cplusplus } #endif #endif spandsp-0.0.6/src/msvc/vc8proj.foot0000664000175000017500000000146311151262015014131 00000000000000 spandsp-0.0.6/src/msvc/spandsp.h0000664000175000017500000001000312343640733013467 00000000000000/* * SpanDSP - a series of DSP components for telephony * * spandsp.h - The head guy amongst the headers * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_H_) #define _SPANDSP_H_ #define __inline__ __inline #pragma warning(disable:4200) #undef SPANDSP_USE_FIXED_POINT #undef SPANDSP_MISALIGNED_ACCESS_FAILS #define SPANDSP_USE_EXPORT_CAPABILITY 1 #include #include #include #include #include #include @INSERT_STDBOOL_HEADER@ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /*#include */ #include #include #include /*#include */ #include #include #include #include #include #include #include /*#include */ /*#include */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #endif #if defined(SPANDSP_EXPOSE_INTERNAL_STRUCTURES) #include #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/msvc/Download_TIFF.2005.vcproj0000664000175000017500000000244211262423504016041 00000000000000 spandsp-0.0.6/src/msvc/config.h0000664000175000017500000000433511422612263013271 00000000000000/* * SpanDSP - a series of DSP components for telephony * * config.h - a fudge for MSVC, which lacks this header * * Written by Steve Underwood * * Copyright (C) 2006 Michael Jerris * * * This file is released in the public domain. */ #if !defined(_MSVC_CONFIG_H_) #define _MSVC_CONFIG_H_ #define HAVE_SINF #define HAVE_COSF #define HAVE_TANF #define HAVE_ASINF #define HAVE_ACOSF #define HAVE_ATANF #define HAVE_ATAN2F #define HAVE_CEILF #define HAVE_FLOORF #define HAVE_POWF #define HAVE_EXPF #define HAVE_LOGF #define HAVE_LOG10F #define HAVE_MATH_H #define HAVE_TGMATH_H #define HAVE_LONG_DOUBLE #define HAVE_LIBTIFF #define SPANDSP_USE_EXPORT_CAPABILITY 1 #define PACKAGE "spandsp" #define VERSION "0.0.6" /* Win32/DevStudio compatibility stuff */ #ifdef _MSC_VER #if (_MSC_VER >= 1400) // VC8+ #ifndef _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE #endif #ifndef _CRT_NONSTDC_NO_DEPRECATE #define _CRT_NONSTDC_NO_DEPRECATE #endif #ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS #endif #endif // VC8+ // disable the following warnings #pragma warning(disable:4100) // The formal parameter is not referenced in the body of the function. The unreferenced parameter is ignored. #pragma warning(disable:4200) // Non standard extension C zero sized array #pragma warning(disable:4706) // assignment within conditional expression #pragma warning(disable:4244) // conversion from 'type1' to 'type2', possible loss of data #pragma warning(disable:4295) // array is too small to include a terminating null character #pragma warning(disable:4125) // decimal digit terminates octal escape sequence #pragma warning(disable:4305) // 'function' : truncation from 'double' to 'float' #pragma warning(disable:4018) // '<' : signed/unsigned mismatch #pragma warning(disable:4389) // '==' : signed/unsigned mismatch #pragma warning(disable:4245) // 'return' : conversion from 'int' to 'size_t', signed/unsigned mismatch #define strncasecmp _strnicmp #define strcasecmp _stricmp #define snprintf _snprintf #define inline __inline #define __inline__ __inline #define _MMX_H_ #include // To get alloca #endif #endif spandsp-0.0.6/src/msvc/getopt.c0000664000175000017500000002037511144333311013316 00000000000000/***************************************************************************** * * MODULE NAME : GETOPT.C * * COPYRIGHTS: * This module contains code made available by IBM * Corporation on an AS IS basis. Any one receiving the * module is considered to be licensed under IBM copyrights * to use the IBM-provided source code in any way he or she * deems fit, including copying it, compiling it, modifying * it, and redistributing it, with or without * modifications. No license under any IBM patents or * patent applications is to be implied from this copyright * license. * * A user of the module should understand that IBM cannot * provide technical support for the module and will not be * responsible for any consequences of use of the program. * * Any notices, including this one, are not to be removed * from the module without the prior written consent of * IBM. * * AUTHOR: Original author: * G. R. Blair (BOBBLAIR at AUSVM1) * Internet: bobblair@bobblair.austin.ibm.com * * Extensively revised by: * John Q. Walker II, Ph.D. (JOHHQ at RALVM6) * Internet: johnq@ralvm6.vnet.ibm.com * *****************************************************************************/ /****************************************************************************** * getopt() * * The getopt() function is a command line parser. It returns the next * option character in argv that matches an option character in opstring. * * The argv argument points to an array of argc+1 elements containing argc * pointers to character strings followed by a null pointer. * * The opstring argument points to a string of option characters; if an * option character is followed by a colon, the option is expected to have * an argument that may or may not be separated from it by white space. * The external variable optarg is set to point to the start of the option * argument on return from getopt(). * * The getopt() function places in optind the argv index of the next argument * to be processed. The system initializes the external variable optind to * 1 before the first call to getopt(). * * When all options have been processed (that is, up to the first nonoption * argument), getopt() returns EOF. The special option "--" may be used to * delimit the end of the options; EOF will be returned, and "--" will be * skipped. * * The getopt() function returns a question mark (?) when it encounters an * option character not included in opstring. This error message can be * disabled by setting opterr to zero. Otherwise, it returns the option * character that was detected. * * If the special option "--" is detected, or all options have been * processed, EOF is returned. * * Options are marked by either a minus sign (-) or a slash (/). * * No errors are defined. *****************************************************************************/ #include /* for EOF */ #include /* for strchr() */ /* static (global) variables that are specified as exported by getopt() */ char *optarg = NULL; /* pointer to the start of the option argument */ int optind = 1; /* number of the next argv[] to be evaluated */ int opterr = 1; /* non-zero if a question mark should be returned when a non-valid option character is detected */ /* handle possible future character set concerns by putting this in a macro */ #define _next_char(string) (char)(*(string+1)) int getopt(int argc, char *argv[], char *opstring) { static char *pIndexPosition = NULL; /* place inside current argv string */ char *pArgString = NULL; /* where to start from next */ char *pOptString; /* the string in our program */ if (pIndexPosition != NULL) { /* we last left off inside an argv string */ if (*(++pIndexPosition)) { /* there is more to come in the most recent argv */ pArgString = pIndexPosition; } } if (pArgString == NULL) { /* we didn't leave off in the middle of an argv string */ if (optind >= argc) { /* more command-line arguments than the argument count */ pIndexPosition = NULL; /* not in the middle of anything */ return EOF; /* used up all command-line arguments */ } /*--------------------------------------------------------------------- * If the next argv[] is not an option, there can be no more options. *-------------------------------------------------------------------*/ pArgString = argv[optind++]; /* set this to the next argument ptr */ if (('/' != *pArgString) && /* doesn't start with a slash or a dash? */ ('-' != *pArgString)) { --optind; /* point to current arg once we're done */ optarg = NULL; /* no argument follows the option */ pIndexPosition = NULL; /* not in the middle of anything */ return EOF; /* used up all the command-line flags */ } /* check for special end-of-flags markers */ if ((strcmp(pArgString, "-") == 0) || (strcmp(pArgString, "--") == 0)) { optarg = NULL; /* no argument follows the option */ pIndexPosition = NULL; /* not in the middle of anything */ return EOF; /* encountered the special flag */ } pArgString++; /* look past the / or - */ } if (':' == *pArgString) { /* is it a colon? */ /*--------------------------------------------------------------------- * Rare case: if opterr is non-zero, return a question mark; * otherwise, just return the colon we're on. *-------------------------------------------------------------------*/ return (opterr ? (int)'?' : (int)':'); } else if ((pOptString = strchr(opstring, *pArgString)) == 0) { /*--------------------------------------------------------------------- * The letter on the command-line wasn't any good. *-------------------------------------------------------------------*/ optarg = NULL; /* no argument follows the option */ pIndexPosition = NULL; /* not in the middle of anything */ return (opterr ? (int)'?' : (int)*pArgString); } else { /*--------------------------------------------------------------------- * The letter on the command-line matches one we expect to see *-------------------------------------------------------------------*/ if (':' == _next_char(pOptString)) { /* is the next letter a colon? */ /* It is a colon. Look for an argument string. */ if ('\0' != _next_char(pArgString)) { /* argument in this argv? */ optarg = &pArgString[1]; /* Yes, it is */ } else { /*------------------------------------------------------------- * The argument string must be in the next argv. * But, what if there is none (bad input from the user)? * In that case, return the letter, and optarg as NULL. *-----------------------------------------------------------*/ if (optind < argc) optarg = argv[optind++]; else { optarg = NULL; return (opterr ? (int)'?' : (int)*pArgString); } } pIndexPosition = NULL; /* not in the middle of anything */ } else { /* it's not a colon, so just return the letter */ optarg = NULL; /* no argument follows the option */ pIndexPosition = pArgString; /* point to the letter we're on */ } return (int)*pArgString; /* return the letter that matched */ } } spandsp-0.0.6/src/msvc/msvcproj.head0000664000175000017500000000717211141012442014332 00000000000000# Microsoft Developer Studio Project File - Name="spandsp" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 CFG=spandsp - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE !MESSAGE NMAKE /f "spandsp.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE !MESSAGE NMAKE /f "spandsp.mak" CFG="spandsp - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE !MESSAGE "spandsp - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE "spandsp - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") !MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 # PROP Scc_ProjName "" # PROP Scc_LocalPath "" CPP=cl.exe MTL=midl.exe RSC=rc.exe !IF "$(CFG)" == "spandsp - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 # PROP BASE Output_Dir "Release" # PROP BASE Intermediate_Dir "Release" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 0 # PROP Output_Dir "Release" # PROP Intermediate_Dir "Release" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D HAVE_TGMATH_H /YX /FD /c # ADD CPP /nologo /MT /W3 /GX /Zi /O2 /I "." /I "..\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D HAVE_TGMATH_H /D "_WINDLL" /FR /FD /c # SUBTRACT CPP /YX # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 # ADD LINK32 kernel32.lib ws2_32.lib winmm.lib /nologo /dll /map /debug /machine:I386 /out:"Release/libspandsp.dll" !ELSEIF "$(CFG)" == "spandsp - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 # PROP BASE Output_Dir "Debug" # PROP BASE Intermediate_Dir "Debug" # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 # PROP Output_Dir "Debug" # PROP Intermediate_Dir "Debug" # PROP Ignore_Export_Lib 0 # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D HAVE_TGMATH_H /YX /FD /GZ /c # ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "." /I "..\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D HAVE_TGMATH_H /FR /FD /GZ /c # SUBTRACT CPP /WX /YX # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG" BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib ws2_32.lib winmm.lib /nologo /dll /incremental:no /map /debug /machine:I386 /out:"Debug/libspandsp.dll" /pdbtype:sept # SUBTRACT LINK32 /nodefaultlib !ENDIF # Begin Target # Name "spandsp - Win32 Release" # Name "spandsp - Win32 Debug" spandsp-0.0.6/src/msvc/util.vbs0000664000175000017500000001364011262423504013343 00000000000000' ' Contributor(s): ' Michael Jerris ' David A. Horner http://dave.thehorners.com '---------------------------------------------- 'On Error Resume Next ' ************** ' Initialization ' ************** Set WshShell = CreateObject("WScript.Shell") Set FSO = CreateObject("Scripting.FileSystemObject") Set WshSysEnv = WshShell.Environment("SYSTEM") Set xml = CreateObject("Microsoft.XMLHTTP") Dim UseWgetEXE On Error Resume Next Set oStream = CreateObject("Adodb.Stream") On Error Goto 0 If Not IsObject(oStream) Then wscript.echo("Failed to create Adodb.Stream, using alternative download method.") UseWgetEXE=true Else UseWgetEXE=false End If Randomize Set objArgs = WScript.Arguments quote=Chr(34) ScriptDir=Left(WScript.ScriptFullName,Len(WScript.ScriptFullName)-Len(WScript.ScriptName)) UtilsDir=Showpath(ScriptDir) ToolsBase="http://files.freeswitch.org/downloads/win32/" If UseWgetEXE Then GetWgetEXE UtilsDir End If GetCompressionTools UtilsDir If objArgs.Count >=3 Then Select Case objArgs(0) Case "Get" Wget objArgs(1), Showpath(objArgs(2)) Case "GetUnzip" WgetUnCompress objArgs(1), Showpath(objArgs(2)) End Select End If ' ******************* ' Utility Subroutines ' ******************* Sub WgetUnCompress(URL, DestFolder) If Right(DestFolder, 1) <> "\" Then DestFolder = DestFolder & "\" End If StartPos = InstrRev(URL, "/", -1, 1) strlength = Len(URL) filename=Right(URL,strlength-StartPos) NameEnd = InstrRev(filename, ".",-1, 1) filestrlength = Len(filename) filebase = Left(filename,NameEnd) fileext = Right(filename, Len(filename) - NameEnd) Wget URL, DestFolder If fileext = "zip" Then UnCompress Destfolder & filename, DestFolder & filebase Else UnCompress Destfolder & filename, DestFolder End If End Sub Sub GetCompressionTools(DestFolder) Dim oExec If Right(DestFolder, 1) <> "\" Then DestFolder = DestFolder & "\" End If If Not FSO.FileExists(DestFolder & "7za.exe") Then If Not FSO.FileExists(DestFolder & "7za.tag") Then Set MyFile = fso.CreateTextFile(DestFolder & "7za.tag", True) MyFile.WriteLine("This file marks a pending download for 7za.exe so we don't download it twice at the same time") MyFile.Close Wget ToolsBase & "7za.exe", DestFolder FSO.DeleteFile DestFolder & "7za.tag" ,true Else WScript.Sleep(5000) End If End If End Sub Sub GetWgetEXE(DestFolder) Dim oExec If Right(DestFolder, 1) <> "\" Then DestFolder = DestFolder & "\" End If If Not FSO.FileExists(DestFolder & "wget.exe") Then Slow_Wget ToolsBase & "wget.exe", DestFolder End If End Sub Sub UnCompress(Archive, DestFolder) batname = "tmp" & CStr(Int(10000*Rnd)) & ".bat" wscript.echo("Extracting: " & Archive) Set MyFile = fso.CreateTextFile(UtilsDir & batname, True) MyFile.WriteLine("@" & quote & UtilsDir & "7za.exe" & quote & " x " & quote & Archive & quote & " -y -o" & quote & DestFolder & quote ) MyFile.Close Set oExec = WshShell.Exec(UtilsDir & batname) Do WScript.Echo OExec.StdOut.ReadLine() Loop While Not OExec.StdOut.atEndOfStream If FSO.FileExists(Left(Archive, Len(Archive)-3))Then Set MyFile = fso.CreateTextFile(UtilsDir & batname, True) MyFile.WriteLine("@" & quote & UtilsDir & "7za.exe" & quote & " x " & quote & Left(Archive, Len(Archive)-3) & quote & " -y -o" & quote & DestFolder & quote ) MyFile.Close Set oExec = WshShell.Exec(UtilsDir & batname) Do WScript.Echo OExec.StdOut.ReadLine() Loop While Not OExec.StdOut.atEndOfStream WScript.Sleep(500) FSO.DeleteFile Left(Archive, Len(Archive)-3) ,true End If If FSO.FileExists(Left(Archive, Len(Archive)-3) & "tar")Then Set MyFile = fso.CreateTextFile(UtilsDir & batname, True) MyFile.WriteLine("@" & quote & UtilsDir & "7za.exe" & quote & " x " & quote & Left(Archive, Len(Archive)-3) & "tar" & quote & " -y -o" & quote & DestFolder & quote ) MyFile.Close Set oExec = WshShell.Exec(UtilsDir & batname) Do WScript.Echo OExec.StdOut.ReadLine() Loop While Not OExec.StdOut.atEndOfStream WScript.Sleep(500) FSO.DeleteFile Left(Archive, Len(Archive)-3) & "tar",true End If WScript.Sleep(500) If FSO.FileExists(UtilsDir & batname)Then FSO.DeleteFile UtilsDir & batname, True End If End Sub Sub Wget(URL, DestFolder) StartPos = InstrRev(URL, "/", -1, 1) strlength = Len(URL) filename=Right(URL,strlength-StartPos) If Right(DestFolder, 1) <> "\" Then DestFolder = DestFolder & "\" End If Wscript.echo("Downloading: " & URL) If UseWgetEXE Then batname = "tmp" & CStr(Int(10000*Rnd)) & ".bat" Set MyFile = fso.CreateTextFile(UtilsDir & batname, True) MyFile.WriteLine("@cd " & quote & DestFolder & quote) MyFile.WriteLine("@" & quote & UtilsDir & "wget.exe" & quote & " " & URL) MyFile.Close Set oExec = WshShell.Exec(UtilsDir & batname) Do WScript.Echo OExec.StdOut.ReadLine() Loop While Not OExec.StdOut.atEndOfStream Else xml.Open "GET", URL, False xml.Send Const adTypeBinary = 1 Const adSaveCreateOverWrite = 2 Const adSaveCreateNotExist = 1 oStream.type = adTypeBinary oStream.open oStream.write xml.responseBody oStream.savetofile DestFolder & filename, adSaveCreateOverWrite oStream.close End If End Sub Sub Slow_Wget(URL, DestFolder) StartPos = InstrRev(URL, "/", -1, 1) strlength = Len(URL) filename=Right(URL,strlength-StartPos) If Right(DestFolder, 1) <> "\" Then DestFolder = DestFolder & "\" End If Wscript.echo("Downloading: " & URL) xml.Open "GET", URL, False xml.Send const ForReading = 1 , ForWriting = 2 , ForAppending = 8 Set MyFile = fso.OpenTextFile(DestFolder & filename ,ForWriting, True) For i = 1 to lenb(xml.responseBody) MyFile.write Chr(Ascb(midb(xml.responseBody,i,1))) Next MyFile.Close() End Sub Function Showpath(folderspec) Set f = FSO.GetFolder(folderspec) showpath = f.path & "\" End Function spandsp-0.0.6/src/msvc/make_at_dictionary.2008.vcproj0000664000175000017500000000463611151262015017315 00000000000000 spandsp-0.0.6/src/msvc/tiff/0000775000175000017500000000000012357123347012666 500000000000000spandsp-0.0.6/src/msvc/tiff/cleancount0000664000175000017500000000000111147701302014640 000000000000001spandsp-0.0.6/src/msvc/vc8proj.head0000664000175000017500000000537011151262015014064 00000000000000 spandsp-0.0.6/src/msvc/vc9proj.foot0000664000175000017500000000273311151262015014133 00000000000000 spandsp-0.0.6/src/msvc/make_at_dictionary.2005.vcproj0000664000175000017500000000467111151262015017311 00000000000000 spandsp-0.0.6/src/msvc/make_modem_filter.2008.vcproj0000664000175000017500000001215411211236550017126 00000000000000 spandsp-0.0.6/src/msvc/tgmath.h0000664000175000017500000000101211032712472013275 00000000000000/* * SpanDSP - a series of DSP components for telephony * * tgmath.h - a fudge for MSVC, which lacks this header * * Written by Steve Underwood * * Copyright (C) 2006 Michael Jerris * * * This file is released in the public domain. * */ #if !defined(_TGMATH_H_) #define _TGMATH_H_ #include #if !defined(M_PI) /* C99 systems may not define M_PI */ #define M_PI 3.14159265358979323846264338327 #endif #ifdef __cplusplus extern "C" { #endif #ifdef __cplusplus } #endif #endif spandsp-0.0.6/src/msvc/Download_TIFF.2008.vcproj0000664000175000017500000000244211262423504016044 00000000000000 spandsp-0.0.6/src/msvc/vc9proj.head0000664000175000017500000001206111211000540014046 00000000000000 spandsp-0.0.6/src/msvc/msvcproj.foot0000664000175000017500000000023011141012442014364 00000000000000 # Begin Group "Resource Files" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # End Group # End Target # End Project spandsp-0.0.6/src/msvc/gettimeofday.c0000664000175000017500000000036010402512210014456 00000000000000#ifdef _MSC_VER #pragma warning(disable:4100) #endif #include "windows.h" void gettimeofday(struct timeval *tv, void *tz) { long int l = GetTickCount(); tv->tv_sec = l / 1000; tv->tv_usec = (l % 1000) * 1000; return; } spandsp-0.0.6/src/msvc/make_modem_filter.2005.vcproj0000664000175000017500000001217311220272236017125 00000000000000 spandsp-0.0.6/src/silence_gen.c0000664000175000017500000001162212101035326013311 00000000000000/* * SpanDSP - a series of DSP components for telephony * * silence_gen.c - A silence generator, for inserting timed silences. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include "spandsp/telephony.h" #include "spandsp/logging.h" #include "spandsp/async.h" #include "spandsp/silence_gen.h" #include "spandsp/private/silence_gen.h" SPAN_DECLARE_NONSTD(int) silence_gen(silence_gen_state_t *s, int16_t *amp, int max_len) { if (s->remaining_samples != INT_MAX) { if (max_len >= s->remaining_samples) { max_len = s->remaining_samples; if (max_len && s->status_handler) s->status_handler(s->status_user_data, SIG_STATUS_SHUTDOWN_COMPLETE); } s->remaining_samples -= max_len; } if (INT_MAX - s->total_samples >= max_len) s->total_samples += max_len; memset(amp, 0, max_len*sizeof(int16_t)); return max_len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) silence_gen_always(silence_gen_state_t *s) { s->remaining_samples = INT_MAX; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) silence_gen_set(silence_gen_state_t *s, int silent_samples) { s->remaining_samples = silent_samples; s->total_samples = 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) silence_gen_alter(silence_gen_state_t *s, int silent_samples) { /* Block negative silences */ if (silent_samples < 0) { if (-silent_samples > s->remaining_samples) silent_samples = -s->remaining_samples; } s->remaining_samples += silent_samples; s->total_samples += silent_samples; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) silence_gen_remainder(silence_gen_state_t *s) { return s->remaining_samples; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) silence_gen_generated(silence_gen_state_t *s) { return s->total_samples; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) silence_gen_status_handler(silence_gen_state_t *s, modem_status_func_t handler, void *user_data) { s->status_handler = handler; s->status_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(silence_gen_state_t *) silence_gen_init(silence_gen_state_t *s, int silent_samples) { if (s == NULL) { if ((s = (silence_gen_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); s->remaining_samples = silent_samples; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) silence_gen_release(silence_gen_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) silence_gen_free(silence_gen_state_t *s) { if (s) free(s); return 0; } /*- End of function --------------------------------------------------------*/ /* The following dummy routines, to absorb data, don't really have a proper home, so they have been put here. */ SPAN_DECLARE_NONSTD(int) span_dummy_rx(void *user_data, const int16_t amp[], int len) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) span_dummy_mod(void *user_data, int16_t amp[], int len) { return len; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) span_dummy_rx_fillin(void *user_data, int len) { return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/hdlc.c0000664000175000017500000005264712345731124011775 00000000000000/* * SpanDSP - a series of DSP components for telephony * * hdlc.c * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_STDBOOL_H) #include #else #include "spandsp/stdbool.h" #endif #include "spandsp/telephony.h" #include "spandsp/async.h" #include "spandsp/crc.h" #include "spandsp/bit_operations.h" #include "spandsp/hdlc.h" #include "spandsp/private/hdlc.h" static void report_status_change(hdlc_rx_state_t *s, int status) { if (s->status_handler) s->status_handler(s->status_user_data, status); else if (s->frame_handler) s->frame_handler(s->frame_user_data, NULL, status, true); } /*- End of function --------------------------------------------------------*/ static void rx_special_condition(hdlc_rx_state_t *s, int status) { /* Special conditions */ switch (status) { case SIG_STATUS_CARRIER_UP: case SIG_STATUS_TRAINING_SUCCEEDED: /* Reset the HDLC receiver. */ s->raw_bit_stream = 0; s->len = 0; s->num_bits = 0; s->flags_seen = 0; s->framing_ok_announced = false; /* Fall through */ case SIG_STATUS_TRAINING_IN_PROGRESS: case SIG_STATUS_TRAINING_FAILED: case SIG_STATUS_CARRIER_DOWN: case SIG_STATUS_END_OF_DATA: report_status_change(s, status); break; default: //printf("Eh!\n"); break; } } /*- End of function --------------------------------------------------------*/ static __inline__ void octet_set_and_count(hdlc_rx_state_t *s) { if (s->octet_count_report_interval == 0) return; /* If we are not in octet counting mode, we start it. If we are in octet counting mode, we update it. */ if (s->octet_counting_mode) { if (--s->octet_count <= 0) { s->octet_count = s->octet_count_report_interval; report_status_change(s, SIG_STATUS_OCTET_REPORT); } } else { s->octet_counting_mode = true; s->octet_count = s->octet_count_report_interval; } } /*- End of function --------------------------------------------------------*/ static __inline__ void octet_count(hdlc_rx_state_t *s) { if (s->octet_count_report_interval == 0) return; /* If we are not in octet counting mode, we start it. If we are in octet counting mode, we update it. */ if (s->octet_counting_mode) { if (--s->octet_count <= 0) { s->octet_count = s->octet_count_report_interval; report_status_change(s, SIG_STATUS_OCTET_REPORT); } } } /*- End of function --------------------------------------------------------*/ static void rx_flag_or_abort(hdlc_rx_state_t *s) { if ((s->raw_bit_stream & 0x8000)) { /* Hit HDLC abort */ s->rx_aborts++; report_status_change(s, SIG_STATUS_ABORT); /* If we have not yet seen enough flags, restart the count. If we are beyond that point, just back off one step, so we need to see another flag before proceeding to collect frame octets. */ if (s->flags_seen < s->framing_ok_threshold - 1) s->flags_seen = 0; else s->flags_seen = s->framing_ok_threshold - 1; /* An abort starts octet counting */ octet_set_and_count(s); } else { /* Hit HDLC flag */ /* A flag clears octet counting */ s->octet_counting_mode = false; if (s->flags_seen >= s->framing_ok_threshold) { /* We may have a frame, or we may have back to back flags */ if (s->len) { if (s->num_bits == 7 && s->len >= (size_t) s->crc_bytes && s->len <= s->max_frame_len) { if ((s->crc_bytes == 2 && crc_itu16_check(s->buffer, s->len)) || (s->crc_bytes != 2 && crc_itu32_check(s->buffer, s->len))) { s->rx_frames++; s->rx_bytes += s->len - s->crc_bytes; s->len -= s->crc_bytes; if (s->frame_handler) s->frame_handler(s->frame_user_data, s->buffer, s->len, true); } else { s->rx_crc_errors++; if (s->report_bad_frames) { s->len -= s->crc_bytes; if (s->frame_handler) s->frame_handler(s->frame_user_data, s->buffer, s->len, false); } } } else { /* Frame too short or too long, or the flag is misaligned with its octets. */ if (s->report_bad_frames) { /* Don't let the length go below zero, or it will be confused with one of the special conditions. */ if (s->len >= (size_t) s->crc_bytes) s->len -= s->crc_bytes; else s->len = 0; if (s->frame_handler) s->frame_handler(s->frame_user_data, s->buffer, s->len, false); } s->rx_length_errors++; } } } else { /* Check the flags are back-to-back when testing for valid preamble. This greatly reduces the chances of false preamble detection, and anything which doesn't send them back-to-back is badly broken. */ if (s->num_bits != 7) { /* Don't set the flags seen indicator back to zero too aggressively. We want to pick up with the minimum of discarded data when there is a bit error in the stream, and a bit error could emulate a misaligned flag. */ if (s->flags_seen < s->framing_ok_threshold - 1) s->flags_seen = 0; else s->flags_seen = s->framing_ok_threshold - 1; } if (++s->flags_seen >= s->framing_ok_threshold && !s->framing_ok_announced) { report_status_change(s, SIG_STATUS_FRAMING_OK); s->framing_ok_announced = true; } } } s->len = 0; s->num_bits = 0; } /*- End of function --------------------------------------------------------*/ static __inline__ void hdlc_rx_put_bit_core(hdlc_rx_state_t *s) { if ((s->raw_bit_stream & 0x3F00) == 0x3E00) { /* Its time to either skip a bit, for stuffing, or process a flag or abort */ if ((s->raw_bit_stream & 0x4000)) rx_flag_or_abort(s); return; } s->num_bits++; if (s->flags_seen < s->framing_ok_threshold) { if ((s->num_bits & 0x7) == 0) octet_count(s); return; } s->byte_in_progress = (s->byte_in_progress | (s->raw_bit_stream & 0x100)) >> 1; if (s->num_bits == 8) { /* Ensure we do not accept an overlength frame, and especially that we do not overflow our buffer */ if (s->len < s->max_frame_len) { s->buffer[s->len++] = (uint8_t) s->byte_in_progress; } else { /* This is too long. Abandon the frame, and wait for the next flag octet. */ s->len = sizeof(s->buffer) + 1; s->flags_seen = s->framing_ok_threshold - 1; octet_set_and_count(s); } s->num_bits = 0; } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(void) hdlc_rx_put_bit(hdlc_rx_state_t *s, int new_bit) { if (new_bit < 0) { rx_special_condition(s, new_bit); return; } s->raw_bit_stream = (s->raw_bit_stream << 1) | ((new_bit << 8) & 0x100); hdlc_rx_put_bit_core(s); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(void) hdlc_rx_put_byte(hdlc_rx_state_t *s, int new_byte) { int i; if (new_byte < 0) { rx_special_condition(s, new_byte); return; } s->raw_bit_stream |= new_byte; for (i = 0; i < 8; i++) { s->raw_bit_stream <<= 1; hdlc_rx_put_bit_core(s); } } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(void) hdlc_rx_put(hdlc_rx_state_t *s, const uint8_t buf[], int len) { int i; for (i = 0; i < len; i++) hdlc_rx_put_byte(s, buf[i]); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) hdlc_rx_set_max_frame_len(hdlc_rx_state_t *s, size_t max_len) { max_len += s->crc_bytes; s->max_frame_len = (max_len <= sizeof(s->buffer)) ? max_len : sizeof(s->buffer); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) hdlc_rx_set_octet_counting_report_interval(hdlc_rx_state_t *s, int interval) { s->octet_count_report_interval = interval; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) hdlc_rx_restart(hdlc_rx_state_t *s) { s->framing_ok_announced = false; s->flags_seen = 0; s->raw_bit_stream = 0; s->byte_in_progress = 0; s->num_bits = 0; s->octet_counting_mode = false; s->octet_count = 0; s->len = 0; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(hdlc_rx_state_t *) hdlc_rx_init(hdlc_rx_state_t *s, int crc32, int report_bad_frames, int framing_ok_threshold, hdlc_frame_handler_t handler, void *user_data) { if (s == NULL) { if ((s = (hdlc_rx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); s->frame_handler = handler; s->frame_user_data = user_data; s->crc_bytes = (crc32) ? 4 : 2; s->report_bad_frames = report_bad_frames; s->framing_ok_threshold = (framing_ok_threshold < 1) ? 1 : framing_ok_threshold; s->max_frame_len = sizeof(s->buffer); return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) hdlc_rx_set_frame_handler(hdlc_rx_state_t *s, hdlc_frame_handler_t handler, void *user_data) { s->frame_handler = handler; s->frame_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) hdlc_rx_set_status_handler(hdlc_rx_state_t *s, modem_status_func_t handler, void *user_data) { s->status_handler = handler; s->status_user_data = user_data; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) hdlc_rx_release(hdlc_rx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) hdlc_rx_free(hdlc_rx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) hdlc_rx_get_stats(hdlc_rx_state_t *s, hdlc_rx_stats_t *t) { t->bytes = s->rx_bytes; t->good_frames = s->rx_frames; t->crc_errors = s->rx_crc_errors; t->length_errors = s->rx_length_errors; t->aborts = s->rx_aborts; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) hdlc_tx_frame(hdlc_tx_state_t *s, const uint8_t *frame, size_t len) { if (len == 0) { s->tx_end = true; return 0; } if (s->len + len > s->max_frame_len) return -1; if (s->progressive) { /* Only lock out if we are in the CRC section. */ if (s->pos >= HDLC_MAXFRAME_LEN) return -1; } else { /* Lock out if there is anything in the buffer. */ if (s->len) return -1; } memcpy(&s->buffer[s->len], frame, len); if (s->crc_bytes == 2) s->crc = crc_itu16_calc(frame, len, (uint16_t) s->crc); else s->crc = crc_itu32_calc(frame, len, s->crc); if (s->progressive) s->len += len; else s->len = len; s->tx_end = false; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) hdlc_tx_flags(hdlc_tx_state_t *s, int len) { /* Some HDLC applications require the ability to force a period of HDLC flag words. */ if (s->pos) return -1; if (len < 0) s->flag_octets += -len; else s->flag_octets = len; s->report_flag_underflow = true; s->tx_end = false; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) hdlc_tx_abort(hdlc_tx_state_t *s) { /* TODO: This is a really crude way of just fudging an abort out for simple test purposes. */ s->flag_octets++; s->abort_octets++; return -1; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) hdlc_tx_corrupt_frame(hdlc_tx_state_t *s) { if (s->len <= 0) return -1; s->crc ^= 0xFFFF; s->buffer[HDLC_MAXFRAME_LEN] ^= 0xFF; s->buffer[HDLC_MAXFRAME_LEN + 1] ^= 0xFF; s->buffer[HDLC_MAXFRAME_LEN + 2] ^= 0xFF; s->buffer[HDLC_MAXFRAME_LEN + 3] ^= 0xFF; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) hdlc_tx_get_byte(hdlc_tx_state_t *s) { int i; int byte_in_progress; int txbyte; if (s->flag_octets > 0) { /* We are in a timed flag section (preamble, inter frame gap, etc.) */ if (--s->flag_octets <= 0 && s->report_flag_underflow) { s->report_flag_underflow = false; if (s->len == 0) { /* The timed flags have finished, there is nothing else queued to go, and we have been told to report this underflow. */ if (s->underflow_handler) s->underflow_handler(s->user_data); } } if (s->abort_octets) { s->abort_octets = 0; return 0x7F; } return s->idle_octet; } if (s->len) { if (s->num_bits >= 8) { s->num_bits -= 8; return (s->octets_in_progress >> s->num_bits) & 0xFF; } if (s->pos >= s->len) { if (s->pos == s->len) { s->crc ^= 0xFFFFFFFF; s->buffer[HDLC_MAXFRAME_LEN] = (uint8_t) s->crc; s->buffer[HDLC_MAXFRAME_LEN + 1] = (uint8_t) (s->crc >> 8); if (s->crc_bytes == 4) { s->buffer[HDLC_MAXFRAME_LEN + 2] = (uint8_t) (s->crc >> 16); s->buffer[HDLC_MAXFRAME_LEN + 3] = (uint8_t) (s->crc >> 24); } s->pos = HDLC_MAXFRAME_LEN; } else if (s->pos == (size_t) (HDLC_MAXFRAME_LEN + s->crc_bytes)) { /* Finish off the current byte with some flag bits. If we are at the start of a byte we need a at least one whole byte of flag to ensure we cannot end up with back to back frames, and no flag octet at all */ txbyte = (uint8_t) ((s->octets_in_progress << (8 - s->num_bits)) | (0x7E >> s->num_bits)); /* Create a rotated octet of flag for idling... */ s->idle_octet = (0x7E7E >> s->num_bits) & 0xFF; /* ...and the partial flag octet needed to start off the next message. */ s->octets_in_progress = s->idle_octet >> (8 - s->num_bits); s->flag_octets = s->inter_frame_flags - 1; s->len = 0; s->pos = 0; if (s->crc_bytes == 2) s->crc = 0xFFFF; else s->crc = 0xFFFFFFFF; /* Report the underflow now. If there are timed flags still in progress, loading the next frame right now will be harmless. */ s->report_flag_underflow = false; if (s->underflow_handler) s->underflow_handler(s->user_data); /* Make sure we finish off with at least one flag octet, if the underflow report did not result in a new frame being sent. */ if (s->len == 0 && s->flag_octets < 2) s->flag_octets = 2; return txbyte; } } byte_in_progress = s->buffer[s->pos++]; i = bottom_bit(byte_in_progress | 0x100); s->octets_in_progress <<= i; byte_in_progress >>= i; for ( ; i < 8; i++) { s->octets_in_progress = (s->octets_in_progress << 1) | (byte_in_progress & 0x01); byte_in_progress >>= 1; if ((s->octets_in_progress & 0x1F) == 0x1F) { /* There are 5 ones - stuff */ s->octets_in_progress <<= 1; s->num_bits++; } } /* An input byte will generate between 8 and 10 output bits */ return (s->octets_in_progress >> s->num_bits) & 0xFF; } /* Untimed idling on flags */ if (s->tx_end) { s->tx_end = false; return SIG_STATUS_END_OF_DATA; } return s->idle_octet; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) hdlc_tx_get_bit(hdlc_tx_state_t *s) { int txbit; if (s->bits == 0) { if ((s->byte = hdlc_tx_get_byte(s)) < 0) return s->byte; s->bits = 8; } s->bits--; txbit = (s->byte >> s->bits) & 0x01; return txbit; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) hdlc_tx_get(hdlc_tx_state_t *s, uint8_t buf[], size_t max_len) { size_t i; int x; for (i = 0; i < max_len; i++) { if ((x = hdlc_tx_get_byte(s)) == SIG_STATUS_END_OF_DATA) return i; buf[i] = (uint8_t) x; } return (int) i; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) hdlc_tx_set_max_frame_len(hdlc_tx_state_t *s, size_t max_len) { s->max_frame_len = (max_len <= HDLC_MAXFRAME_LEN) ? max_len : HDLC_MAXFRAME_LEN; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) hdlc_tx_restart(hdlc_tx_state_t *s) { s->octets_in_progress = 0; s->num_bits = 0; s->idle_octet = 0x7E; s->flag_octets = 0; s->abort_octets = 0; s->report_flag_underflow = false; s->len = 0; s->pos = 0; if (s->crc_bytes == 2) s->crc = 0xFFFF; else s->crc = 0xFFFFFFFF; s->byte = 0; s->bits = 0; s->tx_end = false; return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(hdlc_tx_state_t *) hdlc_tx_init(hdlc_tx_state_t *s, int crc32, int inter_frame_flags, int progressive, hdlc_underflow_handler_t handler, void *user_data) { if (s == NULL) { if ((s = (hdlc_tx_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); s->underflow_handler = handler; s->user_data = user_data; s->inter_frame_flags = (inter_frame_flags < 1) ? 1 : inter_frame_flags; if (crc32) { s->crc_bytes = 4; s->crc = 0xFFFFFFFF; } else { s->crc_bytes = 2; s->crc = 0xFFFF; } s->idle_octet = 0x7E; s->progressive = progressive; s->max_frame_len = HDLC_MAXFRAME_LEN; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) hdlc_tx_release(hdlc_tx_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) hdlc_tx_free(hdlc_tx_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/libspandsp.2008.sln0000664000175000017500000003435111211246554014153 00000000000000 Microsoft Visual Studio Solution File, Format Version 10.00 # Visual C++ Express 2008 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_at_dictionary", "msvc\make_at_dictionary.2008.vcproj", "{DEE932AB-5911-4700-9EEB-8C7090A0A330}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_modem_filter", "msvc\make_modem_filter.2008.vcproj", "{329A6FA0-0FCC-4435-A950-E670AEFA9838}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspandsp", "libspandsp.2008.vcproj", "{1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}" ProjectSection(ProjectDependencies) = postProject {329A6FA0-0FCC-4435-A950-E670AEFA9838} = {329A6FA0-0FCC-4435-A950-E670AEFA9838} {DEE932AB-5911-4700-9EEB-8C7090A0A330} = {DEE932AB-5911-4700-9EEB-8C7090A0A330} {401A40CD-5DB4-4E34-AC68-FA99E9FAC014} = {401A40CD-5DB4-4E34-AC68-FA99E9FAC014} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "make_line_models", "..\spandsp-sim\msvc\make_line_models.2008.vcproj", "{F290BADE-82DE-4037-B49D-D563E43169DA}" ProjectSection(ProjectDependencies) = postProject {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libspandsp_sim", "..\spandsp-sim\libspandsp_sim.2008.vcproj", "{502F1E51-F0A0-4607-AB7F-05BAB530AAE1}" ProjectSection(ProjectDependencies) = postProject {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtiff", "libtiff.2008.vcproj", "{401A40CD-5DB4-4E34-AC68-FA99E9FAC014}" ProjectSection(ProjectDependencies) = postProject {2B8A45C9-FEB4-4734-AB37-8DB9DB899917} = {2B8A45C9-FEB4-4734-AB37-8DB9DB899917} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Download TIFF", "msvc\Download_TIFF.2008.vcproj", "{2B8A45C9-FEB4-4734-AB37-8DB9DB899917}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "t38_core_tests", "..\tests\msvc\t38_core_tests.vcproj", "{A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}" ProjectSection(ProjectDependencies) = postProject {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "t38_non_ecm_buffer_tests", "..\tests\msvc\t38_non_ecm_buffer_tests.vcproj", "{80A3D9D9-3846-4DA5-8676-F940D725EA62}" ProjectSection(ProjectDependencies) = postProject {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vector_int_tests", "..\tests\msvc\vector_int_tests.vcproj", "{80A60464-29E8-4EE8-BAFA-8708B7C08CC3}" ProjectSection(ProjectDependencies) = postProject {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vector_float_tests", "..\tests\msvc\vector_float_tests.vcproj", "{EA745FF7-9E4B-4C13-BA19-2EE8165A6245}" ProjectSection(ProjectDependencies) = postProject {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "complex_tests", "..\tests\msvc\complex_tests.vcproj", "{A349379F-0FEA-49C8-9535-05F39663337B}" ProjectSection(ProjectDependencies) = postProject {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "complex_vector_float_tests", "..\tests\msvc\complex_vector_float_tests.vcproj", "{2B0D705C-1CF2-401C-BFBC-A43FB806908C}" ProjectSection(ProjectDependencies) = postProject {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} EndProjectSection EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "complex_vector_int_tests", "..\tests\msvc\complex_vector_int_tests.vcproj", "{C2E8B4D1-A398-4D57-94F8-B61F20C7D514}" ProjectSection(ProjectDependencies) = postProject {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} = {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5} EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution All|Win32 = All|Win32 All|x64 = All|x64 Debug|Win32 = Debug|Win32 Debug|x64 = Debug|x64 Release|Win32 = Release|Win32 Release|x64 = Release|x64 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|Win32.ActiveCfg = All|Win32 {DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|Win32.Build.0 = All|Win32 {DEE932AB-5911-4700-9EEB-8C7090A0A330}.All|x64.ActiveCfg = All|Win32 {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|Win32.ActiveCfg = All|Win32 {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|Win32.Build.0 = All|Win32 {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Debug|x64.ActiveCfg = All|Win32 {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Release|Win32.ActiveCfg = All|Win32 {DEE932AB-5911-4700-9EEB-8C7090A0A330}.Release|x64.ActiveCfg = All|Win32 {329A6FA0-0FCC-4435-A950-E670AEFA9838}.All|Win32.ActiveCfg = All|Win32 {329A6FA0-0FCC-4435-A950-E670AEFA9838}.All|Win32.Build.0 = All|Win32 {329A6FA0-0FCC-4435-A950-E670AEFA9838}.All|x64.ActiveCfg = All|Win32 {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|Win32.ActiveCfg = All|Win32 {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|Win32.Build.0 = All|Win32 {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Debug|x64.ActiveCfg = All|Win32 {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Release|Win32.ActiveCfg = All|Win32 {329A6FA0-0FCC-4435-A950-E670AEFA9838}.Release|x64.ActiveCfg = All|Win32 {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.All|Win32.ActiveCfg = Release|x64 {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.All|x64.ActiveCfg = Release|x64 {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.All|x64.Build.0 = Release|x64 {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|Win32.ActiveCfg = Debug|Win32 {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|Win32.Build.0 = Debug|Win32 {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|x64.ActiveCfg = Debug|x64 {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Debug|x64.Build.0 = Debug|x64 {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|Win32.ActiveCfg = Release|Win32 {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|Win32.Build.0 = Release|Win32 {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|x64.ActiveCfg = Release|x64 {1CBB0077-18C5-455F-801C-0A0CE7B0BBF5}.Release|x64.Build.0 = Release|x64 {502F1E51-F0A0-4607-AB7F-05BAB530AAE1}.All|Win32.ActiveCfg = Release|Win32 {502F1E51-F0A0-4607-AB7F-05BAB530AAE1}.All|Win32.Build.0 = Release|Win32 {502F1E51-F0A0-4607-AB7F-05BAB530AAE1}.All|x64.ActiveCfg = Release|Win32 {502F1E51-F0A0-4607-AB7F-05BAB530AAE1}.Debug|Win32.ActiveCfg = Debug|Win32 {502F1E51-F0A0-4607-AB7F-05BAB530AAE1}.Debug|Win32.Build.0 = Debug|Win32 {502F1E51-F0A0-4607-AB7F-05BAB530AAE1}.Debug|x64.ActiveCfg = Debug|Win32 {502F1E51-F0A0-4607-AB7F-05BAB530AAE1}.Release|Win32.ActiveCfg = Release|Win32 {502F1E51-F0A0-4607-AB7F-05BAB530AAE1}.Release|Win32.Build.0 = Release|Win32 {502F1E51-F0A0-4607-AB7F-05BAB530AAE1}.Release|x64.ActiveCfg = Release|Win32 {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.All|Win32.ActiveCfg = Release|x64 {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.All|x64.ActiveCfg = Release|x64 {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.All|x64.Build.0 = Release|x64 {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|Win32.ActiveCfg = Debug|Win32 {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|Win32.Build.0 = Debug|Win32 {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|x64.ActiveCfg = Debug|x64 {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Debug|x64.Build.0 = Debug|x64 {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|Win32.ActiveCfg = Release|Win32 {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|Win32.Build.0 = Release|Win32 {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|x64.ActiveCfg = Release|x64 {401A40CD-5DB4-4E34-AC68-FA99E9FAC014}.Release|x64.Build.0 = Release|x64 {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.All|Win32.ActiveCfg = All|Win32 {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.All|Win32.Build.0 = All|Win32 {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.All|x64.ActiveCfg = All|Win32 {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Debug|Win32.ActiveCfg = All|Win32 {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Debug|Win32.Build.0 = All|Win32 {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Debug|x64.ActiveCfg = All|Win32 {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Release|Win32.ActiveCfg = All|Win32 {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Release|Win32.Build.0 = All|Win32 {2B8A45C9-FEB4-4734-AB37-8DB9DB899917}.Release|x64.ActiveCfg = All|Win32 {A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.All|Win32.ActiveCfg = Release|Win32 {A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.All|Win32.Build.0 = Release|Win32 {A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.All|x64.ActiveCfg = Release|Win32 {A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.Debug|Win32.ActiveCfg = Debug|Win32 {A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.Debug|Win32.Build.0 = Debug|Win32 {A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.Debug|x64.ActiveCfg = Debug|Win32 {A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.Release|Win32.ActiveCfg = Release|Win32 {A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.Release|Win32.Build.0 = Release|Win32 {A34A9D0E-A7E2-4A04-B044-7BB2FE709EF3}.Release|x64.ActiveCfg = Release|Win32 {80A3D9D9-3846-4DA5-8676-F940D725EA62}.All|Win32.ActiveCfg = Release|Win32 {80A3D9D9-3846-4DA5-8676-F940D725EA62}.All|Win32.Build.0 = Release|Win32 {80A3D9D9-3846-4DA5-8676-F940D725EA62}.All|x64.ActiveCfg = Release|Win32 {80A3D9D9-3846-4DA5-8676-F940D725EA62}.Debug|Win32.ActiveCfg = Debug|Win32 {80A3D9D9-3846-4DA5-8676-F940D725EA62}.Debug|Win32.Build.0 = Debug|Win32 {80A3D9D9-3846-4DA5-8676-F940D725EA62}.Debug|x64.ActiveCfg = Debug|Win32 {80A3D9D9-3846-4DA5-8676-F940D725EA62}.Release|Win32.ActiveCfg = Release|Win32 {80A3D9D9-3846-4DA5-8676-F940D725EA62}.Release|Win32.Build.0 = Release|Win32 {80A3D9D9-3846-4DA5-8676-F940D725EA62}.Release|x64.ActiveCfg = Release|Win32 {80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.All|Win32.ActiveCfg = Release|Win32 {80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.All|Win32.Build.0 = Release|Win32 {80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.All|x64.ActiveCfg = Release|Win32 {80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.Debug|Win32.ActiveCfg = Debug|Win32 {80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.Debug|Win32.Build.0 = Debug|Win32 {80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.Debug|x64.ActiveCfg = Debug|Win32 {80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.Release|Win32.ActiveCfg = Release|Win32 {80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.Release|Win32.Build.0 = Release|Win32 {80A60464-29E8-4EE8-BAFA-8708B7C08CC3}.Release|x64.ActiveCfg = Release|Win32 {EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.All|Win32.ActiveCfg = Release|Win32 {EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.All|Win32.Build.0 = Release|Win32 {EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.All|x64.ActiveCfg = Release|Win32 {EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.Debug|Win32.ActiveCfg = Debug|Win32 {EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.Debug|Win32.Build.0 = Debug|Win32 {EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.Debug|x64.ActiveCfg = Debug|Win32 {EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.Release|Win32.ActiveCfg = Release|Win32 {EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.Release|Win32.Build.0 = Release|Win32 {EA745FF7-9E4B-4C13-BA19-2EE8165A6245}.Release|x64.ActiveCfg = Release|Win32 {A349379F-0FEA-49C8-9535-05F39663337B}.All|Win32.ActiveCfg = Release|Win32 {A349379F-0FEA-49C8-9535-05F39663337B}.All|Win32.Build.0 = Release|Win32 {A349379F-0FEA-49C8-9535-05F39663337B}.All|x64.ActiveCfg = Release|Win32 {A349379F-0FEA-49C8-9535-05F39663337B}.Debug|Win32.ActiveCfg = Debug|Win32 {A349379F-0FEA-49C8-9535-05F39663337B}.Debug|Win32.Build.0 = Debug|Win32 {A349379F-0FEA-49C8-9535-05F39663337B}.Debug|x64.ActiveCfg = Debug|Win32 {A349379F-0FEA-49C8-9535-05F39663337B}.Release|Win32.ActiveCfg = Release|Win32 {A349379F-0FEA-49C8-9535-05F39663337B}.Release|Win32.Build.0 = Release|Win32 {A349379F-0FEA-49C8-9535-05F39663337B}.Release|x64.ActiveCfg = Release|Win32 {2B0D705C-1CF2-401C-BFBC-A43FB806908C}.All|Win32.ActiveCfg = Release|Win32 {2B0D705C-1CF2-401C-BFBC-A43FB806908C}.All|Win32.Build.0 = Release|Win32 {2B0D705C-1CF2-401C-BFBC-A43FB806908C}.All|x64.ActiveCfg = Release|Win32 {2B0D705C-1CF2-401C-BFBC-A43FB806908C}.Debug|Win32.ActiveCfg = Debug|Win32 {2B0D705C-1CF2-401C-BFBC-A43FB806908C}.Debug|Win32.Build.0 = Debug|Win32 {2B0D705C-1CF2-401C-BFBC-A43FB806908C}.Debug|x64.ActiveCfg = Debug|Win32 {2B0D705C-1CF2-401C-BFBC-A43FB806908C}.Release|Win32.ActiveCfg = Release|Win32 {2B0D705C-1CF2-401C-BFBC-A43FB806908C}.Release|Win32.Build.0 = Release|Win32 {2B0D705C-1CF2-401C-BFBC-A43FB806908C}.Release|x64.ActiveCfg = Release|Win32 {C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.All|Win32.ActiveCfg = Release|Win32 {C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.All|Win32.Build.0 = Release|Win32 {C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.All|x64.ActiveCfg = Release|Win32 {C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.Debug|Win32.ActiveCfg = Debug|Win32 {C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.Debug|Win32.Build.0 = Debug|Win32 {C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.Debug|x64.ActiveCfg = Debug|Win32 {C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.Release|Win32.ActiveCfg = Release|Win32 {C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.Release|Win32.Build.0 = Release|Win32 {C2E8B4D1-A398-4D57-94F8-B61F20C7D514}.Release|x64.ActiveCfg = Release|Win32 {F290BADE-82DE-4037-B49D-D563E43169DA}.All|Win32.ActiveCfg = All|Win32 {F290BADE-82DE-4037-B49D-D563E43169DA}.All|Win32.Build.0 = All|Win32 {F290BADE-82DE-4037-B49D-D563E43169DA}.All|x64.ActiveCfg = All|Win32 {F290BADE-82DE-4037-B49D-D563E43169DA}.Debug|Win32.ActiveCfg = All|Win32 {F290BADE-82DE-4037-B49D-D563E43169DA}.Debug|Win32.Build.0 = All|Win32 {F290BADE-82DE-4037-B49D-D563E43169DA}.Debug|x64.ActiveCfg = All|Win32 {F290BADE-82DE-4037-B49D-D563E43169DA}.Release|Win32.ActiveCfg = All|Win32 {F290BADE-82DE-4037-B49D-D563E43169DA}.Release|Win32.Build.0 = All|Win32 {F290BADE-82DE-4037-B49D-D563E43169DA}.Release|x64.ActiveCfg = All|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection EndGlobal spandsp-0.0.6/src/tone_generate.c0000664000175000017500000001767611422612263013702 00000000000000/* * SpanDSP - a series of DSP components for telephony * * tone_generate.c - General telephony tone generation. * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/fast_convert.h" #include "spandsp/dc_restore.h" #include "spandsp/complex.h" #include "spandsp/dds.h" #include "spandsp/tone_generate.h" #include "spandsp/private/tone_generate.h" #if !defined(M_PI) /* C99 systems may not define M_PI */ #define M_PI 3.14159265358979323846264338327 #endif SPAN_DECLARE(tone_gen_descriptor_t *) tone_gen_descriptor_init(tone_gen_descriptor_t *s, int f1, int l1, int f2, int l2, int d1, int d2, int d3, int d4, int repeat) { if (s == NULL) { if ((s = (tone_gen_descriptor_t *) malloc(sizeof(*s))) == NULL) { return NULL; } } memset(s, 0, sizeof(*s)); if (f1) { #if defined(SPANDSP_USE_FIXED_POINT) s->tone[0].phase_rate = dds_phase_rate((float) f1); if (f2 < 0) s->tone[0].phase_rate = -s->tone[0].phase_rate; s->tone[0].gain = dds_scaling_dbm0((float) l1); #else s->tone[0].phase_rate = dds_phase_ratef((float) f1); if (f2 < 0) s->tone[0].phase_rate = -s->tone[0].phase_rate; s->tone[0].gain = dds_scaling_dbm0f((float) l1); #endif } if (f2) { #if defined(SPANDSP_USE_FIXED_POINT) s->tone[1].phase_rate = dds_phase_rate((float) abs(f2)); s->tone[1].gain = (f2 < 0) ? (float) 32767.0f*l2/100.0f : dds_scaling_dbm0((float) l2); #else s->tone[1].phase_rate = dds_phase_ratef((float) abs(f2)); s->tone[1].gain = (f2 < 0) ? (float) l2/100.0f : dds_scaling_dbm0f((float) l2); #endif } s->duration[0] = d1*SAMPLE_RATE/1000; s->duration[1] = d2*SAMPLE_RATE/1000; s->duration[2] = d3*SAMPLE_RATE/1000; s->duration[3] = d4*SAMPLE_RATE/1000; s->repeat = repeat; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(void) tone_gen_descriptor_free(tone_gen_descriptor_t *s) { free(s); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE_NONSTD(int) tone_gen(tone_gen_state_t *s, int16_t amp[], int max_samples) { int samples; int limit; #if defined(SPANDSP_USE_FIXED_POINT) int16_t xamp; #else float xamp; #endif int i; if (s->current_section < 0) return 0; for (samples = 0; samples < max_samples; ) { limit = samples + s->duration[s->current_section] - s->current_position; if (limit > max_samples) limit = max_samples; s->current_position += (limit - samples); if (s->current_section & 1) { /* A silent section */ for ( ; samples < limit; samples++) amp[samples] = 0; } else { if (s->tone[0].phase_rate < 0) { /* Modulated tone */ for ( ; samples < limit; samples++) { /* There must be two, and only two, tones */ #if defined(SPANDSP_USE_FIXED_POINT) xamp = ((int32_t) dds_mod(&s->phase[0], -s->tone[0].phase_rate, s->tone[0].gain, 0) *(32767 + (int32_t) dds_mod(&s->phase[1], s->tone[1].phase_rate, s->tone[1].gain, 0))) >> 15; amp[samples] = xamp; #else xamp = dds_modf(&s->phase[0], -s->tone[0].phase_rate, s->tone[0].gain, 0) *(1.0f + dds_modf(&s->phase[1], s->tone[1].phase_rate, s->tone[1].gain, 0)); amp[samples] = (int16_t) lfastrintf(xamp); #endif } } else { for ( ; samples < limit; samples++) { #if defined(SPANDSP_USE_FIXED_POINT) xamp = 0; #else xamp = 0.0f; #endif for (i = 0; i < 4; i++) { if (s->tone[i].phase_rate == 0) break; #if defined(SPANDSP_USE_FIXED_POINT) xamp += dds_mod(&s->phase[i], s->tone[i].phase_rate, s->tone[i].gain, 0); #else xamp += dds_modf(&s->phase[i], s->tone[i].phase_rate, s->tone[i].gain, 0); #endif } /* Saturation of the answer is the right thing at this point. However, we are normally generating well controlled tones, that cannot clip. So, the overhead of doing saturation is a waste of valuable time. */ #if defined(SPANDSP_USE_FIXED_POINT) amp[samples] = xamp; #else amp[samples] = (int16_t) lfastrintf(xamp); #endif } } } if (s->current_position >= s->duration[s->current_section]) { s->current_position = 0; if (++s->current_section > 3 || s->duration[s->current_section] == 0) { if (!s->repeat) { /* Force a quick exit */ s->current_section = -1; break; } s->current_section = 0; } } } return samples; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(tone_gen_state_t *) tone_gen_init(tone_gen_state_t *s, tone_gen_descriptor_t *t) { int i; if (s == NULL) { if ((s = (tone_gen_state_t *) malloc(sizeof(*s))) == NULL) { return NULL; } } memset(s, 0, sizeof(*s)); for (i = 0; i < 4; i++) { s->tone[i] = t->tone[i]; s->phase[i] = 0; } for (i = 0; i < 4; i++) s->duration[i] = t->duration[i]; s->repeat = t->repeat; s->current_section = 0; s->current_position = 0; return s; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) tone_gen_release(tone_gen_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int) tone_gen_free(tone_gen_state_t *s) { if (s) free(s); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/0000775000175000017500000000000012357123347012436 500000000000000spandsp-0.0.6/src/spandsp/g726.h0000664000175000017500000000727211422612264013215 00000000000000/* * SpanDSP - a series of DSP components for telephony * * g726.h - ITU G.726 codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_G726_H_) #define _SPANDSP_G726_H_ /*! \page g726_page G.726 encoding and decoding \section g726_page_sec_1 What does it do? The G.726 module is a bit exact implementation of the full ITU G.726 specification. It supports: - 16 kbps, 24kbps, 32kbps, and 40kbps operation. - Tandem adjustment, for interworking with A-law and u-law. - Annex A support, for use in environments not using A-law or u-law. It passes the ITU tests. \section g726_page_sec_2 How does it work? ???. */ enum { G726_ENCODING_LINEAR = 0, /* Interworking with 16 bit signed linear */ G726_ENCODING_ULAW, /* Interworking with u-law */ G726_ENCODING_ALAW /* Interworking with A-law */ }; enum { G726_PACKING_NONE = 0, G726_PACKING_LEFT = 1, G726_PACKING_RIGHT = 2 }; /*! G.726 state */ typedef struct g726_state_s g726_state_t; typedef int16_t (*g726_decoder_func_t)(g726_state_t *s, uint8_t code); typedef uint8_t (*g726_encoder_func_t)(g726_state_t *s, int16_t amp); #if defined(__cplusplus) extern "C" { #endif /*! Initialise a G.726 encode or decode context. \param s The G.726 context. \param bit_rate The required bit rate for the ADPCM data. The valid rates are 16000, 24000, 32000 and 40000. \param ext_coding The coding used outside G.726. \param packing One of the G.726_PACKING_xxx options. \return A pointer to the G.726 context, or NULL for error. */ SPAN_DECLARE(g726_state_t *) g726_init(g726_state_t *s, int bit_rate, int ext_coding, int packing); /*! Release a G.726 encode or decode context. \param s The G.726 context. \return 0 for OK. */ SPAN_DECLARE(int) g726_release(g726_state_t *s); /*! Free a G.726 encode or decode context. \param s The G.726 context. \return 0 for OK. */ SPAN_DECLARE(int) g726_free(g726_state_t *s); /*! Decode a buffer of G.726 ADPCM data to linear PCM, a-law or u-law. \param s The G.726 context. \param amp The audio sample buffer. \param g726_data \param g726_bytes \return The number of samples returned. */ SPAN_DECLARE(int) g726_decode(g726_state_t *s, int16_t amp[], const uint8_t g726_data[], int g726_bytes); /*! Encode a buffer of linear PCM data to G.726 ADPCM. \param s The G.726 context. \param g726_data The G.726 data produced. \param amp The audio sample buffer. \param len The number of samples in the buffer. \return The number of bytes of G.726 data produced. */ SPAN_DECLARE(int) g726_encode(g726_state_t *s, uint8_t g726_data[], const int16_t amp[], int len); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/complex_filters.h0000664000175000017500000000347311422612264015726 00000000000000/* * SpanDSP - a series of DSP components for telephony * * complex_filters.h * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_COMPLEX_FILTERS_H_) #define _SPANDSP_COMPLEX_FILTERS_H_ typedef struct filter_s filter_t; typedef float (*filter_step_func_t)(filter_t *fi, float x); /*! Filter state */ typedef struct { int nz; int np; filter_step_func_t fsf; } fspec_t; struct filter_s { fspec_t *fs; float sum; int ptr; /* Only for moving average filters */ float v[]; }; typedef struct { filter_t *ref; filter_t *imf; } cfilter_t; #if defined(__cplusplus) extern "C" { #endif SPAN_DECLARE(filter_t *) filter_create(fspec_t *fs); SPAN_DECLARE(void) filter_delete(filter_t *fi); SPAN_DECLARE(float) filter_step(filter_t *fi, float x); SPAN_DECLARE(cfilter_t *) cfilter_create(fspec_t *fs); SPAN_DECLARE(void) cfilter_delete(cfilter_t *cfi); SPAN_DECLARE(complexf_t) cfilter_step(cfilter_t *cfi, const complexf_t *z); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/v17rx.h0000664000175000017500000004503712100763643013522 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v17rx.h - ITU V.17 modem receive part * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_V17RX_H_) #define _SPANDSP_V17RX_H_ /*! \page v17rx_page The V.17 receiver \section v17rx_page_sec_1 What does it do? The V.17 receiver implements the receive side of a V.17 modem. This can operate at data rates of 14400, 12000, 9600 and 7200 bits/second. The audio input is a stream of 16 bit samples, at 8000 samples/second. The transmit and receive side of V.17 modems operate independantly. V.17 is mostly used for FAX transmission over PSTN lines, where it provides the standard 14400 bits/second rate. \section v17rx_page_sec_2 How does it work? V.17 uses QAM modulation, at 2400 baud, and trellis coding. Constellations with 16, 32, 64, and 128 points are defined. After one bit per baud is absorbed by the trellis coding, this gives usable bit rates of 7200, 9600, 12000, and 14400 per second. V.17 specifies a training sequence at the start of transmission, which makes the design of a V.17 receiver relatively straightforward. The first stage of the training sequence consists of 256 symbols, alternating between two constellation positions. The receiver monitors the signal power, to sense the possible presence of a valid carrier. When the alternating signal begins, the power rising above a minimum threshold (-43dBm0) causes the main receiver computation to begin. The initial measured power is used to quickly set the gain of the receiver. After this initial settling, the front end gain is locked, and the adaptive equalizer tracks any subsequent signal level variation. The signal is oversampled to 24000 samples/second (i.e. signal, zero, zero, signal, zero, zero, ...) and fed to a complex root raised cosine pulse shaping filter. This filter has been modified from the conventional root raised cosine filter, by shifting it up the band, to be centred at the nominal carrier frequency. This filter interpolates the samples, pulse shapes, and performs a fractional sample delay at the same time. 192 sets of filter coefficients are used to achieve a set of finely spaces fractional sample delays, between zero and one sample. By choosing every fifth sample, and the appropriate set of filter coefficients, the properly tuned symbol tracker can select data samples at 4800 samples/second from points within 0.28 degrees of the centre and mid-points of each symbol. The output of the filter is multiplied by a complex carrier, generated by a DDS. The result is a baseband signal, requiring no further filtering, apart from an adaptive equalizer. The baseband signal is fed to a T/2 adaptive equalizer. A band edge component maximisation algorithm is used to tune the sampling, so the samples fed to the equalizer are close to the mid point and edges of each symbol. Initially the algorithm is very lightly damped, to ensure the symbol alignment pulls in quickly. Because the sampling rate will not be precisely the same as the transmitter's (the spec. says the symbol timing should be within 0.01%), the receiver constantly evaluates and corrects this sampling throughout its operation. During the symbol timing maintainence phase, the algorithm uses a heavier damping. The carrier is specified as 1800Hz +- 1Hz at the transmitter, and 1800 +-7Hz at the receiver. The receive carrier would only be this inaccurate if the link includes FDM sections. These are being phased out, but the design must still allow for the worst case. Using an initial 1800Hz signal for demodulation gives a worst case rotation rate for the constellation of about one degree per symbol. Once the symbol timing synchronisation algorithm has been given time to lock to the symbol timing of the initial alternating pattern, the phase of the demodulated signal is recorded on two successive symbols - once for each of the constellation positions. The receiver then tracks the symbol alternations, until a large phase jump occurs. This signifies the start of the next phase of the training sequence. At this point the total phase shift between the original recorded symbol phase, and the symbol phase just before the phase jump occurred is used to provide a coarse estimation of the rotation rate of the constellation, and it current absolute angle of rotation. These are used to update the current carrier phase and phase update rate in the carrier DDS. The working data already in the pulse shaping filter and equalizer buffers is given a similar step rotation to pull it all into line. From this point on, a heavily damped integrate and dump approach, based on the angular difference between each received constellation position and its expected position, is sufficient to track the carrier, and maintain phase alignment. A fast rough approximator for the arc-tangent function is adequate for the estimation of the angular error. The next phase of the training sequence is a scrambled sequence of two particular symbols. We train the T/2 adaptive equalizer using this sequence. The scrambling makes the signal sufficiently diverse to ensure the equalizer converges to the proper generalised solution. At the end of this sequence, the equalizer should be sufficiently well adapted that is can correctly resolve the full QAM constellation. However, the equalizer continues to adapt throughout operation of the modem, fine tuning on the more complex data patterns of the full QAM constellation. In the last phase of the training sequence, the modem enters normal data operation, with a short defined period of all ones as data. As in most high speed modems, data in a V.17 modem passes through a scrambler, to whiten the spectrum of the signal. The transmitter should initialise its data scrambler, and pass the ones through it. At the end of the ones, real data begins to pass through the scrambler, and the transmit modem is in normal operation. The receiver tests that ones are really received, in order to verify the modem trained correctly. If all is well, the data following the ones is fed to the application, and the receive modem is up and running. Unfortunately, some transmit side of some real V.17 modems fail to initialise their scrambler before sending the ones. This means the first 23 received bits (the length of the scrambler register) cannot be trusted for the test. The receive modem, therefore, only tests that bits starting at bit 24 are really ones. The V.17 signal is trellis coded. Two bits of each symbol are convolutionally coded to form a 3 bit trellis code - the two original bits, plus an extra redundant bit. It is possible to ignore the trellis coding, and just decode the non-redundant bits. However, the noise performance of the receiver would suffer. Using a proper trellis decoder adds several dB to the noise tolerance to the receiving modem. Trellis coding seems quite complex at first sight, but is fairly straightforward once you get to grips with it. Trellis decoding tracks the data in terms of the possible states of the convolutional coder at the transmitter. There are 8 possible states of the V.17 coder. The first step in trellis decoding is to find the best candidate constellation point for each of these 8 states. One of thse will be our final answer. The constellation has been designed so groups of 8 are spread fairly evenly across it. Locating them is achieved is a reasonably fast manner, by looking up the answers in a set of space map tables. The disadvantage is the tables are potentially large enough to affect cache performance. The trellis decoder works over 16 successive symbols. The result of decoding is not known until 16 symbols after the data enters the decoder. The minimum total accumulated mismatch between each received point and the actual constellation (termed the distance) is assessed for each of the 8 states. A little analysis of the coder shows that each of the 8 current states could be arrived at from 4 different previous states, through 4 different constellation bit patterns. For each new state, the running total distance is arrived at by inspecting a previous total plus a new distance for the appropriate 4 previous states. The minimum of the 4 values becomes the new distance for the state. Clearly, a mechanism is needed to stop this distance from growing indefinitely. A sliding window, and several other schemes are possible. However, a simple single pole IIR is very simple, and provides adequate results. For each new state we store the constellation bit pattern, or path, to that state, and the number of the previous state. We find the minimum distance amongst the 8 new states for each new symbol. We then trace back through the states, until we reach the one 16 states ago which leads to the current minimum distance. The bit pattern stored there is the error corrected bit pattern for that symbol. So, what does Trellis coding actually achieve? TCM is easier to understand by looking at the V.23bis modem spec. The V.32bis spec. is very similar to V.17, except that it is a full duplex modem and has non-TCM options, as well as the TCM ones in V.17. V32bis defines two options for pumping 9600 bits per second down a phone line - one with and one without TCM. Both run at 2400 baud. The non-TCM one uses simple 16 point QAM on the raw data. The other takes two out of every four raw bits, and convolutionally encodes them to 3. Now we have 5 bits per symbol, and we need 32 point QAM to send the data. The raw error rate from simple decoding of the 32 point QAM is horrible compared to decoding the 16 point QAM. If a point decoded from the 32 point QAM is wrong, the likely correct choice should be one of the adjacent ones. It is unlikely to have been one that is far away across the constellation, unless there was a huge noise spike, interference, or something equally nasty. Now, the 32 point symbols do not exist in isolation. There was a kind of temporal smearing in the convolutional coding. It created a well defined dependency between successive symbols. If we knew for sure what the last few symbols were, they would lead us to a limited group of possible values for the current symbol, constrained by the behaviour of the convolutional coder. If you look at how the symbols were mapped to constellation points, you will see the mapping tries to spread those possible symbols as far apart as possible. This will leave only one that is pretty close to the received point, which must be the correct choice. However, this assumes we know the last few symbols for sure. Since we don't, we have a bit more work to do to achieve reliable decoding. Instead of decoding to the nearest point on the constellation, we decode to a group of likely constellation points in the neighbourhood of the received point. We record the mismatch for each - that is the distance across the constellation between the received point and the group of nearby points. To avoid square roots, recording x2 + y2 can be good enough. Symbol by symbol, we record this information. After a few symbols we can stand back and look at the recorded information. For each symbol we have a set of possible symbol values and error metric pairs. The dependency between symbols, created by the convolutional coder, means some paths from symbol to symbol are possible and some are not. It we trace back through the possible symbol to symbol paths, and total up the error metric through those paths, we end up with a set of figures of merit (or more accurately figures of demerit, since larger == worse) for the likelihood of each path being the correct one. The path with the lowest total metric is the most likely, and gives us our final choice for what we think the current symbol really is. That was hard work. It takes considerable computation to do this selection and traceback, symbol by symbol. We need to get quite a lot from this. It needs to drive the error rate down so far that is compensates for the much higher error rate due to the larger constellation, and then buys us some actual benefit. Well in the example we are looking at - V.32bis at 9600bps - it works out the error rate from the TCM option is like using the non-TCM option with several dB more signal to noise ratio. That's nice. The non-TCM option is pretty reasonable on most phone lines, but a better error rate is always a good thing. However, V32bis includes a 14,400bps option. That uses 2400 baud, and 6 bit symbols. Convolutional encoding increases that to 7 bits per symbol, by taking 2 bits and encoding them to 3. This give a 128 point QAM constellation. Again, the difference between using this, and using just an uncoded 64 point constellation is equivalent to maybe 5dB of extra signal to noise ratio. However, in this case it is the difference between the modem working only on the most optimal lines, and being widely usable across most phone lines. TCM absolutely transformed the phone line modem business. */ /*! V.17 modem receive side descriptor. This defines the working state for a single instance of a V.17 modem receiver. */ typedef struct v17_rx_state_s v17_rx_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Initialise a V.17 modem receive context. \brief Initialise a V.17 modem receive context. \param s The modem context. \param bit_rate The bit rate of the modem. Valid values are 7200, 9600, 12000 and 14400. \param put_bit The callback routine used to put the received data. \param user_data An opaque pointer passed to the put_bit routine. \return A pointer to the modem context, or NULL if there was a problem. */ SPAN_DECLARE(v17_rx_state_t *) v17_rx_init(v17_rx_state_t *s, int bit_rate, put_bit_func_t put_bit, void *user_data); /*! Reinitialise an existing V.17 modem receive context. \brief Reinitialise an existing V.17 modem receive context. \param s The modem context. \param bit_rate The bit rate of the modem. Valid values are 7200, 9600, 12000 and 14400. \param short_train TRUE if a short training sequence is expected. \return 0 for OK, -1 for bad parameter */ SPAN_DECLARE(int) v17_rx_restart(v17_rx_state_t *s, int bit_rate, int short_train); /*! Release a V.17 modem receive context. \brief Release a V.17 modem receive context. \param s The modem context. \return 0 for OK */ SPAN_DECLARE(int) v17_rx_release(v17_rx_state_t *s); /*! Free a V.17 modem receive context. \brief Free a V.17 modem receive context. \param s The modem context. \return 0 for OK */ SPAN_DECLARE(int) v17_rx_free(v17_rx_state_t *s); /*! Get the logging context associated with a V.17 modem receive context. \brief Get the logging context associated with a V.17 modem receive context. \param s The modem context. \return A pointer to the logging context */ SPAN_DECLARE(logging_state_t *) v17_rx_get_logging_state(v17_rx_state_t *s); /*! Change the put_bit function associated with a V.17 modem receive context. \brief Change the put_bit function associated with a V.17 modem receive context. \param s The modem context. \param put_bit The callback routine used to handle received bits. \param user_data An opaque pointer. */ SPAN_DECLARE(void) v17_rx_set_put_bit(v17_rx_state_t *s, put_bit_func_t put_bit, void *user_data); /*! Change the modem status report function associated with a V.17 modem receive context. \brief Change the modem status report function associated with a V.17 modem receive context. \param s The modem context. \param handler The callback routine used to report modem status changes. \param user_data An opaque pointer. */ SPAN_DECLARE(void) v17_rx_set_modem_status_handler(v17_rx_state_t *s, modem_status_func_t handler, void *user_data); /*! Process a block of received V.17 modem audio samples. \brief Process a block of received V.17 modem audio samples. \param s The modem context. \param amp The audio sample buffer. \param len The number of samples in the buffer. \return The number of samples unprocessed. */ SPAN_DECLARE_NONSTD(int) v17_rx(v17_rx_state_t *s, const int16_t amp[], int len); /*! Fake processing of a missing block of received V.17 modem audio samples. (e.g due to packet loss). \brief Fake processing of a missing block of received V.17 modem audio samples. \param s The modem context. \param len The number of samples to fake. \return The number of samples unprocessed. */ SPAN_DECLARE_NONSTD(int) v17_rx_fillin(v17_rx_state_t *s, int len); /*! Get a snapshot of the current equalizer coefficients. \brief Get a snapshot of the current equalizer coefficients. \param s The modem context. \param coeffs The vector of complex coefficients. \return The number of coefficients in the vector. */ #if defined(SPANDSP_USE_FIXED_POINTx) SPAN_DECLARE(int) v17_rx_equalizer_state(v17_rx_state_t *s, complexi_t **coeffs); #else SPAN_DECLARE(int) v17_rx_equalizer_state(v17_rx_state_t *s, complexf_t **coeffs); #endif /*! Get the current received carrier frequency. \param s The modem context. \return The frequency, in Hertz. */ SPAN_DECLARE(float) v17_rx_carrier_frequency(v17_rx_state_t *s); /*! Get the current symbol timing correction since startup. \param s The modem context. \return The correction. */ SPAN_DECLARE(float) v17_rx_symbol_timing_correction(v17_rx_state_t *s); /*! Get a current received signal power. \param s The modem context. \return The signal power, in dBm0. */ SPAN_DECLARE(float) v17_rx_signal_power(v17_rx_state_t *s); /*! Set the power level at which the carrier detection will cut in \param s The modem context. \param cutoff The signal cutoff power, in dBm0. */ SPAN_DECLARE(void) v17_rx_signal_cutoff(v17_rx_state_t *s, float cutoff); /*! Set a handler routine to process QAM status reports \param s The modem context. \param handler The handler routine. \param user_data An opaque pointer passed to the handler routine. */ SPAN_DECLARE(void) v17_rx_set_qam_report_handler(v17_rx_state_t *s, qam_report_handler_t handler, void *user_data); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/lpc10.h0000664000175000017500000000753411422612264013450 00000000000000/* * SpanDSP - a series of DSP components for telephony * * lpc10.h - LPC10 low bit rate speech codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_LPC10_H_) #define _SPANDSP_LPC10_H_ /*! \page lpc10_page LPC10 encoding and decoding \section lpc10_page_sec_1 What does it do? The LPC10 module implements the US Department of Defense LPC10 codec. This codec produces compressed data at 2400bps. At such a low rate high fidelity cannot be expected. However, the speech clarity is quite good, and this codec is unencumbered by patent or other restrictions. \section lpc10_page_sec_2 How does it work? ???. */ #define LPC10_SAMPLES_PER_FRAME 180 #define LPC10_BITS_IN_COMPRESSED_FRAME 54 /*! LPC10 codec unpacked frame. */ typedef struct { /*! Pitch */ int32_t ipitch; /*! Energy */ int32_t irms; /*! Reflection coefficients */ int32_t irc[10]; } lpc10_frame_t; /*! LPC10 codec encoder state descriptor. This defines the state of a single working instance of the LPC10 encoder. */ typedef struct lpc10_encode_state_s lpc10_encode_state_t; /*! LPC10 codec decoder state descriptor. This defines the state of a single working instance of the LPC10 decoder. */ typedef struct lpc10_decode_state_s lpc10_decode_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Initialise an LPC10e encode context. \param s The LPC10e context \param error_correction ??? \return A pointer to the LPC10e context, or NULL for error. */ SPAN_DECLARE(lpc10_encode_state_t *) lpc10_encode_init(lpc10_encode_state_t *s, int error_correction); SPAN_DECLARE(int) lpc10_encode_release(lpc10_encode_state_t *s); SPAN_DECLARE(int) lpc10_encode_free(lpc10_encode_state_t *s); /*! Encode a buffer of linear PCM data to LPC10e. \param s The LPC10e context. \param ima_data The LPC10e data produced. \param amp The audio sample buffer. \param len The number of samples in the buffer. This must be a multiple of 180, as this is the number of samples on a frame. \return The number of bytes of LPC10e data produced. */ SPAN_DECLARE(int) lpc10_encode(lpc10_encode_state_t *s, uint8_t code[], const int16_t amp[], int len); /*! Initialise an LPC10e decode context. \param s The LPC10e context \param error_correction ??? \return A pointer to the LPC10e context, or NULL for error. */ SPAN_DECLARE(lpc10_decode_state_t *) lpc10_decode_init(lpc10_decode_state_t *st, int error_correction); SPAN_DECLARE(int) lpc10_decode_release(lpc10_decode_state_t *s); SPAN_DECLARE(int) lpc10_decode_free(lpc10_decode_state_t *s); /*! Decode a buffer of LPC10e data to linear PCM. \param s The LPC10e context. \param amp The audio sample buffer. \param code The LPC10e data. \param len The number of bytes of LPC10e data to be decoded. This must be a multiple of 7, as each frame is packed into 7 bytes. \return The number of samples returned. */ SPAN_DECLARE(int) lpc10_decode(lpc10_decode_state_t *s, int16_t amp[], const uint8_t code[], int len); #if defined(__cplusplus) } #endif #endif /*- End of include ---------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/version.h.in0000664000175000017500000000247611422612265014624 00000000000000/* * SpanDSP - a series of DSP components for telephony * * version.h - A tag file, so the exact installed revision can be assertained. * * Written by Steve Underwood * * Copyright (C) 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_VERSION_H_) #define _SPANDSP_VERSION_H_ /* The date and time of the version are in UTC form. */ #define SPANDSP_RELEASE_DATE $SPANDSP_RELEASE_DATE #define SPANDSP_RELEASE_TIME $SPANDSP_RELEASE_TIME #define SPANDSP_RELEASE_DATETIME_STRING "$SPANDSP_RELEASE_DATE $SPANDSP_RELEASE_TIME" #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/v29tx.h0000664000175000017500000001643512100763554013530 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v29tx.h - ITU V.29 modem transmit part * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_V29TX_H_) #define _SPANDSP_V29TX_H_ /*! \page v29tx_page The V.29 transmitter \section v29tx_page_sec_1 What does it do? The V.29 transmitter implements the transmit side of a V.29 modem. This can operate at data rates of 9600, 7200 and 4800 bits/s. The audio output is a stream of 16 bit samples, at 8000 samples/second. The transmit and receive side of V.29 modems operate independantly. V.29 is mostly used for FAX transmission, where it provides the standard 9600 and 7200 bits/s rates (the 4800 bits/s mode is not used for FAX). \section v29tx_page_sec_2 How does it work? V.29 uses QAM modulation. The standard method of producing a QAM modulated signal is to use a sampling rate which is a multiple of the baud rate. The raw signal is then a series of complex pulses, each an integer number of samples long. These can be shaped, using a suitable complex filter, and multiplied by a complex carrier signal to produce the final QAM signal for transmission. The pulse shaping filter is only vaguely defined by the V.29 spec. Some of the other ITU modem specs. fully define the filter, typically specifying a root raised cosine filter, with 50% excess bandwidth. This is a pity, since it increases the variability of the received signal. However, the receiver's adaptive equalizer will compensate for these differences. The current design uses a root raised cosine filter with 25% excess bandwidth. Greater excess bandwidth will not allow the tranmitted signal to meet the spectral requirements. The sampling rate for our transmitter is defined by the channel - 8000 per second. This is not a multiple of the baud rate (i.e. 2400 baud). The baud interval is actually 10/3 sample periods. Instead of using a symmetric FIR to pulse shape the signal, a polyphase filter is used. This consists of 10 sets of coefficients, offering zero to 9/10ths of a baud phase shift as well as root raised cosine filtering. The appropriate coefficient set is chosen for each signal sample generated. The carrier is generated using the DDS method. Using two second order resonators, started in quadrature, might be more efficient, as it would have less impact on the processor cache than a table lookup approach. However, the DDS approach suits the receiver better, so the same signal generator is also used for the transmitter. The equation defining QAM modulation is: s(n) = A*cos(2*pi*f*n + phi(n)) where phi(n) is the phase of the information, and A is the amplitude of the information using the identity cos(x + y) = cos(x)*cos(y) - sin(x)*sin(y) we get s(n) = A {cos(2*pi*f*n)*cos(phi(n)) - sin(2*pi*f*n)*sin(phi(n))} substituting with the constellation positions I(n) = A*cos(phi(n)) Q(n) = A*sin(phi(n)) gives s(n) = I(n)*cos(2*pi*f*n) - Q(n)*sin(2*pi*f*n) */ /*! V.29 modem transmit side descriptor. This defines the working state for a single instance of a V.29 modem transmitter. */ typedef struct v29_tx_state_s v29_tx_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Adjust a V.29 modem transmit context's power output. \brief Adjust a V.29 modem transmit context's output power. \param s The modem context. \param power The power level, in dBm0 */ SPAN_DECLARE(void) v29_tx_power(v29_tx_state_t *s, float power); /*! Initialise a V.29 modem transmit context. This must be called before the first use of the context, to initialise its contents. \brief Initialise a V.29 modem transmit context. \param s The modem context. \param bit_rate The bit rate of the modem. Valid values are 4800, 7200 and 9600. \param tep TRUE is the optional TEP tone is to be transmitted. \param get_bit The callback routine used to get the data to be transmitted. \param user_data An opaque pointer. \return A pointer to the modem context, or NULL if there was a problem. */ SPAN_DECLARE(v29_tx_state_t *) v29_tx_init(v29_tx_state_t *s, int bit_rate, int tep, get_bit_func_t get_bit, void *user_data); /*! Reinitialise an existing V.29 modem transmit context, so it may be reused. \brief Reinitialise an existing V.29 modem transmit context. \param s The modem context. \param bit_rate The bit rate of the modem. Valid values are 4800, 7200 and 9600. \param tep TRUE is the optional TEP tone is to be transmitted. \return 0 for OK, -1 for bad parameter */ SPAN_DECLARE(int) v29_tx_restart(v29_tx_state_t *s, int bit_rate, int tep); /*! Release a V.29 modem transmit context. \brief Release a V.29 modem transmit context. \param s The modem context. \return 0 for OK */ SPAN_DECLARE(int) v29_tx_release(v29_tx_state_t *s); /*! Free a V.29 modem transmit context. \brief Free a V.29 modem transmit context. \param s The modem context. \return 0 for OK */ SPAN_DECLARE(int) v29_tx_free(v29_tx_state_t *s); /*! Get the logging context associated with a V.29 modem transmit context. \brief Get the logging context associated with a V.29 modem transmit context. \param s The modem context. \return A pointer to the logging context */ SPAN_DECLARE(logging_state_t *) v29_tx_get_logging_state(v29_tx_state_t *s); /*! Change the get_bit function associated with a V.29 modem transmit context. \brief Change the get_bit function associated with a V.29 modem transmit context. \param s The modem context. \param get_bit The callback routine used to get the data to be transmitted. \param user_data An opaque pointer. */ SPAN_DECLARE(void) v29_tx_set_get_bit(v29_tx_state_t *s, get_bit_func_t get_bit, void *user_data); /*! Change the modem status report function associated with a V.29 modem transmit context. \brief Change the modem status report function associated with a V.29 modem transmit context. \param s The modem context. \param handler The callback routine used to report modem status changes. \param user_data An opaque pointer. */ SPAN_DECLARE(void) v29_tx_set_modem_status_handler(v29_tx_state_t *s, modem_status_func_t handler, void *user_data); /*! Generate a block of V.29 modem audio samples. \brief Generate a block of V.29 modem audio samples. \param s The modem context. \param amp The audio sample buffer. \param len The number of samples to be generated. \return The number of samples actually generated. */ SPAN_DECLARE_NONSTD(int) v29_tx(v29_tx_state_t *s, int16_t amp[], int len); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/g711.h0000664000175000017500000002463111422612264013205 00000000000000/* * SpanDSP - a series of DSP components for telephony * * g711.h - In line A-law and u-law conversion routines * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page g711_page A-law and mu-law handling Lookup tables for A-law and u-law look attractive, until you consider the impact on the CPU cache. If it causes a substantial area of your processor cache to get hit too often, cache sloshing will severely slow things down. The main reason these routines are slow in C, is the lack of direct access to the CPU's "find the first 1" instruction. A little in-line assembler fixes that, and the conversion routines can be faster than lookup tables, in most real world usage. A "find the first 1" instruction is available on most modern CPUs, and is a much underused feature. If an assembly language method of bit searching is not available, these routines revert to a method that can be a little slow, so the cache thrashing might not seem so bad :( Feel free to submit patches to add fast "find the first 1" support for your own favourite processor. Look up tables are used for transcoding between A-law and u-law, since it is difficult to achieve the precise transcoding procedure laid down in the G.711 specification by other means. */ #if !defined(_SPANDSP_G711_H_) #define _SPANDSP_G711_H_ /* The usual values to use on idle channels, to emulate silence */ /*! Idle value for A-law channels */ #define G711_ALAW_IDLE_OCTET 0x5D /*! Idle value for u-law channels */ #define G711_ULAW_IDLE_OCTET 0xFF enum { G711_ALAW = 0, G711_ULAW }; /*! G.711 state */ typedef struct g711_state_s g711_state_t; #if defined(__cplusplus) extern "C" { #endif /* N.B. It is tempting to use look-up tables for A-law and u-law conversion. * However, you should consider the cache footprint. * * A 64K byte table for linear to x-law and a 512 byte table for x-law to * linear sound like peanuts these days, and shouldn't an array lookup be * real fast? No! When the cache sloshes as badly as this one will, a tight * calculation may be better. The messiest part is normally finding the * segment, but a little inline assembly can fix that on an i386, x86_64 and * many other modern processors. */ /* * Mu-law is basically as follows: * * Biased Linear Input Code Compressed Code * ------------------------ --------------- * 00000001wxyza 000wxyz * 0000001wxyzab 001wxyz * 000001wxyzabc 010wxyz * 00001wxyzabcd 011wxyz * 0001wxyzabcde 100wxyz * 001wxyzabcdef 101wxyz * 01wxyzabcdefg 110wxyz * 1wxyzabcdefgh 111wxyz * * Each biased linear code has a leading 1 which identifies the segment * number. The value of the segment number is equal to 7 minus the number * of leading 0's. The quantization interval is directly available as the * four bits wxyz. * The trailing bits (a - h) are ignored. * * Ordinarily the complement of the resulting code word is used for * transmission, and so the code word is complemented before it is returned. * * For further information see John C. Bellamy's Digital Telephony, 1982, * John Wiley & Sons, pps 98-111 and 472-476. */ /* Enable the trap as per the MIL-STD */ //#define G711_ULAW_ZEROTRAP /*! Bias for u-law encoding from linear. */ #define G711_ULAW_BIAS 0x84 /*! \brief Encode a linear sample to u-law \param linear The sample to encode. \return The u-law value. */ static __inline__ uint8_t linear_to_ulaw(int linear) { uint8_t u_val; int mask; int seg; /* Get the sign and the magnitude of the value. */ if (linear >= 0) { linear = G711_ULAW_BIAS + linear; mask = 0xFF; } else { linear = G711_ULAW_BIAS - linear; mask = 0x7F; } seg = top_bit(linear | 0xFF) - 7; /* * Combine the sign, segment, quantization bits, * and complement the code word. */ if (seg >= 8) u_val = (uint8_t) (0x7F ^ mask); else u_val = (uint8_t) (((seg << 4) | ((linear >> (seg + 3)) & 0xF)) ^ mask); #if defined(G711_ULAW_ZEROTRAP) /* Optional ITU trap */ if (u_val == 0) u_val = 0x02; #endif return u_val; } /*- End of function --------------------------------------------------------*/ /*! \brief Decode an u-law sample to a linear value. \param ulaw The u-law sample to decode. \return The linear value. */ static __inline__ int16_t ulaw_to_linear(uint8_t ulaw) { int t; /* Complement to obtain normal u-law value. */ ulaw = ~ulaw; /* * Extract and bias the quantization bits. Then * shift up by the segment number and subtract out the bias. */ t = (((ulaw & 0x0F) << 3) + G711_ULAW_BIAS) << (((int) ulaw & 0x70) >> 4); return (int16_t) ((ulaw & 0x80) ? (G711_ULAW_BIAS - t) : (t - G711_ULAW_BIAS)); } /*- End of function --------------------------------------------------------*/ /* * A-law is basically as follows: * * Linear Input Code Compressed Code * ----------------- --------------- * 0000000wxyza 000wxyz * 0000001wxyza 001wxyz * 000001wxyzab 010wxyz * 00001wxyzabc 011wxyz * 0001wxyzabcd 100wxyz * 001wxyzabcde 101wxyz * 01wxyzabcdef 110wxyz * 1wxyzabcdefg 111wxyz * * For further information see John C. Bellamy's Digital Telephony, 1982, * John Wiley & Sons, pps 98-111 and 472-476. */ /*! The A-law alternate mark inversion mask */ #define G711_ALAW_AMI_MASK 0x55 /*! \brief Encode a linear sample to A-law \param linear The sample to encode. \return The A-law value. */ static __inline__ uint8_t linear_to_alaw(int linear) { int mask; int seg; if (linear >= 0) { /* Sign (bit 7) bit = 1 */ mask = G711_ALAW_AMI_MASK | 0x80; } else { /* Sign (bit 7) bit = 0 */ mask = G711_ALAW_AMI_MASK; linear = -linear - 1; } /* Convert the scaled magnitude to segment number. */ seg = top_bit(linear | 0xFF) - 7; if (seg >= 8) { if (linear >= 0) { /* Out of range. Return maximum value. */ return (uint8_t) (0x7F ^ mask); } /* We must be just a tiny step below zero */ return (uint8_t) (0x00 ^ mask); } /* Combine the sign, segment, and quantization bits. */ return (uint8_t) (((seg << 4) | ((linear >> ((seg) ? (seg + 3) : 4)) & 0x0F)) ^ mask); } /*- End of function --------------------------------------------------------*/ /*! \brief Decode an A-law sample to a linear value. \param alaw The A-law sample to decode. \return The linear value. */ static __inline__ int16_t alaw_to_linear(uint8_t alaw) { int i; int seg; alaw ^= G711_ALAW_AMI_MASK; i = ((alaw & 0x0F) << 4); seg = (((int) alaw & 0x70) >> 4); if (seg) i = (i + 0x108) << (seg - 1); else i += 8; return (int16_t) ((alaw & 0x80) ? i : -i); } /*- End of function --------------------------------------------------------*/ /*! \brief Transcode from A-law to u-law, using the procedure defined in G.711. \param alaw The A-law sample to transcode. \return The best matching u-law value. */ SPAN_DECLARE(uint8_t) alaw_to_ulaw(uint8_t alaw); /*! \brief Transcode from u-law to A-law, using the procedure defined in G.711. \param ulaw The u-law sample to transcode. \return The best matching A-law value. */ SPAN_DECLARE(uint8_t) ulaw_to_alaw(uint8_t ulaw); /*! \brief Decode from u-law or A-law to linear. \param s The G.711 context. \param amp The linear audio buffer. \param g711_data The G.711 data. \param g711_bytes The number of G.711 samples to decode. \return The number of samples of linear audio produced. */ SPAN_DECLARE(int) g711_decode(g711_state_t *s, int16_t amp[], const uint8_t g711_data[], int g711_bytes); /*! \brief Encode from linear to u-law or A-law. \param s The G.711 context. \param g711_data The G.711 data. \param amp The linear audio buffer. \param len The number of samples to encode. \return The number of G.711 samples produced. */ SPAN_DECLARE(int) g711_encode(g711_state_t *s, uint8_t g711_data[], const int16_t amp[], int len); /*! \brief Transcode between u-law and A-law. \param s The G.711 context. \param g711_out The resulting G.711 data. \param g711_in The original G.711 data. \param g711_bytes The number of G.711 samples to transcode. \return The number of G.711 samples produced. */ SPAN_DECLARE(int) g711_transcode(g711_state_t *s, uint8_t g711_out[], const uint8_t g711_in[], int g711_bytes); /*! Initialise a G.711 encode or decode context. \param s The G.711 context. \param mode The G.711 mode. \return A pointer to the G.711 context, or NULL for error. */ SPAN_DECLARE(g711_state_t *) g711_init(g711_state_t *s, int mode); /*! Release a G.711 encode or decode context. \param s The G.711 context. \return 0 for OK. */ SPAN_DECLARE(int) g711_release(g711_state_t *s); /*! Free a G.711 encode or decode context. \param s The G.711 context. \return 0 for OK. */ SPAN_DECLARE(int) g711_free(g711_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/crc.h0000664000175000017500000000741711422612264013300 00000000000000/* * SpanDSP - a series of DSP components for telephony * * crc.h * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page crc_page CRC \section crc_page_sec_1 What does it do? \section crc_page_sec_2 How does it work? */ #if !defined(_SPANDSP_CRC_H_) #define _SPANDSP_CRC_H_ #if defined(__cplusplus) extern "C" { #endif /*! \brief Calculate the ITU/CCITT CRC-32 value in buffer. \param buf The buffer containing the data. \param len The length of the frame. \param crc The initial CRC value. This is usually 0xFFFFFFFF, or 0 for a new block (it depends on the application). It is previous returned CRC value for the continuation of a block. \return The CRC value. */ SPAN_DECLARE(uint32_t) crc_itu32_calc(const uint8_t *buf, int len, uint32_t crc); /*! \brief Append an ITU/CCITT CRC-32 value to a frame. \param buf The buffer containing the frame. This must be at least 2 bytes longer than the frame it contains, to allow room for the CRC value. \param len The length of the frame. \return The new length of the frame. */ SPAN_DECLARE(int) crc_itu32_append(uint8_t *buf, int len); /*! \brief Check the ITU/CCITT CRC-32 value in a frame. \param buf The buffer containing the frame. \param len The length of the frame. \return TRUE if the CRC is OK, else FALSE. */ SPAN_DECLARE(int) crc_itu32_check(const uint8_t *buf, int len); /*! \brief Calculate the ITU/CCITT CRC-16 value in buffer by whole bytes. \param buf The buffer containing the data. \param len The length of the frame. \param crc The initial CRC value. This is usually 0xFFFF, or 0 for a new block (it depends on the application). It is previous returned CRC value for the continuation of a block. \return The CRC value. */ SPAN_DECLARE(uint16_t) crc_itu16_calc(const uint8_t *buf, int len, uint16_t crc); /*! \brief Calculate the ITU/CCITT CRC-16 value of some bits from a byte. \param buf The buffer containing the byte of data. \param len The number of bits, starting from the LSB. \param crc The initial CRC value. This is usually 0xFFFF, or 0 for a new block (it depends on the application). It is previous returned CRC value for the continuation of a block. \return The CRC value. */ SPAN_DECLARE(uint16_t) crc_itu16_bits(uint8_t buf, int len, uint16_t crc); /*! \brief Append an ITU/CCITT CRC-16 value to a frame. \param buf The buffer containing the frame. This must be at least 2 bytes longer than the frame it contains, to allow room for the CRC value. \param len The length of the frame. \return The new length of the frame. */ SPAN_DECLARE(int) crc_itu16_append(uint8_t *buf, int len); /*! \brief Check the ITU/CCITT CRC-16 value in a frame. \param buf The buffer containing the frame. \param len The length of the frame. \return TRUE if the CRC is OK, else FALSE. */ SPAN_DECLARE(int) crc_itu16_check(const uint8_t *buf, int len); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/time_scale.h0000664000175000017500000001131111422612264014622 00000000000000/* * SpanDSP - a series of DSP components for telephony * * time_scale.h - Time scaling for linear speech data * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_TIME_SCALE_H_) #define _SPANDSP_TIME_SCALE_H_ /*! \page time_scale_page Time scaling speech \section time_scale_page_sec_1 What does it do? The time scaling module allows speech files to be played back at a different speed from the speed at which they were recorded. If this were done by simply speeding up or slowing down replay, the pitch of the voice would change, and sound very odd. This module keeps the pitch of the voice at its original level. The speed of the voice may be altered over a wide range. However, the practical useful rates are between about half normal speed and twice normal speed. \section time_scale_page_sec_2 How does it work? The time scaling module is based on the Pointer Interval Controlled OverLap and Add (PICOLA) method, developed by Morita Naotaka. Mikio Ikeda has an excellent web page on this subject at http://keizai.yokkaichi-u.ac.jp/~ikeda/research/picola.html There is also working code there. This implementation uses exactly the same algorithms, but the code is a complete rewrite. Mikio's code batch processes files. This version works incrementally on streams, and allows multiple streams to be processed concurrently. \section time_scale_page_sec_3 How do I used it? The output buffer must be big enough to hold the maximum number of samples which could result from the data in the input buffer, which is: input_len*playout_rate + sample_rate/TIME_SCALE_MIN_PITCH + 1 */ /*! Audio time scaling descriptor. */ typedef struct time_scale_state_s time_scale_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Initialise a time scale context. This must be called before the first use of the context, to initialise its contents. \brief Initialise a time scale context. \param s The time scale context. \param sample_rate The sample rate of the signal. \param playout_rate The ratio between the output speed and the input speed. \return A pointer to the context, or NULL if there was a problem. */ SPAN_DECLARE(time_scale_state_t *) time_scale_init(time_scale_state_t *s, int sample_rate, float playout_rate); /*! \brief Release a time scale context. \param s The time scale context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) time_scale_release(time_scale_state_t *s); /*! \brief Free a time scale context. \param s The time scale context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) time_scale_free(time_scale_state_t *s); /*! Change the time scale rate. \brief Change the time scale rate. \param s The time scale context. \param playout_rate The ratio between the output speed and the input speed. \return 0 if changed OK, else -1. */ SPAN_DECLARE(int) time_scale_rate(time_scale_state_t *s, float playout_rate); /*! Find the maximum possible samples which could result from scaling the specified number of input samples, at the current playback rate. \brief Find the maximum possible output samples. \param s The time scale context. \param input_len The number of input samples. \return The maximum possible output samples. */ SPAN_DECLARE(int) time_scale_max_output_len(time_scale_state_t *s, int input_len); /*! Time scale a chunk of audio samples. \brief Time scale a chunk of audio samples. \param s The time scale context. \param out The output audio sample buffer. This must be large enough to accept the longest possible result from processing the input data. See the algorithm documentation for how the longest possible result may be calculated. \param in The input audio sample buffer. \param len The number of input samples. \return The number of output samples. */ SPAN_DECLARE(int) time_scale(time_scale_state_t *s, int16_t out[], int16_t in[], int len); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/v22bis.h0000664000175000017500000002327212101413074013626 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v22bis.h - ITU V.22bis modem * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page v22bis_page The V.22bis modem \section v22bis_page_sec_1 What does it do? The V.22bis modem is a duplex modem for general data use on the PSTN, at rates of 1200 and 2400 bits/second. It is a compatible extension of the V.22 modem, which is a 1200 bits/second only design. It is a band-split design, using carriers of 1200Hz and 2400Hz. It is the fastest PSTN modem in general use which does not use echo-cancellation. \section v22bis__page_sec_2 How does it work? V.22bis uses 4PSK modulation at 1200 bits/second or 16QAM modulation at 2400 bits/second. At 1200bps the symbols are so long that a fixed compromise equaliser is sufficient to recover the 4PSK signal reliably. At 2400bps an adaptive equaliser is necessary. The V.22bis training sequence includes sections which allow the modems to determine if the far modem can support (or is willing to support) 2400bps operation. The modems will automatically use 2400bps if both ends are willing to use that speed, or 1200bps if one or both ends to not acknowledge that 2400bps is OK. */ #if !defined(_SPANDSP_V22BIS_H_) #define _SPANDSP_V22BIS_H_ enum { V22BIS_GUARD_TONE_NONE, V22BIS_GUARD_TONE_550HZ, V22BIS_GUARD_TONE_1800HZ }; /*! V.22bis modem descriptor. This defines the working state for a single instance of a V.22bis modem. */ typedef struct v22bis_state_s v22bis_state_t; extern const complexf_t v22bis_constellation[16]; #if defined(__cplusplus) extern "C" { #endif /*! Process a block of received V.22bis modem audio samples. \brief Process a block of received V.22bis modem audio samples. \param s The modem context. \param amp The audio sample buffer. \param len The number of samples in the buffer. \return The number of samples unprocessed. */ SPAN_DECLARE_NONSTD(int) v22bis_rx(v22bis_state_t *s, const int16_t amp[], int len); /*! Fake processing of a missing block of received V.22bis modem audio samples. (e.g due to packet loss). \brief Fake processing of a missing block of received V.22bis modem audio samples. \param s The modem context. \param len The number of samples to fake. \return The number of samples unprocessed. */ SPAN_DECLARE_NONSTD(int) v22bis_rx_fillin(v22bis_state_t *s, int len); /*! Get a snapshot of the current equalizer coefficients. \brief Get a snapshot of the current equalizer coefficients. \param coeffs The vector of complex coefficients. \return The number of coefficients in the vector. */ SPAN_DECLARE(int) v22bis_rx_equalizer_state(v22bis_state_t *s, complexf_t **coeffs); /*! Get the current received carrier frequency. \param s The modem context. \return The frequency, in Hertz. */ SPAN_DECLARE(float) v22bis_rx_carrier_frequency(v22bis_state_t *s); /*! Get the current symbol timing correction since startup. \param s The modem context. \return The correction. */ SPAN_DECLARE(float) v22bis_rx_symbol_timing_correction(v22bis_state_t *s); /*! Get a current received signal power. \param s The modem context. \return The signal power, in dBm0. */ SPAN_DECLARE(float) v22bis_rx_signal_power(v22bis_state_t *s); /*! Set the power level at which the carrier detection will cut in \param s The modem context. \param cutoff The signal cutoff power, in dBm0. */ SPAN_DECLARE(void) v22bis_rx_signal_cutoff(v22bis_state_t *s, float cutoff); /*! Set a handler routine to process QAM status reports \param s The modem context. \param handler The handler routine. \param user_data An opaque pointer passed to the handler routine. */ SPAN_DECLARE(void) v22bis_rx_set_qam_report_handler(v22bis_state_t *s, qam_report_handler_t handler, void *user_data); /*! Generate a block of V.22bis modem audio samples. \brief Generate a block of V.22bis modem audio samples. \param s The modem context. \param amp The audio sample buffer. \param len The number of samples to be generated. \return The number of samples actually generated. */ SPAN_DECLARE_NONSTD(int) v22bis_tx(v22bis_state_t *s, int16_t amp[], int len); /*! Adjust a V.22bis modem transmit context's power output. \brief Adjust a V.22bis modem transmit context's output power. \param s The modem context. \param power The power level, in dBm0 */ SPAN_DECLARE(void) v22bis_tx_power(v22bis_state_t *s, float power); /*! Reinitialise an existing V.22bis modem context, so it may be reused. \brief Reinitialise an existing V.22bis modem context. \param s The modem context. \param bit_rate The bit rate of the modem. Valid values are 1200 and 2400. \return 0 for OK, -1 for bad parameter. */ SPAN_DECLARE(int) v22bis_restart(v22bis_state_t *s, int bit_rate); /*! Request a retrain for a V.22bis modem context. A rate change may also be requested. \brief Request a retrain for a V.22bis modem context. \param s The modem context. \param bit_rate The bit rate of the modem. Valid values are 1200 and 2400. \return 0 for OK, -1 for request rejected. */ SPAN_DECLARE(int) v22bis_request_retrain(v22bis_state_t *s, int bit_rate); /*! Request a loopback 2 for a V.22bis modem context. \brief Request a loopback 2 for a V.22bis modem context. \param s The modem context. \param enable TRUE to enable loopback, or FALSE to disable it. \return 0 for OK, -1 for request reject. */ SPAN_DECLARE(int) v22bis_remote_loopback(v22bis_state_t *s, int enable); /*! Report the current operating bit rate of a V.22bis modem context. \brief Report the current operating bit rate of a V.22bis modem context \param s The modem context. */ SPAN_DECLARE(int) v22bis_get_current_bit_rate(v22bis_state_t *s); /*! Initialise a V.22bis modem context. This must be called before the first use of the context, to initialise its contents. \brief Initialise a V.22bis modem context. \param s The modem context. \param bit_rate The bit rate of the modem. Valid values are 1200 and 2400. \param guard The guard tone option. 0 = none, 1 = 550Hz, 2 = 1800Hz. \param calling_party TRUE if this is the calling modem. \param get_bit The callback routine used to get the data to be transmitted. \param put_bit The callback routine used to get the data to be transmitted. \param user_data An opaque pointer, passed in calls to the get and put routines. \return A pointer to the modem context, or NULL if there was a problem. */ SPAN_DECLARE(v22bis_state_t *) v22bis_init(v22bis_state_t *s, int bit_rate, int guard, int calling_party, get_bit_func_t get_bit, void *get_bit_user_data, put_bit_func_t put_bit, void *put_bit_user_data); /*! Release a V.22bis modem receive context. \brief Release a V.22bis modem receive context. \param s The modem context. \return 0 for OK */ SPAN_DECLARE(int) v22bis_release(v22bis_state_t *s); /*! Free a V.22bis modem receive context. \brief Free a V.22bis modem receive context. \param s The modem context. \return 0 for OK */ SPAN_DECLARE(int) v22bis_free(v22bis_state_t *s); /*! Get the logging context associated with a V.22bis modem context. \brief Get the logging context associated with a V.22bis modem context. \param s The modem context. \return A pointer to the logging context */ SPAN_DECLARE(logging_state_t *) v22bis_get_logging_state(v22bis_state_t *s); /*! Change the get_bit function associated with a V.22bis modem context. \brief Change the get_bit function associated with a V.22bis modem context. \param s The modem context. \param get_bit The callback routine used to get the data to be transmitted. \param user_data An opaque pointer. */ SPAN_DECLARE(void) v22bis_set_get_bit(v22bis_state_t *s, get_bit_func_t get_bit, void *user_data); /*! Change the get_bit function associated with a V.22bis modem context. \brief Change the put_bit function associated with a V.22bis modem context. \param s The modem context. \param put_bit The callback routine used to process the data received. \param user_data An opaque pointer. */ SPAN_DECLARE(void) v22bis_set_put_bit(v22bis_state_t *s, put_bit_func_t put_bit, void *user_data); /*! Change the modem status report function associated with a V.22bis modem receive context. \brief Change the modem status report function associated with a V.22bis modem receive context. \param s The modem context. \param handler The callback routine used to report modem status changes. \param user_data An opaque pointer. */ SPAN_DECLARE(void) v22bis_set_modem_status_handler(v22bis_state_t *s, modem_status_func_t handler, void *user_data); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/t30_logging.h0000664000175000017500000000407011422612264014635 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t30_logging.h - definitions for T.30 fax processing * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_T30_LOGGING_H_) #define _SPANDSP_T30_LOGGING_H_ #if defined(__cplusplus) extern "C" { #endif /*! Return a text name for a T.30 frame type. \brief Return a text name for a T.30 frame type. \param x The frametype octet. \return A pointer to the text name for the frame type. If the frame type is not value, the string "???" is returned. */ SPAN_DECLARE(const char *) t30_frametype(uint8_t x); /*! Decode a DIS, DTC or DCS frame, and log the contents. \brief Decode a DIS, DTC or DCS frame, and log the contents. \param s The T.30 context. \param dis A pointer to the frame to be decoded. \param len The length of the frame. */ SPAN_DECLARE(void) t30_decode_dis_dtc_dcs(t30_state_t *s, const uint8_t *dis, int len); /*! Convert a phase E completion code to a short text description. \brief Convert a phase E completion code to a short text description. \param result The result code. \return A pointer to the description. */ SPAN_DECLARE(const char *) t30_completion_code_to_str(int result); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/t4_tx.h0000664000175000017500000004052712101412331013556 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t4_tx.h - definitions for T.4 FAX transmit processing * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_T4_TX_H_) #define _SPANDSP_T4_TX_H_ //#define SPANDSP_SUPPORT_TIFF_FX /*! This function is a callback from the image decoders, to read the unencoded bi-level image, row by row. It is called for each row, with len set to the number of bytes per row expected. \return len for OK, or zero to indicate the end of the image data. */ typedef int (*t4_row_read_handler_t)(void *user_data, uint8_t buf[], size_t len); #if defined(SPANDSP_SUPPORT_TIFF_FX) /* TIFF-FX related extensions to the tag set supported by libtiff */ /* Indexed(346) = 0, 1. SHORT 0: not a palette-color image. 1: palette-color image. This field is used to indicate that each sample value is an index into an array of color values specified in the image data stream. Because the color map is embedded in the image data stream, the ColorMap field is not used in Profile L. Lossless color fax profile supports palette-color images with the ITULAB encoding. The SamplesPerPixel value must be 1. GlobalParametersIFD (400) IFD An IFD containing global parameters. It is recommended that a TIFF writer place this field in the first IFD, where a TIFF reader would find it quickly. Each field in the GlobalParametersIFD is a TIFF field that is legal in any IFD. Required baseline fields should not be located in the GlobalParametersIFD, but should be in each image IFD. If a conflict exists between fields in the GlobalParametersIFD and in the image IFDs, then the data in the image IFD shall prevail. Among the GlobalParametersIFD entries is a new ProfileType field which generally describes information in this IFD and in the TIFF file. ProfileType(401) LONG The type of image data stored in this IFD. 0 = Unspecified 1 = Group 3 fax No default The following new global fields are defined in this document as IFD entries for use with fax applications. FaxProfile(402) = 0 - 6. BYTE The profile that applies to this file; a profile is subset of the full set of permitted fields and field values of TIFF for facsimile. The currently defined values are: 0: does not conform to a profile defined for TIFF for facsimile 1: minimal black & white lossless, Profile S 2: extended black & white lossless, Profile F 3: lossless JBIG black & white, Profile J 4: lossy color and grayscale, Profile C 5: lossless color and grayscale, Profile L 6: Mixed Raster Content, Profile M CodingMethods(403) LONG This field indicates which coding methods are used in the file. A bit value of 1 indicates which of the following coding methods is used: Bit 0: unspecified compression, Bit 1: 1-dimensional coding, ITU-T Rec. T.4 (MH - Modified Huffman), Bit 2: 2-dimensional coding, ITU-T Rec. T.4 (MR - Modified Read), Bit 3: 2-dimensional coding, ITU-T Rec. T.6 (MMR - Modified MR), Bit 4: ITU-T Rec. T.82 coding, using ITU-T Rec. T.85 (JBIG), Bit 5: ITU-T Rec. T.81 (Baseline JPEG), Bit 6: ITU-T Rec. T.82 coding, using ITU-T Rec. T.43 (JBIG color), Bits 7-31: reserved for future use Note: There is a limit of 32 compression types to identify standard compression methods. VersionYear(404) BYTE Count: 4 The year of the standard specified by the FaxProfile field, given as 4 characters, e.g. '1997'; used in lossy and lossless color modes. ModeNumber (405) BYTE The mode of the standard specified by the FaxProfile field. A value of 0 indicates Mode 1.0; used in Mixed Raster Content mode. Decode(433) SRATIONAL Count = 2 * SamplesPerPixel Describes how to map image sample values into the range of values appropriate for the current color space. In general, the values are taken in pairs and specify the minimum and maximum output value for each color component. For the base color fax profile, Decode has a count of 6 values and maps the unsigned ITULAB- encoded sample values (Lsample, asample, bsample) to signed L*a*b* values, as follows: L* = Decode[0] + Lsample x (Decode[1]-Decode[0])/(2^n -1) a* = Decode[2] + asample x (Decode[3]-Decode[2])/(2^n -1) b* = Decode[4] + bsample x (Decode[5]-Decode[4])/(2^n -1) where Decode[0], Decode[2] and Decode[4] are the minimum values for L*, a*, and b*; Decode[1], Decode[3] and Decode[5] are the maximum values for L*, a*, and b*; and n is the BitsPerSample. When n=8,=20 L*=Decode[0] when Lsample=0 and L*=Decode[1] when Lsample=255. ImageBaseColor(434) SHORT Count = SamplesPerPixel In areas of an image layer where no image data is available (i.e., where no strips are defined, or where the StripByteCounts entry for a given strip is 0), the color specified by ImageBaseColor will be used. StripRowCounts(559) LONG Count = number of strips. The number of scanlines stored in a strip. Profile M allows each fax strip to store a different number of scanlines. For strips with more than one layer, the maximum strip size is either 256 scanlines or full page size. The 256 maximum SHOULD be used unless the capability to receive longer strips has been negotiated. This field replaces RowsPerStrip for IFDs with variable-size strips. Only one of the two fields, StripRowCounts and RowsPerStrip, may be used in an IFD. ImageLayer(34732) LONG Count = 2. Image layers are defined such that layer 1 is the Background layer, layer 3 is the Foreground layer, and layer 2 is the Mask layer, which selects pixels from the Background and Foreground layers. The ImageLayer tag contains two values, which describe the layer to which the image belongs and the order in which it is imaged. ImageLayer[0] = 1, 2, 3. 1: Image is a Background image, i.e. the image that will appear whenever the Mask contains a value of 0. Background images typically contain low-resolution, continuous-tone imagery. 2: Image is the Mask layer. In MRC, if the Mask layer is present, it must be the Primary IFD and be full page in extent. 3: Image is a Foreground image, i.e. the image that will appear whenever the Mask contains a value of 1. The Foreground image generally defines the color of text or lines but may also contain high-resolution imagery. ImageLayer[1]: 1: first image to be imaged in this layer 2: second image to be imaged in this layer 3: ... */ #define TIFFTAG_INDEXED 346 #define TIFFTAG_GLOBALPARAMETERSIFD 400 #define TIFFTAG_PROFILETYPE 401 #define PROFILETYPE_UNSPECIFIED 0 #define PROFILETYPE_G3_FAX 1 #define TIFFTAG_FAXPROFILE 402 #define FAXPROFILE_S 1 #define FAXPROFILE_F 2 #define FAXPROFILE_J 3 #define FAXPROFILE_C 4 #define FAXPROFILE_L 5 #define FAXPROFILE_M 6 #define TIFFTAG_CODINGMETHODS 403 #define CODINGMETHODS_T4_1D (1 << 1) #define CODINGMETHODS_T4_2D (1 << 2) #define CODINGMETHODS_T6 (1 << 3) #define CODINGMETHODS_T85 (1 << 4) #define CODINGMETHODS_T42 (1 << 5) #define CODINGMETHODS_T43 (1 << 6) #define TIFFTAG_VERSIONYEAR 404 #define TIFFTAG_MODENUMBER 405 #define TIFFTAG_DECODE 433 #define TIFFTAG_IMAGEBASECOLOR 434 #define TIFFTAG_T82OPTIONS 435 #define TIFFTAG_STRIPROWCOUNTS 559 #define TIFFTAG_IMAGELAYER 34732 #define COMPRESSION_T85 9 #define COMPRESSION_T43 10 #endif typedef struct t4_state_s t4_tx_state_t; #if defined(__cplusplus) extern "C" { #endif /*! \brief Prepare to send the next page of the current document. \param s The T.4 context. \return zero for success, -1 for failure. */ SPAN_DECLARE(int) t4_tx_start_page(t4_tx_state_t *s); /*! \brief Prepare the current page for a resend. \param s The T.4 context. \return zero for success, -1 for failure. */ SPAN_DECLARE(int) t4_tx_restart_page(t4_tx_state_t *s); /*! \brief Check for the existance of the next page, and whether its format is like the current one. This information can be needed before it is determined that the current page is finished with. \param s The T.4 context. \return 0 for next page found with the same format as the current page. 1 for next page found with different format from the current page. -1 for no page found, or file failure. */ SPAN_DECLARE(int) t4_tx_next_page_has_different_format(t4_tx_state_t *s); /*! \brief Complete the sending of a page. \param s The T.4 context. \return zero for success, -1 for failure. */ SPAN_DECLARE(int) t4_tx_end_page(t4_tx_state_t *s); /*! \brief Return the next bit of the current document page, without actually moving forward in the buffer. The document will be padded for the current minimum scan line time. \param s The T.4 context. \return The next bit (i.e. 0 or 1). For the last bit of data, bit 1 is set (i.e. the returned value is 2 or 3). */ SPAN_DECLARE(int) t4_tx_check_bit(t4_tx_state_t *s); /*! \brief Get the next bit of the current document page. The document will be padded for the current minimum scan line time. \param s The T.4 context. \return The next bit (i.e. 0 or 1). For the last bit of data, bit 1 is set (i.e. the returned value is 2 or 3). */ SPAN_DECLARE(int) t4_tx_get_bit(t4_tx_state_t *s); /*! \brief Get the next byte of the current document page. The document will be padded for the current minimum scan line time. \param s The T.4 context. \return The next byte. For the last byte of data, bit 8 is set. In this case, one or more bits of the byte may be padded with zeros, to complete the byte. */ SPAN_DECLARE(int) t4_tx_get_byte(t4_tx_state_t *s); /*! \brief Get the next chunk of the current document page. The document will be padded for the current minimum scan line time. \param s The T.4 context. \param buf The buffer into which the chunk is to written. \param max_len The maximum length of the chunk. \return The actual length of the chunk. If this is less than max_len it indicates that the end of the document has been reached. */ SPAN_DECLARE(int) t4_tx_get_chunk(t4_tx_state_t *s, uint8_t buf[], int max_len); /*! \brief Set the encoding for the encoded data. \param s The T.4 context. \param encoding The encoding. */ SPAN_DECLARE(void) t4_tx_set_tx_encoding(t4_tx_state_t *s, int encoding); /*! \brief Set the minimum number of encoded bits per row. This allows the makes the encoding process to be set to comply with the minimum row time specified by a remote receiving machine. \param s The T.4 context. \param bits The minimum number of bits per row. */ SPAN_DECLARE(void) t4_tx_set_min_bits_per_row(t4_tx_state_t *s, int bits); /*! \brief Set the identity of the local machine, for inclusion in page headers. \param s The T.4 context. \param ident The identity string. */ SPAN_DECLARE(void) t4_tx_set_local_ident(t4_tx_state_t *s, const char *ident); /*! Set the info field, included in the header line included in each page of an encoded FAX. This is a string of up to 50 characters. Other information (date, local ident, etc.) are automatically included in the header. If the header info is set to NULL or a zero length string, no header lines will be added to the encoded FAX. \brief Set the header info. \param s The T.4 context. \param info A string, of up to 50 bytes, which will form the info field. */ SPAN_DECLARE(void) t4_tx_set_header_info(t4_tx_state_t *s, const char *info); /*! Set the time zone for the time stamp in page header lines. If this function is not used the current time zone of the program's environment is used. \brief Set the header timezone. \param s The T.4 context. \param tz A time zone descriptor. */ SPAN_DECLARE(void) t4_tx_set_header_tz(t4_tx_state_t *s, tz_t *tz); /*! \brief Set the row read handler for a T.4 transmit context. \param s The T.4 transmit context. \param handler A pointer to the handler routine. \param user_data An opaque pointer passed to the handler routine. \return 0 for success, otherwise -1. */ SPAN_DECLARE(int) t4_tx_set_row_read_handler(t4_tx_state_t *s, t4_row_read_handler_t handler, void *user_data); /*! \brief Get the row-to-row (y) resolution of the current page. \param s The T.4 context. \return The resolution, in pixels per metre. */ SPAN_DECLARE(int) t4_tx_get_y_resolution(t4_tx_state_t *s); /*! \brief Get the column-to-column (x) resolution of the current page. \param s The T.4 context. \return The resolution, in pixels per metre. */ SPAN_DECLARE(int) t4_tx_get_x_resolution(t4_tx_state_t *s); /*! \brief Get the width of the current page, in pixel columns. \param s The T.4 context. \return The number of columns. */ SPAN_DECLARE(int) t4_tx_get_image_width(t4_tx_state_t *s); /*! \brief Get the number of pages in the file. \param s The T.4 context. \return The number of pages, or -1 if there is an error. */ SPAN_DECLARE(int) t4_tx_get_pages_in_file(t4_tx_state_t *s); /*! \brief Get the currnet page number in the file. \param s The T.4 context. \return The page number, or -1 if there is an error. */ SPAN_DECLARE(int) t4_tx_get_current_page_in_file(t4_tx_state_t *s); /*! Get the current image transfer statistics. \brief Get the current transfer statistics. \param s The T.4 context. \param t A pointer to a statistics structure. */ SPAN_DECLARE(void) t4_tx_get_transfer_statistics(t4_tx_state_t *s, t4_stats_t *t); /*! \brief Prepare for transmission of a document. \param s The T.4 context. \param file The name of the file to be sent. \param start_page The first page to send. -1 for no restriction. \param stop_page The last page to send. -1 for no restriction. \return A pointer to the context, or NULL if there was a problem. */ SPAN_DECLARE(t4_tx_state_t *) t4_tx_init(t4_tx_state_t *s, const char *file, int start_page, int stop_page); /*! \brief End the transmission of a document. Tidy up and close the file. This should be used to end T.4 transmission started with t4_tx_init. \param s The T.4 context. \return 0 for success, otherwise -1. */ SPAN_DECLARE(int) t4_tx_release(t4_tx_state_t *s); /*! \brief End the transmission of a document. Tidy up, close the file and free the context. This should be used to end T.4 transmission started with t4_tx_init. \param s The T.4 context. \return 0 for success, otherwise -1. */ SPAN_DECLARE(int) t4_tx_free(t4_tx_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/gsm0610.h0000664000175000017500000001336011422612264013620 00000000000000/* * SpanDSP - a series of DSP components for telephony * * gsm0610.h - GSM 06.10 full rate speech codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_GSM0610_H_) #define _SPANDSP_GSM0610_H_ /*! \page gsm0610_page GSM 06.10 encoding and decoding \section gsm0610_page_sec_1 What does it do? The GSM 06.10 module is an version of the widely used GSM FR codec software available from http://kbs.cs.tu-berlin.de/~jutta/toast.html. This version was produced since some versions of this codec are not bit exact, or not very efficient on modern processors. This implementation can use MMX instructions on Pentium class processors, or alternative methods on other processors. It passes all the ETSI test vectors. That is, it is a tested bit exact implementation. This implementation supports encoded data in one of three packing formats: - Unpacked, with the 76 parameters of a GSM 06.10 code frame each occupying a separate byte. (note that none of the parameters exceed 8 bits). - Packed the the 33 byte per frame, used for VoIP, where 4 bits per frame are wasted. - Packed in WAV49 format, where 2 frames are packed into 65 bytes. \section gsm0610_page_sec_2 How does it work? ???. */ enum { GSM0610_PACKING_NONE, GSM0610_PACKING_WAV49, GSM0610_PACKING_VOIP }; /*! GSM 06.10 FR codec unpacked frame. */ typedef struct { int16_t LARc[8]; int16_t Nc[4]; int16_t bc[4]; int16_t Mc[4]; int16_t xmaxc[4]; int16_t xMc[4][13]; } gsm0610_frame_t; /*! GSM 06.10 FR codec state descriptor. This defines the state of a single working instance of the GSM 06.10 FR encoder or decoder. */ typedef struct gsm0610_state_s gsm0610_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Initialise a GSM 06.10 encode or decode context. \param s The GSM 06.10 context \param packing One of the GSM0610_PACKING_xxx options. \return A pointer to the GSM 06.10 context, or NULL for error. */ SPAN_DECLARE(gsm0610_state_t *) gsm0610_init(gsm0610_state_t *s, int packing); /*! Release a GSM 06.10 encode or decode context. \param s The GSM 06.10 context \return 0 for success, else -1. */ SPAN_DECLARE(int) gsm0610_release(gsm0610_state_t *s); /*! Free a GSM 06.10 encode or decode context. \param s The GSM 06.10 context \return 0 for success, else -1. */ SPAN_DECLARE(int) gsm0610_free(gsm0610_state_t *s); /*! Set the packing format for a GSM 06.10 encode or decode context. \param s The GSM 06.10 context \param packing One of the GSM0610_PACKING_xxx options. \return 0 for success, else -1. */ SPAN_DECLARE(int) gsm0610_set_packing(gsm0610_state_t *s, int packing); /*! Encode a buffer of linear PCM data to GSM 06.10. \param s The GSM 06.10 context. \param code The GSM 06.10 data produced. \param amp The audio sample buffer. \param len The number of samples in the buffer. \return The number of bytes of GSM 06.10 data produced. */ SPAN_DECLARE(int) gsm0610_encode(gsm0610_state_t *s, uint8_t code[], const int16_t amp[], int len); /*! Decode a buffer of GSM 06.10 data to linear PCM. \param s The GSM 06.10 context. \param amp The audio sample buffer. \param code The GSM 06.10 data. \param len The number of bytes of GSM 06.10 data to be decoded. \return The number of samples returned. */ SPAN_DECLARE(int) gsm0610_decode(gsm0610_state_t *s, int16_t amp[], const uint8_t code[], int len); SPAN_DECLARE(int) gsm0610_pack_none(uint8_t c[], const gsm0610_frame_t *s); /*! Pack a pair of GSM 06.10 frames in the format used for wave files (wave type 49). \param c The buffer for the packed data. This must be at least 65 bytes long. \param s A pointer to the frames to be packed. \return The number of bytes generated. */ SPAN_DECLARE(int) gsm0610_pack_wav49(uint8_t c[], const gsm0610_frame_t *s); /*! Pack a GSM 06.10 frames in the format used for VoIP. \param c The buffer for the packed data. This must be at least 33 bytes long. \param s A pointer to the frame to be packed. \return The number of bytes generated. */ SPAN_DECLARE(int) gsm0610_pack_voip(uint8_t c[], const gsm0610_frame_t *s); SPAN_DECLARE(int) gsm0610_unpack_none(gsm0610_frame_t *s, const uint8_t c[]); /*! Unpack a pair of GSM 06.10 frames from the format used for wave files (wave type 49). \param s A pointer to a buffer into which the frames will be packed. \param c The buffer containing the data to be unpacked. This must be at least 65 bytes long. \return The number of bytes absorbed. */ SPAN_DECLARE(int) gsm0610_unpack_wav49(gsm0610_frame_t *s, const uint8_t c[]); /*! Unpack a GSM 06.10 frame from the format used for VoIP. \param s A pointer to a buffer into which the frame will be packed. \param c The buffer containing the data to be unpacked. This must be at least 33 bytes long. \return The number of bytes absorbed. */ SPAN_DECLARE(int) gsm0610_unpack_voip(gsm0610_frame_t *s, const uint8_t c[]); #if defined(__cplusplus) } #endif #endif /*- End of include ---------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/tone_detect.h0000664000175000017500000002170511422612264015022 00000000000000/* * SpanDSP - a series of DSP components for telephony * * tone_detect.h - General telephony tone detection. * * Written by Steve Underwood * * Copyright (C) 2001, 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_TONE_DETECT_H_) #define _SPANDSP_TONE_DETECT_H_ /*! Goertzel filter descriptor. */ struct goertzel_descriptor_s { #if defined(SPANDSP_USE_FIXED_POINT) int16_t fac; #else float fac; #endif int samples; }; /*! Goertzel filter state descriptor. */ struct goertzel_state_s { #if defined(SPANDSP_USE_FIXED_POINT) int16_t v2; int16_t v3; int16_t fac; #else float v2; float v3; float fac; #endif int samples; int current_sample; }; /*! Goertzel filter descriptor. */ typedef struct goertzel_descriptor_s goertzel_descriptor_t; /*! Goertzel filter state descriptor. */ typedef struct goertzel_state_s goertzel_state_t; #if defined(__cplusplus) extern "C" { #endif /*! \brief Create a descriptor for use with either a Goertzel transform */ SPAN_DECLARE(void) make_goertzel_descriptor(goertzel_descriptor_t *t, float freq, int samples); /*! \brief Initialise the state of a Goertzel transform. \param s The Goertzel context. If NULL, a context is allocated with malloc. \param t The Goertzel descriptor. \return A pointer to the Goertzel state. */ SPAN_DECLARE(goertzel_state_t *) goertzel_init(goertzel_state_t *s, goertzel_descriptor_t *t); SPAN_DECLARE(int) goertzel_release(goertzel_state_t *s); SPAN_DECLARE(int) goertzel_free(goertzel_state_t *s); /*! \brief Reset the state of a Goertzel transform. \param s The Goertzel context. */ SPAN_DECLARE(void) goertzel_reset(goertzel_state_t *s); /*! \brief Update the state of a Goertzel transform. \param s The Goertzel context. \param amp The samples to be transformed. \param samples The number of samples. \return The number of samples unprocessed */ SPAN_DECLARE(int) goertzel_update(goertzel_state_t *s, const int16_t amp[], int samples); /*! \brief Evaluate the final result of a Goertzel transform. \param s The Goertzel context. \return The result of the transform. The expected result for a pure sine wave signal of level x dBm0, at the very centre of the bin is: [Floating point] ((samples_per_goertzel_block*32768.0/1.4142)*10^((x - DBM0_MAX_SINE_POWER)/20.0))^2 [Fixed point] ((samples_per_goertzel_block*256.0/1.4142)*10^((x - DBM0_MAX_SINE_POWER)/20.0))^2 */ #if defined(SPANDSP_USE_FIXED_POINT) SPAN_DECLARE(int32_t) goertzel_result(goertzel_state_t *s); #else SPAN_DECLARE(float) goertzel_result(goertzel_state_t *s); #endif /*! \brief Update the state of a Goertzel transform. \param s The Goertzel context. \param amp The sample to be transformed. */ static __inline__ void goertzel_sample(goertzel_state_t *s, int16_t amp) { #if defined(SPANDSP_USE_FIXED_POINT) int16_t x; int16_t v1; #else float v1; #endif v1 = s->v2; s->v2 = s->v3; #if defined(SPANDSP_USE_FIXED_POINT) x = (((int32_t) s->fac*s->v2) >> 14); /* Scale down the input signal to avoid overflows. 9 bits is enough to monitor the signals of interest with adequate dynamic range and resolution. In telephony we generally only start with 13 or 14 bits, anyway. */ s->v3 = x - v1 + (amp >> 7); #else s->v3 = s->fac*s->v2 - v1 + amp; #endif s->current_sample++; } /*- End of function --------------------------------------------------------*/ /* Scale down the input signal to avoid overflows. 9 bits is enough to monitor the signals of interest with adequate dynamic range and resolution. In telephony we generally only start with 13 or 14 bits, anyway. This is sufficient for the longest Goertzel we currently use. */ #if defined(SPANDSP_USE_FIXED_POINT) #define goertzel_preadjust_amp(amp) (((int16_t) amp) >> 7) #else #define goertzel_preadjust_amp(amp) ((float) amp) #endif /* Minimal update the state of a Goertzel transform. This is similar to goertzel_sample, but more suited to blocks of Goertzels. It assumes the amplitude is pre-shifted, and does not update the per-state sample count. \brief Update the state of a Goertzel transform. \param s The Goertzel context. \param amp The adjusted sample to be transformed. */ #if defined(SPANDSP_USE_FIXED_POINT) static __inline__ void goertzel_samplex(goertzel_state_t *s, int16_t amp) #else static __inline__ void goertzel_samplex(goertzel_state_t *s, float amp) #endif { #if defined(SPANDSP_USE_FIXED_POINT) int16_t x; int16_t v1; #else float v1; #endif v1 = s->v2; s->v2 = s->v3; #if defined(SPANDSP_USE_FIXED_POINT) x = (((int32_t) s->fac*s->v2) >> 14); s->v3 = x - v1 + amp; #else s->v3 = s->fac*s->v2 - v1 + amp; #endif } /*- End of function --------------------------------------------------------*/ /*! Generate a Hamming weighted coefficient set, to be used for a periodogram analysis. \param coeffs The generated coefficients. \param freq The frequency to be matched by the periodogram, in Hz. \param sample_rate The sample rate of the signal, in samples per second. \param window_len The length of the periodogram window. This must be an even number. \return The number of generated coefficients. */ SPAN_DECLARE(int) periodogram_generate_coeffs(complexf_t coeffs[], float freq, int sample_rate, int window_len); /*! Generate the phase offset to be expected between successive periodograms evaluated at the specified interval. \param offset A point to the generated phase offset. \param freq The frequency being matched by the periodogram, in Hz. \param sample_rate The sample rate of the signal, in samples per second. \param interval The interval between periodograms, in samples. \return The scaling factor. */ SPAN_DECLARE(float) periodogram_generate_phase_offset(complexf_t *offset, float freq, int sample_rate, int interval); /*! Evaluate a periodogram. \param coeffs A set of coefficients generated by periodogram_generate_coeffs(). \param amp The complex amplitude of the signal. \param len The length of the periodogram, in samples. This must be an even number. \return The periodogram result. */ SPAN_DECLARE(complexf_t) periodogram(const complexf_t coeffs[], const complexf_t amp[], int len); /*! Prepare data for evaluating a set of periodograms. \param sum A vector of sums of pairs of signal samples. This will be half the length of len. \param diff A vector of differences between pairs of signal samples. This will be half the length of len. \param amp The complex amplitude of the signal. \param len The length of the periodogram, in samples. This must be an even number. \return The length of the vectors sum and diff. */ SPAN_DECLARE(int) periodogram_prepare(complexf_t sum[], complexf_t diff[], const complexf_t amp[], int len); /*! Evaluate a periodogram, based on data prepared by periodogram_prepare(). This is more efficient than using periodogram() when several periodograms are to be applied to the same signal. \param coeffs A set of coefficients generated by periodogram_generate_coeffs(). \param sum A vector of sums produced by periodogram_prepare(). \param diff A vector of differences produced by periodogram_prepare(). \param len The length of the periodogram, in samples. This must be an even number. \return The periodogram result. */ SPAN_DECLARE(complexf_t) periodogram_apply(const complexf_t coeffs[], const complexf_t sum[], const complexf_t diff[], int len); /*! Apply a phase offset, to find the frequency error between periodogram evaluations. specified interval. \param phase_offset A point to the expected phase offset. \param scale The scaling factor to be used. \param last_result A pointer to the previous periodogram result. \param result A pointer to the current periodogram result. \return The frequency error, in Hz. */ SPAN_DECLARE(float) periodogram_freq_error(const complexf_t *phase_offset, float scale, const complexf_t *last_result, const complexf_t *result); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/bell_r2_mf.h0000664000175000017500000002611611422612263014530 00000000000000/* * SpanDSP - a series of DSP components for telephony * * bell_r2_mf.h - Bell MF and MFC/R2 tone generation and detection. * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_BELL_R2_MF_H_) #define _SPANDSP_BELL_R2_MF_H_ /*! \page mfc_r2_tone_generation_page MFC/R2 tone generation \section mfc_r2_tone_generation_page_sec_1 What does it do? The MFC/R2 tone generation module provides for the generation of the repertoire of 15 dual tones needs for the digital MFC/R2 signalling protocol. \section mfc_r2_tone_generation_page_sec_2 How does it work? */ /*! \page bell_mf_tone_generation_page Bell MF tone generation \section bell_mf_tone_generation_page_sec_1 What does it do? The Bell MF tone generation module provides for the generation of the repertoire of 15 dual tones needs for various Bell MF signalling protocols. \section bell_mf_tone_generation_page_sec_2 How does it work? Basic Bell MF tone generation specs: - Tone on time = KP: 100+-7ms. All other signals: 68+-7ms - Tone off time (between digits) = 68+-7ms - Frequency tolerance +- 1.5% - Signal level -7+-1dBm per frequency */ /*! \page mfc_r2_tone_rx_page MFC/R2 tone receiver \section mfc_r2_tone_rx_page_sec_1 What does it do? The MFC/R2 tone receiver module provides for the detection of the repertoire of 15 dual tones needs for the digital MFC/R2 signalling protocol. It is compliant with ITU-T Q.441D. \section mfc_r2_tone_rx_page_sec_2 How does it work? Basic MFC/R2 tone detection specs: - Receiver response range: -5dBm to -35dBm - Difference in level for a pair of frequencies - Adjacent tones: <5dB - Non-adjacent tones: <7dB - Receiver not to detect a signal of 2 frequencies of level -5dB and duration <7ms. - Receiver not to recognise a signal of 2 frequencies having a difference in level >=20dB. - Max received signal frequency error: +-10Hz - The sum of the operate and release times of a 2 frequency signal not to exceed 80ms (there are no individual specs for the operate and release times). - Receiver not to release for signal interruptions <=7ms. - System malfunction due to signal interruptions >7ms (typically 20ms) is prevented by further logic elements. */ /*! \page bell_mf_tone_rx_page Bell MF tone receiver \section bell_mf_tone_rx_page_sec_1 What does it do? The Bell MF tone receiver module provides for the detection of the repertoire of 15 dual tones needs for various Bell MF signalling protocols. It is compliant with ITU-T Q.320, ITU-T Q.322, ITU-T Q.323B. \section bell_mf_tone_rx_page_sec_2 How does it work? Basic Bell MF tone detection specs: - Frequency tolerance +- 1.5% +-10Hz - Signal level -14dBm to 0dBm - Perform a "two and only two tones present" test. - Twist <= 6dB accepted - Receiver sensitive to signals above -22dBm per frequency - Test for a minimum of 55ms if KP, or 30ms of other signals. - Signals to be recognised if the two tones arrive within 8ms of each other. - Invalid signals result in the return of the re-order tone. Note: Above -3dBm the signal starts to clip. We can detect with a little clipping, but not up to 0dBm, which the above spec seems to require. There isn't a lot we can do about that. Is the spec. incorrectly worded about the dBm0 reference point, or have I misunderstood it? */ /*! The maximum number of Bell MF digits we can buffer. */ #define MAX_BELL_MF_DIGITS 128 /*! Bell MF generator state descriptor. This defines the state of a single working instance of a Bell MF generator. */ typedef struct bell_mf_tx_state_s bell_mf_tx_state_t; /*! Bell MF digit detector descriptor. */ typedef struct bell_mf_rx_state_s bell_mf_rx_state_t; /*! MFC/R2 tone detector descriptor. */ typedef struct r2_mf_tx_state_s r2_mf_tx_state_t; /*! MFC/R2 tone detector descriptor. */ typedef struct r2_mf_rx_state_s r2_mf_rx_state_t; #if defined(__cplusplus) extern "C" { #endif /*! \brief Generate a buffer of Bell MF tones. \param s The Bell MF generator context. \param amp The buffer for the generated signal. \param max_samples The required number of generated samples. \return The number of samples actually generated. This may be less than max_samples if the input buffer empties. */ SPAN_DECLARE(int) bell_mf_tx(bell_mf_tx_state_t *s, int16_t amp[], int max_samples); /*! \brief Put a string of digits in a Bell MF generator's input buffer. \param s The Bell MF generator context. \param digits The string of digits to be added. \param len The length of the string of digits. If negative, the string is assumed to be a NULL terminated string. \return The number of digits actually added. This may be less than the length of the digit string, if the buffer fills up. */ SPAN_DECLARE(int) bell_mf_tx_put(bell_mf_tx_state_t *s, const char *digits, int len); /*! \brief Initialise a Bell MF generator context. \param s The Bell MF generator context. \return A pointer to the Bell MF generator context.*/ SPAN_DECLARE(bell_mf_tx_state_t *) bell_mf_tx_init(bell_mf_tx_state_t *s); /*! \brief Release a Bell MF generator context. \param s The Bell MF generator context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) bell_mf_tx_release(bell_mf_tx_state_t *s); /*! \brief Free a Bell MF generator context. \param s The Bell MF generator context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) bell_mf_tx_free(bell_mf_tx_state_t *s); /*! \brief Generate a block of R2 MF tones. \param s The R2 MF generator context. \param amp The buffer for the generated signal. \param samples The required number of generated samples. \return The number of samples actually generated. */ SPAN_DECLARE(int) r2_mf_tx(r2_mf_tx_state_t *s, int16_t amp[], int samples); /*! \brief Generate a block of R2 MF tones. \param s The R2 MF generator context. \param digit The digit to be generated. \return 0 for OK, or -1 for a bad request. */ SPAN_DECLARE(int) r2_mf_tx_put(r2_mf_tx_state_t *s, char digit); /*! \brief Initialise an R2 MF tone generator context. \param s The R2 MF generator context. \param fwd TRUE if the context is for forward signals. FALSE if the context is for backward signals. \return A pointer to the MFC/R2 generator context.*/ SPAN_DECLARE(r2_mf_tx_state_t *) r2_mf_tx_init(r2_mf_tx_state_t *s, int fwd); /*! \brief Release an R2 MF tone generator context. \param s The R2 MF tone generator context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) r2_mf_tx_release(r2_mf_tx_state_t *s); /*! \brief Free an R2 MF tone generator context. \param s The R2 MF tone generator context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) r2_mf_tx_free(r2_mf_tx_state_t *s); /*! Process a block of received Bell MF audio samples. \brief Process a block of received Bell MF audio samples. \param s The Bell MF receiver context. \param amp The audio sample buffer. \param samples The number of samples in the buffer. \return The number of samples unprocessed. */ SPAN_DECLARE(int) bell_mf_rx(bell_mf_rx_state_t *s, const int16_t amp[], int samples); /*! \brief Get a string of digits from a Bell MF receiver's output buffer. \param s The Bell MF receiver context. \param buf The buffer for the received digits. \param max The maximum number of digits to be returned, \return The number of digits actually returned. */ SPAN_DECLARE(size_t) bell_mf_rx_get(bell_mf_rx_state_t *s, char *buf, int max); /*! \brief Initialise a Bell MF receiver context. \param s The Bell MF receiver context. \param callback An optional callback routine, used to report received digits. If no callback routine is set, digits may be collected, using the bell_mf_rx_get() function. \param user_data An opaque pointer which is associated with the context, and supplied in callbacks. \return A pointer to the Bell MF receiver context.*/ SPAN_DECLARE(bell_mf_rx_state_t *) bell_mf_rx_init(bell_mf_rx_state_t *s, digits_rx_callback_t callback, void *user_data); /*! \brief Release a Bell MF receiver context. \param s The Bell MF receiver context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) bell_mf_rx_release(bell_mf_rx_state_t *s); /*! \brief Free a Bell MF receiver context. \param s The Bell MF receiver context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) bell_mf_rx_free(bell_mf_rx_state_t *s); /*! Process a block of received R2 MF audio samples. \brief Process a block of received R2 MF audio samples. \param s The R2 MF receiver context. \param amp The audio sample buffer. \param samples The number of samples in the buffer. \return The number of samples unprocessed. */ SPAN_DECLARE(int) r2_mf_rx(r2_mf_rx_state_t *s, const int16_t amp[], int samples); /*! \brief Get the current digit from an R2 MF receiver. \param s The R2 MF receiver context. \return The number digits being received. */ SPAN_DECLARE(int) r2_mf_rx_get(r2_mf_rx_state_t *s); /*! \brief Initialise an R2 MF receiver context. \param s The R2 MF receiver context. \param fwd TRUE if the context is for forward signals. FALSE if the context is for backward signals. \param callback An optional callback routine, used to report received digits. If no callback routine is set, digits may be collected, using the r2_mf_rx_get() function. \param user_data An opaque pointer which is associated with the context, and supplied in callbacks. \return A pointer to the R2 MF receiver context. */ SPAN_DECLARE(r2_mf_rx_state_t *) r2_mf_rx_init(r2_mf_rx_state_t *s, int fwd, tone_report_func_t callback, void *user_data); /*! \brief Release an R2 MF receiver context. \param s The R2 MF receiver context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) r2_mf_rx_release(r2_mf_rx_state_t *s); /*! \brief Free an R2 MF receiver context. \param s The R2 MF receiver context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) r2_mf_rx_free(r2_mf_rx_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/v42bis.h0000664000175000017500000001164312100752765013643 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v42bis.h * * Written by Steve Underwood * * Copyright (C) 2005, 2011 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page v42bis_page V.42bis modem data compression \section v42bis_page_sec_1 What does it do? The v.42bis specification defines a data compression scheme, to work in conjunction with the error correction scheme defined in V.42. \section v42bis_page_sec_2 How does it work? */ #if !defined(_SPANDSP_V42BIS_H_) #define _SPANDSP_V42BIS_H_ #define V42BIS_MIN_STRING_SIZE 6 #define V42BIS_MAX_STRING_SIZE 250 #define V42BIS_MIN_DICTIONARY_SIZE 512 #define V42BIS_MAX_BITS 12 #define V42BIS_MAX_CODEWORDS 4096 /* 2^V42BIS_MAX_BITS */ #define V42BIS_MAX_OUTPUT_LENGTH 1024 enum { V42BIS_P0_NEITHER_DIRECTION = 0, V42BIS_P0_INITIATOR_RESPONDER, V42BIS_P0_RESPONDER_INITIATOR, V42BIS_P0_BOTH_DIRECTIONS }; enum { V42BIS_COMPRESSION_MODE_DYNAMIC = 0, V42BIS_COMPRESSION_MODE_ALWAYS, V42BIS_COMPRESSION_MODE_NEVER }; /*! V.42bis compression/decompression descriptor. This defines the working state for a single instance of V.42bis compress/decompression. */ typedef struct v42bis_state_s v42bis_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Compress a block of octets. \param s The V.42bis context. \param buf The data to be compressed. \param len The length of the data buffer. \return 0 */ SPAN_DECLARE(int) v42bis_compress(v42bis_state_t *s, const uint8_t buf[], int len); /*! Flush out any data remaining in a compression buffer. \param s The V.42bis context. \return 0 */ SPAN_DECLARE(int) v42bis_compress_flush(v42bis_state_t *s); /*! Decompress a block of octets. \param s The V.42bis context. \param buf The data to be decompressed. \param len The length of the data buffer. \return 0 */ SPAN_DECLARE(int) v42bis_decompress(v42bis_state_t *s, const uint8_t buf[], int len); /*! Flush out any data remaining in the decompression buffer. \param s The V.42bis context. \return 0 */ SPAN_DECLARE(int) v42bis_decompress_flush(v42bis_state_t *s); /*! Set the compression mode. \param s The V.42bis context. \param mode One of the V.42bis compression modes - V42BIS_COMPRESSION_MODE_DYNAMIC, V42BIS_COMPRESSION_MODE_ALWAYS, V42BIS_COMPRESSION_MODE_NEVER */ SPAN_DECLARE(void) v42bis_compression_control(v42bis_state_t *s, int mode); /*! Initialise a V.42bis context. \param s The V.42bis context. \param negotiated_p0 The negotiated P0 parameter, from the V.42bis spec. \param negotiated_p1 The negotiated P1 parameter, from the V.42bis spec. \param negotiated_p2 The negotiated P2 parameter, from the V.42bis spec. \param encode_handler Encode callback handler. \param encode_user_data An opaque pointer passed to the encode callback handler. \param max_encode_len The maximum length that should be passed to the encode handler. \param decode_handler Decode callback handler. \param decode_user_data An opaque pointer passed to the decode callback handler. \param max_decode_len The maximum length that should be passed to the decode handler. \return The V.42bis context. */ SPAN_DECLARE(v42bis_state_t *) v42bis_init(v42bis_state_t *s, int negotiated_p0, int negotiated_p1, int negotiated_p2, put_msg_func_t encode_handler, void *encode_user_data, int max_encode_len, put_msg_func_t decode_handler, void *decode_user_data, int max_decode_len); /*! Release a V.42bis context. \param s The V.42bis context. \return 0 if OK */ SPAN_DECLARE(int) v42bis_release(v42bis_state_t *s); /*! Free a V.42bis context. \param s The V.42bis context. \return 0 if OK */ SPAN_DECLARE(int) v42bis_free(v42bis_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/dds.h0000664000175000017500000002553112350625140013276 00000000000000/* * SpanDSP - a series of DSP components for telephony * * dds.h * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_DDS_H_) #define _SPANDSP_DDS_H_ #define DDS_PHASE_RATE(frequency) (int32_t) ((frequency)*65536.0f*65536.0f/SAMPLE_RATE) #define DDS_PHASE(angle) (int32_t) ((uint32_t) (((angle < 0.0f) ? (360.0f + angle) : angle)*65536.0f*65536.0f/360.0f)) #if defined(__cplusplus) extern "C" { #endif /*! \brief Convert a 32 bit phase angle to an angle in radians, between 0 and 2*PI \param phase The angle to convert. \return The angle in radians. */ SPAN_DECLARE(float) dds_phase_to_radians(uint32_t phase); /*! \brief Find the phase rate value to achieve a particular frequency. \param frequency The desired frequency, in Hz. \return The phase rate which while achieve the desired frequency. */ SPAN_DECLARE(int32_t) dds_phase_rate(float frequency); /*! \brief Find the frequency, in Hz, equivalent to a phase rate. \param phase_rate The phase rate. \return The equivalent frequency, in Hz. */ SPAN_DECLARE(float) dds_frequency(int32_t phase_rate); /*! \brief Find the scaling factor needed to achieve a specified level in dBm0. \param level The desired signal level, in dBm0. \return The scaling factor. */ SPAN_DECLARE(int16_t) dds_scaling_dbm0(float level); /*! \brief Find the scaling factor needed to achieve a specified level in dBmov. \param level The desired signal level, in dBmov. \return The scaling factor. */ SPAN_DECLARE(int16_t) dds_scaling_dbov(float level); /*! \brief Find the amplitude for a particular phase. \param phase The desired phase 32 bit phase. \return The signal amplitude. */ SPAN_DECLARE(int16_t) dds_lookup(uint32_t phase); /*! \brief Find the amplitude for a particular phase offset from an accumulated phase. \param phase_acc The accumulated phase. \param phase_offset The phase offset. \return The signal amplitude. */ SPAN_DECLARE(int16_t) dds_offset(uint32_t phase_acc, int32_t phase_offset); /*! \brief Advance the phase, without returning any new signal sample. \param phase_acc A pointer to a phase accumulator value. \param phase_rate The phase increment to be applied. */ SPAN_DECLARE(void) dds_advance(uint32_t *phase_acc, int32_t phase_rate); /*! \brief Generate an integer tone sample. \param phase_acc A pointer to a phase accumulator value. \param phase_rate The phase increment to be applied. \return The signal amplitude, between -32767 and 32767. */ SPAN_DECLARE(int16_t) dds(uint32_t *phase_acc, int32_t phase_rate); /*! \brief Lookup the integer value of a specified phase. \param phase The phase accumulator value to be looked up. \return The signal amplitude, between -32767 and 32767. */ SPAN_DECLARE(int16_t) dds_lookup(uint32_t phase); /*! \brief Generate an integer tone sample, with modulation. \param phase_acc A pointer to a phase accumulator value. \param phase_rate The phase increment to be applied. \param scale The scaling factor. \param phase The phase offset. \return The signal amplitude, between -32767 and 32767. */ SPAN_DECLARE(int16_t) dds_mod(uint32_t *phase_acc, int32_t phase_rate, int16_t scale, int32_t phase); /*! \brief Lookup the complex integer value of a specified phase. \param phase The phase accumulator value to be looked up. \return The complex signal amplitude, between (-32767, -32767) and (32767, 32767). */ SPAN_DECLARE(complexi_t) dds_lookup_complexi(uint32_t phase); /*! \brief Generate a complex integer tone sample. \param phase_acc A pointer to a phase accumulator value. \param phase_rate The phase increment to be applied. \return The complex signal amplitude, between (-32767, -32767) and (32767, 32767). */ SPAN_DECLARE(complexi_t) dds_complexi(uint32_t *phase_acc, int32_t phase_rate); /*! \brief Generate a complex integer tone sample, with modulation. \param phase_acc A pointer to a phase accumulator value. \param phase_rate The phase increment to be applied. \param scale The scaling factor. \param phase The phase offset. \return The complex signal amplitude, between (-32767, -32767) and (32767, 32767). */ SPAN_DECLARE(complexi_t) dds_complexi_mod(uint32_t *phase_acc, int32_t phase_rate, int16_t scale, int32_t phase); /*! \brief Generate a complex 16 bit integer tone sample. \param phase_acc A pointer to a phase accumulator value. \param phase_rate The phase increment to be applied. \return The complex signal amplitude, between (-32767, -32767) and (32767, 32767). */ SPAN_DECLARE(complexi16_t) dds_lookup_complexi16(uint32_t phase); /*! \brief Generate a complex 16 bit integer tone sample. \param phase_acc A pointer to a phase accumulator value. \param phase_rate The phase increment to be applied. \return The complex signal amplitude, between (-32767, -32767) and (32767, 32767). */ SPAN_DECLARE(complexi16_t) dds_complexi16(uint32_t *phase_acc, int32_t phase_rate); /*! \brief Generate a complex 16bit integer tone sample, with modulation. \param phase_acc A pointer to a phase accumulator value. \param phase_rate The phase increment to be applied. \param scale The scaling factor. \param phase The phase offset. \return The complex signal amplitude, between (-32767, -32767) and (32767, 32767). */ SPAN_DECLARE(complexi16_t) dds_complexi16_mod(uint32_t *phase_acc, int32_t phase_rate, int16_t scale, int32_t phase); /*! \brief Generate a complex 32 bit integer tone sample, with modulation. \param phase_acc A pointer to a phase accumulator value. \param phase_rate The phase increment to be applied. \param scale The scaling factor. \param phase The phase offset. \return The complex signal amplitude, between (-32767, -32767) and (32767, 32767). */ SPAN_DECLARE(complexi32_t) dds_complexi32_mod(uint32_t *phase_acc, int32_t phase_rate, int16_t scale, int32_t phase); /*! \brief Generate a complex 32 bit integer tone sample. \param phase_acc A pointer to a phase accumulator value. \param phase_rate The phase increment to be applied. \return The complex signal amplitude, between (-32767, -32767) and (32767, 32767). */ SPAN_DECLARE(complexi32_t) dds_lookup_complexi32(uint32_t phase); /*! \brief Generate a complex 32 bit integer tone sample. \param phase_acc A pointer to a phase accumulator value. \param phase_rate The phase increment to be applied. \return The complex signal amplitude, between (-32767, -32767) and (32767, 32767). */ SPAN_DECLARE(complexi32_t) dds_complexi32(uint32_t *phase_acc, int32_t phase_rate); /*! \brief Generate a complex 32 bit integer tone sample, with modulation. \param phase_acc A pointer to a phase accumulator value. \param phase_rate The phase increment to be applied. \param scale The scaling factor. \param phase The phase offset. \return The complex signal amplitude, between (-32767, -32767) and (32767, 32767). */ SPAN_DECLARE(complexi32_t) dds_complexi32_mod(uint32_t *phase_acc, int32_t phase_rate, int16_t scale, int32_t phase); /*! \brief Find the phase rate equivalent to a frequency, in Hz. \param frequency The frequency, in Hz. \return The equivalent phase rate. */ SPAN_DECLARE(int32_t) dds_phase_ratef(float frequency); /*! \brief Find the frequency, in Hz, equivalent to a phase rate. \param phase_rate The phase rate. \return The equivalent frequency, in Hz. */ SPAN_DECLARE(float) dds_frequencyf(int32_t phase_rate); /*! \brief Find the scaling factor equivalent to a dBm0 value. \param level The signal level in dBm0. \return The equivalent scaling factor. */ SPAN_DECLARE(float) dds_scaling_dbm0f(float level); /*! \brief Find the scaling factor equivalent to a dBmov value. \param level The signal level in dBmov. \return The equivalent scaling factor. */ SPAN_DECLARE(float) dds_scaling_dbovf(float level); /*! \brief Advance the phase, without returning any new signal sample. \param phase_acc A pointer to a phase accumulator value. \param phase_rate The phase increment to be applied. */ SPAN_DECLARE(void) dds_advancef(uint32_t *phase_acc, int32_t phase_rate); /*! \brief Generate a floating point tone sample. \param phase_acc A pointer to a phase accumulator value. \param phase_rate The phase increment to be applied. \return The signal amplitude, between -1.0 and 1.0. */ SPAN_DECLARE(float) ddsf(uint32_t *phase_acc, int32_t phase_rate); /*! \brief Lookup the floating point value of a specified phase. \param phase The phase accumulator value to be looked up. \return The signal amplitude, between -1.0 and 1.0. */ SPAN_DECLARE(float) dds_lookupf(uint32_t phase); /*! \brief Generate a floating point tone sample, with modulation. \param phase_acc A pointer to a phase accumulator value. \param phase_rate The phase increment to be applied. \param scale The scaling factor. \param phase The phase offset. \return The signal amplitude, between -1.0 and 1.0. */ SPAN_DECLARE(float) dds_modf(uint32_t *phase_acc, int32_t phase_rate, float scale, int32_t phase); /*! \brief Generate a complex floating point tone sample. \param phase_acc A pointer to a phase accumulator value. \param phase_rate The phase increment to be applied. \return The complex signal amplitude, between (-1.0, -1.0) and (1.0, 1.0). */ SPAN_DECLARE(complexf_t) dds_complexf(uint32_t *phase_acc, int32_t phase_rate); /*! \brief Lookup the complex value of a specified phase. \param phase The phase accumulator value to be looked up. \return The complex signal amplitude, between (-1.0, -1.0) and (1.0, 1.0). */ SPAN_DECLARE(complexf_t) dds_lookup_complexf(uint32_t phase_acc); /*! \brief Generate a complex floating point tone sample, with modulation. \param phase_acc A pointer to a phase accumulator value. \param phase_rate The phase increment to be applied. \param scale The scaling factor. \param phase The phase offset. \return The complex signal amplitude, between (-1.0, -1.0) and (1.0, 1.0). */ SPAN_DECLARE(complexf_t) dds_complex_modf(uint32_t *phase_acc, int32_t phase_rate, float scale, int32_t phase); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/expose.h0000664000175000017500000000664012101002627014020 00000000000000/* * SpanDSP - a series of DSP components for telephony * * expose.h - Expose the internal structures of spandsp, for users who * really need that. * * Written by Steve Underwood * * Copyright (C) 2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /* TRY TO ONLY INCLUDE THIS IF YOU REALLY REALLY HAVE TO */ #if !defined(_SPANDSP_EXPOSE_H_) #define _SPANDSP_EXPOSE_H_ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /*#include */ /*#include */ #include #include #include #include #include #include #include #include /*#include */ /*#include */ #include #include #include #include #include #include #include #include #include #include #include #include #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/modem_connect_tones.h0000664000175000017500000001734212100762017016545 00000000000000/* * SpanDSP - a series of DSP components for telephony * * modem_connect_tones.c - Generation and detection of tones * associated with modems calling and * answering calls. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_MODEM_CONNECT_TONES_H_) #define _SPANDSP_MODEM_CONNECT_TONES_H_ /*! \page modem_connect_tones_page Modem connect tone detection \section modem_connect_tones_page_sec_1 What does it do? Some telephony terminal equipment, such as modems, require a channel which is as clear as possible. They use their own echo cancellation. If the network is also performing echo cancellation the two cancellors can end up squabbling about the nature of the channel, with bad results. A special tone is defined which should cause the network to disable any echo cancellation processes. This is the echo canceller disable tone. The tone detector's design assumes the channel is free of any DC component. \section modem_connect_tones_page_sec_2 How does it work? A sharp notch filter is implemented as a single bi-quad section. The presence of the 2100Hz disable tone is detected by comparing the notched filtered energy with the unfiltered energy. If the notch filtered energy is much lower than the unfiltered energy, then a large proportion of the energy must be at the notch frequency. This type of detector may seem less intuitive than using a narrow bandpass filter to isolate the energy at the notch freqency. However, a sharp bandpass implemented as an IIR filter rings badly. The reciprocal notch filter is very well behaved for our purpose. */ enum { /*! \brief This is reported when a tone stops. */ MODEM_CONNECT_TONES_NONE = 0, /*! \brief CNG tone is a pure 1100Hz tone, in 0.5s bursts, with 3s silences in between. The bursts repeat for as long as is required. */ MODEM_CONNECT_TONES_FAX_CNG = 1, /*! \brief ANS tone is a pure continuous 2100Hz+-15Hz tone for 3.3s+-0.7s. */ MODEM_CONNECT_TONES_ANS = 2, /*! \brief ANS with phase reversals tone is a 2100Hz+-15Hz tone for 3.3s+-0.7s, with a 180 degree phase jump every 450ms+-25ms. */ MODEM_CONNECT_TONES_ANS_PR = 3, /*! \brief The ANSam tone is a version of ANS with 20% of 15Hz+-0.1Hz AM modulation, as per V.8 */ MODEM_CONNECT_TONES_ANSAM = 4, /*! \brief The ANSam with phase reversals tone is a version of ANS_PR with 20% of 15Hz+-0.1Hz AM modulation, as per V.8 */ MODEM_CONNECT_TONES_ANSAM_PR = 5, /*! \brief FAX preamble in a string of V.21 HDLC flag octets. */ MODEM_CONNECT_TONES_FAX_PREAMBLE = 6, /*! \brief CED tone is the same as ANS tone. FAX preamble in a string of V.21 HDLC flag octets. This is only valid as a tone type to receive. It is never reported as a detected tone type. The report will either be for FAX preamble or CED/ANS tone. */ MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE = 7, /*! \brief Bell ANS tone is a pure continuous 2225Hz+-15Hz tone for 3.3s+-0.7s. */ MODEM_CONNECT_TONES_BELL_ANS = 8, /*! \brief Calling tone is a pure 1300Hz tone, in 0.6s bursts, with 2s silences in between. The bursts repeat for as long as is required. */ MODEM_CONNECT_TONES_CALLING_TONE = 9 }; /*! \brief FAX CED tone is the same as ANS tone. */ #define MODEM_CONNECT_TONES_FAX_CED MODEM_CONNECT_TONES_ANS /*! Modem connect tones generator descriptor. This defines the state of a single working instance of the tone generator. */ typedef struct modem_connect_tones_tx_state_s modem_connect_tones_tx_state_t; /*! Modem connect tones receiver descriptor. This defines the state of a single working instance of the tone detector. */ typedef struct modem_connect_tones_rx_state_s modem_connect_tones_rx_state_t; #if defined(__cplusplus) extern "C" { #endif /*! \brief Initialise an instance of the modem connect tones generator. \param s The context. */ SPAN_DECLARE(modem_connect_tones_tx_state_t *) modem_connect_tones_tx_init(modem_connect_tones_tx_state_t *s, int tone_type); /*! \brief Release an instance of the modem connect tones generator. \param s The context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) modem_connect_tones_tx_release(modem_connect_tones_tx_state_t *s); /*! \brief Free an instance of the modem connect tones generator. \param s The context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) modem_connect_tones_tx_free(modem_connect_tones_tx_state_t *s); /*! \brief Generate a block of modem connect tones samples. \param s The context. \param amp An array of signal samples. \param len The number of samples to generate. \return The number of samples generated. */ SPAN_DECLARE_NONSTD(int) modem_connect_tones_tx(modem_connect_tones_tx_state_t *s, int16_t amp[], int len); /*! \brief Process a block of samples through an instance of the modem connect tones detector. \param s The context. \param amp An array of signal samples. \param len The number of samples in the array. \return The number of unprocessed samples. */ SPAN_DECLARE_NONSTD(int) modem_connect_tones_rx(modem_connect_tones_rx_state_t *s, const int16_t amp[], int len); /*! \brief Test if a modem_connect tone has been detected. \param s The context. \return TRUE if tone is detected, else FALSE. */ SPAN_DECLARE(int) modem_connect_tones_rx_get(modem_connect_tones_rx_state_t *s); /*! \brief Initialise an instance of the modem connect tones detector. \param s The context. \param tone_type The type of connect tone being tested for. \param tone_callback An optional callback routine, used to report tones \param user_data An opaque pointer passed to the callback routine, \return A pointer to the context. */ SPAN_DECLARE(modem_connect_tones_rx_state_t *) modem_connect_tones_rx_init(modem_connect_tones_rx_state_t *s, int tone_type, tone_report_func_t tone_callback, void *user_data); /*! \brief Release an instance of the modem connect tones detector. \param s The context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) modem_connect_tones_rx_release(modem_connect_tones_rx_state_t *s); /*! \brief Free an instance of the modem connect tones detector. \param s The context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) modem_connect_tones_rx_free(modem_connect_tones_rx_state_t *s); SPAN_DECLARE(const char *) modem_connect_tone_to_str(int tone); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/at_interpreter.h0000664000175000017500000001372112100750604015546 00000000000000/* * SpanDSP - a series of DSP components for telephony * * at_interpreter.h - AT command interpreter to V.251, V.252, V.253, T.31 and the 3GPP specs. * * Written by Steve Underwood * * Copyright (C) 2004, 2005, 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_AT_INTERPRETER_H_) #define _SPANDSP_AT_INTERPRETER_H_ /*! \page at_page AT command interpreter \section at_page_sec_1 What does it do? The AT interpreter module implements V.251, V.252, V.253, T.31 and various 3GPP modem control commands. \section at_page_sec_2 How does it work? */ enum at_rx_mode_e { AT_MODE_ONHOOK_COMMAND, AT_MODE_OFFHOOK_COMMAND, AT_MODE_CONNECTED, AT_MODE_DELIVERY, AT_MODE_HDLC, AT_MODE_STUFFED }; enum at_call_event_e { AT_CALL_EVENT_ALERTING = 1, AT_CALL_EVENT_CONNECTED, AT_CALL_EVENT_ANSWERED, AT_CALL_EVENT_BUSY, AT_CALL_EVENT_NO_DIALTONE, AT_CALL_EVENT_NO_ANSWER, AT_CALL_EVENT_HANGUP }; enum at_modem_control_operation_e { /*! Start an outgoing call. */ AT_MODEM_CONTROL_CALL, /*! Answer an incoming call. */ AT_MODEM_CONTROL_ANSWER, /*! Hangup a call. */ AT_MODEM_CONTROL_HANGUP, /*! Take the line off hook. */ AT_MODEM_CONTROL_OFFHOOK, /*! Put the line on hook. */ AT_MODEM_CONTROL_ONHOOK, /*! Control V.24 Circuit 108, "data terminal ready". */ AT_MODEM_CONTROL_DTR, /*! Control V.24 Circuit 105, "request to send". */ AT_MODEM_CONTROL_RTS, /*! Control V.24 Circuit 106, "clear to send". */ AT_MODEM_CONTROL_CTS, /*! Control V.24 Circuit 109, "receive line signal detector" (i.e. carrier detect). */ AT_MODEM_CONTROL_CAR, /*! Control V.24 Circuit 125, "ring indicator". */ AT_MODEM_CONTROL_RNG, /*! Control V.24 Circuit 107, "data set ready". */ AT_MODEM_CONTROL_DSR, /*! Set the caller ID for outgoing calls. */ AT_MODEM_CONTROL_SETID, /* The remainder of the control functions should not get past the modem, to the application. */ AT_MODEM_CONTROL_RESTART, AT_MODEM_CONTROL_DTE_TIMEOUT }; enum { AT_RESPONSE_CODE_OK = 0, AT_RESPONSE_CODE_CONNECT, AT_RESPONSE_CODE_RING, AT_RESPONSE_CODE_NO_CARRIER, AT_RESPONSE_CODE_ERROR, AT_RESPONSE_CODE_XXX, AT_RESPONSE_CODE_NO_DIALTONE, AT_RESPONSE_CODE_BUSY, AT_RESPONSE_CODE_NO_ANSWER, AT_RESPONSE_CODE_FCERROR, AT_RESPONSE_CODE_FRH3 }; typedef struct at_state_s at_state_t; typedef int (at_modem_control_handler_t)(at_state_t *s, void *user_data, int op, const char *num); typedef int (at_tx_handler_t)(at_state_t *s, void *user_data, const uint8_t *buf, size_t len); typedef int (at_class1_handler_t)(at_state_t *s, void *user_data, int direction, int operation, int val); /*! AT profile. */ typedef struct { /*! TRUE if character echo is enabled */ int echo; /*! TRUE if verbose reporting is enabled */ int verbose; /*! TRUE if result codes are verbose */ int result_code_format; /*! TRUE if pulse dialling is the default */ int pulse_dial; /*! ??? */ int double_escape; /*! ??? */ int adaptive_receive; /*! The state of all possible S registers */ uint8_t s_regs[100]; } at_profile_t; #if defined(__cplusplus) extern "C" { #endif SPAN_DECLARE(void) at_set_at_rx_mode(at_state_t *s, int new_mode); SPAN_DECLARE(void) at_put_response(at_state_t *s, const char *t); SPAN_DECLARE(void) at_put_numeric_response(at_state_t *s, int val); SPAN_DECLARE(void) at_put_response_code(at_state_t *s, int code); SPAN_DECLARE(void) at_reset_call_info(at_state_t *s); /*! Set the call information for an AT interpreter. \brief Set the call information for an AT interpreter. \param s The AT interpreter context. \param id . \param value . */ SPAN_DECLARE(void) at_set_call_info(at_state_t *s, char const *id, char const *value); SPAN_DECLARE(void) at_display_call_info(at_state_t *s); SPAN_DECLARE(int) at_modem_control(at_state_t *s, int op, const char *num); SPAN_DECLARE(void) at_call_event(at_state_t *s, int event); SPAN_DECLARE(void) at_interpreter(at_state_t *s, const char *cmd, int len); SPAN_DECLARE(void) at_set_class1_handler(at_state_t *s, at_class1_handler_t handler, void *user_data); /*! Initialise an AT interpreter context. \brief Initialise an AT interpreter context. \param s The AT context. \param at_tx_handler x. \param at_tx_user_data x. \param modem_control_handler x. \param modem_control_user_data x. \return A pointer to the AT context, or NULL if there was a problem. */ SPAN_DECLARE(at_state_t *) at_init(at_state_t *s, at_tx_handler_t *at_tx_handler, void *at_tx_user_data, at_modem_control_handler_t *modem_control_handler, void *modem_control_user_data); /*! Release an AT interpreter context. \brief Release an AT interpreter context. \param s The AT context. \return 0 for OK */ SPAN_DECLARE(int) at_release(at_state_t *s); /*! Free an AT interpreter context. \brief Free an AT interpreter context. \param s The AT context. \return 0 for OK */ SPAN_DECLARE(int) at_free(at_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/bitstream.h0000664000175000017500000000640211422612263014513 00000000000000/* * SpanDSP - a series of DSP components for telephony * * bitstream.h - Bitstream composition and decomposition routines. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_BITSTREAM_H_) #define _SPANDSP_BITSTREAM_H_ /*! \page bitstream_page Bitstream composition and decomposition \section bitstream_page_sec_1 What does it do? \section bitstream_page_sec_2 How does it work? */ /*! Bitstream handler state */ typedef struct bitstream_state_s bitstream_state_t; #if defined(__cplusplus) extern "C" { #endif /*! \brief Put a chunk of bits into the output buffer. \param s A pointer to the bitstream context. \param c A pointer to the bitstream output buffer. \param value The value to be pushed into the output buffer. \param bits The number of bits of value to be pushed. 1 to 25 bits is valid. */ SPAN_DECLARE(void) bitstream_put(bitstream_state_t *s, uint8_t **c, uint32_t value, int bits); /*! \brief Get a chunk of bits from the input buffer. \param s A pointer to the bitstream context. \param c A pointer to the bitstream input buffer. \param bits The number of bits of value to be grabbed. 1 to 25 bits is valid. \return The value retrieved from the input buffer. */ SPAN_DECLARE(uint32_t) bitstream_get(bitstream_state_t *s, const uint8_t **c, int bits); /*! \brief Emit any residual bits to the output buffer, without actually flushing them. This is useful for getting the buffer fully up to date, ready for things like CRC calculations, while allowing bitstream_put() to be used to continue the message later. \param s A pointer to the bitstream context. \param c A pointer to the bitstream output buffer. */ SPAN_DECLARE(void) bitstream_emit(bitstream_state_t *s, uint8_t **c); /*! \brief Flush any residual bits to the output buffer. \param s A pointer to the bitstream context. \param c A pointer to the bitstream output buffer. */ SPAN_DECLARE(void) bitstream_flush(bitstream_state_t *s, uint8_t **c); /*! \brief Initialise a bitstream context. \param s A pointer to the bitstream context. \param lsb_first TRUE if the bit stream is LSB first, else its MSB first. \return A pointer to the bitstream context. */ SPAN_DECLARE(bitstream_state_t *) bitstream_init(bitstream_state_t *s, int direction); SPAN_DECLARE(int) bitstream_release(bitstream_state_t *s); SPAN_DECLARE(int) bitstream_free(bitstream_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/t30_api.h0000664000175000017500000006252511422612264013771 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t30_api.h - definitions for T.30 fax processing * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_T30_API_H_) #define _SPANDSP_T30_API_H_ #if defined(__cplusplus) extern "C" { #endif /*! Set the transmitted NSF frame to be associated with a T.30 context. \brief Set the transmitted NSF frame to be associated with a T.30 context. \param s The T.30 context. \param nsf A pointer to the frame. \param len The length of the frame. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t30_set_tx_nsf(t30_state_t *s, const uint8_t *nsf, int len); /*! Get an NSF frame to be associated with a T.30 context. \brief Set an NSF frame to be associated with a T.30 context. \param s The T.30 context. \param nsf A pointer to the frame. \return the length of the NSF message. */ SPAN_DECLARE(size_t) t30_get_tx_nsf(t30_state_t *s, const uint8_t *nsf[]); /*! Get an NSF frame to be associated with a T.30 context. \brief Set an NSF frame to be associated with a T.30 context. \param s The T.30 context. \param nsf A pointer to the frame. \return the length of the NSF message. */ SPAN_DECLARE(size_t) t30_get_rx_nsf(t30_state_t *s, const uint8_t *nsf[]); /*! Set the transmitted NSC frame to be associated with a T.30 context. \brief Set the transmitted NSC frame to be associated with a T.30 context. \param s The T.30 context. \param nsc A pointer to the frame. \param len The length of the frame. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t30_set_tx_nsc(t30_state_t *s, const uint8_t *nsc, int len); /*! Get an NSC frame to be associated with a T.30 context. \brief Set an NSC frame to be associated with a T.30 context. \param s The T.30 context. \param nsc A pointer to the frame. \return the length of the NSC message. */ SPAN_DECLARE(size_t) t30_get_tx_nsc(t30_state_t *s, const uint8_t *nsc[]); /*! Get an NSC frame to be associated with a T.30 context. \brief Set an NSC frame to be associated with a T.30 context. \param s The T.30 context. \param nsc A pointer to the frame. \return the length of the NSC message. */ SPAN_DECLARE(size_t) t30_get_rx_nsc(t30_state_t *s, const uint8_t *nsc[]); /*! Set the transmitted NSS frame to be associated with a T.30 context. \brief Set the transmitted NSS frame to be associated with a T.30 context. \param s The T.30 context. \param nss A pointer to the frame. \param len The length of the frame. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t30_set_tx_nss(t30_state_t *s, const uint8_t *nss, int len); /*! Get an NSS frame to be associated with a T.30 context. \brief Set an NSS frame to be associated with a T.30 context. \param s The T.30 context. \param nss A pointer to the frame. \return the length of the NSS message. */ SPAN_DECLARE(size_t) t30_get_tx_nss(t30_state_t *s, const uint8_t *nss[]); /*! Get an NSS frame to be associated with a T.30 context. \brief Set an NSS frame to be associated with a T.30 context. \param s The T.30 context. \param nss A pointer to the frame. \return the length of the NSS message. */ SPAN_DECLARE(size_t) t30_get_rx_nss(t30_state_t *s, const uint8_t *nss[]); /*! Set the transmitted identifier associated with a T.30 context. \brief Set the transmitted identifier associated with a T.30 context. \param s The T.30 context. \param id A pointer to the identifier. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t30_set_tx_ident(t30_state_t *s, const char *id); /*! Get the transmitted identifier associated with a T.30 context. \brief Set the transmitted identifier associated with a T.30 context. \param s The T.30 context. \return A pointer to the identifier. */ SPAN_DECLARE(const char *) t30_get_tx_ident(t30_state_t *s); /*! Get the transmitted identifier associated with a T.30 context. \brief Set the transmitted identifier associated with a T.30 context. \param s The T.30 context. \return A pointer to the identifier. */ SPAN_DECLARE(const char *) t30_get_rx_ident(t30_state_t *s); /*! Set the transmitted sub-address associated with a T.30 context. \brief Set the transmitted sub-address associated with a T.30 context. \param s The T.30 context. \param sub_address A pointer to the sub-address. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t30_set_tx_sub_address(t30_state_t *s, const char *sub_address); /*! Get the received sub-address associated with a T.30 context. \brief Get the received sub-address associated with a T.30 context. \param s The T.30 context. \return A pointer to the sub-address. */ SPAN_DECLARE(const char *) t30_get_tx_sub_address(t30_state_t *s); /*! Get the received sub-address associated with a T.30 context. \brief Get the received sub-address associated with a T.30 context. \param s The T.30 context. \return A pointer to the sub-address. */ SPAN_DECLARE(const char *) t30_get_rx_sub_address(t30_state_t *s); /*! Set the transmitted selective polling address (i.e. the one we will send to the far end) associated with a T.30 context. \brief Set the transmitted selective polling address associated with a T.30 context. \param s The T.30 context. \param selective_polling_address A pointer to the selective polling address. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t30_set_tx_selective_polling_address(t30_state_t *s, const char *selective_polling_address); /*! Get the received selective polling address (i.e. the one we will send to the far end) associated with a T.30 context. \brief Get the received selective polling address associated with a T.30 context. \param s The T.30 context. \return A pointer to the selective polling address. */ SPAN_DECLARE(const char *) t30_get_tx_selective_polling_address(t30_state_t *s); /*! Get the received selective polling address (i.e. the one we will send to the far end) associated with a T.30 context. \brief Get the received selective polling address associated with a T.30 context. \param s The T.30 context. \return A pointer to the selective polling address. */ SPAN_DECLARE(const char *) t30_get_rx_selective_polling_address(t30_state_t *s); /*! Set the transmitted polled sub-address (i.e. the one we will send to the far end) associated with a T.30 context. \brief Set the transmitted polled sub-address associated with a T.30 context. \param s The T.30 context. \param polled_sub_address A pointer to the polled sub-address. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t30_set_tx_polled_sub_address(t30_state_t *s, const char *polled_sub_address); /*! Get the received polled sub-address (i.e. the one we will send to the far end) associated with a T.30 context. \brief Get the received polled sub-address associated with a T.30 context. \param s The T.30 context. \return A pointer to the polled sub-address. */ SPAN_DECLARE(const char *) t30_get_tx_polled_sub_address(t30_state_t *s); /*! Get the received polled sub-address (i.e. the one we will send to the far end) associated with a T.30 context. \brief Get the received polled sub-address associated with a T.30 context. \param s The T.30 context. \return A pointer to the polled sub-address. */ SPAN_DECLARE(const char *) t30_get_rx_polled_sub_address(t30_state_t *s); /*! Set the transmitted sender ident (i.e. the one we will send to the far end) associated with a T.30 context. \brief Set the transmitted sender ident associated with a T.30 context. \param s The T.30 context. \param sender_ident A pointer to the sender ident. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t30_set_tx_sender_ident(t30_state_t *s, const char *sender_ident); /*! Get the received sender ident (i.e. the one we will send to the far end) associated with a T.30 context. \brief Get the received sender ident associated with a T.30 context. \param s The T.30 context. \return A pointer to the sender ident. */ SPAN_DECLARE(const char *) t30_get_tx_sender_ident(t30_state_t *s); /*! Get the received sender ident (i.e. the one we will send to the far end) associated with a T.30 context. \brief Get the received sender ident associated with a T.30 context. \param s The T.30 context. \return A pointer to the sender ident. */ SPAN_DECLARE(const char *) t30_get_rx_sender_ident(t30_state_t *s); /*! Set the transmitted password (i.e. the one we will send to the far end) associated with a T.30 context. \brief Set the transmitted password associated with a T.30 context. \param s The T.30 context. \param password A pointer to the password. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t30_set_tx_password(t30_state_t *s, const char *password); /*! Get the received password (i.e. the one we will send to the far end) associated with a T.30 context. \brief Get the received password associated with a T.30 context. \param s The T.30 context. \return A pointer to the password. */ SPAN_DECLARE(const char *) t30_get_tx_password(t30_state_t *s); /*! Get the received password (i.e. the one we will send to the far end) associated with a T.30 context. \brief Get the received password associated with a T.30 context. \param s The T.30 context. \return A pointer to the password. */ SPAN_DECLARE(const char *) t30_get_rx_password(t30_state_t *s); /*! Set the transmitted TSA (i.e. the one we will send to the far end) associated with a T.30 context. \brief Set the transmitted TSA associated with a T.30 context. \param s The T.30 context. \param type The type of address. \param address A pointer to the address. \param len The length of the address. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t30_set_tx_tsa(t30_state_t *s, int type, const char *address, int len); /*! Get the transmitted TSA (i.e. the one we will send to the far end) associated with a T.30 context. \brief Get the received TSA associated with a T.30 context. \param s The T.30 context. \param type The type of address. \param address A pointer to the address. \return The length of the address. */ SPAN_DECLARE(size_t) t30_get_tx_tsa(t30_state_t *s, int *type, const char *address[]); /*! Get the received TSA associated with a T.30 context. \brief Get the received TSA associated with a T.30 context. \param s The T.30 context. \param type The type of address. \param address A pointer to the address. \return The length of the address. */ SPAN_DECLARE(size_t) t30_get_rx_tsa(t30_state_t *s, int *type, const char *address[]); /*! Set the transmitted IRA (i.e. the one we will send to the far end) associated with a T.30 context. \brief Set the transmitted IRA associated with a T.30 context. \param s The T.30 context. \param type The type of address. \param address A pointer to the address. \param len The length of the address. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t30_set_tx_ira(t30_state_t *s, int type, const char *address, int len); /*! Get the transmitted IRA (i.e. the one we will send to the far end) associated with a T.30 context. \brief Get the received IRA associated with a T.30 context. \param s The T.30 context. \param type The type of address. \param address A pointer to the address. \return The length of the address. */ SPAN_DECLARE(size_t) t30_get_tx_ira(t30_state_t *s, int *type, const char *address[]); /*! Get the received IRA associated with a T.30 context. \brief Get the received IRA associated with a T.30 context. \param s The T.30 context. \param type The type of address. \param address A pointer to the address. \return The length of the address. */ SPAN_DECLARE(size_t) t30_get_rx_ira(t30_state_t *s, int *type, const char *address[]); /*! Set the transmitted CIA (i.e. the one we will send to the far end) associated with a T.30 context. \brief Set the transmitted CIA associated with a T.30 context. \param s The T.30 context. \param type The type of address. \param address A pointer to the address. \param len The length of the address. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t30_set_tx_cia(t30_state_t *s, int type, const char *address, int len); /*! Get the transmitted CIA (i.e. the one we will send to the far end) associated with a T.30 context. \brief Get the received CIA associated with a T.30 context. \param s The T.30 context. \param type The type of address. \param address A pointer to the address. \return The length of the address. */ SPAN_DECLARE(size_t) t30_get_tx_cia(t30_state_t *s, int *type, const char *address[]); /*! Get the received CIA associated with a T.30 context. \brief Get the received CIA associated with a T.30 context. \param s The T.30 context. \param type The type of address. \param address A pointer to the address. \return 0 for OK, else -1. */ SPAN_DECLARE(size_t) t30_get_rx_cia(t30_state_t *s, int *type, const char *address[]); /*! Set the transmitted ISP (i.e. the one we will send to the far end) associated with a T.30 context. \brief Set the transmitted ISP associated with a T.30 context. \param s The T.30 context. \param type The type of address. \param address A pointer to the address. \param len The length of the address. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t30_set_tx_isp(t30_state_t *s, int type, const char *address, int len); /*! Get the transmitted ISP (i.e. the one we will send to the far end) associated with a T.30 context. \brief Get the received ISP associated with a T.30 context. \param s The T.30 context. \param type The type of address. \param address A pointer to the address. \return 0 for OK, else -1. */ SPAN_DECLARE(size_t) t30_get_tx_isp(t30_state_t *s, int *type, const char *address[]); /*! Get the received ISP associated with a T.30 context. \brief Get the received ISP associated with a T.30 context. \param s The T.30 context. \param type The type of address. \param address A pointer to the address. \return 0 for OK, else -1. */ SPAN_DECLARE(size_t) t30_get_rx_isp(t30_state_t *s, int *type, const char *address[]); /*! Set the transmitted CSA (i.e. the one we will send to the far end) associated with a T.30 context. \brief Set the transmitted CSA associated with a T.30 context. \param s The T.30 context. \param type The type of address. \param address A pointer to the address. \param len The length of the address. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t30_set_tx_csa(t30_state_t *s, int type, const char *address, int len); /*! Get the transmitted CSA (i.e. the one we will send to the far end) associated with a T.30 context. \brief Get the received CSA associated with a T.30 context. \param s The T.30 context. \param type The type of address. \param address A pointer to the address. \return The length of the address. */ SPAN_DECLARE(size_t) t30_get_tx_csa(t30_state_t *s, int *type, const char *address[]); /*! Get the received CSA associated with a T.30 context. \brief Get the received CSA associated with a T.30 context. \param s The T.30 context. \param type The type of address. \param address A pointer to the address. \return 0 for OK, else -1. */ SPAN_DECLARE(size_t) t30_get_rx_csa(t30_state_t *s, int *type, const char *address[]); /*! Set page header extends or overlays the image mode. \brief Set page header overlay mode. \param s The T.30 context. \param header_overlays_image TRUE for overlay, or FALSE for extend the page. */ SPAN_DECLARE(int) t30_set_tx_page_header_overlays_image(t30_state_t *s, int header_overlays_image); /*! Set the transmitted header information associated with a T.30 context. \brief Set the transmitted header information associated with a T.30 context. \param s The T.30 context. \param info A pointer to the information string. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t30_set_tx_page_header_info(t30_state_t *s, const char *info); /*! Set the transmitted header timestamp timezone associated with a T.30 context. \brief Set the transmitted header timestamp timezone associated with a T.30 context. \param s The T.30 context. \param info A pointer to the POSIZ timezone string. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t30_set_tx_page_header_tz(t30_state_t *s, const char *tzstring); /*! Get the header information associated with a T.30 context. \brief Get the header information associated with a T.30 context. \param s The T.30 context. \param info A pointer to a buffer for the header information. The buffer should be at least 51 bytes long. \return the length of the string. */ SPAN_DECLARE(size_t) t30_get_tx_page_header_info(t30_state_t *s, char *info); /*! Get the country of origin of the remote FAX machine associated with a T.30 context. \brief Get the country of origin of the remote FAX machine associated with a T.30 context. \param s The T.30 context. \return a pointer to the country name, or NULL if the country is not known. */ SPAN_DECLARE(const char *) t30_get_rx_country(t30_state_t *s); /*! Get the name of the vendor of the remote FAX machine associated with a T.30 context. \brief Get the name of the vendor of the remote FAX machine associated with a T.30 context. \param s The T.30 context. \return a pointer to the vendor name, or NULL if the vendor is not known. */ SPAN_DECLARE(const char *) t30_get_rx_vendor(t30_state_t *s); /*! Get the name of the model of the remote FAX machine associated with a T.30 context. \brief Get the name of the model of the remote FAX machine associated with a T.30 context. \param s The T.30 context. \return a pointer to the model name, or NULL if the model is not known. */ SPAN_DECLARE(const char *) t30_get_rx_model(t30_state_t *s); /*! Specify the file name of the next TIFF file to be received by a T.30 context. \brief Set next receive file name. \param s The T.30 context. \param file The file name \param stop_page The maximum page to receive. -1 for no restriction. */ SPAN_DECLARE(void) t30_set_rx_file(t30_state_t *s, const char *file, int stop_page); /*! Specify the file name of the next TIFF file to be transmitted by a T.30 context. \brief Set next transmit file name. \param s The T.30 context. \param file The file name \param start_page The first page to send. -1 for no restriction. \param stop_page The last page to send. -1 for no restriction. */ SPAN_DECLARE(void) t30_set_tx_file(t30_state_t *s, const char *file, int start_page, int stop_page); /*! Set Internet aware FAX (IAF) mode. \brief Set Internet aware FAX (IAF) mode. \param s The T.30 context. \param iaf TRUE for IAF, or FALSE for non-IAF. */ SPAN_DECLARE(void) t30_set_iaf_mode(t30_state_t *s, int iaf); /*! Specify if error correction mode (ECM) is allowed by a T.30 context. \brief Select ECM capability. \param s The T.30 context. \param enabled TRUE for ECM capable, FALSE for not ECM capable. \return 0 if OK, else -1. */ SPAN_DECLARE(int) t30_set_ecm_capability(t30_state_t *s, int enabled); /*! Specify the output encoding for TIFF files created during FAX reception. \brief Specify the output encoding for TIFF files created during FAX reception. \param s The T.30 context. \param encoding The coding required. The options are T4_COMPRESSION_ITU_T4_1D, T4_COMPRESSION_ITU_T4_2D, T4_COMPRESSION_ITU_T6. T6 is usually the densest option, but support for it is broken in a number of software packages. \return 0 if OK, else -1. */ SPAN_DECLARE(int) t30_set_rx_encoding(t30_state_t *s, int encoding); /*! Specify the minimum scan line time supported by a T.30 context. \brief Specify minimum scan line time. \param s The T.30 context. \param min_time The minimum permitted scan line time, in milliseconds. \return 0 if OK, else -1. */ SPAN_DECLARE(int) t30_set_minimum_scan_line_time(t30_state_t *s, int min_time); /*! Specify which modem types are supported by a T.30 context. \brief Specify supported modems. \param s The T.30 context. \param supported_modems Bit field list of the supported modems. \return 0 if OK, else -1. */ SPAN_DECLARE(int) t30_set_supported_modems(t30_state_t *s, int supported_modems); /*! Specify which compression types are supported by a T.30 context. \brief Specify supported compression types. \param s The T.30 context. \param supported_compressions Bit field list of the supported compression types. \return 0 if OK, else -1. */ SPAN_DECLARE(int) t30_set_supported_compressions(t30_state_t *s, int supported_compressions); /*! Specify which resolutions are supported by a T.30 context. \brief Specify supported resolutions. \param s The T.30 context. \param supported_resolutions Bit field list of the supported resolutions. \return 0 if OK, else -1. */ SPAN_DECLARE(int) t30_set_supported_resolutions(t30_state_t *s, int supported_resolutions); /*! Specify which images sizes are supported by a T.30 context. \brief Specify supported image sizes. \param s The T.30 context. \param supported_image_sizes Bit field list of the supported widths and lengths. \return 0 if OK, else -1. */ SPAN_DECLARE(int) t30_set_supported_image_sizes(t30_state_t *s, int supported_image_sizes); /*! Specify which special T.30 features are supported by a T.30 context. \brief Specify supported T.30 features. \param s The T.30 context. \param supported_t30_features Bit field list of the supported features. \return 0 if OK, else -1. */ SPAN_DECLARE(int) t30_set_supported_t30_features(t30_state_t *s, int supported_t30_features); /*! Set T.30 status. This may be used to adjust the status from within the phase B and phase D callbacks. \brief Set T.30 status. \param s The T.30 context. \param status The new status. */ SPAN_DECLARE(void) t30_set_status(t30_state_t *s, int status); /*! Specify a period of responding with receiver not ready. \brief Specify a period of responding with receiver not ready. \param s The T.30 context. \param count The number of times to report receiver not ready. \return 0 if OK, else -1. */ SPAN_DECLARE(int) t30_set_receiver_not_ready(t30_state_t *s, int count); /*! Set a callback function for T.30 phase B handling. \brief Set a callback function for T.30 phase B handling. \param s The T.30 context. \param handler The callback function. \param user_data An opaque pointer passed to the callback function. */ SPAN_DECLARE(void) t30_set_phase_b_handler(t30_state_t *s, t30_phase_b_handler_t *handler, void *user_data); /*! Set a callback function for T.30 phase D handling. \brief Set a callback function for T.30 phase D handling. \param s The T.30 context. \param handler The callback function. \param user_data An opaque pointer passed to the callback function. */ SPAN_DECLARE(void) t30_set_phase_d_handler(t30_state_t *s, t30_phase_d_handler_t *handler, void *user_data); /*! Set a callback function for T.30 phase E handling. \brief Set a callback function for T.30 phase E handling. \param s The T.30 context. \param handler The callback function. \param user_data An opaque pointer passed to the callback function. */ SPAN_DECLARE(void) t30_set_phase_e_handler(t30_state_t *s, t30_phase_e_handler_t *handler, void *user_data); /*! Set a callback function for T.30 end of document handling. \brief Set a callback function for T.30 end of document handling. \param s The T.30 context. \param handler The callback function. \param user_data An opaque pointer passed to the callback function. */ SPAN_DECLARE(void) t30_set_document_handler(t30_state_t *s, t30_document_handler_t *handler, void *user_data); /*! Set a callback function for T.30 frame exchange monitoring. This is called from the heart of the signal processing, so don't take too long in the handler routine. \brief Set a callback function for T.30 frame exchange monitoring. \param s The T.30 context. \param handler The callback function. \param user_data An opaque pointer passed to the callback function. */ SPAN_DECLARE(void) t30_set_real_time_frame_handler(t30_state_t *s, t30_real_time_frame_handler_t *handler, void *user_data); /*! Get a pointer to the logging context associated with a T.30 context. \brief Get a pointer to the logging context associated with a T.30 context. \param s The T.30 context. \return A pointer to the logging context, or NULL. */ SPAN_DECLARE(logging_state_t *) t30_get_logging_state(t30_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/t30.h0000664000175000017500000007330312101412063013122 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t30.h - definitions for T.30 fax processing * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_T30_H_) #define _SPANDSP_T30_H_ /*! \page t30_page T.30 FAX protocol handling \section t30_page_sec_1 What does it do? The T.30 protocol is the core protocol used for FAX transmission. This module implements most of its key featrues. It does not interface to the outside work. Seperate modules do that for T.38, analogue line, and other forms of FAX communication. Current features of this module include: - FAXing to and from multi-page TIFF/F files, whose images are one of the standard FAX sizes. - V.27ter, V.29 and V.17 modes (2400bps, to 14,400bps). - T.4 1D (MH), T.4 2D,(MR) and T.6 (MMR) compression. - Error correction mode (ECM). - All standard horizonal resolutions (R8, R16, 300dpi, 600dpi, 800dpi, 1200dpi). - All standard vertical resolutions (standard, fine, superfine, 300dpi, 600dpi, 800dpi, 1200dpi). - All standard page widths (A4, B4, A3). - All standard page lengths (A4, B4, North American letter, North American legal, continuous). - Monitoring and sending identifier strings (CSI, TSI, and CIG). - Monitoring and sending sub-address strings (SUB). - Monitoring and sending polling sub-addresses (SEP). - Monitoring and sending polled sub-addresses (PSA). - Monitoring and sending sender identifications (SID). - Monitoring and sending passwords (PWD). - Monitoring of non-standard facility frames (NSF, NSC, and NSS). - Sending custom non-standard facility frames (NSF, NSC, and NSS). - Analogue modem and T.38 operation. \section t30_page_sec_2 How does it work? Some of the following is paraphrased from some notes found a while ago on the Internet. I cannot remember exactly where they came from, but they are useful. \subsection t30_page_sec_2a The answer (CED) tone The T.30 standard says an answering fax device must send CED (a 2100Hz tone) for approximately 3 seconds before sending the first handshake message. Some machines send an 1100Hz or 1850Hz tone, and some send no tone at all. In fact, this answer tone is so unpredictable, it cannot really be used. It should, however, always be generated according to the specification. \subsection t30_page_sec_2b Common Timing Deviations The T.30 spec. specifies a number of time-outs. For example, after dialing a number, a calling fax system should listen for a response for 35 seconds before giving up. These time-out periods are as follows: - T1 - 35+-5s: the maximum time for which two fax system will attempt to identify each other - T2 - 6+-1s: a time-out used to start the sequence for changing transmit parameters - T3 - 10+-5s: a time-out used in handling operator interrupts - T5 - 60+-5s: a time-out used in error correction mode These time-outs are sometimes misinterpreted. In addition, they are routinely ignored, sometimes with good reason. For example, after placing a call, the calling fax system is supposed to wait for 35 seconds before giving up. If the answering unit does not answer on the first ring or if a voice answering machine is connected to the line, or if there are many delays through the network, the delay before answer can be much longer than 35 seconds. Fax units that support error correction mode (ECM) can respond to a post-image handshake message with a receiver not ready (RNR) message. The calling unit then queries the receiving fax unit with a receiver ready (RR) message. If the answering unit is still busy (printing for example), it will repeat the RNR message. According to the T.30 standard, this sequence (RR/RNR RR/RNR) can be repeated for up to the end of T5 (60+-5s). However, many fax systems ignore the time-out and will continue the sequence indefinitely, unless the user manually overrides. All the time-outs are subject to alteration, and sometimes misuse. Good T.30 implementations must do the right thing, and tolerate others doing the wrong thing. \subsection t30_page_sec_2c Variations in the inter-carrier gap T.30 specifies 75+-20ms of silence between signals using different modulation schemes. Examples are between the end of a DCS signal and the start of a TCF signal, and between the end of an image and the start of a post-image signal. Many fax systems violate this requirement, especially for the silent period between DCS and TCF. This may be stretched to well over 100ms. If this period is too long, it can interfere with handshake signal error recovery, should a packet be corrupted on the line. Systems should ensure they stay within the prescribed T.30 limits, and be tolerant of others being out of spec.. \subsection t30_page_sec_2d Other timing variations Testing is required to determine the ability of a fax system to handle variations in the duration of pauses between unacknowledged handshake message repetitions, and also in the pauses between the receipt of a handshake command and the start of a response to that command. In order to reduce the total transmission time, many fax systems start sending a response message before the end of the command has been received. \subsection t30_page_sec_2e Other deviations from the T.30 standard There are many other commonly encountered variations between machines, including: - frame sequence deviations - preamble and flag sequence variations - improper EOM usage - unusual data rate fallback sequences - common training pattern detection algorithms - image transmission deviations - use of the talker echo protect tone - image padding and short lines - RTP/RTN handshake message usage - long duration lines - nonstandard disconnect sequences - DCN usage */ /*! The maximum length of a DIS, DTC or DCS frame */ #define T30_MAX_DIS_DTC_DCS_LEN 22 /*! The maximum length of the body of an ident string */ #define T30_MAX_IDENT_LEN 20 /*! The maximum length of the user string to insert in page headers */ #define T30_MAX_PAGE_HEADER_INFO 50 typedef struct t30_state_s t30_state_t; /*! T.30 phase B callback handler. This handler can be used to process addition information available in some FAX calls, such as passwords. The callback handler can access whatever additional information might have been received, using t30_get_received_info(). \brief T.30 phase B callback handler. \param s The T.30 context. \param user_data An opaque pointer. \param result The phase B event code. \return The new status. Normally, T30_ERR_OK is returned. */ typedef int (t30_phase_b_handler_t)(t30_state_t *s, void *user_data, int result); /*! T.30 phase D callback handler. \brief T.30 phase D callback handler. \param s The T.30 context. \param user_data An opaque pointer. \param result The phase D event code. \return The new status. Normally, T30_ERR_OK is returned. */ typedef int (t30_phase_d_handler_t)(t30_state_t *s, void *user_data, int result); /*! T.30 phase E callback handler. \brief T.30 phase E callback handler. \param s The T.30 context. \param user_data An opaque pointer. \param completion_code The phase E completion code. */ typedef void (t30_phase_e_handler_t)(t30_state_t *s, void *user_data, int completion_code); /*! T.30 real time frame handler. \brief T.30 real time frame handler. \param s The T.30 context. \param user_data An opaque pointer. \param direction TRUE for incoming, FALSE for outgoing. \param msg The HDLC message. \param len The length of the message. */ typedef void (t30_real_time_frame_handler_t)(t30_state_t *s, void *user_data, int direction, const uint8_t msg[], int len); /*! T.30 document handler. \brief T.30 document handler. \param s The T.30 context. \param user_data An opaque pointer. \param result The document event code. */ typedef int (t30_document_handler_t)(t30_state_t *s, void *user_data, int status); /*! T.30 set a receive or transmit type handler. \brief T.30 set a receive or transmit type handler. \param user_data An opaque pointer. \param type The modem, tone or silence to be sent or received. \param bit_rate The bit rate of the modem to be sent or received. \param short_train TRUE if the short training sequence should be used (where one exists). \param use_hdlc FALSE for bit stream, TRUE for HDLC framing. */ typedef void (t30_set_handler_t)(void *user_data, int type, int bit_rate, int short_train, int use_hdlc); /*! T.30 send HDLC handler. \brief T.30 send HDLC handler. \param user_data An opaque pointer. \param msg The HDLC message. \param len The length of the message. */ typedef void (t30_send_hdlc_handler_t)(void *user_data, const uint8_t msg[], int len); /*! T.30 protocol completion codes, at phase E. */ enum { T30_ERR_OK = 0, /*! OK */ /* Link problems */ T30_ERR_CEDTONE, /*! The CED tone exceeded 5s */ T30_ERR_T0_EXPIRED, /*! Timed out waiting for initial communication */ T30_ERR_T1_EXPIRED, /*! Timed out waiting for the first message */ T30_ERR_T3_EXPIRED, /*! Timed out waiting for procedural interrupt */ T30_ERR_HDLC_CARRIER, /*! The HDLC carrier did not stop in a timely manner */ T30_ERR_CANNOT_TRAIN, /*! Failed to train with any of the compatible modems */ T30_ERR_OPER_INT_FAIL, /*! Operator intervention failed */ T30_ERR_INCOMPATIBLE, /*! Far end is not compatible */ T30_ERR_RX_INCAPABLE, /*! Far end is not able to receive */ T30_ERR_TX_INCAPABLE, /*! Far end is not able to transmit */ T30_ERR_NORESSUPPORT, /*! Far end cannot receive at the resolution of the image */ T30_ERR_NOSIZESUPPORT, /*! Far end cannot receive at the size of image */ T30_ERR_UNEXPECTED, /*! Unexpected message received */ /* Phase E status values returned to a transmitter */ T30_ERR_TX_BADDCS, /*! Received bad response to DCS or training */ T30_ERR_TX_BADPG, /*! Received a DCN from remote after sending a page */ T30_ERR_TX_ECMPHD, /*! Invalid ECM response received from receiver */ T30_ERR_TX_GOTDCN, /*! Received a DCN while waiting for a DIS */ T30_ERR_TX_INVALRSP, /*! Invalid response after sending a page */ T30_ERR_TX_NODIS, /*! Received other than DIS while waiting for DIS */ T30_ERR_TX_PHBDEAD, /*! Received no response to DCS, training or TCF */ T30_ERR_TX_PHDDEAD, /*! No response after sending a page */ T30_ERR_TX_T5EXP, /*! Timed out waiting for receiver ready (ECM mode) */ /* Phase E status values returned to a receiver */ T30_ERR_RX_ECMPHD, /*! Invalid ECM response received from transmitter */ T30_ERR_RX_GOTDCS, /*! DCS received while waiting for DTC */ T30_ERR_RX_INVALCMD, /*! Unexpected command after page received */ T30_ERR_RX_NOCARRIER, /*! Carrier lost during fax receive */ T30_ERR_RX_NOEOL, /*! Timed out while waiting for EOL (end of line) */ T30_ERR_RX_NOFAX, /*! Timed out while waiting for first line */ T30_ERR_RX_T2EXPDCN, /*! Timer T2 expired while waiting for DCN */ T30_ERR_RX_T2EXPD, /*! Timer T2 expired while waiting for phase D */ T30_ERR_RX_T2EXPFAX, /*! Timer T2 expired while waiting for fax page */ T30_ERR_RX_T2EXPMPS, /*! Timer T2 expired while waiting for next fax page */ T30_ERR_RX_T2EXPRR, /*! Timer T2 expired while waiting for RR command */ T30_ERR_RX_T2EXP, /*! Timer T2 expired while waiting for NSS, DCS or MCF */ T30_ERR_RX_DCNWHY, /*! Unexpected DCN while waiting for DCS or DIS */ T30_ERR_RX_DCNDATA, /*! Unexpected DCN while waiting for image data */ T30_ERR_RX_DCNFAX, /*! Unexpected DCN while waiting for EOM, EOP or MPS */ T30_ERR_RX_DCNPHD, /*! Unexpected DCN after EOM or MPS sequence */ T30_ERR_RX_DCNRRD, /*! Unexpected DCN after RR/RNR sequence */ T30_ERR_RX_DCNNORTN, /*! Unexpected DCN after requested retransmission */ /* TIFF file problems */ T30_ERR_FILEERROR, /*! TIFF/F file cannot be opened */ T30_ERR_NOPAGE, /*! TIFF/F page not found */ T30_ERR_BADTIFF, /*! TIFF/F format is not compatible */ T30_ERR_BADPAGE, /*! TIFF/F page number tag missing */ T30_ERR_BADTAG, /*! Incorrect values for TIFF/F tags */ T30_ERR_BADTIFFHDR, /*! Bad TIFF/F header - incorrect values in fields */ T30_ERR_NOMEM, /*! Cannot allocate memory for more pages */ /* General problems */ T30_ERR_RETRYDCN, /*! Disconnected after permitted retries */ T30_ERR_CALLDROPPED, /*! The call dropped prematurely */ /* Feature negotiation issues */ T30_ERR_NOPOLL, /*! Poll not accepted */ T30_ERR_IDENT_UNACCEPTABLE, /*! Far end's ident is not acceptable */ T30_ERR_SUB_UNACCEPTABLE, /*! Far end's sub-address is not acceptable */ T30_ERR_SEP_UNACCEPTABLE, /*! Far end's selective polling address is not acceptable */ T30_ERR_PSA_UNACCEPTABLE, /*! Far end's polled sub-address is not acceptable */ T30_ERR_SID_UNACCEPTABLE, /*! Far end's sender identification is not acceptable */ T30_ERR_PWD_UNACCEPTABLE, /*! Far end's password is not acceptable */ T30_ERR_TSA_UNACCEPTABLE, /*! Far end's transmitting subscriber internet address is not acceptable */ T30_ERR_IRA_UNACCEPTABLE, /*! Far end's internet routing address is not acceptable */ T30_ERR_CIA_UNACCEPTABLE, /*! Far end's calling subscriber internet address is not acceptable */ T30_ERR_ISP_UNACCEPTABLE, /*! Far end's internet selective polling address is not acceptable */ T30_ERR_CSA_UNACCEPTABLE /*! Far end's called subscriber internet address is not acceptable */ }; /*! I/O modes for the T.30 protocol. These are allocated such that the lower 4 bits represents the variant of the modem - e.g. the particular bit rate selected. */ enum { T30_MODEM_NONE = 0, T30_MODEM_PAUSE, T30_MODEM_CED, T30_MODEM_CNG, T30_MODEM_V21, T30_MODEM_V27TER, T30_MODEM_V29, T30_MODEM_V17, T30_MODEM_V34HDX, T30_MODEM_DONE }; enum { T30_FRONT_END_SEND_STEP_COMPLETE = 0, /*! The current receive has completed. This is only needed to report an unexpected end of the receive operation, as might happen with T.38 dying. */ T30_FRONT_END_RECEIVE_COMPLETE, T30_FRONT_END_SIGNAL_PRESENT, T30_FRONT_END_SIGNAL_ABSENT, T30_FRONT_END_CED_PRESENT, T30_FRONT_END_CNG_PRESENT }; enum { /*! Support the V.27ter modem (2400, and 4800bps) for image transfer. */ T30_SUPPORT_V27TER = 0x01, /*! Support the V.29 modem (9600, and 7200bps) for image transfer. */ T30_SUPPORT_V29 = 0x02, /*! Support the V.17 modem (14400, 12000, 9600 and 7200bps) for image transfer. */ T30_SUPPORT_V17 = 0x04, /*! Support the V.34 modem (up to 33,600bps) for image transfer. */ T30_SUPPORT_V34HDX = 0x08, /*! Support the Internet aware FAX mode (no bit rate limit) for image transfer. */ T30_SUPPORT_IAF = 0x10 }; enum { /*! No compression */ T30_SUPPORT_NO_COMPRESSION = 0x01, /*! T.1 1D compression */ T30_SUPPORT_T4_1D_COMPRESSION = 0x02, /*! T.4 2D compression */ T30_SUPPORT_T4_2D_COMPRESSION = 0x04, /*! T.6 2D compression */ T30_SUPPORT_T6_COMPRESSION = 0x08, /*! T.85 monochrome JBIG compression, with fixed L0 */ T30_SUPPORT_T85_COMPRESSION = 0x10, /*! T.85 monochrome JBIG compression, with variable L0 */ T30_SUPPORT_T85_L0_COMPRESSION = 0x20, /*! T.43 colour JBIG compression */ T30_SUPPORT_T43_COMPRESSION = 0x40, /*! T.45 run length colour compression */ T30_SUPPORT_T45_COMPRESSION = 0x80, /*! T.81 + T.30 Annex E colour JPEG compression */ T30_SUPPORT_T81_COMPRESSION = 0x100, /*! T.81 + T.30 Annex K colour sYCC-JPEG compression */ T30_SUPPORT_SYCC_T81_COMPRESSION = 0x200, /*! T.88 monochrome JBIG2 compression */ T30_SUPPORT_T88_COMPRESSION = 0x400 }; enum { /*! Support standard FAX Y-resolution 98/100dpi */ T30_SUPPORT_STANDARD_RESOLUTION = 0x01, /*! Support fine FAX Y-resolution 196/200dpi */ T30_SUPPORT_FINE_RESOLUTION = 0x02, /*! Support super-fine FAX Y-resolution 392/400dpi */ T30_SUPPORT_SUPERFINE_RESOLUTION = 0x04, /*! Support half FAX X-resolution 100/102dpi */ T30_SUPPORT_R4_RESOLUTION = 0x10000, /*! Support standard FAX X-resolution 200/204dpi */ T30_SUPPORT_R8_RESOLUTION = 0x20000, /*! Support double FAX X-resolution 400dpi */ T30_SUPPORT_R16_RESOLUTION = 0x40000, /*! Support 300dpi x 300 dpi */ T30_SUPPORT_300_300_RESOLUTION = 0x100000, /*! Support 400dpi x 400 dpi */ T30_SUPPORT_400_400_RESOLUTION = 0x200000, /*! Support 600dpi x 600 dpi */ T30_SUPPORT_600_600_RESOLUTION = 0x400000, /*! Support 1200dpi x 1200 dpi */ T30_SUPPORT_1200_1200_RESOLUTION = 0x800000, /*! Support 300dpi x 600 dpi */ T30_SUPPORT_300_600_RESOLUTION = 0x1000000, /*! Support 400dpi x 800 dpi */ T30_SUPPORT_400_800_RESOLUTION = 0x2000000, /*! Support 600dpi x 1200 dpi */ T30_SUPPORT_600_1200_RESOLUTION = 0x4000000 }; enum { T30_SUPPORT_215MM_WIDTH = 0x01, T30_SUPPORT_255MM_WIDTH = 0x02, T30_SUPPORT_303MM_WIDTH = 0x04, T30_SUPPORT_UNLIMITED_LENGTH = 0x10000, T30_SUPPORT_A4_LENGTH = 0x20000, T30_SUPPORT_B4_LENGTH = 0x40000, T30_SUPPORT_US_LETTER_LENGTH = 0x80000, T30_SUPPORT_US_LEGAL_LENGTH = 0x100000 }; enum { /*! Enable support of identification, through the SID and/or PWD frames. */ T30_SUPPORT_IDENTIFICATION = 0x01, /*! Enable support of selective polling, through the SEP frame. */ T30_SUPPORT_SELECTIVE_POLLING = 0x02, /*! Enable support of polling sub-addressing, through the PSA frame. */ T30_SUPPORT_POLLED_SUB_ADDRESSING = 0x04, /*! Enable support of multiple selective polling, through repeated used of the SEP and PSA frames. */ T30_SUPPORT_MULTIPLE_SELECTIVE_POLLING = 0x08, /*! Enable support of sub-addressing, through the SUB frame. */ T30_SUPPORT_SUB_ADDRESSING = 0x10, /*! Enable support of transmitting subscriber internet address, through the TSA frame. */ T30_SUPPORT_TRANSMITTING_SUBSCRIBER_INTERNET_ADDRESS = 0x20, /*! Enable support of internet routing address, through the IRA frame. */ T30_SUPPORT_INTERNET_ROUTING_ADDRESS = 0x40, /*! Enable support of calling subscriber internet address, through the CIA frame. */ T30_SUPPORT_CALLING_SUBSCRIBER_INTERNET_ADDRESS = 0x80, /*! Enable support of internet selective polling address, through the ISP frame. */ T30_SUPPORT_INTERNET_SELECTIVE_POLLING_ADDRESS = 0x100, /*! Enable support of called subscriber internet address, through the CSA frame. */ T30_SUPPORT_CALLED_SUBSCRIBER_INTERNET_ADDRESS = 0x200, /*! Enable support of the field not valid (FNV) frame. */ T30_SUPPORT_FIELD_NOT_VALID = 0x400, /*! Enable support of the command repeat (CRP) frame. */ T30_SUPPORT_COMMAND_REPEAT = 0x800 }; enum { T30_IAF_MODE_T37 = 0x01, T30_IAF_MODE_T38 = 0x02, T30_IAF_MODE_FLOW_CONTROL = 0x04, /*! Continuous flow mode means data is sent as fast as possible, usually across the Internet, where speed is not constrained by a PSTN modem. */ T30_IAF_MODE_CONTINUOUS_FLOW = 0x08, /*! No TCF means TCF is not exchanged. The end points must sort out usable speed issues locally. */ T30_IAF_MODE_NO_TCF = 0x10, /*! No fill bits means do not insert fill bits, even if the T.30 messages request them. */ T30_IAF_MODE_NO_FILL_BITS = 0x20, /*! No indicators means do not send indicator messages when using T.38. */ T30_IAF_MODE_NO_INDICATORS = 0x40, /*! Use relaxed timers for T.38. This is appropriate when using TCP/TPKT for T.38, as there is no point in anything but a long backstop timeout in such a mode. */ T30_IAF_MODE_RELAXED_TIMERS = 0x80 }; typedef struct { /*! \brief The identifier string (CSI, TSI, CIG). */ char ident[T30_MAX_IDENT_LEN + 1]; /*! \brief The sub-address string (SUB). */ char sub_address[T30_MAX_IDENT_LEN + 1]; /*! \brief The selective polling sub-address (SEP). */ char selective_polling_address[T30_MAX_IDENT_LEN + 1]; /*! \brief The polled sub-address (PSA). */ char polled_sub_address[T30_MAX_IDENT_LEN + 1]; /*! \brief The sender identification (SID). */ char sender_ident[T30_MAX_IDENT_LEN + 1]; /*! \brief The password (PWD). */ char password[T30_MAX_IDENT_LEN + 1]; /*! \brief Non-standard facilities (NSF). */ uint8_t *nsf; size_t nsf_len; /*! \brief Non-standard facilities command (NSC). */ uint8_t *nsc; size_t nsc_len; /*! \brief Non-standard facilities set-up (NSS). */ uint8_t *nss; size_t nss_len; /*! \brief Transmitting subscriber internet address (TSA). */ int tsa_type; char *tsa; size_t tsa_len; /*! \brief Internet routing address (IRA). */ int ira_type; char *ira; size_t ira_len; /*! \brief Calling subscriber internet address (CIA). */ int cia_type; char *cia; size_t cia_len; /*! \brief Internet selective polling address (ISP). */ int isp_type; char *isp; size_t isp_len; /*! \brief Called subscriber internet address (CSA). */ int csa_type; char *csa; size_t csa_len; } t30_exchanged_info_t; typedef struct { /*! \brief The current bit rate for image transfer. */ int bit_rate; /*! \brief TRUE if error correcting mode is used. */ int error_correcting_mode; /*! \brief The number of pages sent so far. */ int pages_tx; /*! \brief The number of pages received so far. */ int pages_rx; /*! \brief The number of pages in the file (<0 if not known). */ int pages_in_file; /*! \brief The horizontal column-to-column resolution of the most recent page, in pixels per metre */ int x_resolution; /*! \brief The vertical row-to-row resolution of the most recent page, in pixels per metre */ int y_resolution; /*! \brief The number of horizontal pixels in the most recent page. */ int width; /*! \brief The number of vertical pixels in the most recent page. */ int length; /*! \brief The size of the image, in bytes */ int image_size; /*! \brief The type of compression used between the FAX machines */ int encoding; /*! \brief The number of bad pixel rows in the most recent page. */ int bad_rows; /*! \brief The largest number of bad pixel rows in a block in the most recent page. */ int longest_bad_row_run; /*! \brief The number of HDLC frame retries, if error correcting mode is used. */ int error_correcting_mode_retries; /*! \brief Current status. */ int current_status; #if 0 /*! \brief The number of RTP events in this call. */ int rtp_events; /*! \brief The number of RTN events in this call. */ int rtn_events; #endif } t30_stats_t; #if defined(__cplusplus) extern "C" { #endif /*! Initialise a T.30 context. \brief Initialise a T.30 context. \param s The T.30 context. \param calling_party TRUE if the context is for a calling party. FALSE if the context is for an answering party. \param set_rx_type_handler \param set_rx_type_user_data \param set_tx_type_handler \param set_tx_type_user_data \param send_hdlc_handler \param send_hdlc_user_data \return A pointer to the context, or NULL if there was a problem. */ SPAN_DECLARE(t30_state_t *) t30_init(t30_state_t *s, int calling_party, t30_set_handler_t *set_rx_type_handler, void *set_rx_type_user_data, t30_set_handler_t *set_tx_type_handler, void *set_tx_type_user_data, t30_send_hdlc_handler_t *send_hdlc_handler, void *send_hdlc_user_data); /*! Release a T.30 context. \brief Release a T.30 context. \param s The T.30 context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t30_release(t30_state_t *s); /*! Free a T.30 context. \brief Free a T.30 context. \param s The T.30 context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t30_free(t30_state_t *s); /*! Restart a T.30 context. \brief Restart a T.30 context. \param s The T.30 context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t30_restart(t30_state_t *s); /*! Check if a T.30 call is still active. This may be used to regularly poll if the job has finished. \brief Check if a T.30 call is still active. \param s The T.30 context. \return TRUE for call still active, or FALSE for call completed. */ SPAN_DECLARE(int) t30_call_active(t30_state_t *s); /*! Cleanup a T.30 context if the call terminates. \brief Cleanup a T.30 context if the call terminates. \param s The T.30 context. */ SPAN_DECLARE(void) t30_terminate(t30_state_t *s); /*! Inform the T.30 engine of a status change in the front end (end of tx, rx signal change, etc.). \brief Inform the T.30 engine of a status change in the front end (end of tx, rx signal change, etc.). \param user_data The T.30 context. \param status The type of status change which occured. */ SPAN_DECLARE(void) t30_front_end_status(void *user_data, int status); /*! Get a bit of received non-ECM image data. \brief Get a bit of received non-ECM image data. \param user_data An opaque pointer, which must point to the T.30 context. \return The next bit to transmit. */ SPAN_DECLARE_NONSTD(int) t30_non_ecm_get_bit(void *user_data); /*! Get a byte of received non-ECM image data. \brief Get a byte of received non-ECM image data. \param user_data An opaque pointer, which must point to the T.30 context. \return The next byte to transmit. */ SPAN_DECLARE(int) t30_non_ecm_get_byte(void *user_data); /*! Get a chunk of received non-ECM image data. \brief Get a bit of received non-ECM image data. \param user_data An opaque pointer, which must point to the T.30 context. \param buf The buffer to contain the data. \param max_len The maximum length of the chunk. \return The actual length of the chunk. */ SPAN_DECLARE(int) t30_non_ecm_get_chunk(void *user_data, uint8_t buf[], int max_len); /*! Process a bit of received non-ECM image data. \brief Process a bit of received non-ECM image data \param user_data An opaque pointer, which must point to the T.30 context. \param bit The received bit. */ SPAN_DECLARE_NONSTD(void) t30_non_ecm_put_bit(void *user_data, int bit); /*! Process a byte of received non-ECM image data. \brief Process a byte of received non-ECM image data \param user_data An opaque pointer, which must point to the T.30 context. \param byte The received byte. */ SPAN_DECLARE(void) t30_non_ecm_put_byte(void *user_data, int byte); /*! Process a chunk of received non-ECM image data. \brief Process a chunk of received non-ECM image data \param user_data An opaque pointer, which must point to the T.30 context. \param buf The buffer containing the received data. \param len The length of the data in buf. */ SPAN_DECLARE(void) t30_non_ecm_put_chunk(void *user_data, const uint8_t buf[], int len); /*! Process a received HDLC frame. \brief Process a received HDLC frame. \param user_data The T.30 context. \param msg The HDLC message. \param len The length of the message, in octets. \param ok TRUE if the frame was received without error. */ SPAN_DECLARE_NONSTD(void) t30_hdlc_accept(void *user_data, const uint8_t msg[], int len, int ok); /*! Report the passage of time to the T.30 engine. \brief Report the passage of time to the T.30 engine. \param s The T.30 context. \param samples The time change in 1/8000th second steps. */ SPAN_DECLARE(void) t30_timer_update(t30_state_t *s, int samples); /*! Get the current transfer statistics for the file being sent or received. \brief Get the current transfer statistics. \param s The T.30 context. \param t A pointer to a buffer for the statistics. */ SPAN_DECLARE(void) t30_get_transfer_statistics(t30_state_t *s, t30_stats_t *t); /*! Request a local interrupt of FAX exchange. \brief Request a local interrupt of FAX exchange. \param s The T.30 context. \param state TRUE to enable interrupt request, else FALSE. */ SPAN_DECLARE(void) t30_local_interrupt_request(t30_state_t *s, int state); /*! Allow remote interrupts of FAX exchange. \brief Allow remote interrupts of FAX exchange. \param s The T.30 context. \param state TRUE to allow interruptd, else FALSE. */ SPAN_DECLARE(void) t30_remote_interrupts_allowed(t30_state_t *s, int state); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/echo.h0000664000175000017500000002055611422612264013446 00000000000000/* * SpanDSP - a series of DSP components for telephony * * echo.h - An echo cancellor, suitable for electrical and acoustic * cancellation. This code does not currently comply with * any relevant standards (e.g. G.164/5/7/8). * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_ECHO_H_) #define _SPANDSP_ECHO_H_ /*! \page echo_can_page Line echo cancellation for voice \section echo_can_page_sec_1 What does it do? This module aims to provide G.168-2002 compliant echo cancellation, to remove electrical echoes (e.g. from 2-4 wire hybrids) from voice calls. \section echo_can_page_sec_2 How does it work? The heart of the echo cancellor is FIR filter. This is adapted to match the echo impulse response of the telephone line. It must be long enough to adequately cover the duration of that impulse response. The signal transmitted to the telephone line is passed through the FIR filter. Once the FIR is properly adapted, the resulting output is an estimate of the echo signal received from the line. This is subtracted from the received signal. The result is an estimate of the signal which originated at the far end of the line, free from echos of our own transmitted signal. The least mean squares (LMS) algorithm is attributed to Widrow and Hoff, and was introduced in 1960. It is the commonest form of filter adaption used in things like modem line equalisers and line echo cancellers. There it works very well. However, it only works well for signals of constant amplitude. It works very poorly for things like speech echo cancellation, where the signal level varies widely. This is quite easy to fix. If the signal level is normalised - similar to applying AGC - LMS can work as well for a signal of varying amplitude as it does for a modem signal. This normalised least mean squares (NLMS) algorithm is the commonest one used for speech echo cancellation. Many other algorithms exist - e.g. RLS (essentially the same as Kalman filtering), FAP, etc. Some perform significantly better than NLMS. However, factors such as computational complexity and patents favour the use of NLMS. A simple refinement to NLMS can improve its performance with speech. NLMS tends to adapt best to the strongest parts of a signal. If the signal is white noise, the NLMS algorithm works very well. However, speech has more low frequency than high frequency content. Pre-whitening (i.e. filtering the signal to flatten its spectrum) the echo signal improves the adapt rate for speech, and ensures the final residual signal is not heavily biased towards high frequencies. A very low complexity filter is adequate for this, so pre-whitening adds little to the compute requirements of the echo canceller. An FIR filter adapted using pre-whitened NLMS performs well, provided certain conditions are met: - The transmitted signal has poor self-correlation. - There is no signal being generated within the environment being cancelled. The difficulty is that neither of these can be guaranteed. If the adaption is performed while transmitting noise (or something fairly noise like, such as voice) the adaption works very well. If the adaption is performed while transmitting something highly correlative (typically narrow band energy such as signalling tones or DTMF), the adaption can go seriously wrong. The reason is there is only one solution for the adaption on a near random signal - the impulse response of the line. For a repetitive signal, there are any number of solutions which converge the adaption, and nothing guides the adaption to choose the generalised one. Allowing an untrained canceller to converge on this kind of narrowband energy probably a good thing, since at least it cancels the tones. Allowing a well converged canceller to continue converging on such energy is just a way to ruin its generalised adaption. A narrowband detector is needed, so adapation can be suspended at appropriate times. The adaption process is based on trying to eliminate the received signal. When there is any signal from within the environment being cancelled it may upset the adaption process. Similarly, if the signal we are transmitting is small, noise may dominate and disturb the adaption process. If we can ensure that the adaption is only performed when we are transmitting a significant signal level, and the environment is not, things will be OK. Clearly, it is easy to tell when we are sending a significant signal. Telling, if the environment is generating a significant signal, and doing it with sufficient speed that the adaption will not have diverged too much more we stop it, is a little harder. The key problem in detecting when the environment is sourcing significant energy is that we must do this very quickly. Given a reasonably long sample of the received signal, there are a number of strategies which may be used to assess whether that signal contains a strong far end component. However, by the time that assessment is complete the far end signal will have already caused major mis-convergence in the adaption process. An assessment algorithm is needed which produces a fairly accurate result from a very short burst of far end energy. \section echo_can_page_sec_3 How do I use it? The echo cancellor processes both the transmit and receive streams sample by sample. The processing function is not declared inline. Unfortunately, cancellation requires many operations per sample, so the call overhead is only a minor burden. */ #include "fir.h" /* Mask bits for the adaption mode */ enum { ECHO_CAN_USE_ADAPTION = 0x01, ECHO_CAN_USE_NLP = 0x02, ECHO_CAN_USE_CNG = 0x04, ECHO_CAN_USE_CLIP = 0x08, ECHO_CAN_USE_SUPPRESSOR = 0x10, ECHO_CAN_USE_TX_HPF = 0x20, ECHO_CAN_USE_RX_HPF = 0x40, ECHO_CAN_DISABLE = 0x80 }; /*! G.168 echo canceller descriptor. This defines the working state for a line echo canceller. */ typedef struct echo_can_state_s echo_can_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Create a voice echo canceller context. \param len The length of the canceller, in samples. \return The new canceller context, or NULL if the canceller could not be created. */ SPAN_DECLARE(echo_can_state_t *) echo_can_init(int len, int adaption_mode); /*! Release a voice echo canceller context. \param ec The echo canceller context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) echo_can_release(echo_can_state_t *ec); /*! Free a voice echo canceller context. \param ec The echo canceller context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) echo_can_free(echo_can_state_t *ec); /*! Flush (reinitialise) a voice echo canceller context. \param ec The echo canceller context. */ SPAN_DECLARE(void) echo_can_flush(echo_can_state_t *ec); /*! Set the adaption mode of a voice echo canceller context. \param ec The echo canceller context. \param adaption_mode The mode. */ SPAN_DECLARE(void) echo_can_adaption_mode(echo_can_state_t *ec, int adaption_mode); /*! Process a sample through a voice echo canceller. \param ec The echo canceller context. \param tx The transmitted audio sample. \param rx The received audio sample. \return The clean (echo cancelled) received sample. */ SPAN_DECLARE(int16_t) echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t rx); /*! Process to high pass filter the tx signal. \param ec The echo canceller context. \param tx The transmitted auio sample. \return The HP filtered transmit sample, send this to your D/A. */ SPAN_DECLARE(int16_t) echo_can_hpf_tx(echo_can_state_t *ec, int16_t tx); SPAN_DECLARE(void) echo_can_snapshot(echo_can_state_t *ec); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/vector_int.h0000664000175000017500000001223311422612265014676 00000000000000/* * SpanDSP - a series of DSP components for telephony * * vector_int.h * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_VECTOR_INT_H_) #define _SPANDSP_VECTOR_INT_H_ #if defined(__cplusplus) extern "C" { #endif static __inline__ void vec_copyi(int z[], const int x[], int n) { memcpy(z, x, n*sizeof(z[0])); } /*- End of function --------------------------------------------------------*/ static __inline__ void vec_copyi16(int16_t z[], const int16_t x[], int n) { memcpy(z, x, n*sizeof(z[0])); } /*- End of function --------------------------------------------------------*/ static __inline__ void vec_copyi32(int32_t z[], const int32_t x[], int n) { memcpy(z, x, n*sizeof(z[0])); } /*- End of function --------------------------------------------------------*/ static __inline__ void vec_zeroi(int z[], int n) { memset(z, 0, n*sizeof(z[0])); } /*- End of function --------------------------------------------------------*/ static __inline__ void vec_zeroi16(int16_t z[], int n) { memset(z, 0, n*sizeof(z[0])); } /*- End of function --------------------------------------------------------*/ static __inline__ void vec_zeroi32(int32_t z[], int n) { memset(z, 0, n*sizeof(z[0])); } /*- End of function --------------------------------------------------------*/ static __inline__ void vec_seti(int z[], int x, int n) { int i; for (i = 0; i < n; i++) z[i] = x; } /*- End of function --------------------------------------------------------*/ static __inline__ void vec_seti16(int16_t z[], int16_t x, int n) { int i; for (i = 0; i < n; i++) z[i] = x; } /*- End of function --------------------------------------------------------*/ static __inline__ void vec_seti32(int32_t z[], int32_t x, int n) { int i; for (i = 0; i < n; i++) z[i] = x; } /*- End of function --------------------------------------------------------*/ /*! \brief Find the dot product of two int16_t vectors. \param x The first vector. \param y The first vector. \param n The number of elements in the vectors. \return The dot product of the two vectors. */ SPAN_DECLARE(int32_t) vec_dot_prodi16(const int16_t x[], const int16_t y[], int n); /*! \brief Find the dot product of two int16_t vectors, where the first is a circular buffer with an offset for the starting position. \param x The first vector. \param y The first vector. \param n The number of elements in the vectors. \param pos The starting position in the x vector. \return The dot product of the two vectors. */ SPAN_DECLARE(int32_t) vec_circular_dot_prodi16(const int16_t x[], const int16_t y[], int n, int pos); SPAN_DECLARE(void) vec_lmsi16(const int16_t x[], int16_t y[], int n, int16_t error); SPAN_DECLARE(void) vec_circular_lmsi16(const int16_t x[], int16_t y[], int n, int pos, int16_t error); /*! \brief Find the minimum and maximum values in an int16_t vector. \param x The vector to be searched. \param n The number of elements in the vector. \param out A two element vector. The first will receive the maximum. The second will receive the minimum. This parameter may be set to NULL. \return The absolute maximum value. Since the range of negative numbers exceeds the range of positive one, the returned integer is longer than the ones being searched. */ SPAN_DECLARE(int32_t) vec_min_maxi16(const int16_t x[], int n, int16_t out[]); static __inline__ int vec_norm2i16(const int16_t *vec, int len) { int i; int sum; sum = 0; for (i = 0; i < len; i++) sum += vec[i]*vec[i]; return sum; } /*- End of function --------------------------------------------------------*/ static __inline__ void vec_sari16(int16_t *vec, int len, int shift) { int i; for (i = 0; i < len; i++) vec[i] >>= shift; } /*- End of function --------------------------------------------------------*/ static __inline__ int vec_max_bitsi16(const int16_t *vec, int len) { int i; int max; int v; int b; max = 0; for (i = 0; i < len; i++) { v = abs(vec[i]); if (v > max) max = v; } b = 0; while (max != 0) { b++; max >>= 1; } return b; } /*- End of function --------------------------------------------------------*/ #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/v42.h0000664000175000017500000000707512100752762013146 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v42.h * * Written by Steve Underwood * * Copyright (C) 2003, 2011 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page v42_page V.42 modem error correction \section v42_page_sec_1 What does it do? The V.42 specification defines an error correcting protocol for PSTN modems, based on HDLC and LAP. This makes it similar to an X.25 link. A special variant of LAP, known as LAP-M, is defined in the V.42 specification. A means for modems to determine if the far modem supports V.42 is also defined. \section v42_page_sec_2 How does it work? */ #if !defined(_SPANDSP_V42_H_) #define _SPANDSP_V42_H_ typedef struct v42_state_s v42_state_t; #if defined(__cplusplus) extern "C" { #endif SPAN_DECLARE(const char *) lapm_status_to_str(int status); SPAN_DECLARE_NONSTD(void) lapm_receive(void *user_data, const uint8_t *frame, int len, int ok); SPAN_DECLARE(void) v42_start(v42_state_t *s); SPAN_DECLARE(void) v42_stop(v42_state_t *s); /*! Set the busy status of the local end of a V.42 context. \param s The V.42 context. \param busy The new local end busy status. \return The previous local end busy status. */ SPAN_DECLARE(int) v42_set_local_busy_status(v42_state_t *s, int busy); /*! Get the busy status of the far end of a V.42 context. \param s The V.42 context. \return The far end busy status. */ SPAN_DECLARE(int) v42_get_far_busy_status(v42_state_t *s); SPAN_DECLARE(void) v42_rx_bit(void *user_data, int bit); SPAN_DECLARE(int) v42_tx_bit(void *user_data); SPAN_DECLARE(void) v42_set_status_callback(v42_state_t *s, modem_status_func_t callback, void *user_data); /*! Initialise a V.42 context. \param s The V.42 context. \param calling_party TRUE if caller mode, else answerer mode. \param detect TRUE to perform the V.42 detection, else go straight into LAP.M \param iframe_get A callback function to handle received frames of data. \param iframe_put A callback function to get frames of data for transmission. \param user_data An opaque pointer passed to the frame handler routines. \return ??? */ SPAN_DECLARE(v42_state_t *) v42_init(v42_state_t *s, int calling_party, int detect, get_msg_func_t iframe_get, put_msg_func_t iframe_put, void *user_data); /*! Restart a V.42 context. \param s The V.42 context. */ SPAN_DECLARE(void) v42_restart(v42_state_t *s); /*! Release a V.42 context. \param s The V.42 context. \return 0 if OK */ SPAN_DECLARE(int) v42_release(v42_state_t *s); /*! Free a V.42 context. \param s The V.42 context. \return 0 if OK */ SPAN_DECLARE(int) v42_free(v42_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/fax.h0000664000175000017500000001202611422612264013277 00000000000000/* * SpanDSP - a series of DSP components for telephony * * fax.h - definitions for analogue line ITU T.30 fax processing * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_FAX_H_) #define _SPANDSP_FAX_H_ /*! \page fax_page FAX over analogue modem handling \section fax_page_sec_1 What does it do? \section fax_page_sec_2 How does it work? */ typedef struct fax_state_s fax_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Apply T.30 receive processing to a block of audio samples. \brief Apply T.30 receive processing to a block of audio samples. \param s The FAX context. \param amp The audio sample buffer. \param len The number of samples in the buffer. \return The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call. */ SPAN_DECLARE_NONSTD(int) fax_rx(fax_state_t *s, int16_t *amp, int len); /*! Apply fake T.30 receive processing when a block of audio samples is missing (e.g due to packet loss). \brief Apply fake T.30 receive processing. \param s The FAX context. \param len The number of samples to fake. \return The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call. */ SPAN_DECLARE_NONSTD(int) fax_rx_fillin(fax_state_t *s, int len); /*! Apply T.30 transmit processing to generate a block of audio samples. \brief Apply T.30 transmit processing to generate a block of audio samples. \param s The FAX context. \param amp The audio sample buffer. \param max_len The number of samples to be generated. \return The number of samples actually generated. This will be zero when there is nothing to send. */ SPAN_DECLARE_NONSTD(int) fax_tx(fax_state_t *s, int16_t *amp, int max_len); /*! Select whether silent audio will be sent when FAX transmit is idle. \brief Select whether silent audio will be sent when FAX transmit is idle. \param s The FAX context. \param transmit_on_idle TRUE if silent audio should be output when the FAX transmitter is idle. FALSE to transmit zero length audio when the FAX transmitter is idle. The default behaviour is FALSE. */ SPAN_DECLARE(void) fax_set_transmit_on_idle(fax_state_t *s, int transmit_on_idle); /*! Select whether talker echo protection tone will be sent for the image modems. \brief Select whether TEP will be sent for the image modems. \param s The FAX context. \param use_tep TRUE if TEP should be sent. */ SPAN_DECLARE(void) fax_set_tep_mode(fax_state_t *s, int use_tep); /*! Get a pointer to the T.30 engine associated with a FAX context. \brief Get a pointer to the T.30 engine associated with a FAX context. \param s The FAX context. \return A pointer to the T.30 context, or NULL. */ SPAN_DECLARE(t30_state_t *) fax_get_t30_state(fax_state_t *s); /*! Get a pointer to the logging context associated with a FAX context. \brief Get a pointer to the logging context associated with a FAX context. \param s The FAX context. \return A pointer to the logging context, or NULL. */ SPAN_DECLARE(logging_state_t *) fax_get_logging_state(fax_state_t *s); /*! Restart a FAX context. \brief Restart a FAX context. \param s The FAX context. \param calling_party TRUE if the context is for a calling party. FALSE if the context is for an answering party. \return 0 for OK, else -1. */ SPAN_DECLARE(int) fax_restart(fax_state_t *s, int calling_party); /*! Initialise a FAX context. \brief Initialise a FAX context. \param s The FAX context. \param calling_party TRUE if the context is for a calling party. FALSE if the context is for an answering party. \return A pointer to the FAX context, or NULL if there was a problem. */ SPAN_DECLARE(fax_state_t *) fax_init(fax_state_t *s, int calling_party); /*! Release a FAX context. \brief Release a FAX context. \param s The FAX context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) fax_release(fax_state_t *s); /*! Free a FAX context. \brief Free a FAX context. \param s The FAX context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) fax_free(fax_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/bit_operations.h0000664000175000017500000002061612100763751015550 00000000000000/* * SpanDSP - a series of DSP components for telephony * * bit_operations.h - Various bit level operations, such as bit reversal * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_BIT_OPERATIONS_H_) #define _SPANDSP_BIT_OPERATIONS_H_ #if defined(__i386__) || defined(__x86_64__) #if !defined(__SUNPRO_C) || (__SUNPRO_C >= 0x0590) #define SPANDSP_USE_86_ASM #endif #endif #if defined(__cplusplus) extern "C" { #endif /*! \brief Find the bit position of the highest set bit in a word \param bits The word to be searched \return The bit number of the highest set bit, or -1 if the word is zero. */ static __inline__ int top_bit(unsigned int bits) { #if defined(SPANDSP_USE_86_ASM) int res; __asm__ (" xorl %[res],%[res];\n" " decl %[res];\n" " bsrl %[bits],%[res]\n" : [res] "=&r" (res) : [bits] "rm" (bits)); return res; #elif defined(__ppc__) || defined(__powerpc__) int res; __asm__ ("cntlzw %[res],%[bits];\n" : [res] "=&r" (res) : [bits] "r" (bits)); return 31 - res; #elif defined(_M_IX86) /* Visual Studio i386 */ __asm { xor eax, eax dec eax bsr eax, bits } #elif defined(_M_X64) /* Visual Studio x86_64 */ /* TODO: Need the appropriate x86_64 code */ int res; if (bits == 0) return -1; res = 0; if (bits & 0xFFFF0000) { bits &= 0xFFFF0000; res += 16; } if (bits & 0xFF00FF00) { bits &= 0xFF00FF00; res += 8; } if (bits & 0xF0F0F0F0) { bits &= 0xF0F0F0F0; res += 4; } if (bits & 0xCCCCCCCC) { bits &= 0xCCCCCCCC; res += 2; } if (bits & 0xAAAAAAAA) { bits &= 0xAAAAAAAA; res += 1; } return res; #else int res; if (bits == 0) return -1; res = 0; if (bits & 0xFFFF0000) { bits &= 0xFFFF0000; res += 16; } if (bits & 0xFF00FF00) { bits &= 0xFF00FF00; res += 8; } if (bits & 0xF0F0F0F0) { bits &= 0xF0F0F0F0; res += 4; } if (bits & 0xCCCCCCCC) { bits &= 0xCCCCCCCC; res += 2; } if (bits & 0xAAAAAAAA) { bits &= 0xAAAAAAAA; res += 1; } return res; #endif } /*- End of function --------------------------------------------------------*/ /*! \brief Find the bit position of the lowest set bit in a word \param bits The word to be searched \return The bit number of the lowest set bit, or -1 if the word is zero. */ static __inline__ int bottom_bit(unsigned int bits) { int res; #if defined(SPANDSP_USE_86_ASM) __asm__ (" xorl %[res],%[res];\n" " decl %[res];\n" " bsfl %[bits],%[res]\n" : [res] "=&r" (res) : [bits] "rm" (bits)); return res; #else if (bits == 0) return -1; res = 31; if (bits & 0x0000FFFF) { bits &= 0x0000FFFF; res -= 16; } if (bits & 0x00FF00FF) { bits &= 0x00FF00FF; res -= 8; } if (bits & 0x0F0F0F0F) { bits &= 0x0F0F0F0F; res -= 4; } if (bits & 0x33333333) { bits &= 0x33333333; res -= 2; } if (bits & 0x55555555) { bits &= 0x55555555; res -= 1; } return res; #endif } /*- End of function --------------------------------------------------------*/ /*! \brief Bit reverse a byte. \param data The byte to be reversed. \return The bit reversed version of data. */ static __inline__ uint8_t bit_reverse8(uint8_t x) { #if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__powerpc__) /* If multiply is fast */ return ((x*0x0802U & 0x22110U) | (x*0x8020U & 0x88440U))*0x10101U >> 16; #else /* If multiply is slow, but we have a barrel shifter */ x = (x >> 4) | (x << 4); x = ((x & 0xCC) >> 2) | ((x & 0x33) << 2); return ((x & 0xAA) >> 1) | ((x & 0x55) << 1); #endif } /*- End of function --------------------------------------------------------*/ /*! \brief Bit reverse a 16 bit word. \param data The word to be reversed. \return The bit reversed version of data. */ SPAN_DECLARE(uint16_t) bit_reverse16(uint16_t data); /*! \brief Bit reverse a 32 bit word. \param data The word to be reversed. \return The bit reversed version of data. */ SPAN_DECLARE(uint32_t) bit_reverse32(uint32_t data); /*! \brief Bit reverse each of the four bytes in a 32 bit word. \param data The word to be reversed. \return The bit reversed version of data. */ SPAN_DECLARE(uint32_t) bit_reverse_4bytes(uint32_t data); #if defined(__x86_64__) /*! \brief Bit reverse each of the eight bytes in a 64 bit word. \param data The word to be reversed. \return The bit reversed version of data. */ SPAN_DECLARE(uint64_t) bit_reverse_8bytes(uint64_t data); #endif /*! \brief Bit reverse each byte in a buffer. \param to The buffer to place the reversed data in. \param from The buffer containing the data to be reversed. \param len The length of the data in the buffer. */ SPAN_DECLARE(void) bit_reverse(uint8_t to[], const uint8_t from[], int len); /*! \brief Find the number of set bits in a 32 bit word. \param x The word to be searched. \return The number of set bits. */ SPAN_DECLARE(int) one_bits32(uint32_t x); /*! \brief Create a mask as wide as the number in a 32 bit word. \param x The word to be searched. \return The mask. */ SPAN_DECLARE(uint32_t) make_mask32(uint32_t x); /*! \brief Create a mask as wide as the number in a 16 bit word. \param x The word to be searched. \return The mask. */ SPAN_DECLARE(uint16_t) make_mask16(uint16_t x); /*! \brief Find the least significant one in a word, and return a word with just that bit set. \param x The word to be searched. \return The word with the single set bit. */ static __inline__ uint32_t least_significant_one32(uint32_t x) { return (x & (-(int32_t) x)); } /*- End of function --------------------------------------------------------*/ /*! \brief Find the most significant one in a word, and return a word with just that bit set. \param x The word to be searched. \return The word with the single set bit. */ static __inline__ uint32_t most_significant_one32(uint32_t x) { #if defined(__i386__) || defined(__x86_64__) || defined(__ppc__) || defined(__powerpc__) return 1 << top_bit(x); #else x = make_mask32(x); return (x ^ (x >> 1)); #endif } /*- End of function --------------------------------------------------------*/ /*! \brief Find the parity of a byte. \param x The byte to be checked. \return 1 for odd, or 0 for even. */ static __inline__ int parity8(uint8_t x) { x = (x ^ (x >> 4)) & 0x0F; return (0x6996 >> x) & 1; } /*- End of function --------------------------------------------------------*/ /*! \brief Find the parity of a 16 bit word. \param x The word to be checked. \return 1 for odd, or 0 for even. */ static __inline__ int parity16(uint16_t x) { x ^= (x >> 8); x = (x ^ (x >> 4)) & 0x0F; return (0x6996 >> x) & 1; } /*- End of function --------------------------------------------------------*/ /*! \brief Find the parity of a 32 bit word. \param x The word to be checked. \return 1 for odd, or 0 for even. */ static __inline__ int parity32(uint32_t x) { x ^= (x >> 16); x ^= (x >> 8); x = (x ^ (x >> 4)) & 0x0F; return (0x6996 >> x) & 1; } /*- End of function --------------------------------------------------------*/ #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/bert.h0000664000175000017500000001201711422612263013454 00000000000000/* * SpanDSP - a series of DSP components for telephony * * bert.h - Bit error rate tests. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_BERT_H_) #define _SPANDSP_BERT_H_ /*! \page bert_page The Bit Error Rate tester \section bert_page_sec_1 What does it do? The Bit Error Rate tester generates a pseudo random bit stream. It also accepts such a pattern, synchronises to it, and checks the bit error rate in this stream. \section bert_page_sec_2 How does it work? The Bit Error Rate tester generates a bit stream, with a repeating 2047 bit pseudo random pattern, using an 11 stage polynomial generator. It also accepts such a pattern, synchronises to it, and checks the bit error rate in this stream. If the error rate is excessive the tester assumes synchronisation has been lost, and it attempts to resynchronise with the stream. The bit error rate is continuously assessed against decadic ranges - > 1 in 10^2 > 1 in 10^3 > 1 in 10^4 > 1 in 10^5 > 1 in 10^6 > 1 in 10^7 < 1 in 10^7 To ensure fairly smooth results from this assessment, each decadic level is assessed over 10/error rate bits. That is, to assess if the signal's BER is above or below 1 in 10^5 the software looks over 10*10^5 => 10^6 bits. */ enum { BERT_REPORT_SYNCED = 0, BERT_REPORT_UNSYNCED, BERT_REPORT_REGULAR, BERT_REPORT_GT_10_2, BERT_REPORT_LT_10_2, BERT_REPORT_LT_10_3, BERT_REPORT_LT_10_4, BERT_REPORT_LT_10_5, BERT_REPORT_LT_10_6, BERT_REPORT_LT_10_7 }; /* The QBF strings should be: "VoyeZ Le BricK GeanT QuE J'ExaminE PreS Du WharF 123 456 7890 + - * : = $ % ( )" "ThE QuicK BrowN FoX JumpS OveR ThE LazY DoG 123 456 7890 + - * : = $ % ( )" */ enum { BERT_PATTERN_ZEROS = 0, BERT_PATTERN_ONES, BERT_PATTERN_7_TO_1, BERT_PATTERN_3_TO_1, BERT_PATTERN_1_TO_1, BERT_PATTERN_1_TO_3, BERT_PATTERN_1_TO_7, BERT_PATTERN_QBF, BERT_PATTERN_ITU_O151_23, BERT_PATTERN_ITU_O151_20, BERT_PATTERN_ITU_O151_15, BERT_PATTERN_ITU_O152_11, BERT_PATTERN_ITU_O153_9 }; /*! Bit error rate tester (BERT) results descriptor. This is used to report the results of a BER test. */ typedef struct { int total_bits; int bad_bits; int resyncs; } bert_results_t; typedef void (*bert_report_func_t)(void *user_data, int reason, bert_results_t *bert_results); /*! Bit error rate tester (BERT) descriptor. This defines the working state for a single instance of the BERT. */ typedef struct bert_state_s bert_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Return a short description of a BERT event. \param event The event type. \return A pointer to a short text string describing the event. */ SPAN_DECLARE(const char *) bert_event_to_str(int event); /*! Initialise a BERT context. \param s The BERT context. \param limit The maximum test duration. \param pattern One of the supported BERT signal patterns. \param resync_len ??? \param resync_percent The percentage of bad bits which will cause a resync. \return The BERT context. */ SPAN_DECLARE(bert_state_t *) bert_init(bert_state_t *s, int limit, int pattern, int resync_len, int resync_percent); SPAN_DECLARE(int) bert_release(bert_state_t *s); SPAN_DECLARE(int) bert_free(bert_state_t *s); /*! Get the next bit of the BERT sequence from the generator. \param s The BERT context. \return The bit. */ SPAN_DECLARE(int) bert_get_bit(bert_state_t *s); /*! Put the next bit of the BERT sequence to the analyser. \param s The BERT context. \param bit The bit. */ SPAN_DECLARE(void) bert_put_bit(bert_state_t *s, int bit); /*! Set the callback function for reporting the test status. \param s The BERT context. \param freq The required frequency of regular reports. \param reporter The callback function. \param user_data An opaque pointer passed to the reporter routine. */ SPAN_DECLARE(void) bert_set_report(bert_state_t *s, int freq, bert_report_func_t reporter, void *user_data); /*! Get the results of the BERT. \param s The BERT context. \param results The results. \return The size of the result structure. */ SPAN_DECLARE(int) bert_result(bert_state_t *s, bert_results_t *results); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/math_fixed.h0000644000175000017500000000471612101004227014623 00000000000000/* * SpanDSP - a series of DSP components for telephony * * math_fixed.h * * Written by Steve Underwood * * Copyright (C) 2010 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_MATH_FIXED_H_) #define _MATH_FIXED_H_ /*! \page math_fixed_page Fixed point math functions \section math_fixed_page_sec_1 What does it do? \section math_fixed_page_sec_2 How does it work? */ #if defined(__cplusplus) extern "C" { #endif #if defined(SPANDSP_USE_FIXED_POINT) SPAN_DECLARE(uint16_t) sqrtu32_u16(uint32_t x); #endif SPAN_DECLARE(uint16_t) fixed_reciprocal16(uint16_t x, int *shift); SPAN_DECLARE(uint16_t) fixed_divide16(uint16_t y, uint16_t x); SPAN_DECLARE(uint16_t) fixed_divide32(uint32_t y, uint16_t x); SPAN_DECLARE(int16_t) fixed_log10_16(uint16_t x); SPAN_DECLARE(int32_t) fixed_log10_32(uint32_t x); SPAN_DECLARE(uint16_t) fixed_sqrt16(uint16_t x); SPAN_DECLARE(uint16_t) fixed_sqrt32(uint32_t x); /*! Evaluate an approximate 16 bit fixed point sine. \brief Evaluate an approximate 16 bit fixed point sine. \param x A 16 bit unsigned angle, in 360/65536 degree steps. \return sin(x)*32767. */ SPAN_DECLARE(int16_t) fixed_sin(uint16_t x); /*! Evaluate an approximate 16 bit fixed point cosine. \brief Evaluate an approximate 16 bit fixed point cosine. \param x A 16 bit unsigned angle, in 360/65536 degree steps. \return cos(x)*32767. */ SPAN_DECLARE(int16_t) fixed_cos(uint16_t x); /*! Evaluate an approximate 16 bit fixed point sine. \brief Evaluate an approximate 16 bit fixed point sine. \param y . \param x . \return The 16 bit unsigned angle, in 360/65536 degree steps. */ SPAN_DECLARE(uint16_t) fixed_atan2(int16_t y, int16_t x); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/t38_non_ecm_buffer.h0000664000175000017500000001416711422612264016176 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t38_non_ecm_buffer.h - A rate adapting buffer for T.38 non-ECM image * and TCF data * * Written by Steve Underwood * * Copyright (C) 2005, 2006, 2007, 2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_T38_NON_ECM_BUFFER_H_) #define _SPANDSP_T38_NON_ECM_BUFFER_H_ /*! \page t38_non_ecm_buffer_page T.38 rate adapting non-ECM image data buffer \section t38_non_ecm_buffer_page_sec_1 What does it do? The T.38 rate adapting non-ECM image data buffer is used to buffer TCF and non-ECM FAX image data being gatewayed from a T.38 link to an analogue FAX modem link. As well as rate adapting, the buffer has the ability to impose a minimum on the number of bits per row of image data. This allows any row padding zeros to be stripped from the data stream, to minimise the data sent as T.38 packets, and be reinserted before the data is sent to its final destination. Not all T.38 implementations support this feature, so it's use must be negotiated. \section t38_non_ecm_buffer_page_sec_2 How does it work? When inserting padding bits, whether to ensure a minimum row time or for flow control, it is important the right value is inserted at the right point in the data sequence. If we are in the optional initial period of all ones, we can insert a byte of extra ones at any time. Once we pass that initial stage, TCF and image data need separate handling. TCF data is all zeros. Once the period of all zeros has begun it is OK to insert additional bytes of zeros at any point. Image data consists of rows, separated by EOL (end of line) markers. Inserting zeros at arbitrary times would corrupt the image. However, it is OK to insert a considerable number of extra zeros just before an EOL. Therefore we track where the EOL markers occur as we fill the buffer. As we empty the buffer stop outputting real data, and start outputting bytes of zero, if we reach this last EOL marker location. The EOL marker is 11 zeros following by 1 (1D mode) or 2 (2D mode) ones. Therefore, it always spills across 2 bytes in the buffer, and there is always a point where we can insert our extra zeros between bytes. Padding between the group of successive EOL markers which for the RTC (return to control) marker that ends an image causes some FAX machines not to recognise them as an RTC condition. Therefore, our padding applies special protection so padding never occurs between two successive EOL markers, with no pixel data between them. */ /*! The buffer length much be a power of two. The chosen length is big enough for over 9s of data at the V.17 14,400bps rate. */ #define T38_NON_ECM_TX_BUF_LEN 16384 /*! \brief A flow controlled non-ECM image data buffer, for buffering T.38 to analogue modem data. */ typedef struct t38_non_ecm_buffer_state_s t38_non_ecm_buffer_state_t; #if defined(__cplusplus) extern "C" { #endif /*! \brief Initialise a T.38 rate adapting non-ECM buffer context. \param s The buffer context. \param mode TRUE for image data mode, or FALSE for TCF mode. \param bits The minimum number of bits per FAX image row. \return A pointer to the buffer context, or NULL if there was a problem. */ SPAN_DECLARE(t38_non_ecm_buffer_state_t *) t38_non_ecm_buffer_init(t38_non_ecm_buffer_state_t *s, int mode, int min_row_bits); SPAN_DECLARE(int) t38_non_ecm_buffer_release(t38_non_ecm_buffer_state_t *s); SPAN_DECLARE(int) t38_non_ecm_buffer_free(t38_non_ecm_buffer_state_t *s); /*! \brief Set the mode of a T.38 rate adapting non-ECM buffer context. \param s The buffer context. \param mode TRUE for image data mode, or FALSE for TCF mode. \param bits The minimum number of bits per FAX image row. */ SPAN_DECLARE(void) t38_non_ecm_buffer_set_mode(t38_non_ecm_buffer_state_t *s, int mode, int min_row_bits); /*! \brief Inject data to T.38 rate adapting non-ECM buffer context. \param s The buffer context. \param buf The data buffer to be injected. \param len The length of the data to be injected. */ SPAN_DECLARE(void) t38_non_ecm_buffer_inject(t38_non_ecm_buffer_state_t *s, const uint8_t *buf, int len); /*! \brief Inform a T.38 rate adapting non-ECM buffer context that the incoming data has finished, and the contents of the buffer should be played out as quickly as possible. \param s The buffer context. */ SPAN_DECLARE(void) t38_non_ecm_buffer_push(t38_non_ecm_buffer_state_t *s); /*! \brief Report the input status of a T.38 rate adapting non-ECM buffer context to the specified logging context. \param s The buffer context. \param logging The logging context. */ SPAN_DECLARE(void) t38_non_ecm_buffer_report_input_status(t38_non_ecm_buffer_state_t *s, logging_state_t *logging); /*! \brief Report the output status of a T.38 rate adapting non-ECM buffer context to the specified logging context. \param s The buffer context. \param logging The logging context. */ SPAN_DECLARE(void) t38_non_ecm_buffer_report_output_status(t38_non_ecm_buffer_state_t *s, logging_state_t *logging); /*! \brief Get the next bit of data from a T.38 rate adapting non-ECM buffer context. \param user_data The buffer context, cast to a void pointer. \return The next bit, or one of the values indicating a change of modem status. */ SPAN_DECLARE_NONSTD(int) t38_non_ecm_buffer_get_bit(void *user_data); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/async.h0000664000175000017500000002106412100750514013633 00000000000000/* * SpanDSP - a series of DSP components for telephony * * async.h - Asynchronous serial bit stream encoding and decoding * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page async_page Asynchronous bit stream processing \section async_page_sec_1 What does it do? The asynchronous serial bit stream processing module provides generation and decoding facilities for most asynchronous data formats. It supports: - 1 or 2 stop bits. - Odd, even or no parity. - 5, 6, 7, or 8 bit characters. - V.14 rate adaption. The input to this module is a bit stream. This means any symbol synchronisation and decoding must occur before data is fed to this module. \section async_page_sec_2 The transmitter ???. \section async_page_sec_3 The receiver ???. */ #if !defined(_SPANDSP_ASYNC_H_) #define _SPANDSP_ASYNC_H_ /*! Special "bit" values for the bitstream put and get functions, and the signal status functions. */ enum { /*! \brief The carrier signal has dropped. */ SIG_STATUS_CARRIER_DOWN = -1, /*! \brief The carrier signal is up. This merely indicates that carrier energy has been seen. It is not an indication that the carrier is either valid, or of the expected type. */ SIG_STATUS_CARRIER_UP = -2, /*! \brief The modem is training. This is an early indication that the signal seems to be of the right type. This may be needed in time critical applications, like T.38, to forward an early indication of what is happening on the wire. */ SIG_STATUS_TRAINING_IN_PROGRESS = -3, /*! \brief The modem has trained, and is ready for data exchange. */ SIG_STATUS_TRAINING_SUCCEEDED = -4, /*! \brief The modem has failed to train. */ SIG_STATUS_TRAINING_FAILED = -5, /*! \brief Packet framing (e.g. HDLC framing) is OK. */ SIG_STATUS_FRAMING_OK = -6, /*! \brief The data stream has ended. */ SIG_STATUS_END_OF_DATA = -7, /*! \brief An abort signal (e.g. an HDLC abort) has been received. */ SIG_STATUS_ABORT = -8, /*! \brief A break signal (e.g. an async break) has been received. */ SIG_STATUS_BREAK = -9, /*! \brief A modem has completed its task, and shut down. */ SIG_STATUS_SHUTDOWN_COMPLETE = -10, /*! \brief Regular octet report for things like HDLC to the MTP standards. */ SIG_STATUS_OCTET_REPORT = -11, /*! \brief Notification that a modem has detected signal quality degradation. */ SIG_STATUS_POOR_SIGNAL_QUALITY = -12, /*! \brief Notification that a modem retrain has occurred. */ SIG_STATUS_MODEM_RETRAIN_OCCURRED = -13, /*! \brief The link protocol (e.g. V.42) has connected. */ SIG_STATUS_LINK_CONNECTED = -14, /*! \brief The link protocol (e.g. V.42) has disconnected. */ SIG_STATUS_LINK_DISCONNECTED = -15, /*! \brief An error has occurred in the link protocol (e.g. V.42). */ SIG_STATUS_LINK_ERROR = -16 }; /*! Message put function for data pumps */ typedef void (*put_msg_func_t)(void *user_data, const uint8_t *msg, int len); /*! Message get function for data pumps */ typedef int (*get_msg_func_t)(void *user_data, uint8_t *msg, int max_len); /*! Byte put function for data pumps */ typedef void (*put_byte_func_t)(void *user_data, int byte); /*! Byte get function for data pumps */ typedef int (*get_byte_func_t)(void *user_data); /*! Bit put function for data pumps */ typedef void (*put_bit_func_t)(void *user_data, int bit); /*! Bit get function for data pumps */ typedef int (*get_bit_func_t)(void *user_data); #define modem_rx_status_func_t modem_status_func_t #define modem_tx_status_func_t modem_status_func_t /*! Status change callback function for data pumps */ typedef void (*modem_status_func_t)(void *user_data, int status); /*! Asynchronous data transmit descriptor. This defines the state of a single working instance of a byte to asynchronous serial converter, for use in FSK modems. */ typedef struct async_tx_state_s async_tx_state_t; /*! Asynchronous data receive descriptor. This defines the state of a single working instance of an asynchronous serial to byte converter, for use in FSK modems. */ typedef struct async_rx_state_s async_rx_state_t; enum { /*! No parity bit should be used */ ASYNC_PARITY_NONE = 0, /*! An even parity bit will exist, after the data bits */ ASYNC_PARITY_EVEN, /*! An odd parity bit will exist, after the data bits */ ASYNC_PARITY_ODD }; #if defined(__cplusplus) extern "C" { #endif /*! Convert a signal status to a short text description. \brief Convert a signal status to a short text description. \param status The modem signal status. \return A pointer to the description. */ SPAN_DECLARE(const char *) signal_status_to_str(int status); /*! Initialise an asynchronous data transmit context. \brief Initialise an asynchronous data transmit context. \param s The transmitter context. \param data_bits The number of data bit. \param parity_bits The type of parity. \param stop_bits The number of stop bits. \param use_v14 TRUE if V.14 rate adaption processing should be used. \param get_byte The callback routine used to get the data to be transmitted. \param user_data An opaque pointer. \return A pointer to the initialised context, or NULL if there was a problem. */ SPAN_DECLARE(async_tx_state_t *) async_tx_init(async_tx_state_t *s, int data_bits, int parity_bits, int stop_bits, int use_v14, get_byte_func_t get_byte, void *user_data); SPAN_DECLARE(int) async_tx_release(async_tx_state_t *s); SPAN_DECLARE(int) async_tx_free(async_tx_state_t *s); /*! Get the next bit of a transmitted serial bit stream. \brief Get the next bit of a transmitted serial bit stream. \param user_data An opaque point which must point to a transmitter context. \return the next bit, or PUTBIT_END_OF_DATA to indicate the data stream has ended. */ SPAN_DECLARE_NONSTD(int) async_tx_get_bit(void *user_data); /*! Initialise an asynchronous data receiver context. \brief Initialise an asynchronous data receiver context. \param s The receiver context. \param data_bits The number of data bits. \param parity_bits The type of parity. \param stop_bits The number of stop bits. \param use_v14 TRUE if V.14 rate adaption processing should be used. \param put_byte The callback routine used to put the received data. \param user_data An opaque pointer. \return A pointer to the initialised context, or NULL if there was a problem. */ SPAN_DECLARE(async_rx_state_t *) async_rx_init(async_rx_state_t *s, int data_bits, int parity_bits, int stop_bits, int use_v14, put_byte_func_t put_byte, void *user_data); SPAN_DECLARE(int) async_rx_release(async_rx_state_t *s); SPAN_DECLARE(int) async_rx_free(async_rx_state_t *s); /*! Accept a bit from a received serial bit stream \brief Accept a bit from a received serial bit stream \param user_data An opaque point which must point to a receiver context. \param bit The new bit. Some special values are supported for this field. - SIG_STATUS_CARRIER_UP - SIG_STATUS_CARRIER_DOWN - SIG_STATUS_TRAINING_SUCCEEDED - SIG_STATUS_TRAINING_FAILED - SIG_STATUS_END_OF_DATA */ SPAN_DECLARE_NONSTD(void) async_rx_put_bit(void *user_data, int bit); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/t38_terminal.h0000664000175000017500000001357012101162665015037 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t38_terminal.h - T.38 termination, less the packet exchange part * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_T38_TERMINAL_H_) #define _SPANDSP_T38_TERMINAL_H_ /*! \page t38_terminal_page T.38 real time FAX over IP termination \section t38_terminal_page_sec_1 What does it do? \section t38_terminal_page_sec_2 How does it work? */ /* Make sure the HDLC frame buffers are big enough for ECM frames. */ #define T38_MAX_HDLC_LEN 260 enum { /*! This option enables the continuous streaming of FAX data, with no allowance for FAX machine speeds. This is usually used with TCP/TPKT transmission of T.38 FAXes */ T38_TERMINAL_OPTION_NO_PACING = 0x01, /*! This option enables the regular repeat transmission of indicator signals, during periods when no FAX signal transmission occurs. */ T38_TERMINAL_OPTION_REGULAR_INDICATORS = 0x02, /*! This option enables the regular repeat transmission of indicator signals for the first 2s, during periods when no FAX signal transmission occurs. */ T38_TERMINAL_OPTION_2S_REPEATING_INDICATORS = 0x04, /*! This option suppresses the transmission of indicators. This is usually used with TCP/TPKT transmission of T.38 FAXes */ T38_TERMINAL_OPTION_NO_INDICATORS = 0x08 }; typedef struct t38_terminal_state_s t38_terminal_state_t; #if defined(__cplusplus) extern "C" { #endif SPAN_DECLARE(int) t38_terminal_send_timeout(t38_terminal_state_t *s, int samples); /*! Set configuration options. \brief Set configuration options. \param s The T.38 context. \param config A combinations of T38_TERMINAL_OPTION_* bits. */ SPAN_DECLARE(void) t38_terminal_set_config(t38_terminal_state_t *s, int config); /*! Select whether the time for talker echo protection tone will be allowed for when sending. \brief Select whether TEP time will be allowed for. \param s The T.38 context. \param use_tep TRUE if TEP should be allowed for. */ SPAN_DECLARE(void) t38_terminal_set_tep_mode(t38_terminal_state_t *s, int use_tep); /*! Select whether non-ECM fill bits are to be removed during transmission. \brief Select whether non-ECM fill bits are to be removed during transmission. \param s The T.38 context. \param remove TRUE if fill bits are to be removed. */ SPAN_DECLARE(void) t38_terminal_set_fill_bit_removal(t38_terminal_state_t *s, int remove); /*! Get a pointer to the T.30 engine associated with a termination mode T.38 context. \brief Get a pointer to the T.30 engine associated with a T.38 context. \param s The T.38 context. \return A pointer to the T.30 context, or NULL. */ SPAN_DECLARE(t30_state_t *) t38_terminal_get_t30_state(t38_terminal_state_t *s); /*! Get a pointer to the T.38 core IFP packet engine associated with a termination mode T.38 context. \brief Get a pointer to the T.38 core IFP packet engine associated with a T.38 context. \param s The T.38 context. \return A pointer to the T.38 core context, or NULL. */ SPAN_DECLARE(t38_core_state_t *) t38_terminal_get_t38_core_state(t38_terminal_state_t *s); /*! Get a pointer to the logging context associated with a T.38 context. \brief Get a pointer to the logging context associated with a T.38 context. \param s The T.38 context. \return A pointer to the logging context, or NULL. */ SPAN_DECLARE(logging_state_t *) t38_terminal_get_logging_state(t38_terminal_state_t *s); /*! \brief Reinitialise a termination mode T.38 context. \param s The T.38 context. \param calling_party TRUE if the context is for a calling party. FALSE if the context is for an answering party. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t38_terminal_restart(t38_terminal_state_t *s, int calling_party); /*! \brief Initialise a termination mode T.38 context. \param s The T.38 context. \param calling_party TRUE if the context is for a calling party. FALSE if the context is for an answering party. \param tx_packet_handler A callback routine to encapsulate and transmit T.38 packets. \param tx_packet_user_data An opaque pointer passed to the tx_packet_handler routine. \return A pointer to the termination mode T.38 context, or NULL if there was a problem. */ SPAN_DECLARE(t38_terminal_state_t *) t38_terminal_init(t38_terminal_state_t *s, int calling_party, t38_tx_packet_handler_t *tx_packet_handler, void *tx_packet_user_data); /*! Release a termination mode T.38 context. \brief Release a T.38 context. \param s The T.38 context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t38_terminal_release(t38_terminal_state_t *s); /*! Free a a termination mode T.38 context. \brief Free a T.38 context. \param s The T.38 context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t38_terminal_free(t38_terminal_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/complex_vector_float.h0000664000175000017500000001225111422612264016737 00000000000000/* * SpanDSP - a series of DSP components for telephony * * complex_vector_float.h * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_COMPLEX_VECTOR_FLOAT_H_) #define _SPANDSP_COMPLEX_VECTOR_FLOAT_H_ #if defined(__cplusplus) extern "C" { #endif static __inline__ void cvec_copyf(complexf_t z[], const complexf_t x[], int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]; } /*- End of function --------------------------------------------------------*/ static __inline__ void cvec_copy(complex_t z[], const complex_t x[], int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) static __inline__ void cvec_copyl(complexl_t z[], const complexl_t x[], int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]; } /*- End of function --------------------------------------------------------*/ #endif static __inline__ void cvec_zerof(complexf_t z[], int n) { int i; for (i = 0; i < n; i++) z[i] = complex_setf(0.0f, 0.0f); } /*- End of function --------------------------------------------------------*/ static __inline__ void cvec_zero(complex_t z[], int n) { int i; for (i = 0; i < n; i++) z[i] = complex_set(0.0, 0.0); } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) static __inline__ void cvec_zerol(complexl_t z[], int n) { int i; for (i = 0; i < n; i++) z[i] = complex_setl(0.0, 0.0); } /*- End of function --------------------------------------------------------*/ #endif static __inline__ void cvec_setf(complexf_t z[], complexf_t *x, int n) { int i; for (i = 0; i < n; i++) z[i] = *x; } /*- End of function --------------------------------------------------------*/ static __inline__ void cvec_set(complex_t z[], complex_t *x, int n) { int i; for (i = 0; i < n; i++) z[i] = *x; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) static __inline__ void cvec_setl(complexl_t z[], complexl_t *x, int n) { int i; for (i = 0; i < n; i++) z[i] = *x; } /*- End of function --------------------------------------------------------*/ #endif SPAN_DECLARE(void) cvec_mulf(complexf_t z[], const complexf_t x[], const complexf_t y[], int n); SPAN_DECLARE(void) cvec_mul(complex_t z[], const complex_t x[], const complex_t y[], int n); #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) cvec_mull(complexl_t z[], const complexl_t x[], const complexl_t y[], int n); #endif /*! \brief Find the dot product of two complex float vectors. \param x The first vector. \param y The first vector. \param n The number of elements in the vectors. \return The dot product of the two vectors. */ SPAN_DECLARE(complexf_t) cvec_dot_prodf(const complexf_t x[], const complexf_t y[], int n); /*! \brief Find the dot product of two complex double vectors. \param x The first vector. \param y The first vector. \param n The number of elements in the vectors. \return The dot product of the two vectors. */ SPAN_DECLARE(complex_t) cvec_dot_prod(const complex_t x[], const complex_t y[], int n); #if defined(HAVE_LONG_DOUBLE) /*! \brief Find the dot product of two complex long double vectors. \param x The first vector. \param y The first vector. \param n The number of elements in the vectors. \return The dot product of the two vectors. */ SPAN_DECLARE(complexl_t) cvec_dot_prodl(const complexl_t x[], const complexl_t y[], int n); #endif /*! \brief Find the dot product of two complex float vectors, where the first is a circular buffer with an offset for the starting position. \param x The first vector. \param y The first vector. \param n The number of elements in the vectors. \param pos The starting position in the x vector. \return The dot product of the two vectors. */ SPAN_DECLARE(complexf_t) cvec_circular_dot_prodf(const complexf_t x[], const complexf_t y[], int n, int pos); SPAN_DECLARE(void) cvec_lmsf(const complexf_t x[], complexf_t y[], int n, const complexf_t *error); SPAN_DECLARE(void) cvec_circular_lmsf(const complexf_t x[], complexf_t y[], int n, int pos, const complexf_t *error); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/t4_t6_encode.h0000664000175000017500000000230611422612264014776 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t4_t6_encode.h - definitions for T.4/T.6 fax encoding * * Written by Steve Underwood * * Copyright (C) 2003, 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_T4_T6_ENCODE_H_) #define _SPANDSP_T4_T6_ENCODE_H_ typedef struct t4_t6_encode_state_s t4_t6_encode_state_t; #if defined(__cplusplus) extern "C" { #endif #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/fsk.h0000664000175000017500000002432212100762302013277 00000000000000/* * SpanDSP - a series of DSP components for telephony * * fsk.h - FSK modem transmit and receive parts * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page fsk_page FSK modems \section fsk_page_sec_1 What does it do? Most of the oldest telephony modems use incoherent FSK modulation. This module can be used to implement both the transmit and receive sides of a number of these modems. There are integrated definitions for: - V.21 - V.23 - Bell 103 - Bell 202 - Weitbrecht (Used for TDD - Telecoms Device for the Deaf) The audio output or input is a stream of 16 bit samples, at 8000 samples/second. The transmit and receive sides can be used independantly. \section fsk_page_sec_2 The transmitter The FSK transmitter uses a DDS generator to synthesise the waveform. This naturally produces phase coherent transitions, as the phase update rate is switched, producing a clean spectrum. The symbols are not generally an integer number of samples long. However, the symbol time for the fastest data rate generally used (1200bps) is more than 7 samples long. The jitter resulting from switching at the nearest sample is, therefore, acceptable. No interpolation is used. \section fsk_page_sec_3 The receiver The FSK receiver uses a quadrature correlation technique to demodulate the signal. Two DDS quadrature oscillators are used. The incoming signal is correlated with the oscillator signals over a period of one symbol. The oscillator giving the highest net correlation from its I and Q outputs is the one that matches the frequency being transmitted during the correlation interval. Because the transmission is totally asynchronous, the demodulation process must run sample by sample to find the symbol transitions. The correlation is performed on a sliding window basis, so the computational load of demodulating sample by sample is not great. Two modes of symbol synchronisation are provided: - In synchronous mode, symbol transitions are smoothed, to track their true position in the prescence of high timing jitter. This provides the most reliable symbol recovery in poor signal to noise conditions. However, it takes a little time to settle, so it not really suitable for data streams which must start up instantaneously (e.g. the TDD systems used by hearing impaired people). - In asynchronous mode each transition is taken at face value, with no temporal smoothing. There is no settling time for this mode, but when the signal to noise ratio is very poor it does not perform as well as the synchronous mode. */ #if !defined(_SPANDSP_FSK_H_) #define _SPANDSP_FSK_H_ /*! FSK modem specification. This defines the frequencies, signal levels and baud rate (== bit rate for simple FSK) for a single channel of an FSK modem. */ typedef struct { /*! Short text name for the modem. */ const char *name; /*! The frequency of the zero bit state, in Hz */ int freq_zero; /*! The frequency of the one bit state, in Hz */ int freq_one; /*! The transmit power level, in dBm0 */ int tx_level; /*! The minimum acceptable receive power level, in dBm0 */ int min_level; /*! The bit rate of the modem, in units of 1/100th bps */ int baud_rate; } fsk_spec_t; /* Predefined FSK modem channels */ enum { FSK_V21CH1 = 0, FSK_V21CH2, FSK_V23CH1, FSK_V23CH2, FSK_BELL103CH1, FSK_BELL103CH2, FSK_BELL202, FSK_WEITBRECHT, /* 45.45 baud version, used for TDD (Telecom Device for the Deaf) */ FSK_WEITBRECHT50, /* 50 baud version, used for TDD (Telecom Device for the Deaf) */ FSK_V21CH1_110 /* 110 bps version of V.21 channel 1, as used by V.18 */ }; enum { FSK_FRAME_MODE_ASYNC = 0, FSK_FRAME_MODE_SYNC = 1, FSK_FRAME_MODE_5N1_FRAMES = 7, /* 5 bits of data + start bit + stop bit */ FSK_FRAME_MODE_7N1_FRAMES = 9, /* 7 bits of data + start bit + stop bit */ FSK_FRAME_MODE_7E1_FRAMES = 10, /* 7 bits of data + even parity + start bit + stop bit */ FSK_FRAME_MODE_7E2_FRAMES = 11 /* 7 bits of data + even parity + start bit + 2 stop bits */ }; SPAN_DECLARE_DATA extern const fsk_spec_t preset_fsk_specs[]; /*! FSK modem transmit descriptor. This defines the state of a single working instance of an FSK modem transmitter. */ typedef struct fsk_tx_state_s fsk_tx_state_t; /* The longest window will probably be 106 for 75 baud */ #define FSK_MAX_WINDOW_LEN 128 /*! FSK modem receive descriptor. This defines the state of a single working instance of an FSK modem receiver. */ typedef struct fsk_rx_state_s fsk_rx_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Initialise an FSK modem transmit context. \brief Initialise an FSK modem transmit context. \param s The modem context. \param spec The specification of the modem tones and rate. \param get_bit The callback routine used to get the data to be transmitted. \param user_data An opaque pointer. \return A pointer to the modem context, or NULL if there was a problem. */ SPAN_DECLARE(fsk_tx_state_t *) fsk_tx_init(fsk_tx_state_t *s, const fsk_spec_t *spec, get_bit_func_t get_bit, void *user_data); SPAN_DECLARE(int) fsk_tx_restart(fsk_tx_state_t *s, const fsk_spec_t *spec); SPAN_DECLARE(int) fsk_tx_release(fsk_tx_state_t *s); SPAN_DECLARE(int) fsk_tx_free(fsk_tx_state_t *s); /*! Adjust an FSK modem transmit context's power output. \brief Adjust an FSK modem transmit context's power output. \param s The modem context. \param power The power level, in dBm0 */ SPAN_DECLARE(void) fsk_tx_power(fsk_tx_state_t *s, float power); SPAN_DECLARE(void) fsk_tx_set_get_bit(fsk_tx_state_t *s, get_bit_func_t get_bit, void *user_data); /*! Change the modem status report function associated with an FSK modem transmit context. \brief Change the modem status report function associated with an FSK modem transmit context. \param s The modem context. \param handler The callback routine used to report modem status changes. \param user_data An opaque pointer. */ SPAN_DECLARE(void) fsk_tx_set_modem_status_handler(fsk_tx_state_t *s, modem_status_func_t handler, void *user_data); /*! Generate a block of FSK modem audio samples. \brief Generate a block of FSK modem audio samples. \param s The modem context. \param amp The audio sample buffer. \param len The number of samples to be generated. \return The number of samples actually generated. */ SPAN_DECLARE_NONSTD(int) fsk_tx(fsk_tx_state_t *s, int16_t amp[], int len); /*! Get the current received signal power. \param s The modem context. \return The signal power, in dBm0. */ SPAN_DECLARE(float) fsk_rx_signal_power(fsk_rx_state_t *s); /*! Adjust an FSK modem receive context's carrier detect power threshold. \brief Adjust an FSK modem receive context's carrier detect power threshold. \param s The modem context. \param cutoff The power level, in dBm0 */ SPAN_DECLARE(void) fsk_rx_signal_cutoff(fsk_rx_state_t *s, float cutoff); /*! Initialise an FSK modem receive context. \brief Initialise an FSK modem receive context. \param s The modem context. \param spec The specification of the modem tones and rate. \param framing_mode 0 for fully asynchronous mode. 1 for synchronous mode. >1 for this many bits per asynchronous character frame. \param put_bit The callback routine used to put the received data. \param user_data An opaque pointer. \return A pointer to the modem context, or NULL if there was a problem. */ SPAN_DECLARE(fsk_rx_state_t *) fsk_rx_init(fsk_rx_state_t *s, const fsk_spec_t *spec, int framing_mode, put_bit_func_t put_bit, void *user_data); SPAN_DECLARE(int) fsk_rx_restart(fsk_rx_state_t *s, const fsk_spec_t *spec, int framing_mode); SPAN_DECLARE(int) fsk_rx_release(fsk_rx_state_t *s); SPAN_DECLARE(int) fsk_rx_free(fsk_rx_state_t *s); /*! Process a block of received FSK modem audio samples. \brief Process a block of received FSK modem audio samples. \param s The modem context. \param amp The audio sample buffer. \param len The number of samples in the buffer. \return The number of samples unprocessed. */ SPAN_DECLARE_NONSTD(int) fsk_rx(fsk_rx_state_t *s, const int16_t *amp, int len); /*! Fake processing of a missing block of received FSK modem audio samples (e.g due to packet loss). \brief Fake processing of a missing block of received FSK modem audio samples. \param s The modem context. \param len The number of samples to fake. \return The number of samples unprocessed. */ SPAN_DECLARE_NONSTD(int) fsk_rx_fillin(fsk_rx_state_t *s, int len); SPAN_DECLARE(void) fsk_rx_set_put_bit(fsk_rx_state_t *s, put_bit_func_t put_bit, void *user_data); /*! Change the modem status report function associated with an FSK modem receive context. \brief Change the modem status report function associated with an FSK modem receive context. \param s The modem context. \param handler The callback routine used to report modem status changes. \param user_data An opaque pointer. */ SPAN_DECLARE(void) fsk_rx_set_modem_status_handler(fsk_rx_state_t *s, modem_status_func_t handler, void *user_data); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/telephony.h0000664000175000017500000001136012100752263014526 00000000000000/* * SpanDSP - a series of DSP components for telephony * * telephony.h - some very basic telephony definitions * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_TELEPHONY_H_) #define _SPANDSP_TELEPHONY_H_ #if defined(_M_IX86) || defined(_M_X64) #if defined(LIBSPANDSP_EXPORTS) #define SPAN_DECLARE(type) __declspec(dllexport) type __stdcall #define SPAN_DECLARE_NONSTD(type) __declspec(dllexport) type __cdecl #define SPAN_DECLARE_DATA __declspec(dllexport) #else #define SPAN_DECLARE(type) __declspec(dllimport) type __stdcall #define SPAN_DECLARE_NONSTD(type) __declspec(dllimport) type __cdecl #define SPAN_DECLARE_DATA __declspec(dllimport) #endif #elif defined(SPANDSP_USE_EXPORT_CAPABILITY) && (defined(__GNUC__) || defined(__SUNCC__)) #define SPAN_DECLARE(type) __attribute__((visibility("default"))) type #define SPAN_DECLARE_NONSTD(type) __attribute__((visibility("default"))) type #define SPAN_DECLARE_DATA __attribute__((visibility("default"))) #else #define SPAN_DECLARE(type) /**/ type #define SPAN_DECLARE_NONSTD(type) /**/ type #define SPAN_DECLARE_DATA /**/ #endif #define SAMPLE_RATE 8000 /* This is based on A-law, but u-law is only 0.03dB different */ #define DBM0_MAX_POWER (3.14f + 3.02f) #define DBM0_MAX_SINE_POWER (3.14f) /* This is based on the ITU definition of dbOv in G.100.1 */ #define DBOV_MAX_POWER (0.0f) #define DBOV_MAX_SINE_POWER (-3.02f) /*! \brief A handler for pure receive. The buffer cannot be altered. */ typedef int (span_rx_handler_t)(void *s, const int16_t amp[], int len); /*! \brief A handler for receive, where the buffer can be altered. */ typedef int (span_mod_handler_t)(void *s, int16_t amp[], int len); /*! \brief A handler for missing receive data fill-in. */ typedef int (span_rx_fillin_handler_t)(void *s, int len); /*! \brief A handler for transmit, where the buffer will be filled. */ typedef int (span_tx_handler_t)(void *s, int16_t amp[], int max_len); #define ms_to_samples(t) ((t)*(SAMPLE_RATE/1000)) #define us_to_samples(t) ((t)/(1000000/SAMPLE_RATE)) #if !defined(FALSE) #define FALSE 0 #endif #if !defined(TRUE) #define TRUE (!FALSE) #endif /* Fixed point constant macros */ #define FP_Q_9_7(x) ((int16_t) (128.0*x + ((x >= 0.0) ? 0.5 : -0.5))) #define FP_Q_8_8(x) ((int16_t) (256.0*x + ((x >= 0.0) ? 0.5 : -0.5))) #define FP_Q_7_9(x) ((int16_t) (512.0*x + ((x >= 0.0) ? 0.5 : -0.5))) #define FP_Q_6_10(x) ((int16_t) (1024.0*x + ((x >= 0.0) ? 0.5 : -0.5))) #define FP_Q_5_11(x) ((int16_t) (2048.0*x + ((x >= 0.0) ? 0.5 : -0.5))) #define FP_Q_4_12(x) ((int16_t) (4096.0*x + ((x >= 0.0) ? 0.5 : -0.5))) #define FP_Q_3_13(x) ((int16_t) (8192.0*x + ((x >= 0.0) ? 0.5 : -0.5))) #define FP_Q_2_14(x) ((int16_t) (16384.0*x + ((x >= 0.0) ? 0.5 : -0.5))) #define FP_Q_1_15(x) ((int16_t) (32768.0*x + ((x >= 0.0) ? 0.5 : -0.5))) #define FP_Q_9_23(x) ((int32_t) (65536.0*128.0*x + ((x >= 0.0) ? 0.5 : -0.5))) #define FP_Q_8_24(x) ((int32_t) (65536.0*256.0*x + ((x >= 0.0) ? 0.5 : -0.5))) #define FP_Q_7_25(x) ((int32_t) (65536.0*512.0*x + ((x >= 0.0) ? 0.5 : -0.5))) #define FP_Q_6_26(x) ((int32_t) (65536.0*1024.0*x + ((x >= 0.0) ? 0.5 : -0.5))) #define FP_Q_5_27(x) ((int32_t) (65536.0*2048.0*x + ((x >= 0.0) ? 0.5 : -0.5))) #define FP_Q_4_28(x) ((int32_t) (65536.0*4096.0*x + ((x >= 0.0) ? 0.5 : -0.5))) #define FP_Q_3_29(x) ((int32_t) (65536.0*8192.0*x + ((x >= 0.0) ? 0.5 : -0.5))) #define FP_Q_2_30(x) ((int32_t) (65536.0*16384.0*x + ((x >= 0.0) ? 0.5 : -0.5))) #define FP_Q_1_31(x) ((int32_t) (65536.0*32768.0*x + ((x >= 0.0) ? 0.5 : -0.5))) #if defined(__cplusplus) /* C++ doesn't seem to have sane rounding functions/macros yet */ #if !defined(WIN32) #define lrint(x) ((long int) (x)) #define lrintf(x) ((long int) (x)) #endif #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/fir.h0000664000175000017500000002056711422612264013312 00000000000000/* * SpanDSP - a series of DSP components for telephony * * fir.h - General telephony FIR routines * * Written by Steve Underwood * * Copyright (C) 2002 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page fir_page FIR filtering \section fir_page_sec_1 What does it do? ???. \section fir_page_sec_2 How does it work? ???. */ #if !defined(_SPANDSP_FIR_H_) #define _SPANDSP_FIR_H_ #if defined(USE_MMX) || defined(USE_SSE2) #include "mmx.h" #endif /*! 16 bit integer FIR descriptor. This defines the working state for a single instance of an FIR filter using 16 bit integer coefficients. */ typedef struct { int taps; int curr_pos; const int16_t *coeffs; int16_t *history; } fir16_state_t; /*! 32 bit integer FIR descriptor. This defines the working state for a single instance of an FIR filter using 32 bit integer coefficients, and filtering 16 bit integer data. */ typedef struct { int taps; int curr_pos; const int32_t *coeffs; int16_t *history; } fir32_state_t; /*! Floating point FIR descriptor. This defines the working state for a single instance of an FIR filter using floating point coefficients and data. */ typedef struct { int taps; int curr_pos; const float *coeffs; float *history; } fir_float_state_t; #if defined(__cplusplus) extern "C" { #endif static __inline__ const int16_t *fir16_create(fir16_state_t *fir, const int16_t *coeffs, int taps) { fir->taps = taps; fir->curr_pos = taps - 1; fir->coeffs = coeffs; #if defined(USE_MMX) || defined(USE_SSE2) if ((fir->history = malloc(2*taps*sizeof(int16_t)))) memset(fir->history, 0, 2*taps*sizeof(int16_t)); #else if ((fir->history = (int16_t *) malloc(taps*sizeof(int16_t)))) memset(fir->history, 0, taps*sizeof(int16_t)); #endif return fir->history; } /*- End of function --------------------------------------------------------*/ static __inline__ void fir16_flush(fir16_state_t *fir) { #if defined(USE_MMX) || defined(USE_SSE2) memset(fir->history, 0, 2*fir->taps*sizeof(int16_t)); #else memset(fir->history, 0, fir->taps*sizeof(int16_t)); #endif } /*- End of function --------------------------------------------------------*/ static __inline__ void fir16_free(fir16_state_t *fir) { free(fir->history); } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t fir16(fir16_state_t *fir, int16_t sample) { int i; int32_t y; #if defined(USE_MMX) mmx_t *mmx_coeffs; mmx_t *mmx_hist; fir->history[fir->curr_pos] = sample; fir->history[fir->curr_pos + fir->taps] = sample; mmx_coeffs = (mmx_t *) fir->coeffs; mmx_hist = (mmx_t *) &fir->history[fir->curr_pos]; i = fir->taps; pxor_r2r(mm4, mm4); /* 8 samples per iteration, so the filter must be a multiple of 8 long. */ while (i > 0) { movq_m2r(mmx_coeffs[0], mm0); movq_m2r(mmx_coeffs[1], mm2); movq_m2r(mmx_hist[0], mm1); movq_m2r(mmx_hist[1], mm3); mmx_coeffs += 2; mmx_hist += 2; pmaddwd_r2r(mm1, mm0); pmaddwd_r2r(mm3, mm2); paddd_r2r(mm0, mm4); paddd_r2r(mm2, mm4); i -= 8; } movq_r2r(mm4, mm0); psrlq_i2r(32, mm0); paddd_r2r(mm0, mm4); movd_r2m(mm4, y); emms(); #elif defined(USE_SSE2) xmm_t *xmm_coeffs; xmm_t *xmm_hist; fir->history[fir->curr_pos] = sample; fir->history[fir->curr_pos + fir->taps] = sample; xmm_coeffs = (xmm_t *) fir->coeffs; xmm_hist = (xmm_t *) &fir->history[fir->curr_pos]; i = fir->taps; pxor_r2r(xmm4, xmm4); /* 16 samples per iteration, so the filter must be a multiple of 16 long. */ while (i > 0) { movdqu_m2r(xmm_coeffs[0], xmm0); movdqu_m2r(xmm_coeffs[1], xmm2); movdqu_m2r(xmm_hist[0], xmm1); movdqu_m2r(xmm_hist[1], xmm3); xmm_coeffs += 2; xmm_hist += 2; pmaddwd_r2r(xmm1, xmm0); pmaddwd_r2r(xmm3, xmm2); paddd_r2r(xmm0, xmm4); paddd_r2r(xmm2, xmm4); i -= 16; } movdqa_r2r(xmm4, xmm0); psrldq_i2r(8, xmm0); paddd_r2r(xmm0, xmm4); movdqa_r2r(xmm4, xmm0); psrldq_i2r(4, xmm0); paddd_r2r(xmm0, xmm4); movd_r2m(xmm4, y); #else int offset1; int offset2; fir->history[fir->curr_pos] = sample; offset2 = fir->curr_pos; offset1 = fir->taps - offset2; y = 0; for (i = fir->taps - 1; i >= offset1; i--) y += fir->coeffs[i]*fir->history[i - offset1]; for ( ; i >= 0; i--) y += fir->coeffs[i]*fir->history[i + offset2]; #endif if (fir->curr_pos <= 0) fir->curr_pos = fir->taps; fir->curr_pos--; return (int16_t) (y >> 15); } /*- End of function --------------------------------------------------------*/ static __inline__ const int16_t *fir32_create(fir32_state_t *fir, const int32_t *coeffs, int taps) { fir->taps = taps; fir->curr_pos = taps - 1; fir->coeffs = coeffs; fir->history = (int16_t *) malloc(taps*sizeof(int16_t)); if (fir->history) memset(fir->history, '\0', taps*sizeof(int16_t)); return fir->history; } /*- End of function --------------------------------------------------------*/ static __inline__ void fir32_flush(fir32_state_t *fir) { memset(fir->history, 0, fir->taps*sizeof(int16_t)); } /*- End of function --------------------------------------------------------*/ static __inline__ void fir32_free(fir32_state_t *fir) { free(fir->history); } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t fir32(fir32_state_t *fir, int16_t sample) { int i; int32_t y; int offset1; int offset2; fir->history[fir->curr_pos] = sample; offset2 = fir->curr_pos; offset1 = fir->taps - offset2; y = 0; for (i = fir->taps - 1; i >= offset1; i--) y += fir->coeffs[i]*fir->history[i - offset1]; for ( ; i >= 0; i--) y += fir->coeffs[i]*fir->history[i + offset2]; if (fir->curr_pos <= 0) fir->curr_pos = fir->taps; fir->curr_pos--; return (int16_t) (y >> 15); } /*- End of function --------------------------------------------------------*/ static __inline__ const float *fir_float_create(fir_float_state_t *fir, const float *coeffs, int taps) { fir->taps = taps; fir->curr_pos = taps - 1; fir->coeffs = coeffs; fir->history = (float *) malloc(taps*sizeof(float)); if (fir->history) memset(fir->history, '\0', taps*sizeof(float)); return fir->history; } /*- End of function --------------------------------------------------------*/ static __inline__ void fir_float_free(fir_float_state_t *fir) { free(fir->history); } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t fir_float(fir_float_state_t *fir, int16_t sample) { int i; float y; int offset1; int offset2; fir->history[fir->curr_pos] = sample; offset2 = fir->curr_pos; offset1 = fir->taps - offset2; y = 0; for (i = fir->taps - 1; i >= offset1; i--) y += fir->coeffs[i]*fir->history[i - offset1]; for ( ; i >= 0; i--) y += fir->coeffs[i]*fir->history[i + offset2]; if (fir->curr_pos <= 0) fir->curr_pos = fir->taps; fir->curr_pos--; return (int16_t) y; } /*- End of function --------------------------------------------------------*/ #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/logging.h0000664000175000017500000001110511422612264014144 00000000000000/* * SpanDSP - a series of DSP components for telephony * * logging.h - definitions for error and debug logging. * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page logging_page Logging \section logging_page_sec_1 What does it do? ???. */ #if !defined(_SPANDSP_LOGGING_H_) #define _SPANDSP_LOGGING_H_ /*! General logging function for spandsp logging. */ typedef void (*message_handler_func_t)(int level, const char *text); /*! Error logging function for spandsp logging. */ typedef void (*error_handler_func_t)(const char *text); /* Logging elements */ enum { SPAN_LOG_SEVERITY_MASK = 0x00FF, SPAN_LOG_SHOW_DATE = 0x0100, SPAN_LOG_SHOW_SAMPLE_TIME = 0x0200, SPAN_LOG_SHOW_SEVERITY = 0x0400, SPAN_LOG_SHOW_PROTOCOL = 0x0800, SPAN_LOG_SHOW_VARIANT = 0x1000, SPAN_LOG_SHOW_TAG = 0x2000, SPAN_LOG_SUPPRESS_LABELLING = 0x8000 }; /* Logging severity levels */ enum { SPAN_LOG_NONE = 0, SPAN_LOG_ERROR = 1, SPAN_LOG_WARNING = 2, SPAN_LOG_PROTOCOL_ERROR = 3, SPAN_LOG_PROTOCOL_WARNING = 4, SPAN_LOG_FLOW = 5, SPAN_LOG_FLOW_2 = 6, SPAN_LOG_FLOW_3 = 7, SPAN_LOG_DEBUG = 8, SPAN_LOG_DEBUG_2 = 9, SPAN_LOG_DEBUG_3 = 10 }; /*! Logging descriptor. This defines the working state for a single instance of the logging facility for spandsp. */ typedef struct logging_state_s logging_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Test if logging of a specified severity level is enabled. \brief Test if logging of a specified severity level is enabled. \param s The logging context. \param level The severity level to be tested. \return TRUE if logging is enable, else FALSE. */ SPAN_DECLARE(int) span_log_test(logging_state_t *s, int level); /*! Generate a log entry. \brief Generate a log entry. \param s The logging context. \param level The severity level of the entry. \param format ??? \return 0 if no output generated, else 1. */ SPAN_DECLARE(int) span_log(logging_state_t *s, int level, const char *format, ...); /*! Generate a log entry displaying the contents of a buffer. \brief Generate a log entry displaying the contents of a buffer \param s The logging context. \param level The severity level of the entry. \param tag A label for the log entry. \param buf The buffer to be dumped to the log. \param len The length of buf. \return 0 if no output generated, else 1. */ SPAN_DECLARE(int) span_log_buf(logging_state_t *s, int level, const char *tag, const uint8_t *buf, int len); SPAN_DECLARE(int) span_log_set_level(logging_state_t *s, int level); SPAN_DECLARE(int) span_log_set_tag(logging_state_t *s, const char *tag); SPAN_DECLARE(int) span_log_set_protocol(logging_state_t *s, const char *protocol); SPAN_DECLARE(int) span_log_set_sample_rate(logging_state_t *s, int samples_per_second); SPAN_DECLARE(int) span_log_bump_samples(logging_state_t *s, int samples); SPAN_DECLARE(void) span_log_set_message_handler(logging_state_t *s, message_handler_func_t func); SPAN_DECLARE(void) span_log_set_error_handler(logging_state_t *s, error_handler_func_t func); SPAN_DECLARE(void) span_set_message_handler(message_handler_func_t func); SPAN_DECLARE(void) span_set_error_handler(error_handler_func_t func); SPAN_DECLARE(logging_state_t *) span_log_init(logging_state_t *s, int level, const char *tag); SPAN_DECLARE(int) span_log_release(logging_state_t *s); SPAN_DECLARE(int) span_log_free(logging_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/adsi.h0000664000175000017500000004765412343630175013464 00000000000000/* * SpanDSP - a series of DSP components for telephony * * adsi.h - Analogue display services interface and other call ID related handling. * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_ADSI_H_) #define _SPANDSP_ADSI_H_ /*! \page adsi_page ADSI transmission and reception \section adsi_page_sec_1 What does it do? Although ADSI has a specific meaning in some places, the term is used here to indicate any form of Analogue Display Service Interface, which includes caller ID, SMS, and others. The ADSI module provides for the transmission and reception of ADSI messages in various formats. Currently, the supported formats are: - Bellcore/Telcordia GR-30 CORE CLASS (Custom Local Area Signaling Services) standard (North America, Australia, China, Taiwan, and Hong Kong). - ETSI ETS 300 648, ETS 300 659-1 CLIP (Calling Line Identity Presentation) FSK standard (France, Germany, Norway, Italy, Spain, South Africa, Turkey, and the UK). - ETSI Caller-ID support for the UK, British Telecom SIN227 and SIN242. - ETSI ETS 300 648, ETS 300 659-1 CLIP (Calling Line Identity Presentation) DTMF standard variant 1 (Belgium, Brazil, Denmark, Finland, Iceland, India, Netherlands, Saudi Arabia, Sweden and Uruguay). - ETSI ETS 300 648, ETS 300 659-1 CLIP (Calling Line Identity Presentation) DTMF standard variant 2 (Denmark and Holland). - ETSI ETS 300 648, ETS 300 659-1 CLIP (Calling Line Identity Presentation) DTMF standard variant 3. - ETSI ETS 300 648, ETS 300 659-1 CLIP (Calling Line Identity Presentation) DTMF standard variant 4. (Taiwan and Kuwait). - ETSI Caller-ID support in UK (British Telecom), British Telecomm SIN227, SIN242. - Nippon Telegraph & Telephone Corporation JCLIP (Japanese Calling Line Identity Presentation) standard. - Telecommunications Authority of Singapore ACLIP (Analog Calling Line Identity Presentation) standard. - TDD (Telecommunications Device for the Deaf). \section adsi_page_sec_2 How does it work? \section adsi_page_sec_2a The Bellcore CLASS specification Most FSK based CLI formats are similar to the US CLASS one, which is as follows: The alert tone for CLI during a call is at least 100ms of silence, then 2130Hz + 2750Hz for 88ms to 110ms. When CLI is presented at ringing time, this tone is not sent. In the US, CLI is usually sent between the first two rings. This silence period is long in the US, so the message fits easily. In other places, where the standard ring tone has much smaller silences, a line voltage reversal is used to wake up a power saving receiver, then the message is sent, then the phone begins to ring. The message is sent using a Bell 202 FSK modem. The data rate is 1200 bits per second. The message protocol uses 8-bit data words (bytes), each bounded by a start bit and a stop bit. Channel Carrier Message Message Data Checksum Seizure Signal Type Length Word(s) Word Signal Word Word \section adsi_page_sec_2a1 CHANNEL SEIZURE SIGNAL The channel seizure is 30 continuous bytes of 55h (01010101), including the start and stop bits (i.e. 300 bits of alternations in total). This provides a detectable alternating function to the CPE (i.e. the modem data pump). \section adsi_page_sec_2a2 CARRIER SIGNAL The carrier signal consists of 180 bits of 1s. This may be reduced to 80 bits of 1s for caller ID on call waiting. \section adsi_page_sec_2a3 MESSAGE TYPE WORD Various message types are defined. The commonest ones for the US CLASS standard are: - Type 0x04 (SDMF) - single data message. Simple caller ID (CND) - Type 0x80 (MDMF) - multiple data message. A more flexible caller ID, with extra information. Other messages support message waiting, for voice mail, and other display features. \section adsi_page_sec_2a4 MESSAGE LENGTH WORD The message length word specifies the total number of data words to follow. \section adsi_page_sec_2a5 DATA WORDS The data words contain the actual message. \section adsi_page_sec_2a6 CHECKSUM WORD The Checksum Word contains the twos complement of the modulo 256 sum of the other words in the data message (i.e., message type, message length, and data words). The receiving equipment may calculate the modulo 256 sum of the received words and add this sum to the received checksum word. A result of zero generally indicates that the message was correctly received. Message retransmission is not supported. The sumcheck word should be followed by a minimum of two stop bits. \section adsi_page_sec_2b The ETSI CLIP specification The ETSI CLIP specification uses similar messages to the Bellcore specification. They are not, however, identical. First, ETSI use the V.23 modem standard, rather than Bell 202. Second, different fields, and different message types are available. The wake up indication generally differs from the Bellcore specification, to accomodate differences in European ring cadences. \section adsi_page_sec_2c The ETSI caller ID by DTMF specification CLI by DTMF is usually sent in a very simple way. The exchange does not give any prior warning (no reversal, or ring) to wake up the receiver. It just sends a string of DTMF digits. Around the world several variants of this basic scheme are used. One variant of the digit string is used in Belgium, Brazil, Denmark, Finland, Iceland, India, Netherlands, Saudi Arabia, Sweden and Uruguay: - ADBC Each of these fields may be omitted. The following special information codes are defined - "00" indicates the calling party number is not available. - "10" indicates that the presentation of the calling party number is restricted. A second variant of the digit string is one of the following: - A# - D1# Number not available because the caller has restricted it. - D2# Number not available because the call is international. - D3# Number not available due to technical reasons. A third variant of the digit string is used in Taiwan and Kuwait: - DC A forth variant of the digit string is used in Denmark and Holland: - # There is no distinctive start marker in this format. \section adsi_page_sec_2d The Japanese specification from NTT The Japanese caller ID specification is considerably different from any of the others. It uses V.23 modem signals, but the message structure is uniqeue. Also, the message is delivered while off hook. This results in a sequence - The phone line rings - CPE answers and waits for the caller ID message - CPE hangs up on receipt of the caller ID message - The phone line rings a second time - The CPE answers a second time, connecting the called party with the caller. Timeouts are, obviously, required to ensure this system behaves well when the caller ID message or the second ring are missing. */ enum { ADSI_STANDARD_NONE = 0, ADSI_STANDARD_CLASS = 1, ADSI_STANDARD_CLIP = 2, ADSI_STANDARD_ACLIP = 3, ADSI_STANDARD_JCLIP = 4, ADSI_STANDARD_CLIP_DTMF = 5, ADSI_STANDARD_TDD = 6 }; /* In some of the messages code characters are used, as follows: 'C' for public callbox 'L' for long distance 'O' for overseas 'P' for private 'S' for service conflict Taiwan and Kuwait change this pattern to: 'C' for coin/public callbox 'I' for international call 'O' for out of area call 'P' for private */ /*! Definitions for CLASS (Custom Local Area Signaling Services) */ enum { /*! Single data message caller ID */ CLASS_SDMF_CALLERID = 0x04, /*! Multiple data message caller ID */ CLASS_MDMF_CALLERID = 0x80, /*! Single data message message waiting */ CLASS_SDMF_MSG_WAITING = 0x06, /*! Multiple data message message waiting */ CLASS_MDMF_MSG_WAITING = 0x82 }; /*! CLASS MDMF message IDs */ enum { /*! Date and time (MMDDHHMM) */ MCLASS_DATETIME = 0x01, /*! Caller number */ MCLASS_CALLER_NUMBER = 0x02, /*! Dialed number */ MCLASS_DIALED_NUMBER = 0x03, /*! Caller number absent: 'O' or 'P' */ MCLASS_ABSENCE1 = 0x04, /*! Call forward: universal ('0'), on busy ('1'), or on unanswered ('2') */ MCLASS_REDIRECT = 0x05, /*! Long distance: 'L' */ MCLASS_QUALIFIER = 0x06, /*! Caller's name */ MCLASS_CALLER_NAME = 0x07, /*! Caller's name absent: 'O' or 'P' */ MCLASS_ABSENCE2 = 0x08, /*! Alternate route */ MCLASS_ALT_ROUTE = 0x09 }; /*! CLASS MDMF message waiting message IDs */ /*! Message waiting/not waiting */ #define MCLASS_VISUAL_INDICATOR 0x0B /*! Definitions for CLIP (Calling Line Identity Presentation) (from ETS 300 659-1) */ enum { /*! Multiple data message caller ID */ CLIP_MDMF_CALLERID = 0x80, /*! Multiple data message message waiting */ CLIP_MDMF_MSG_WAITING = 0x82, /*! Multiple data message charge information */ CLIP_MDMF_CHARGE_INFO = 0x86, /*! Multiple data message SMS */ CLIP_MDMF_SMS = 0x89 }; /*! CLIP message IDs (from ETS 300 659-1) */ enum { /*! Date and time (MMDDHHMM) */ CLIP_DATETIME = 0x01, /*! Caller number (AKA calling line identity) */ CLIP_CALLER_NUMBER = 0x02, /*! Dialed number (AKA called line identity) */ CLIP_DIALED_NUMBER = 0x03, /*! Caller number absent: 'O' or 'P' (AKA reason for absence of calling line identity) */ CLIP_ABSENCE1 = 0x04, /*! Caller's name (AKA calling party name) */ CLIP_CALLER_NAME = 0x07, /*! Caller's name absent: 'O' or 'P' (AKA reason for absence of calling party name) */ CLIP_ABSENCE2 = 0x08, /*! Visual indicator */ CLIP_VISUAL_INDICATOR = 0x0B, /*! Message ID */ CLIP_MESSAGE_ID = 0x0D, /*! Complementary calling line identity */ CLIP_COMPLEMENTARY_CALLER_NUMBER = 0x10, /*! Call type - voice call (1), ring-back-when-free call (2), calling name delivery (3) or msg waiting call(0x81) */ CLIP_CALLTYPE = 0x11, /*! Number of messages */ CLIP_NUM_MSG = 0x13, /*! Type of forwarded call */ CLIP_TYPE_OF_FORWARDED_CALL = 0x15, /*! Type of calling user */ CLIP_TYPE_OF_CALLING_USER = 0x16, /*! Redirecting number */ CLIP_REDIR_NUMBER = 0x1A, /*! Charge */ CLIP_CHARGE = 0x20, /*! Duration of the call */ CLIP_DURATION = 0x23, /*! Additional charge */ CLIP_ADD_CHARGE = 0x21, /*! Display information */ CLIP_DISPLAY_INFO = 0x50, /*! Service information */ CLIP_SERVICE_INFO = 0x55 }; /*! Definitions for A-CLIP (Analog Calling Line Identity Presentation) */ enum { /*! Single data message caller ID frame */ ACLIP_SDMF_CALLERID = 0x04, /*! Multiple data message caller ID frame */ ACLIP_MDMF_CALLERID = 0x80 }; /*! A-CLIP MDM message IDs */ enum { /*! Date and time (MMDDHHMM) */ ACLIP_DATETIME = 0x01, /*! Caller number */ ACLIP_CALLER_NUMBER = 0x02, /*! Dialed number */ ACLIP_DIALED_NUMBER = 0x03, /*! Caller number absent: 'O' or 'P' */ ACLIP_NUMBER_ABSENCE = 0x04, /*! Call forward: universal, on busy, or on unanswered */ ACLIP_REDIRECT = 0x05, /*! Long distance call: 'L' */ ACLIP_QUALIFIER = 0x06, /*! Caller's name */ ACLIP_CALLER_NAME = 0x07, /*! Caller's name absent: 'O' or 'P' */ ACLIP_NAME_ABSENCE = 0x08 }; /*! Definitions for J-CLIP (Japan Calling Line Identity Presentation) */ /*! Multiple data message caller ID frame */ #define JCLIP_MDMF_CALLERID 0x40 /*! J-CLIP MDM message IDs */ enum { /*! Caller number */ JCLIP_CALLER_NUMBER = 0x02, /*! Caller number data extension signal */ JCLIP_CALLER_NUM_DES = 0x21, /*! Dialed number */ JCLIP_DIALED_NUMBER = 0x09, /*! Dialed number data extension signal */ JCLIP_DIALED_NUM_DES = 0x22, /*! Caller number absent: 'C', 'O', 'P' or 'S' */ JCLIP_ABSENCE = 0x04 }; /* Definitions for CLIP-DTMF and its variants */ /*! Caller number is '#' terminated DTMF. */ #define CLIP_DTMF_HASH_TERMINATED '#' /*! Caller number is 'C' terminated DTMF. */ #define CLIP_DTMF_C_TERMINATED 'C' /*! Caller number */ #define CLIP_DTMF_HASH_CALLER_NUMBER 'A' /*! Caller number absent: private (1), overseas (2) or not available (3) */ #define CLIP_DTMF_HASH_ABSENCE 'D' /*! Caller ID field with no explicit field type */ #define CLIP_DTMF_HASH_UNSPECIFIED 0 /*! Caller number */ #define CLIP_DTMF_C_CALLER_NUMBER 'A' /*! Diverting number */ #define CLIP_DTMF_C_REDIRECT_NUMBER 'D' /*! Caller number absent: private/restricted (00) or not available (10) */ #define CLIP_DTMF_C_ABSENCE 'B' /*! ADSI transmitter descriptor. This contains all the state information for an ADSI (caller ID, CLASS, CLIP, ACLIP) transmit channel. */ typedef struct adsi_tx_state_s adsi_tx_state_t; /*! ADSI receiver descriptor. This contains all the state information for an ADSI (caller ID, CLASS, CLIP, ACLIP, JCLIP) receive channel. */ typedef struct adsi_rx_state_s adsi_rx_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Get the logging context associated with an ADSI receive context. \brief Get the logging context associated with an ADSI receive context. \param s The ADSI receive context. \return A pointer to the logging context */ SPAN_DECLARE(logging_state_t *) adsi_rx_get_logging_state(adsi_rx_state_t *s); /*! \brief Initialise an ADSI receive context. \param s The ADSI receive context. \param standard The code for the ADSI standard to be used. \param put_msg A callback routine called to deliver the received messages to the application. \param user_data An opaque pointer for the callback routine. \return A pointer to the initialised context, or NULL if there was a problem. */ SPAN_DECLARE(adsi_rx_state_t *) adsi_rx_init(adsi_rx_state_t *s, int standard, put_msg_func_t put_msg, void *user_data); /*! \brief Release an ADSI receive context. \param s The ADSI receive context. \return 0 for OK. */ SPAN_DECLARE(int) adsi_rx_release(adsi_rx_state_t *s); /*! \brief Free the resources of an ADSI receive context. \param s The ADSI receive context. \return 0 for OK. */ SPAN_DECLARE(int) adsi_rx_free(adsi_rx_state_t *s); /*! \brief Receive a chunk of ADSI audio. \param s The ADSI receive context. \param amp The audio sample buffer. \param len The number of samples in the buffer. \return The number of samples unprocessed. */ SPAN_DECLARE(int) adsi_rx(adsi_rx_state_t *s, const int16_t amp[], int len); /*! \brief Initialise an ADSI transmit context. \param s The ADSI transmit context. \param standard The code for the ADSI standard to be used. \return A pointer to the initialised context, or NULL if there was a problem. */ SPAN_DECLARE(adsi_tx_state_t *) adsi_tx_init(adsi_tx_state_t *s, int standard); /*! \brief Release an ADSI transmit context. \param s The ADSI transmit context. \return 0 for OK. */ SPAN_DECLARE(int) adsi_tx_release(adsi_tx_state_t *s); /*! \brief Free the resources of an ADSI transmit context. \param s The ADSI transmit context. \return 0 for OK. */ SPAN_DECLARE(int) adsi_tx_free(adsi_tx_state_t *s); /*! \brief Adjust the preamble associated with an ADSI transmit context. \param s The ADSI transmit context. \param preamble_len The number of bits of preamble. \param preamble_ones_len The number of bits of continuous one before a message. \param postamble_ones_len The number of bits of continuous one after a message. \param stop_bits The number of stop bits per character. */ SPAN_DECLARE(void) adsi_tx_set_preamble(adsi_tx_state_t *s, int preamble_len, int preamble_ones_len, int postamble_ones_len, int stop_bits); /*! \brief Generate a block of ADSI audio samples. \param s The ADSI transmit context. \param amp The audio sample buffer. \param max_len The number of samples to be generated. \return The number of samples actually generated. */ SPAN_DECLARE(int) adsi_tx(adsi_tx_state_t *s, int16_t amp[], int max_len); /*! \brief Request generation of an ADSI alert tone. \param s The ADSI transmit context. */ SPAN_DECLARE(void) adsi_tx_send_alert_tone(adsi_tx_state_t *s); /*! \brief Put a message into the input buffer of an ADSI transmit context. \param s The ADSI transmit context. \param msg The message. \param len The length of the message. \return The length actually added. If a message is already in progress in the transmitter, this function will return zero, as it will not successfully add the message to the buffer. If the message is invalid (e.g. it is too long), this function will return -1. */ SPAN_DECLARE(int) adsi_tx_put_message(adsi_tx_state_t *s, const uint8_t *msg, int len); /*! \brief Get a field from an ADSI message. \param s The ADSI receive context. \param msg The message buffer. \param msg_len The length of the message. \param pos Current position within the message. Set to -1 when starting a message. \param field_type The type code for the field. \param field_body Pointer to the body of the field. \param field_len The length of the field, or -1 for no more fields, or -2 for message structure corrupt. */ SPAN_DECLARE(int) adsi_next_field(adsi_rx_state_t *s, const uint8_t *msg, int msg_len, int pos, uint8_t *field_type, uint8_t const **field_body, int *field_len); /*! \brief Insert the header or a field into an ADSI message. \param s The ADSI transmit context. \param msg The message buffer. \param len The current length of the message. \param field_type The type code for the new field. \param field_body Pointer to the body of the new field. \param field_len The length of the new field. */ SPAN_DECLARE(int) adsi_add_field(adsi_tx_state_t *s, uint8_t *msg, int len, uint8_t field_type, uint8_t const *field_body, int field_len); /*! \brief Return a short name for an ADSI standard \param standard The code for the standard. \return A pointer to the name. */ SPAN_DECLARE(const char *) adsi_standard_to_str(int standard); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/t30_fcf.h0000664000175000017500000001423411422612264013750 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t30_fcf.h - ITU T.30 fax control field definitions * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_T30_FCF_H_) #define _SPANDSP_T30_FCF_H_ enum { /*! Initial identification messages */ /*! From the called to the calling terminal. */ T30_DIS = 0x80, /*! [0000 0001] Digital identification signal */ T30_CSI = 0x40, /*! [0000 0010] Called subscriber identification */ T30_NSF = 0x20, /*! [0000 0100] Non-standard facilities */ /*! Commands to send */ /*! From a calling terminal wishing to be a receiver, to a called terminal which is capable of transmitting. */ T30_DTC = 0x81, /*! [1000 0001] Digital transmit command */ T30_CIG = 0x41, /*! [1000 0010] Calling subscriber identification */ T30_NSC = 0x21, /*! [1000 0100] Non-standard facilities command */ T30_PWD = 0xC1, /*! [1000 0011] Password */ T30_SEP = 0xA1, /*! [1000 0101] Selective polling */ T30_PSA = 0x61, /*! [1000 0110] Polled subaddress */ T30_CIA = 0xE1, /*! [1000 0111] Calling subscriber internet address */ T30_ISP = 0x11, /*! [1000 1000] Internet selective polling address */ /*! Commands to receive */ /*! From a calling terminal wishing to be a transmitter, to a called terminal which is capable of receiving. */ T30_DCS = 0x82, /*! [X100 0001] Digital command signal */ T30_TSI = 0x42, /*! [X100 0010] Transmitting subscriber information */ T30_NSS = 0x22, /*! [X100 0100] Non-standard facilities set-up */ T30_SUB = 0xC2, /*! [X100 0011] Sub-address */ T30_SID = 0xA2, /*! [X100 0101] Sender identification */ /*! T30_TCF - Training check is a burst of 1.5s of zeros sent using the image modem */ T30_CTC = 0x12, /*! [X100 1000] Continue to correct */ T30_TSA = 0x62, /*! [X100 0110] Transmitting subscriber internet address */ T30_IRA = 0xE2, /*! [X100 0111] Internet routing address */ /*! Pre-message response signals */ /*! From the receiver to the transmitter. */ T30_CFR = 0x84, /*! [X010 0001] Confirmation to receive */ T30_FTT = 0x44, /*! [X010 0010] Failure to train */ T30_CTR = 0xC4, /*! [X010 0011] Response for continue to correct */ T30_CSA = 0x24, /*! [X010 0100] Called subscriber internet address */ /*! Post-message commands */ T30_EOM = 0x8E, /*! [X111 0001] End of message */ T30_MPS = 0x4E, /*! [X111 0010] Multipage signal */ T30_EOP = 0x2E, /*! [X111 0100] End of procedure */ T30_PRI_EOM = 0x9E, /*! [X111 1001] Procedure interrupt - end of procedure */ T30_PRI_MPS = 0x5E, /*! [X111 1010] Procedure interrupt - multipage signal */ T30_PRI_EOP = 0x3E, /*! [X111 1100] Procedure interrupt - end of procedure */ T30_EOS = 0x1E, /*! [X111 1000] End of selection */ T30_PPS = 0xBE, /*! [X111 1101] Partial page signal */ T30_EOR = 0xCE, /*! [X111 0011] End of retransmission */ T30_RR = 0x6E, /*! [X111 0110] Receiver ready */ /*! Post-message responses */ T30_MCF = 0x8C, /*! [X011 0001] Message confirmation */ T30_RTP = 0xCC, /*! [X011 0011] Retrain positive */ T30_RTN = 0x4C, /*! [X011 0010] Retrain negative */ T30_PIP = 0xAC, /*! [X011 0101] Procedure interrupt positive */ T30_PIN = 0x2C, /*! [X011 0100] Procedure interrupt negative */ T30_PPR = 0xBC, /*! [X011 1101] Partial page request */ T30_RNR = 0xEC, /*! [X011 0111] Receive not ready */ T30_ERR = 0x1C, /*! [X011 1000] Response for end of retransmission */ T30_FDM = 0xFC, /*! [X011 1111] File diagnostics message */ /*! Other line control signals */ T30_DCN = 0xFA, /*! [X101 1111] Disconnect */ T30_CRP = 0x1A, /*! [X101 1000] Command repeat */ T30_FNV = 0xCA, /*! [X101 0011] Field not valid */ T30_TNR = 0xEA, /*! [X101 0111] Transmitter not ready */ T30_TR = 0x6A, /*! [X101 0110] Transmitter ready */ T30_TK = 0x4B, /*! [1101 0010] Transmitter keys */ T30_RK = 0x4A, /*! [0101 0010] Receiver keys */ T30_PSS = 0x1F, /*! [1111 1000] Present signature signal (used only as FCF2) */ T30_DES = 0xA0, /*! [0000 0101] Digital extended signal */ T30_DEC = 0x93, /*! [1100 1001] Digital extended command */ T30_DER = 0x53, /*! [1100 1010] Digital extended request */ T30_DTR = 0x11, /*! [1000 1000] Digital turnaround request (conflicts with ISP) */ T30_DNK = 0x9A, /*! [X101 1001] Digital not acknowledge */ T30_PID = 0x6C, /*! [X011 0110] Procedure interrupt disconnect */ T30_SPI = 0x10, /*! [0000 1000] Security page indicator */ T30_SPT = 0x80, /*! [0000 0001] Security page type */ /*! Something only use as a secondary value in error correcting mode */ T30_NULL = 0x00, /*! [0000 0000] Nothing to say */ /*! Information frame types used for error correction mode, in T.4 */ T4_FCD = 0x06, /*! [0110 0000] Facsimile coded data */ T4_RCP = 0x86 /*! [0110 0001] Return to control for partial page */ }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/v27ter_rx.h0000664000175000017500000001560312350623206014366 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v27ter_rx.h - ITU V.27ter modem receive part * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_V27TER_RX_H_) #define _SPANDSP_V27TER_RX_H_ /*! \page v27ter_rx_page The V.27ter receiver \section v27ter_rx_page_sec_1 What does it do? The V.27ter receiver implements the receive side of a V.27ter modem. This can operate at data rates of 4800 and 2400 bits/s. The audio input is a stream of 16 bit samples, at 8000 samples/second. The transmit and receive side of V.27ter modems operate independantly. V.27ter is mostly used for FAX transmission, where it provides the standard 4800 bits/s rate (the 2400 bits/s mode is not used for FAX). \section v27ter_rx_page_sec_2 How does it work? V.27ter defines two modes of operation. One uses 8-PSK at 1600 baud, giving 4800bps. The other uses 4-PSK at 1200 baud, giving 2400bps. A training sequence is specified at the start of transmission, which makes the design of a V.27ter receiver relatively straightforward. */ /*! V.27ter modem receive side descriptor. This defines the working state for a single instance of a V.27ter modem receiver. */ typedef struct v27ter_rx_state_s v27ter_rx_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Initialise a V.27ter modem receive context. \brief Initialise a V.27ter modem receive context. \param s The modem context. \param bit_rate The bit rate of the modem. Valid values are 2400 and 4800. \param put_bit The callback routine used to put the received data. \param user_data An opaque pointer passed to the put_bit routine. \return A pointer to the modem context, or NULL if there was a problem. */ SPAN_DECLARE(v27ter_rx_state_t *) v27ter_rx_init(v27ter_rx_state_t *s, int bit_rate, put_bit_func_t put_bit, void *user_data); /*! Reinitialise an existing V.27ter modem receive context. \brief Reinitialise an existing V.27ter modem receive context. \param s The modem context. \param bit_rate The bit rate of the modem. Valid values are 2400 and 4800. \param old_train TRUE if a previous trained values are to be reused. \return 0 for OK, -1 for bad parameter */ SPAN_DECLARE(int) v27ter_rx_restart(v27ter_rx_state_t *s, int bit_rate, int old_train); /*! Release a V.27ter modem receive context. \brief Release a V.27ter modem receive context. \param s The modem context. \return 0 for OK */ SPAN_DECLARE(int) v27ter_rx_release(v27ter_rx_state_t *s); /*! Free a V.27ter modem receive context. \brief Free a V.27ter modem receive context. \param s The modem context. \return 0 for OK */ SPAN_DECLARE(int) v27ter_rx_free(v27ter_rx_state_t *s); /*! Get the logging context associated with a V.27ter modem receive context. \brief Get the logging context associated with a V.27ter modem receive context. \param s The modem context. \return A pointer to the logging context */ SPAN_DECLARE(logging_state_t *) v27ter_rx_get_logging_state(v27ter_rx_state_t *s); /*! Change the put_bit function associated with a V.27ter modem receive context. \brief Change the put_bit function associated with a V.27ter modem receive context. \param s The modem context. \param put_bit The callback routine used to handle received bits. \param user_data An opaque pointer. */ SPAN_DECLARE(void) v27ter_rx_set_put_bit(v27ter_rx_state_t *s, put_bit_func_t put_bit, void *user_data); /*! Change the modem status report function associated with a V.27ter modem receive context. \brief Change the modem status report function associated with a V.27ter modem receive context. \param s The modem context. \param handler The callback routine used to report modem status changes. \param user_data An opaque pointer. */ SPAN_DECLARE(void) v27ter_rx_set_modem_status_handler(v27ter_rx_state_t *s, modem_status_func_t handler, void *user_data); /*! Process a block of received V.27ter modem audio samples. \brief Process a block of received V.27ter modem audio samples. \param s The modem context. \param amp The audio sample buffer. \param len The number of samples in the buffer. \return The number of samples unprocessed. */ SPAN_DECLARE_NONSTD(int) v27ter_rx(v27ter_rx_state_t *s, const int16_t amp[], int len); /*! Fake processing of a missing block of received V.27ter modem audio samples. (e.g due to packet loss). \brief Fake processing of a missing block of received V.27ter modem audio samples. \param s The modem context. \param len The number of samples to fake. \return The number of samples unprocessed. */ SPAN_DECLARE_NONSTD(int) v27ter_rx_fillin(v27ter_rx_state_t *s, int len); /*! Get a snapshot of the current equalizer coefficients. \brief Get a snapshot of the current equalizer coefficients. \param coeffs The vector of complex coefficients. \return The number of coefficients in the vector. */ SPAN_DECLARE(int) v27ter_rx_equalizer_state(v27ter_rx_state_t *s, complexf_t **coeffs); /*! Get the current received carrier frequency. \param s The modem context. \return The frequency, in Hertz. */ SPAN_DECLARE(float) v27ter_rx_carrier_frequency(v27ter_rx_state_t *s); /*! Get the current symbol timing correction since startup. \param s The modem context. \return The correction. */ SPAN_DECLARE(float) v27ter_rx_symbol_timing_correction(v27ter_rx_state_t *s); /*! Get a current received signal power. \param s The modem context. \return The signal power, in dBm0. */ SPAN_DECLARE(float) v27ter_rx_signal_power(v27ter_rx_state_t *s); /*! Set the power level at which the carrier detection will cut in \param s The modem context. \param cutoff The signal cutoff power, in dBm0. */ SPAN_DECLARE(void) v27ter_rx_signal_cutoff(v27ter_rx_state_t *s, float cutoff); /*! Set a handler routine to process QAM status reports \param s The modem context. \param handler The handler routine. \param user_data An opaque pointer passed to the handler routine. */ SPAN_DECLARE(void) v27ter_rx_set_qam_report_handler(v27ter_rx_state_t *s, qam_report_handler_t handler, void *user_data); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/complex.h0000664000175000017500000003054712100764055014200 00000000000000/* * SpanDSP - a series of DSP components for telephony * * complex.h * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page complex_page Complex number support \section complex_page_sec_1 What does it do? Complex number support is part of the C99 standard. However, support for this in C compilers is still patchy. A set of complex number feaures is provided as a "temporary" measure, until native C language complex number support is widespread. */ #if !defined(_SPANDSP_COMPLEX_H_) #define _SPANDSP_COMPLEX_H_ /*! Floating complex type. */ typedef struct { /*! \brief Real part. */ float re; /*! \brief Imaginary part. */ float im; } complexf_t; /*! Floating complex type. */ typedef struct { /*! \brief Real part. */ double re; /*! \brief Imaginary part. */ double im; } complex_t; #if defined(HAVE_LONG_DOUBLE) /*! Long double complex type. */ typedef struct { /*! \brief Real part. */ long double re; /*! \brief Imaginary part. */ long double im; } complexl_t; #endif /*! Complex integer type. */ typedef struct { /*! \brief Real part. */ int re; /*! \brief Imaginary part. */ int im; } complexi_t; /*! Complex 16 bit integer type. */ typedef struct { /*! \brief Real part. */ int16_t re; /*! \brief Imaginary part. */ int16_t im; } complexi16_t; /*! Complex 32 bit integer type. */ typedef struct { /*! \brief Real part. */ int32_t re; /*! \brief Imaginary part. */ int32_t im; } complexi32_t; #if defined(__cplusplus) extern "C" { #endif static __inline__ complexf_t complex_setf(float re, float im) { complexf_t z; z.re = re; z.im = im; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complex_t complex_set(double re, double im) { complex_t z; z.re = re; z.im = im; return z; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) static __inline__ complexl_t complex_setl(long double re, long double im) { complexl_t z; z.re = re; z.im = im; return z; } /*- End of function --------------------------------------------------------*/ #endif static __inline__ complexi_t complex_seti(int re, int im) { complexi_t z; z.re = re; z.im = im; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complexi16_t complex_seti16(int16_t re, int16_t im) { complexi16_t z; z.re = re; z.im = im; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complexi32_t complex_seti32(int32_t re, int32_t im) { complexi32_t z; z.re = re; z.im = im; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complexf_t complex_addf(const complexf_t *x, const complexf_t *y) { complexf_t z; z.re = x->re + y->re; z.im = x->im + y->im; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complex_t complex_add(const complex_t *x, const complex_t *y) { complex_t z; z.re = x->re + y->re; z.im = x->im + y->im; return z; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) static __inline__ complexl_t complex_addl(const complexl_t *x, const complexl_t *y) { complexl_t z; z.re = x->re + y->re; z.im = x->im + y->im; return z; } /*- End of function --------------------------------------------------------*/ #endif static __inline__ complexi_t complex_addi(const complexi_t *x, const complexi_t *y) { complexi_t z; z.re = x->re + y->re; z.im = x->im + y->im; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complexi16_t complex_addi16(const complexi16_t *x, const complexi16_t *y) { complexi16_t z; z.re = x->re + y->re; z.im = x->im + y->im; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complexi32_t complex_addi32(const complexi32_t *x, const complexi32_t *y) { complexi32_t z; z.re = x->re + y->re; z.im = x->im + y->im; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complexf_t complex_subf(const complexf_t *x, const complexf_t *y) { complexf_t z; z.re = x->re - y->re; z.im = x->im - y->im; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complex_t complex_sub(const complex_t *x, const complex_t *y) { complex_t z; z.re = x->re - y->re; z.im = x->im - y->im; return z; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) static __inline__ complexl_t complex_subl(const complexl_t *x, const complexl_t *y) { complexl_t z; z.re = x->re - y->re; z.im = x->im - y->im; return z; } /*- End of function --------------------------------------------------------*/ #endif static __inline__ complexi_t complex_subi(const complexi_t *x, const complexi_t *y) { complexi_t z; z.re = x->re - y->re; z.im = x->im - y->im; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complexi16_t complex_subi16(const complexi16_t *x, const complexi16_t *y) { complexi16_t z; z.re = x->re - y->re; z.im = x->im - y->im; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complexi32_t complex_subi32(const complexi32_t *x, const complexi32_t *y) { complexi32_t z; z.re = x->re - y->re; z.im = x->im - y->im; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complexf_t complex_mulf(const complexf_t *x, const complexf_t *y) { complexf_t z; z.re = x->re*y->re - x->im*y->im; z.im = x->re*y->im + x->im*y->re; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complex_t complex_mul(const complex_t *x, const complex_t *y) { complex_t z; z.re = x->re*y->re - x->im*y->im; z.im = x->re*y->im + x->im*y->re; return z; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) static __inline__ complexl_t complex_mull(const complexl_t *x, const complexl_t *y) { complexl_t z; z.re = x->re*y->re - x->im*y->im; z.im = x->re*y->im + x->im*y->re; return z; } /*- End of function --------------------------------------------------------*/ #endif static __inline__ complexi_t complex_muli(const complexi_t *x, const complexi_t *y) { complexi_t z; z.re = x->re*y->re - x->im*y->im; z.im = x->re*y->im + x->im*y->re; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complexi16_t complex_muli16(const complexi16_t *x, const complexi16_t *y) { complexi16_t z; z.re = (int16_t) ((int32_t) x->re*(int32_t) y->re - (int32_t) x->im*(int32_t) y->im); z.im = (int16_t) ((int32_t) x->re*(int32_t) y->im + (int32_t) x->im*(int32_t) y->re); return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complexi16_t complex_mul_q1_15(const complexi16_t *x, const complexi16_t *y) { complexi16_t z; z.re = (int16_t) (((int32_t) x->re*(int32_t) y->re - (int32_t) x->im*(int32_t) y->im) >> 15); z.im = (int16_t) (((int32_t) x->re*(int32_t) y->im + (int32_t) x->im*(int32_t) y->re) >> 15); return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complexi32_t complex_muli32i16(const complexi32_t *x, const complexi16_t *y) { complexi32_t z; z.re = x->re*(int32_t) y->re - x->im*(int32_t) y->im; z.im = x->re*(int32_t) y->im + x->im*(int32_t) y->re; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complexi32_t complex_muli32(const complexi32_t *x, const complexi32_t *y) { complexi32_t z; z.re = x->re*y->re - x->im*y->im; z.im = x->re*y->im + x->im*y->re; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complexf_t complex_divf(const complexf_t *x, const complexf_t *y) { complexf_t z; float f; f = y->re*y->re + y->im*y->im; z.re = ( x->re*y->re + x->im*y->im)/f; z.im = (-x->re*y->im + x->im*y->re)/f; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complex_t complex_div(const complex_t *x, const complex_t *y) { complex_t z; double f; f = y->re*y->re + y->im*y->im; z.re = ( x->re*y->re + x->im*y->im)/f; z.im = (-x->re*y->im + x->im*y->re)/f; return z; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) static __inline__ complexl_t complex_divl(const complexl_t *x, const complexl_t *y) { complexl_t z; long double f; f = y->re*y->re + y->im*y->im; z.re = ( x->re*y->re + x->im*y->im)/f; z.im = (-x->re*y->im + x->im*y->re)/f; return z; } /*- End of function --------------------------------------------------------*/ #endif static __inline__ complexf_t complex_conjf(const complexf_t *x) { complexf_t z; z.re = x->re; z.im = -x->im; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complex_t complex_conj(const complex_t *x) { complex_t z; z.re = x->re; z.im = -x->im; return z; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) static __inline__ complexl_t complex_conjl(const complexl_t *x) { complexl_t z; z.re = x->re; z.im = -x->im; return z; } /*- End of function --------------------------------------------------------*/ #endif static __inline__ complexi_t complex_conji(const complexi_t *x) { complexi_t z; z.re = x->re; z.im = -x->im; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complexi16_t complex_conji16(const complexi16_t *x) { complexi16_t z; z.re = x->re; z.im = -x->im; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ complexi32_t complex_conji32(const complexi32_t *x) { complexi32_t z; z.re = x->re; z.im = -x->im; return z; } /*- End of function --------------------------------------------------------*/ static __inline__ int32_t poweri16(const complexi16_t *x) { return (int32_t) x->re*x->re + (int32_t) x->im*x->im; } /*- End of function --------------------------------------------------------*/ static __inline__ float powerf(const complexf_t *x) { return x->re*x->re + x->im*x->im; } /*- End of function --------------------------------------------------------*/ static __inline__ double power(const complex_t *x) { return x->re*x->re + x->im*x->im; } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_LONG_DOUBLE) static __inline__ long double powerl(const complexl_t *x) { return x->re*x->re + x->im*x->im; } /*- End of function --------------------------------------------------------*/ #endif #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/0000775000175000017500000000000012357123347014110 500000000000000spandsp-0.0.6/src/spandsp/private/g726.h0000664000175000017500000000556411422612265014672 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/g726.h - ITU G.726 codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_G726_H_) #define _SPANDSP_PRIVATE_G726_H_ /*! * The following is the definition of the state structure * used by the G.726 encoder and decoder to preserve their internal * state between successive calls. The meanings of the majority * of the state structure fields are explained in detail in the * ITU Recommendation G.726. The field names are essentially indentical * to variable names in the bit level description of the coding algorithm * included in this recommendation. */ struct g726_state_s { /*! The bit rate */ int rate; /*! The external coding, for tandem operation */ int ext_coding; /*! The number of bits per sample */ int bits_per_sample; /*! One of the G.726_PACKING_xxx options */ int packing; /*! Locked or steady state step size multiplier. */ int32_t yl; /*! Unlocked or non-steady state step size multiplier. */ int16_t yu; /*! int16_t term energy estimate. */ int16_t dms; /*! Long term energy estimate. */ int16_t dml; /*! Linear weighting coefficient of 'yl' and 'yu'. */ int16_t ap; /*! Coefficients of pole portion of prediction filter. */ int16_t a[2]; /*! Coefficients of zero portion of prediction filter. */ int16_t b[6]; /*! Signs of previous two samples of a partially reconstructed signal. */ int16_t pk[2]; /*! Previous 6 samples of the quantized difference signal represented in an internal floating point format. */ int16_t dq[6]; /*! Previous 2 samples of the quantized difference signal represented in an internal floating point format. */ int16_t sr[2]; /*! Delayed tone detect */ int td; /*! \brief The bit stream processing context. */ bitstream_state_t bs; /*! \brief The current encoder function. */ g726_encoder_func_t enc_func; /*! \brief The current decoder function. */ g726_decoder_func_t dec_func; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/v17rx.h0000664000175000017500000002304512354277422015175 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/v17rx.h - ITU V.17 modem receive part * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_V17RX_H_) #define _SPANDSP_PRIVATE_V17RX_H_ /* Target length for the equalizer is about 63 taps, to deal with the worst stuff in V.56bis. */ /*! The length of the equalizer buffer */ //#define V17_EQUALIZER_LEN 33 #define V17_EQUALIZER_LEN 17 /*! Samples before the target position in the equalizer buffer */ //#define V17_EQUALIZER_PRE_LEN 16 #define V17_EQUALIZER_PRE_LEN 8 /*! The number of taps in the pulse shaping/bandpass filter */ #define V17_RX_FILTER_STEPS 27 /* We can store more trellis depth that we look back over, so that we can push out a group of symbols in one go, giving greater processing efficiency, at the expense of a bit more latency through the modem. */ /* Right now we don't take advantage of this optimisation. */ /*! The depth of the trellis buffer */ #define V17_TRELLIS_STORAGE_DEPTH 16 /*! How far we look back into history for trellis decisions */ #define V17_TRELLIS_LOOKBACK_DEPTH 16 /*! V.17 modem receive side descriptor. This defines the working state for a single instance of a V.17 modem receiver. */ struct v17_rx_state_s { /*! \brief The bit rate of the modem. Valid values are 7200 9600, 12000 and 14400. */ int bit_rate; /*! \brief The callback function used to put each bit received. */ put_bit_func_t put_bit; /*! \brief A user specified opaque pointer passed to the put_but routine. */ void *put_bit_user_data; /*! \brief The callback function used to report modem status changes. */ modem_status_func_t status_handler; /*! \brief A user specified opaque pointer passed to the status function. */ void *status_user_data; /*! \brief A callback function which may be enabled to report every symbol's constellation position. */ qam_report_handler_t qam_report; /*! \brief A user specified opaque pointer passed to the qam_report callback routine. */ void *qam_user_data; #if 1 //defined(RESCALER_TEST) /* Experimental data for AGC tolerance */ int16_t power_window[40]; int power_window_ptr; int64_t window_power; int64_t window_power_save; #endif #if defined(SPANDSP_USE_FIXED_POINTx) /*! \brief The scaling factor accessed by the AGC algorithm. */ float agc_scaling; /*! \brief The previous value of agc_scaling, needed to reuse old training. */ float agc_scaling_save; /*! \brief The current delta factor for updating the equalizer coefficients. */ float eq_delta; /*! \brief The adaptive equalizer coefficients. */ complexi16_t eq_coeff[V17_EQUALIZER_LEN]; /*! \brief A saved set of adaptive equalizer coefficients for use after restarts. */ complexi16_t eq_coeff_save[V17_EQUALIZER_LEN]; /*! \brief The equalizer signal buffer. */ complexi16_t eq_buf[V17_EQUALIZER_LEN]; /*! Low band edge filter for symbol sync. */ int32_t symbol_sync_low[2]; /*! High band edge filter for symbol sync. */ int32_t symbol_sync_high[2]; /*! DC filter for symbol sync. */ int32_t symbol_sync_dc_filter[2]; /*! Baud phase for symbol sync. */ int32_t baud_phase; /*! \brief A measure of how much mismatch there is between the real constellation, and the decoded symbol positions. */ float training_error; /*! \brief The proportional part of the carrier tracking filter. */ float carrier_track_p; /*! \brief The integral part of the carrier tracking filter. */ float carrier_track_i; /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */ int16_t rrc_filter[V17_RX_FILTER_STEPS]; /*! \brief A pointer to the current constellation. */ const complexi16_t *constellation; #else /*! \brief The scaling factor accessed by the AGC algorithm. */ float agc_scaling; /*! \brief The previous value of agc_scaling, needed to reuse old training. */ float agc_scaling_save; /*! \brief The current delta factor for updating the equalizer coefficients. */ float eq_delta; /*! \brief The adaptive equalizer coefficients. */ complexf_t eq_coeff[V17_EQUALIZER_LEN]; /*! \brief A saved set of adaptive equalizer coefficients for use after restarts. */ complexf_t eq_coeff_save[V17_EQUALIZER_LEN]; /*! \brief The equalizer signal buffer. */ complexf_t eq_buf[V17_EQUALIZER_LEN]; /*! Low band edge filter for symbol sync. */ float symbol_sync_low[2]; /*! High band edge filter for symbol sync. */ float symbol_sync_high[2]; /*! DC filter for symbol sync. */ float symbol_sync_dc_filter[2]; /*! Baud phase for symbol sync. */ float baud_phase; /*! \brief A measure of how much mismatch there is between the real constellation, and the decoded symbol positions. */ float training_error; /*! \brief The proportional part of the carrier tracking filter. */ float carrier_track_p; /*! \brief The integral part of the carrier tracking filter. */ float carrier_track_i; /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */ float rrc_filter[V17_RX_FILTER_STEPS]; /*! \brief A pointer to the current constellation. */ const complexf_t *constellation; #endif /*! \brief Current offset into the RRC pulse shaping filter buffer. */ int rrc_filter_step; /*! \brief The current state of the differential decoder */ int diff; /*! \brief The register for the data scrambler. */ uint32_t scramble_reg; /*! \brief Scrambler tap */ //int scrambler_tap; /*! \brief TRUE if the short training sequence is to be used. */ int short_train; /*! \brief The section of the training data we are currently in. */ int training_stage; /*! \brief A count of how far through the current training step we are. */ int training_count; /*! \brief The value of the last signal sample, using the a simple HPF for signal power estimation. */ int16_t last_sample; /*! \brief >0 if a signal above the minimum is present. It may or may not be a V.17 signal. */ int signal_present; /*! \brief Whether or not a carrier drop was detected and the signal delivery is pending. */ int carrier_drop_pending; /*! \brief A count of the current consecutive samples below the carrier off threshold. */ int low_samples; /*! \brief A highest magnitude sample seen. */ int16_t high_sample; /*! \brief The current phase of the carrier (i.e. the DDS parameter). */ uint32_t carrier_phase; /*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */ int32_t carrier_phase_rate; /*! \brief The carrier update rate saved for reuse when using short training. */ int32_t carrier_phase_rate_save; /*! \brief A power meter, to measure the HPF'ed signal power in the channel. */ power_meter_t power; /*! \brief The power meter level at which carrier on is declared. */ int32_t carrier_on_power; /*! \brief The power meter level at which carrier off is declared. */ int32_t carrier_off_power; /*! \brief Current read offset into the equalizer buffer. */ int eq_step; /*! \brief Current write offset into the equalizer buffer. */ int eq_put_step; /*! \brief Symbol count to the next equalizer update. */ int eq_skip; /*! \brief The current half of the baud. */ int baud_half; /*! \brief The total symbol timing correction since the carrier came up. This is only for performance analysis purposes. */ int total_baud_timing_correction; /*! \brief Starting phase angles for the coarse carrier aquisition step. */ int32_t start_angles[2]; /*! \brief History list of phase angles for the coarse carrier aquisition step. */ int32_t angles[16]; /*! \brief A pointer to the current space map. There is a space map for each trellis state. */ int space_map; /*! \brief The number of bits in each symbol at the current bit rate. */ int bits_per_symbol; /*! \brief Current pointer to the trellis buffers */ int trellis_ptr; /*! \brief The trellis. */ int full_path_to_past_state_locations[V17_TRELLIS_STORAGE_DEPTH][8]; /*! \brief The trellis. */ int past_state_locations[V17_TRELLIS_STORAGE_DEPTH][8]; #if defined(SPANDSP_USE_FIXED_POINTx) /*! \brief Euclidean distances (actually the squares of the distances) from the last states of the trellis. */ uint32_t distances[8]; #else /*! \brief Euclidean distances (actually the squares of the distances) from the last states of the trellis. */ float distances[8]; #endif /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/lpc10.h0000664000175000017500000001306511422612265015117 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/lpc10.h - LPC10 low bit rate speech codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_LPC10_H_) #define _SPANDSP_PRIVATE_LPC10_H_ /*! LPC10 codec encoder state descriptor. This defines the state of a single working instance of the LPC10 encoder. */ struct lpc10_encode_state_s { /*! \brief ??? */ int error_correction; /* State used only by function high_pass_100hz */ /*! \brief ??? */ float z11; /*! \brief ??? */ float z21; /*! \brief ??? */ float z12; /*! \brief ??? */ float z22; /* State used by function lpc10_analyse */ /*! \brief ??? */ float inbuf[LPC10_SAMPLES_PER_FRAME*3]; /*! \brief ??? */ float pebuf[LPC10_SAMPLES_PER_FRAME*3]; /*! \brief ??? */ float lpbuf[696]; /*! \brief ??? */ float ivbuf[312]; /*! \brief ??? */ float bias; /*! \brief No initial value necessary */ int32_t osbuf[10]; /*! \brief Initial value 1 */ int32_t osptr; /*! \brief ??? */ int32_t obound[3]; /*! \brief Initial value vwin[2][0] = 307; vwin[2][1] = 462; */ int32_t vwin[3][2]; /*! \brief Initial value awin[2][0] = 307; awin[2][1] = 462; */ int32_t awin[3][2]; /*! \brief ??? */ int32_t voibuf[4][2]; /*! \brief ??? */ float rmsbuf[3]; /*! \brief ??? */ float rcbuf[3][10]; /*! \brief ??? */ float zpre; /* State used by function onset */ /*! \brief ??? */ float n; /*! \brief Initial value 1.0f */ float d__; /*! \brief No initial value necessary */ float fpc; /*! \brief ??? */ float l2buf[16]; /*! \brief ??? */ float l2sum1; /*! \brief Initial value 1 */ int32_t l2ptr1; /*! \brief Initial value 9 */ int32_t l2ptr2; /*! \brief No initial value necessary */ int32_t lasti; /*! \brief Initial value FALSE */ int hyst; /* State used by function lpc10_voicing */ /*! \brief Initial value 20.0f */ float dither; /*! \brief ??? */ float snr; /*! \brief ??? */ float maxmin; /*! \brief Initial value is probably unnecessary */ float voice[3][2]; /*! \brief ??? */ int32_t lbve; /*! \brief ??? */ int32_t lbue; /*! \brief ??? */ int32_t fbve; /*! \brief ??? */ int32_t fbue; /*! \brief ??? */ int32_t ofbue; /*! \brief ??? */ int32_t sfbue; /*! \brief ??? */ int32_t olbue; /*! \brief ??? */ int32_t slbue; /* State used by function dynamic_pitch_tracking */ /*! \brief ??? */ float s[60]; /*! \brief ??? */ int32_t p[2][60]; /*! \brief ??? */ int32_t ipoint; /*! \brief ??? */ float alphax; /* State used by function lpc10_pack */ /*! \brief ??? */ int32_t isync; }; /*! LPC10 codec decoder state descriptor. This defines the state of a single working instance of the LPC10 decoder. */ struct lpc10_decode_state_s { /*! \brief ??? */ int error_correction; /* State used by function decode */ /*! \brief Initial value 60 */ int32_t iptold; /*! \brief Initial value TRUE */ int first; /*! \brief ??? */ int32_t ivp2h; /*! \brief ??? */ int32_t iovoic; /*! \brief Initial value 60. */ int32_t iavgp; /*! \brief ??? */ int32_t erate; /*! \brief ??? */ int32_t drc[10][3]; /*! \brief ??? */ int32_t dpit[3]; /*! \brief ??? */ int32_t drms[3]; /* State used by function synths */ /*! \brief ??? */ float buf[LPC10_SAMPLES_PER_FRAME*2]; /*! \brief Initial value LPC10_SAMPLES_PER_FRAME */ int32_t buflen; /* State used by function pitsyn */ /*! \brief No initial value necessary as long as first_pitsyn is initially TRUE */ int32_t ivoico; /*! \brief No initial value necessary as long as first_pitsyn is initially TRUE */ int32_t ipito; /*! \brief Initial value 1.0f */ float rmso; /*! \brief No initial value necessary as long as first_pitsyn is initially TRUE */ float rco[10]; /*! \brief No initial value necessary as long as first_pitsyn is initially TRUE */ int32_t jsamp; /*! \brief Initial value TRUE */ int first_pitsyn; /* State used by function bsynz */ /*! \brief ??? */ int32_t ipo; /*! \brief ??? */ float exc[166]; /*! \brief ??? */ float exc2[166]; /*! \brief ??? */ float lpi[3]; /*! \brief ??? */ float hpi[3]; /*! \brief ??? */ float rmso_bsynz; /* State used by function random */ /*! \brief ??? */ int32_t j; /*! \brief ??? */ int32_t k; /*! \brief ??? */ int16_t y[5]; /* State used by function deemp */ /*! \brief ??? */ float dei[2]; /*! \brief ??? */ float deo[3]; }; #endif /*- End of include ---------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/v29tx.h0000664000175000017500000001003612101406131015153 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/v29tx.h - ITU V.29 modem transmit part * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_V29TX_H_) #define _SPANDSP_PRIVATE_V29TX_H_ /*! The number of taps in the pulse shaping/bandpass filter */ #define V29_TX_FILTER_STEPS 9 /*! V.29 modem transmit side descriptor. This defines the working state for a single instance of a V.29 modem transmitter. */ struct v29_tx_state_s { /*! \brief The bit rate of the modem. Valid values are 4800, 7200 and 9600. */ int bit_rate; /*! \brief The callback function used to get the next bit to be transmitted. */ get_bit_func_t get_bit; /*! \brief A user specified opaque pointer passed to the get_bit function. */ void *get_bit_user_data; /*! \brief The callback function used to report modem status changes. */ modem_status_func_t status_handler; /*! \brief A user specified opaque pointer passed to the status function. */ void *status_user_data; #if defined(SPANDSP_USE_FIXED_POINT) /*! \brief Gain required to achieve the specified output power, not allowing for the size of the current constellation. */ float base_gain; /*! \brief Gain required to achieve the specified output power, allowing for the size of the current constellation. */ int32_t gain; /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */ complexi16_t rrc_filter[2*V29_TX_FILTER_STEPS]; #else /*! \brief Gain required to achieve the specified output power, not allowing for the size of the current constellation. */ float base_gain; /*! \brief Gain required to achieve the specified output power, allowing for the size of the current constellation. */ float gain; /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */ complexf_t rrc_filter[2*V29_TX_FILTER_STEPS]; #endif /*! \brief Current offset into the RRC pulse shaping filter buffer. */ int rrc_filter_step; /*! \brief The register for the data scrambler. */ uint32_t scramble_reg; /*! \brief The register for the training scrambler. */ uint8_t training_scramble_reg; /*! \brief TRUE if transmitting the training sequence, or shutting down transmission. FALSE if transmitting user data. */ int in_training; /*! \brief A counter used to track progress through sending the training sequence. */ int training_step; /*! \brief An offset value into the table of training parameters, used to match the training pattern to the bit rate. */ int training_offset; /*! \brief The current phase of the carrier (i.e. the DDS parameter). */ uint32_t carrier_phase; /*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */ int32_t carrier_phase_rate; /*! \brief The current fractional phase of the baud timing. */ int baud_phase; /*! \brief The code number for the current position in the constellation. */ int constellation_state; /*! \brief The get_bit function in use at any instant. */ get_bit_func_t current_get_bit; /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/g711.h0000664000175000017500000000222511422612265014653 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/g711.h - In line A-law and u-law conversion routines * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_G711_H_) #define _SPANDSP_PRIVATE_G711_H_ /*! G.711 state */ struct g711_state_s { /*! One of the G.711_xxx options */ int mode; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/time_scale.h0000664000175000017500000000303411422612265016300 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/time_scale.h - Time scaling for linear speech data * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_TIME_SCALE_H_) #define _SPANDSP_PRIVATE_TIME_SCALE_H_ #define TIME_SCALE_MAX_SAMPLE_RATE 48000 #define TIME_SCALE_MIN_PITCH 60 #define TIME_SCALE_MAX_PITCH 250 #define TIME_SCALE_BUF_LEN (2*TIME_SCALE_MAX_SAMPLE_RATE/TIME_SCALE_MIN_PITCH) /*! Audio time scaling descriptor. */ struct time_scale_state_s { int sample_rate; int min_pitch; int max_pitch; int buf_len; float playout_rate; double rcomp; double rate_nudge; int fill; int lcp; int16_t buf[TIME_SCALE_BUF_LEN]; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/v22bis.h0000664000175000017500000002500312101410654015273 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/v22bis.h - ITU V.22bis modem * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_V22BIS_H_) #define _SPANDSP_PRIVATE_V22BIS_H_ /*! The number of steps to the left and to the right of the target position in the equalizer buffer. */ #define V22BIS_EQUALIZER_LEN 7 /*! One less than a power of 2 >= (2*V22BIS_EQUALIZER_LEN + 1) */ #define V22BIS_EQUALIZER_MASK 15 /*! The number of taps in the transmit pulse shaping filter */ #define V22BIS_TX_FILTER_STEPS 9 /*! The number of taps in the receive pulse shaping/bandpass filter */ #define V22BIS_RX_FILTER_STEPS 27 /*! Segments of the training sequence on the receive side */ enum { V22BIS_RX_TRAINING_STAGE_NORMAL_OPERATION, V22BIS_RX_TRAINING_STAGE_SYMBOL_ACQUISITION, V22BIS_RX_TRAINING_STAGE_LOG_PHASE, V22BIS_RX_TRAINING_STAGE_UNSCRAMBLED_ONES, V22BIS_RX_TRAINING_STAGE_UNSCRAMBLED_ONES_SUSTAINING, V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200, V22BIS_RX_TRAINING_STAGE_SCRAMBLED_ONES_AT_1200_SUSTAINING, V22BIS_RX_TRAINING_STAGE_WAIT_FOR_SCRAMBLED_ONES_AT_2400, V22BIS_RX_TRAINING_STAGE_PARKED }; /*! Segments of the training sequence on the transmit side */ enum { V22BIS_TX_TRAINING_STAGE_NORMAL_OPERATION = 0, V22BIS_TX_TRAINING_STAGE_INITIAL_TIMED_SILENCE, V22BIS_TX_TRAINING_STAGE_INITIAL_SILENCE, V22BIS_TX_TRAINING_STAGE_U11, V22BIS_TX_TRAINING_STAGE_U0011, V22BIS_TX_TRAINING_STAGE_S11, V22BIS_TX_TRAINING_STAGE_TIMED_S11, V22BIS_TX_TRAINING_STAGE_S1111, V22BIS_TX_TRAINING_STAGE_PARKED }; /*! V.22bis modem descriptor. This defines the working state for a single instance of a V.22bis modem. */ struct v22bis_state_s { /*! \brief The maximum permitted bit rate of the modem. Valid values are 1200 and 2400. */ int bit_rate; /*! \brief TRUE is this is the calling side modem. */ int calling_party; /*! \brief The callback function used to get the next bit to be transmitted. */ get_bit_func_t get_bit; /*! \brief A user specified opaque pointer passed to the get_bit callback routine. */ void *get_bit_user_data; /*! \brief The callback function used to put each bit received. */ put_bit_func_t put_bit; /*! \brief A user specified opaque pointer passed to the put_bit callback routine. */ void *put_bit_user_data; /*! \brief The callback function used to report modem status changes. */ modem_status_func_t status_handler; /*! \brief A user specified opaque pointer passed to the status function. */ void *status_user_data; int negotiated_bit_rate; /* Receive section */ struct { /*! \brief Current offset into the RRC pulse shaping filter buffer. */ int rrc_filter_step; /*! \brief The register for the data scrambler. */ uint32_t scramble_reg; /*! \brief A counter for the number of consecutive bits of repeating pattern through the scrambler. */ int scrambler_pattern_count; /*! \brief 0 if receiving user data. A training stage value during training */ int training; /*! \brief A count of how far through the current training step we are. */ int training_count; /*! \brief >0 if a signal above the minimum is present. It may or may not be a V.22bis signal. */ int signal_present; /*! \brief The current phase of the carrier (i.e. the DDS parameter). */ uint32_t carrier_phase; /*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */ int32_t carrier_phase_rate; /*! \brief A callback function which may be enabled to report every symbol's constellation position. */ qam_report_handler_t qam_report; /*! \brief A user specified opaque pointer passed to the qam_report callback routine. */ void *qam_user_data; /*! \brief A power meter, to measure the HPF'ed signal power in the channel. */ power_meter_t rx_power; /*! \brief The power meter level at which carrier on is declared. */ int32_t carrier_on_power; /*! \brief The power meter level at which carrier off is declared. */ int32_t carrier_off_power; int constellation_state; #if defined(SPANDSP_USE_FIXED_POINTx) /*! \brief The scaling factor accessed by the AGC algorithm. */ float agc_scaling; /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */ int16_t rrc_filter[V22BIS_RX_FILTER_STEPS]; /*! \brief The current delta factor for updating the equalizer coefficients. */ float eq_delta; /*! \brief The adaptive equalizer coefficients. */ complexi_t eq_coeff[2*V22BIS_EQUALIZER_LEN + 1]; /*! \brief The equalizer signal buffer. */ complexi_t eq_buf[V22BIS_EQUALIZER_MASK + 1]; /*! \brief A measure of how much mismatch there is between the real constellation, and the decoded symbol positions. */ float training_error; /*! \brief The proportional part of the carrier tracking filter. */ float carrier_track_p; /*! \brief The integral part of the carrier tracking filter. */ float carrier_track_i; #else /*! \brief The scaling factor accessed by the AGC algorithm. */ float agc_scaling; /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */ float rrc_filter[V22BIS_RX_FILTER_STEPS]; /*! \brief The current delta factor for updating the equalizer coefficients. */ float eq_delta; /*! \brief The adaptive equalizer coefficients. */ complexf_t eq_coeff[2*V22BIS_EQUALIZER_LEN + 1]; /*! \brief The equalizer signal buffer. */ complexf_t eq_buf[V22BIS_EQUALIZER_MASK + 1]; /*! \brief A measure of how much mismatch there is between the real constellation, and the decoded symbol positions. */ float training_error; /*! \brief The proportional part of the carrier tracking filter. */ float carrier_track_p; /*! \brief The integral part of the carrier tracking filter. */ float carrier_track_i; #endif /*! \brief Current offset into the equalizer buffer. */ int eq_step; /*! \brief Current write offset into the equalizer buffer. */ int eq_put_step; /*! \brief Integration variable for damping the Gardner algorithm tests. */ int gardner_integrate; /*! \brief Current step size of Gardner algorithm integration. */ int gardner_step; /*! \brief The total symbol timing correction since the carrier came up. This is only for performance analysis purposes. */ int total_baud_timing_correction; /*! \brief The current fractional phase of the baud timing. */ int baud_phase; int sixteen_way_decisions; int pattern_repeats; int last_raw_bits; } rx; /* Transmit section */ struct { #if defined(SPANDSP_USE_FIXED_POINTx) /*! \brief The guard tone level. */ float guard_level; /*! \brief The gain factor needed to achieve the specified output power. */ float gain; /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */ complexf_t rrc_filter[2*V22BIS_TX_FILTER_STEPS]; #else /*! \brief The guard tone level. */ float guard_level; /*! \brief The gain factor needed to achieve the specified output power. */ float gain; /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */ complexf_t rrc_filter[2*V22BIS_TX_FILTER_STEPS]; #endif /*! \brief Current offset into the RRC pulse shaping filter buffer. */ int rrc_filter_step; /*! \brief The register for the data scrambler. */ uint32_t scramble_reg; /*! \brief A counter for the number of consecutive bits of repeating pattern through the scrambler. */ int scrambler_pattern_count; /*! \brief 0 if transmitting user data. A training stage value during training */ int training; /*! \brief A counter used to track progress through sending the training sequence. */ int training_count; /*! \brief The current phase of the carrier (i.e. the DDS parameter). */ uint32_t carrier_phase; /*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */ int32_t carrier_phase_rate; /*! \brief The current phase of the guard tone (i.e. the DDS parameter). */ uint32_t guard_phase; /*! \brief The update rate for the phase of the guard tone (i.e. the DDS increment). */ int32_t guard_phase_rate; /*! \brief The current fractional phase of the baud timing. */ int baud_phase; /*! \brief The code number for the current position in the constellation. */ int constellation_state; /*! \brief An indicator to mark that we are tidying up to stop transmission. */ int shutdown; /*! \brief The get_bit function in use at any instant. */ get_bit_func_t current_get_bit; } tx; /*! \brief Error and flow logging control */ logging_state_t logging; }; #if defined(__cplusplus) extern "C" { #endif /*! Reinitialise an existing V.22bis modem receive context. \brief Reinitialise an existing V.22bis modem receive context. \param s The modem context. \return 0 for OK, -1 for bad parameter */ int v22bis_rx_restart(v22bis_state_t *s); void v22bis_report_status_change(v22bis_state_t *s, int status); void v22bis_equalizer_coefficient_reset(v22bis_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/t4_tx.h0000664000175000017500000000767412100761252015246 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/t4_tx.h - definitions for T.4 FAX transmit processing * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_T4_TX_H_) #define _SPANDSP_PRIVATE_T4_TX_H_ #define t4_tx_state_s t4_state_s /*! T.4 FAX compression/decompression descriptor. This defines the working state for a single instance of a T.4 FAX compression or decompression channel. */ struct t4_state_s { /*! \brief The same structure is used for T.4 transmit and receive. This variable records which mode is in progress. */ int rx; /*! \brief The type of compression used between the FAX machines. */ int line_encoding; /*! \brief The time at which handling of the current page began. */ time_t page_start_time; /*! \brief The text which will be used in FAX page header. No text results in no header line. */ const char *header_info; /*! \brief Optional per instance time zone for the FAX page header timestamp. */ struct tz_s *tz; /*! \brief The size of the compressed image on the line side, in bits. */ int line_image_size; /*! \brief The current number of bytes per row of uncompressed image data. */ int bytes_per_row; /*! \brief The size of the image in the image buffer, in bytes. */ int image_size; /*! \brief The current size of the image buffer. */ int image_buffer_size; /*! \brief A point to the image buffer. */ uint8_t *image_buffer; /*! \brief The number of pages transferred to date. */ int current_page; /*! \brief Column-to-column (X) resolution in pixels per metre. */ int x_resolution; /*! \brief Row-to-row (Y) resolution in pixels per metre. */ int y_resolution; /*! \brief Width of the current page, in pixels. */ int image_width; /*! \brief Length of the current page, in pixels. */ int image_length; /*! \brief Current pixel row number. */ int row; /*! \brief This variable is set if we are treating the current row as a 2D encoded one. */ int row_is_2d; /*! \brief The current length of the current row. */ int row_len; /*! \brief Black and white run-lengths for the current row. */ uint32_t *cur_runs; /*! \brief Black and white run-lengths for the reference row. */ uint32_t *ref_runs; /*! \brief Pointer to the buffer for the current pixel row. */ uint8_t *row_buf; /*! \brief Encoded data bits buffer. */ uint32_t tx_bitstream; /*! \brief The number of bits currently in tx_bitstream. */ int tx_bits; /*! \brief The current number of bits in the current encoded row. */ int row_bits; /*! \brief The minimum bits in any row of the current page. For monitoring only. */ int min_row_bits; /*! \brief The maximum bits in any row of the current page. For monitoring only. */ int max_row_bits; /*! \brief Error and flow logging control */ logging_state_t logging; /*! \brief All TIFF file specific state information for the T.4 context. */ t4_tiff_state_t tiff; t4_t6_decode_state_t t4_t6_rx; t4_t6_encode_state_t t4_t6_tx; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/gsm0610.h0000664000175000017500000000326411422612265015275 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/gsm0610.h - GSM 06.10 full rate speech codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_GSM0610_H_) #define _SPANDSP_PRIVATE_GSM0610_H_ /*! GSM 06.10 FR codec state descriptor. This defines the state of a single working instance of the GSM 06.10 FR encoder or decoder. */ struct gsm0610_state_s { /*! \brief One of the packing modes */ int packing; int16_t dp0[280]; /*! Preprocessing */ int16_t z1; int32_t L_z2; /*! Pre-emphasis */ int16_t mp; /*! Short term delay filter */ int16_t u[8]; int16_t LARpp[2][8]; int16_t j; /*! Long term synthesis */ int16_t nrp; /*! Short term synthesis */ int16_t v[9]; /*! Decoder postprocessing */ int16_t msr; /*! Encoder data */ int16_t e[50]; }; #endif /*- End of include ---------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/tone_detect.h0000664000175000017500000000207611422612265016475 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/tone_detect.h - General telephony tone detection. * * Written by Steve Underwood * * Copyright (C) 2001, 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_TONE_DETECT_H_) #define _SPANDSP_PRIVATE_TONE_DETECT_H_ #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/bell_r2_mf.h0000664000175000017500000000614411422612265016203 00000000000000/* * SpanDSP - a series of DSP components for telephony * * bell_r2_mf.h - Bell MF and MFC/R2 tone generation and detection. * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_BELL_R2_MF_H_) #define _SPANDSP_PRIVATE_BELL_R2_MF_H_ /*! Bell MF generator state descriptor. This defines the state of a single working instance of a Bell MF generator. */ struct bell_mf_tx_state_s { /*! The tone generator. */ tone_gen_state_t tones; int current_sample; union { queue_state_t queue; uint8_t buf[QUEUE_STATE_T_SIZE(MAX_BELL_MF_DIGITS)]; } queue; }; /*! Bell MF digit detector descriptor. */ struct bell_mf_rx_state_s { /*! Optional callback funcion to deliver received digits. */ digits_rx_callback_t digits_callback; /*! An opaque pointer passed to the callback function. */ void *digits_callback_data; /*! Tone detector working states */ goertzel_state_t out[6]; /*! Short term history of results from the tone detection, using in persistence checking */ uint8_t hits[5]; /*! The current sample number within a processing block. */ int current_sample; /*! The number of digits which have been lost due to buffer overflows. */ int lost_digits; /*! The number of digits currently in the digit buffer. */ int current_digits; /*! The received digits buffer. This is a NULL terminated string. */ char digits[MAX_BELL_MF_DIGITS + 1]; }; /*! MFC/R2 tone detector descriptor. */ struct r2_mf_tx_state_s { /*! The tone generator. */ tone_gen_state_t tone; /*! TRUE if generating forward tones, otherwise generating reverse tones. */ int fwd; /*! The current digit being generated. */ int digit; }; /*! MFC/R2 tone detector descriptor. */ struct r2_mf_rx_state_s { /*! Optional callback funcion to deliver received digits. */ tone_report_func_t callback; /*! An opaque pointer passed to the callback function. */ void *callback_data; /*! TRUE is we are detecting forward tones. FALSE if we are detecting backward tones */ int fwd; /*! Tone detector working states */ goertzel_state_t out[6]; /*! The current sample number within a processing block. */ int current_sample; /*! The currently detected digit. */ int current_digit; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/v42bis.h0000664000175000017500000001047112100752777015316 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/v42bis.h * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_V42BIS_H_) #define _SPANDSP_PRIVATE_V42BIS_H_ /*! V.42bis dictionary node. Note that 0 is not a valid node to point to (0 is always a control code), so 0 is used as a "no such value" marker in this structure. */ typedef struct { /*! \brief The value of the octet represented by the current dictionary node */ uint8_t node_octet; /*! \brief The parent of this node */ uint16_t parent; /*! \brief The first child of this node */ uint16_t child; /*! \brief The next node at the same depth */ uint16_t next; } v42bis_dict_node_t; /*! V.42bis compression or decompression. This defines the working state for a single instance of V.42bis compression or decompression. */ typedef struct { /*! \brief Compression enabled. */ int v42bis_parm_p0; /*! \brief Compression mode. */ int compression_mode; /*! \brief Callback function to handle output data. */ put_msg_func_t handler; /*! \brief An opaque pointer passed in calls to the data handler. */ void *user_data; /*! \brief The maximum amount to be passed to the data handler. */ int max_output_len; /*! \brief TRUE if we are in transparent (i.e. uncompressable) mode */ int transparent; /*! \brief Next empty dictionary entry */ uint16_t v42bis_parm_c1; /*! \brief Current codeword size */ uint16_t v42bis_parm_c2; /*! \brief Threshold for codeword size change */ uint16_t v42bis_parm_c3; /*! \brief The current update point in the dictionary */ uint16_t update_at; /*! \brief The last entry matched in the dictionary */ uint16_t last_matched; /*! \brief The last entry added to the dictionary */ uint16_t last_added; /*! \brief Total number of codewords in the dictionary */ int v42bis_parm_n2; /*! \brief Maximum permitted string length */ int v42bis_parm_n7; /*! \brief The dictionary */ v42bis_dict_node_t dict[V42BIS_MAX_CODEWORDS]; /*! \brief The octet string in progress */ uint8_t string[V42BIS_MAX_STRING_SIZE]; /*! \brief The current length of the octet string in progress */ int string_length; /*! \brief The amount of the octet string in progress which has already been flushed out of the buffer */ int flushed_length; /*! \brief Compression performance metric */ uint16_t compression_performance; /*! \brief Outgoing bit buffer (compression), or incoming bit buffer (decompression) */ uint32_t bit_buffer; /*! \brief Outgoing bit count (compression), or incoming bit count (decompression) */ int bit_count; /*! \brief The output composition buffer */ uint8_t output_buf[V42BIS_MAX_OUTPUT_LENGTH]; /*! \brief The length of the contents of the output composition buffer */ int output_octet_count; /*! \brief The current value of the escape code */ uint8_t escape_code; /*! \brief TRUE if we just hit an escape code, and are waiting for the following octet */ int escaped; } v42bis_comp_state_t; /*! V.42bis compression/decompression descriptor. This defines the working state for a single instance of V.42bis compress/decompression. */ struct v42bis_state_s { /*! \brief Compression state. */ v42bis_comp_state_t compress; /*! \brief Decompression state. */ v42bis_comp_state_t decompress; /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/modem_connect_tones.h0000664000175000017500000000675511422612265020232 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/modem_connect_tones.c - Generation and detection of tones * associated with modems calling and * answering calls. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_PRIVATE_MODEM_CONNECT_TONES_H_) #define _SPANDSP_PRIVATE_MODEM_CONNECT_TONES_H_ /*! Modem connect tones generator descriptor. This defines the state of a single working instance of the tone generator. */ struct modem_connect_tones_tx_state_s { int tone_type; int32_t tone_phase_rate; uint32_t tone_phase; int16_t level; /*! \brief Countdown to the next phase hop */ int hop_timer; /*! \brief Maximum duration timer */ int duration_timer; uint32_t mod_phase; int32_t mod_phase_rate; int16_t mod_level; }; /*! Modem connect tones receiver descriptor. This defines the state of a single working instance of the tone detector. */ struct modem_connect_tones_rx_state_s { /*! \brief The tone type being detected. */ int tone_type; /*! \brief Callback routine, using to report detection of the tone. */ tone_report_func_t tone_callback; /*! \brief An opaque pointer passed to tone_callback. */ void *callback_data; /*! \brief The notch filter state. */ float znotch_1; float znotch_2; /*! \brief The 15Hz AM filter state. */ float z15hz_1; float z15hz_2; /*! \brief The in notch power estimate */ int32_t notch_level; /*! \brief The total channel power estimate */ int32_t channel_level; /*! \brief The 15Hz AM power estimate */ int32_t am_level; /*! \brief Sample counter for the small chunks of samples, after which a test is conducted. */ int chunk_remainder; /*! \brief TRUE is the tone is currently confirmed present in the audio. */ int tone_present; /*! \brief */ int tone_on; /*! \brief A millisecond counter, to time the duration of tone sections. */ int tone_cycle_duration; /*! \brief A count of the number of good cycles of tone reversal seen. */ int good_cycles; /*! \brief TRUE if the tone has been seen since the last time the user tested for it */ int hit; /*! \brief A V.21 FSK modem context used when searching for FAX preamble. */ fsk_rx_state_t v21rx; /*! \brief The raw (stuffed) bit stream buffer. */ unsigned int raw_bit_stream; /*! \brief The current number of bits in the octet in progress. */ int num_bits; /*! \brief Number of consecutive flags seen so far. */ int flags_seen; /*! \brief TRUE if framing OK has been announced. */ int framing_ok_announced; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/at_interpreter.h0000664000175000017500000000673611422612265017236 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/at_interpreter.h - AT command interpreter to V.251, V.252, V.253, T.31 and the 3GPP specs. * * Written by Steve Underwood * * Copyright (C) 2004, 2005, 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_PRIVATE_AT_INTERPRETER_H_) #define _SPANDSP_PRIVATE_AT_INTERPRETER_H_ typedef struct at_call_id_s at_call_id_t; struct at_call_id_s { char *id; char *value; at_call_id_t *next; }; /*! AT descriptor. This defines the working state for a single instance of the AT interpreter. */ struct at_state_s { at_profile_t p; /*! Value set by +GCI */ int country_of_installation; /*! Value set by +FIT */ int dte_inactivity_timeout; /*! Value set by +FIT */ int dte_inactivity_action; /*! Value set by L */ int speaker_volume; /*! Value set by M */ int speaker_mode; /*! This is no real DTE rate. This variable is for compatibility this serially connected modems. */ /*! Value set by +IPR/+FPR */ int dte_rate; /*! Value set by +ICF */ int dte_char_format; /*! Value set by +ICF */ int dte_parity; /*! Value set by &C */ int rlsd_behaviour; /*! Value set by &D */ int dtr_behaviour; /*! Value set by +FCL */ int carrier_loss_timeout; /*! Value set by X */ int result_code_mode; /*! Value set by +IDSR */ int dsr_option; /*! Value set by +ILSD */ int long_space_disconnect_option; /*! Value set by +ICLOK */ int sync_tx_clock_source; /*! Value set by +EWIND */ int rx_window; /*! Value set by +EWIND */ int tx_window; int v8bis_signal; int v8bis_1st_message; int v8bis_2nd_message; int v8bis_sig_en; int v8bis_msg_en; int v8bis_supp_delay; uint8_t rx_data[256]; int rx_data_bytes; int display_call_info; int call_info_displayed; at_call_id_t *call_id; char *local_id; /*! The currently select FAX modem class. 0 = data modem mode. */ int fclass_mode; int at_rx_mode; int rings_indicated; int do_hangup; int silent_dial; int command_dial; int ok_is_pending; int dte_is_waiting; /*! \brief TRUE if a carrier is presnt. Otherwise FALSE. */ int rx_signal_present; /*! \brief TRUE if a modem has trained, Otherwise FALSE. */ int rx_trained; int transmit; char line[256]; int line_ptr; at_modem_control_handler_t *modem_control_handler; void *modem_control_user_data; at_tx_handler_t *at_tx_handler; void *at_tx_user_data; at_class1_handler_t *class1_handler; void *class1_user_data; /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/bitstream.h0000664000175000017500000000247611422612265016176 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/bitstream.h - Bitstream composition and decomposition routines. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_BITSTREAM_H_) #define _SPANDSP_PRIVATE_BITSTREAM_H_ /*! Bitstream handler state */ struct bitstream_state_s { /*! The bit stream. */ uint32_t bitstream; /*! The residual bits in bitstream. */ int residue; /*! TRUE if the stream is LSB first, else MSB first */ int lsb_first; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/t30.h0000664000175000017500000003216012350607570014607 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/t30.h - definitions for T.30 fax processing * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_PRIVATE_T30_H_) #define _SPANDSP_PRIVATE_T30_H_ /*! T.30 FAX channel descriptor. This defines the state of a single working instance of a T.30 FAX channel. */ struct t30_state_s { /*! \brief T.4 context for reading or writing image data. */ union { t4_rx_state_t rx; t4_tx_state_t tx; } t4; /*! \brief The type of FAX operation currently in progress */ int operation_in_progress; /*! \brief True if behaving as the calling party */ int calling_party; /*! \brief Internet aware FAX mode bit mask. */ int iaf; /*! \brief A bit mask of the currently supported modem types. */ int supported_modems; /*! \brief A bit mask of the currently supported image compression modes. */ int supported_compressions; /*! \brief A bit mask of the currently supported image resolutions. */ int supported_resolutions; /*! \brief A bit mask of the currently supported image sizes. */ int supported_image_sizes; /*! \brief A bit mask of the currently supported T.30 special features. */ int supported_t30_features; /*! \brief True is ECM mode handling is enabled. */ int ecm_allowed; /*! \brief True if we are capable of retransmitting pages */ int retransmit_capable; /*! \brief The received DCS, formatted as an ASCII string, for inclusion in the TIFF file. */ char rx_dcs_string[T30_MAX_DIS_DTC_DCS_LEN*3 + 1]; /*! \brief The text which will be used in FAX page header. No text results in no header line. */ char header_info[T30_MAX_PAGE_HEADER_INFO + 1]; /*! \brief True for FAX page headers to overlay (i.e. replace) the beginning of the page image. False for FAX page headers to add to the overall length of the page. */ int header_overlays_image; /*! \brief Use private timezone if true */ int use_own_tz; /*! \brief Optional per instance time zone for the FAX page header timestamp. */ tz_t tz; /*! \brief True if remote T.30 procedural interrupts are allowed. */ int remote_interrupts_allowed; /*! \brief The information fields received. */ t30_exchanged_info_t rx_info; /*! \brief The information fields to be transmitted. */ t30_exchanged_info_t tx_info; /*! \brief The country of origin of the remote machine, if known, else NULL. */ const char *country; /*! \brief The vendor of the remote machine, if known, else NULL. */ const char *vendor; /*! \brief The model of the remote machine, if known, else NULL. */ const char *model; /*! \brief A pointer to a callback routine to be called when phase B events occur. */ t30_phase_b_handler_t *phase_b_handler; /*! \brief An opaque pointer supplied in event B callbacks. */ void *phase_b_user_data; /*! \brief A pointer to a callback routine to be called when phase D events occur. */ t30_phase_d_handler_t *phase_d_handler; /*! \brief An opaque pointer supplied in event D callbacks. */ void *phase_d_user_data; /*! \brief A pointer to a callback routine to be called when phase E events occur. */ t30_phase_e_handler_t *phase_e_handler; /*! \brief An opaque pointer supplied in event E callbacks. */ void *phase_e_user_data; /*! \brief A pointer to a callback routine to be called when frames are exchanged. */ t30_real_time_frame_handler_t *real_time_frame_handler; /*! \brief An opaque pointer supplied in real time frame callbacks. */ void *real_time_frame_user_data; /*! \brief A pointer to a callback routine to be called when document events (e.g. end of transmitted document) occur. */ t30_document_handler_t *document_handler; /*! \brief An opaque pointer supplied in document callbacks. */ void *document_user_data; /*! \brief The handler for changes to the receive mode */ t30_set_handler_t *set_rx_type_handler; /*! \brief An opaque pointer passed to the handler for changes to the receive mode */ void *set_rx_type_user_data; /*! \brief The handler for changes to the transmit mode */ t30_set_handler_t *set_tx_type_handler; /*! \brief An opaque pointer passed to the handler for changes to the transmit mode */ void *set_tx_type_user_data; /*! \brief The transmitted HDLC frame handler. */ t30_send_hdlc_handler_t *send_hdlc_handler; /*! \brief An opaque pointer passed to the transmitted HDLC frame handler. */ void *send_hdlc_user_data; /*! \brief The DIS code for the minimum scan row time we require. This is usually 0ms, but if we are trying to simulate another type of FAX machine, we may need a non-zero value here. */ uint8_t local_min_scan_time_code; /*! \brief The current T.30 phase. */ int phase; /*! \brief The T.30 phase to change to when the current phase ends. */ int next_phase; /*! \brief The current state of the T.30 state machine. */ int state; /*! \brief The step in sending a sequence of HDLC frames. */ int step; /*! \brief The preparation buffer for the DCS message to be transmitted. */ uint8_t dcs_frame[T30_MAX_DIS_DTC_DCS_LEN]; /*! \brief The length of the DCS message to be transmitted. */ int dcs_len; /*! \brief The preparation buffer for DIS or DTC message to be transmitted. */ uint8_t local_dis_dtc_frame[T30_MAX_DIS_DTC_DCS_LEN]; /*! \brief The length of the DIS or DTC message to be transmitted. */ int local_dis_dtc_len; /*! \brief The last DIS or DTC message received form the far end. */ uint8_t far_dis_dtc_frame[T30_MAX_DIS_DTC_DCS_LEN]; /*! \brief The length of the last DIS or DTC message received form the far end. */ int far_dis_dtc_len; /*! \brief True if a valid DIS has been received from the far end. */ int dis_received; /*! \brief True if the short training sequence should be used. */ int short_train; /*! \brief True if an image carrier appears to have been received, even if it did not successfully train. */ int image_carrier_attempted; /*! \brief A count of the number of bits in the trainability test. This counts down to zero when sending TCF, and counts up when receiving it. */ int tcf_test_bits; /*! \brief The current count of consecutive received zero bits, during the trainability test. */ int tcf_current_zeros; /*! \brief The maximum consecutive received zero bits seen to date, during the trainability test. */ int tcf_most_zeros; /*! \brief The current fallback step for the fast message transfer modem. */ int current_fallback; /*! \brief The subset of supported modems allowed at the current time, allowing for negotiation. */ int current_permitted_modems; /*! \brief True if a carrier is present. Otherwise false. */ int rx_signal_present; /*! \brief True if a modem has trained correctly. */ int rx_trained; /*! \brief True if a valid HDLC frame has been received in the current reception period. */ int rx_frame_received; /*! \brief Current reception mode. */ int current_rx_type; /*! \brief Current transmission mode. */ int current_tx_type; /*! \brief T0 is the answer timeout when calling another FAX machine. Placing calls is handled outside the FAX processing, but this timeout keeps running until V.21 modulation is sent or received. T1 is the remote terminal identification timeout (in audio samples). */ int timer_t0_t1; /*! \brief T2, T2A and T2B are the HDLC command timeouts. T4, T4A and T4B are the HDLC response timeouts (in audio samples). */ int timer_t2_t4; /*! \brief A value specifying which of the possible timers is currently running in timer_t2_t4 */ int timer_t2_t4_is; /*! \brief Procedural interrupt timeout (in audio samples). */ int timer_t3; /*! \brief This is only used in error correcting mode. */ int timer_t5; /*! \brief This is only used in full duplex (e.g. ISDN) modes. */ int timer_t6; /*! \brief This is only used in full duplex (e.g. ISDN) modes. */ int timer_t7; /*! \brief This is only used in full duplex (e.g. ISDN) modes. */ int timer_t8; /*! \brief True once the far end FAX entity has been detected. */ int far_end_detected; /*! \brief True once the end of procedure condition has been detected. */ int end_of_procedure_detected; /*! \brief True if a local T.30 interrupt is pending. */ int local_interrupt_pending; /*! \brief The image coding being used on the line. */ int line_encoding; /*! \brief The image coding being used for output files. */ int output_encoding; /*! \brief The current DCS message minimum scan time code. */ uint8_t min_scan_time_code; /*! \brief The X direction resolution of the current image, in pixels per metre. */ int x_resolution; /*! \brief The Y direction resolution of the current image, in pixels per metre. */ int y_resolution; /*! \brief The width of the current image, in pixels. */ t4_image_width_t image_width; /*! \brief Current number of retries of the action in progress. */ int retries; /*! \brief True if error correcting mode is used. */ int error_correcting_mode; /*! \brief The number of HDLC frame retries, if error correcting mode is used. */ int error_correcting_mode_retries; /*! \brief The current count of consecutive T30_PPR messages. */ int ppr_count; /*! \brief The current count of consecutive T30_RNR messages. */ int receiver_not_ready_count; /*! \brief The number of octets to be used per ECM frame. */ int octets_per_ecm_frame; /*! \brief The ECM partial page buffer. */ uint8_t ecm_data[256][260]; /*! \brief The lengths of the frames in the ECM partial page buffer. */ int16_t ecm_len[256]; /*! \brief A bit map of the OK ECM frames, constructed as a PPR frame. */ uint8_t ecm_frame_map[3 + 32]; /*! \brief The current page number for receiving, in ECM or non-ECM mode. This is reset at the start of a call. */ int rx_page_number; /*! \brief The current page number for sending, in ECM or non-ECM mode. This is reset at the start of a call. */ int tx_page_number; /*! \brief The current block number, in ECM mode */ int ecm_block; /*! \brief The number of frames in the current block number, in ECM mode */ int ecm_frames; /*! \brief The number of frames sent in the current burst of image transmission, in ECM mode */ int ecm_frames_this_tx_burst; /*! \brief The current ECM frame, during ECM transmission. */ int ecm_current_tx_frame; /*! \brief True if we are at the end of an ECM page to se sent - i.e. there are no more partial pages still to come. */ int ecm_at_page_end; /*! \brief The last result for a received non-ECM page - T30_MPS, T30_RTP, or T30_RTN. */ int last_rx_page_result; /*! \brief The transmission step queued to follow the one in progress. */ int next_tx_step; /*! \brief The FCF for the next receive step. */ uint8_t next_rx_step; /*! \brief Image file name for image reception. */ char rx_file[256]; /*! \brief The last page we are prepared accept for a received image file. -1 means no restriction. */ int rx_stop_page; /*! \brief Image file name to be sent. */ char tx_file[256]; /*! \brief The first page to be sent from the image file. -1 means no restriction. */ int tx_start_page; /*! \brief The last page to be sent from the image file. -1 means no restriction. */ int tx_stop_page; /*! \brief The current completion status. */ int current_status; /*! \brief the FCF2 field of the last PPS message we received. */ uint8_t last_pps_fcf2; /*! \brief True if all frames of the current received ECM block are now OK */ int rx_ecm_block_ok; /*! \brief A count of successfully received ECM frames, to assess progress as a basis for deciding whether to continue error correction when PPRs keep repeating. */ int ecm_progress; /*! \brief The number of RTP events */ int rtp_events; /*! \brief The number of RTN events */ int rtn_events; /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/echo.h0000664000175000017500000000501211422612265015107 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/echo.h - An echo cancellor, suitable for electrical and acoustic * cancellation. This code does not currently comply with * any relevant standards (e.g. G.164/5/7/8). * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_PRIVATE_ECHO_H_) #define _SPANDSP_PRIVATE_ECHO_H_ /*! G.168 echo canceller descriptor. This defines the working state for a line echo canceller. */ struct echo_can_state_s { int tx_power[4]; int rx_power[3]; int clean_rx_power; int rx_power_threshold; int nonupdate_dwell; int curr_pos; int taps; int tap_mask; int adaption_mode; int32_t supp_test1; int32_t supp_test2; int32_t supp1; int32_t supp2; int vad; int cng; int16_t geigel_max; int geigel_lag; int dtd_onset; int tap_set; int tap_rotate_counter; int32_t latest_correction; /* Indication of the magnitude of the latest adaption, or a code to indicate why adaption was skipped, for test purposes */ int32_t last_acf[28]; int narrowband_count; int narrowband_score; fir16_state_t fir_state; /*! Echo FIR taps (16 bit version) */ int16_t *fir_taps16[4]; /*! Echo FIR taps (32 bit version) */ int32_t *fir_taps32; /* DC and near DC blocking filter states */ int32_t tx_hpf[2]; int32_t rx_hpf[2]; /* Parameters for the optional Hoth noise generator */ int cng_level; int cng_rndnum; int cng_filter; /* Snapshot sample of coeffs used for development */ int16_t *snapshot; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/v42.h0000664000175000017500000001002612100753002014572 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/v42.h * * Written by Steve Underwood * * Copyright (C) 2003, 2011 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_V42_H_) #define _SPANDSP_PRIVATE_V42_H_ /*! Max retries (9.2.2) */ #define V42_DEFAULT_N_400 5 /*! Default for max octets in an information field (9.2.3) */ #define V42_DEFAULT_N_401 128 /*! Maximum supported value for max octets in an information field */ #define V42_MAX_N_401 128 /*! Default window size (k) (9.2.4) */ #define V42_DEFAULT_WINDOW_SIZE_K 15 /*! Maximum supported window size (k) */ #define V42_MAX_WINDOW_SIZE_K 15 /*! The number of info frames to allocate */ #define V42_INFO_FRAMES (V42_MAX_WINDOW_SIZE_K + 1) /*! The number of control frames to allocate */ #define V42_CTRL_FRAMES 8 typedef struct { /* V.42 LAP.M parameters */ uint8_t v42_tx_window_size_k; uint8_t v42_rx_window_size_k; uint16_t v42_tx_n401; uint16_t v42_rx_n401; /* V.42bis compressor parameters */ uint8_t comp; int comp_dict_size; int comp_max_string; } v42_config_parameters_t; typedef struct frame_s { int len; uint8_t buf[4 + V42_MAX_N_401]; } v42_frame_t; /*! LAP-M descriptor. This defines the working state for a single instance of LAP-M. */ typedef struct { get_msg_func_t iframe_get; void *iframe_get_user_data; put_msg_func_t iframe_put; void *iframe_put_user_data; modem_status_func_t status_handler; void *status_user_data; hdlc_rx_state_t hdlc_rx; hdlc_tx_state_t hdlc_tx; /*! Negotiated values for the window and maximum info sizes */ uint8_t tx_window_size_k; uint8_t rx_window_size_k; uint16_t tx_n401; uint16_t rx_n401; uint8_t cmd_addr; uint8_t rsp_addr; uint8_t vs; uint8_t va; uint8_t vr; int state; int configuring; int local_busy; int far_busy; int rejected; int retry_count; /* The control frame buffer, and its pointers */ int ctrl_put; int ctrl_get; v42_frame_t ctrl_buf[V42_CTRL_FRAMES]; /* The info frame buffer, and its pointers */ int info_put; int info_get; int info_acked; v42_frame_t info_buf[V42_INFO_FRAMES]; void (*packer_process)(v42_state_t *m, int bits); } lapm_state_t; /*! V.42 support negotiation parameters */ typedef struct { /*! Stage in negotiating V.42 support */ int rx_negotiation_step; int rxbits; int rxstream; int rxoks; int odp_seen; int txbits; int txstream; int txadps; } v42_negotiation_t; /*! V.42 descriptor. This defines the working state for a single instance of a V.42 error corrector. */ struct v42_state_s { /*! TRUE if we are the calling party, otherwise FALSE. */ int calling_party; /*! TRUE if we should detect whether the far end is V.42 capable. FALSE if we go directly to protocol establishment. */ int detect; /*! The bit rate, used to time events */ int tx_bit_rate; v42_config_parameters_t config; v42_negotiation_t neg; lapm_state_t lapm; int bit_timer; void (*bit_timer_func)(v42_state_t *m); /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/fax.h0000664000175000017500000000277111422612265014760 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/fax.h - private definitions for analogue line ITU T.30 fax processing * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_PRIVATE_FAX_H_) #define _SPANDSP_PRIVATE_FAX_H_ /*! Analogue line T.30 FAX channel descriptor. This defines the state of a single working instance of an analogue line soft-FAX machine. */ struct fax_state_s { /*! \brief The T.30 back-end */ t30_state_t t30; /*! \brief The analogue modem front-end */ fax_modems_state_t modems; /*! \brief V.8 */ //v8_state_t v8; /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/bert.h0000664000175000017500000000406511422612265015134 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/bert.h - Bit error rate tests. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_BERT_H_) #define _SPANDSP_PRIVATE_BERT_H_ typedef struct { uint32_t reg; int step; int step_bit; int bits; int zeros; } bert_tx_state_t; typedef struct { uint32_t reg; uint32_t ref_reg; uint32_t master_reg; int step; int step_bit; int resync; int bits; int zeros; int resync_len; int resync_percent; int resync_bad_bits; int resync_cnt; int report_countdown; int measurement_step; } bert_rx_state_t; /*! Bit error rate tester (BERT) descriptor. This defines the working state for a single instance of the BERT. */ struct bert_state_s { int pattern; int pattern_class; bert_report_func_t reporter; void *user_data; int report_frequency; int limit; uint32_t mask; int shift; int shift2; int max_zeros; int invert; int resync_time; int decade_ptr[9]; int decade_bad[9][10]; int error_rate; bert_tx_state_t tx; bert_rx_state_t rx; bert_results_t results; /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/t38_non_ecm_buffer.h0000664000175000017500000000643711422612265017652 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/t38_non_ecm_buffer.h - A rate adapting buffer for T.38 non-ECM image * and TCF data * * Written by Steve Underwood * * Copyright (C) 2005, 2006, 2007, 2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_T38_NON_ECM_BUFFER_H_) #define _SPANDSP_PRIVATE_T38_NON_ECM_BUFFER_H_ /*! \brief A flow controlled non-ECM image data buffer, for buffering T.38 to analogue modem data. */ struct t38_non_ecm_buffer_state_s { /*! \brief Minimum number of bits per row, used when fill bits are being deleted on the link, and restored at the emitting gateway. */ int min_bits_per_row; /*! \brief non-ECM modem transmit data buffer. */ uint8_t data[T38_NON_ECM_TX_BUF_LEN]; /*! \brief The current write point in the buffer. */ int in_ptr; /*! \brief The current read point in the buffer. */ int out_ptr; /*! \brief The location of the most recent EOL marker in the buffer. */ int latest_eol_ptr; /*! \brief The number of bits to date in the current row, used when min_row_bits is to be applied. */ int row_bits; /*! \brief The bit stream entering the buffer, used to detect EOLs */ unsigned int bit_stream; /*! \brief The non-ECM flow control fill octet (0xFF before the first data, and 0x00 once data has started). */ uint8_t flow_control_fill_octet; /*! \brief A code for the phase of input buffering, from initial all ones to completion. */ int input_phase; /*! \brief TRUE is the end of non-ECM data indication has been received. */ int data_finished; /*! \brief The current octet being transmitted from the buffer. */ unsigned int octet; /*! \brief The current bit number in the current non-ECM octet. */ int bit_no; /*! \brief TRUE if in image data mode, as opposed to TCF mode. */ int image_data_mode; /*! \brief The number of octets input to the buffer. */ int in_octets; /*! \brief The number of rows input to the buffer. */ int in_rows; /*! \brief The number of non-ECM fill octets generated for minimum row bits purposes. */ int min_row_bits_fill_octets; /*! \brief The number of octets output from the buffer. */ int out_octets; /*! \brief The number of rows output from the buffer. */ int out_rows; /*! \brief The number of non-ECM fill octets generated for flow control purposes. */ int flow_control_fill_octets; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/async.h0000664000175000017500000000601212100754451015305 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/async.h - Asynchronous serial bit stream encoding and decoding * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_ASYNC_H_) #define _SPANDSP_PRIVATE_ASYNC_H_ /*! Asynchronous data transmit descriptor. This defines the state of a single working instance of a byte to asynchronous serial converter, for use in FSK modems. */ struct async_tx_state_s { /*! \brief The number of data bits per character. */ int data_bits; /*! \brief The type of parity. */ int parity; /*! \brief The number of stop bits per character. */ int stop_bits; /*! \brief A pointer to the callback routine used to get characters to be transmitted. */ get_byte_func_t get_byte; /*! \brief An opaque pointer passed when calling get_byte. */ void *user_data; /*! \brief A current, partially transmitted, character. */ unsigned int byte_in_progress; /*! \brief The current bit position within a partially transmitted character. */ int bitpos; /*! \brief Parity bit. */ int parity_bit; }; /*! Asynchronous data receive descriptor. This defines the state of a single working instance of an asynchronous serial to byte converter, for use in FSK modems. */ struct async_rx_state_s { /*! \brief The number of data bits per character. */ int data_bits; /*! \brief The type of parity. */ int parity; /*! \brief The number of stop bits per character. */ int stop_bits; /*! \brief TRUE if V.14 rate adaption processing should be performed. */ int use_v14; /*! \brief A pointer to the callback routine used to handle received characters. */ put_byte_func_t put_byte; /*! \brief An opaque pointer passed when calling put_byte. */ void *user_data; /*! \brief A current, partially complete, character. */ unsigned int byte_in_progress; /*! \brief The current bit position within a partially complete character. */ int bitpos; /*! \brief Parity bit. */ int parity_bit; /*! A count of the number of parity errors seen. */ int parity_errors; /*! A count of the number of character framing errors seen. */ int framing_errors; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/t30_dis_dtc_dcs_bits.h0000664000175000017500000005014312101032351020132 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t30_dis_dtc_dcs_bits.h - ITU T.30 fax control bits definitions * * Written by Steve Underwood * * Copyright (C) 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_PRIVATE_T30_DIS_DTC_DCS_BITS_H_) #define _SPANDSP_PRIVATE_T30_DIS_DTC_DCS_BITS_H_ /* Indicates that the terminal has the Simple mode capability defined in ITU-T Rec. T.37. Internet address signals CIA, TSA or CSA can be sent and received. The recipient terminal may process or ignore this signal. */ #define T30_DIS_BIT_T37 1 #define T30_DCS_BIT_T37 1 /* Indicates that the terminal has the capability to communicate using ITU-T Rec. T.38. Internet address signals CIA, TSA or CSA can be sent and received. The recipient terminal may process or ignore this signal. */ #define T30_DIS_BIT_T38 3 #define T30_DCS_BIT_T38 3 /* Bit 4 set to "1" indicates 3rd Generation Mobile Network Access to the GSTN Connection. Bit 4 set to "0" conveys no information about the type of connection. */ #define T30_DIS_BIT_3G_MOBILE 4 #define T30_DCS_BIT_3G_MOBILE 4 /* When ISDN mode is used, in DIS/DTC bit 6 shall be set to "0". */ #define T30_DIS_BIT_V8_CAPABILITY 6 /* When ISDN mode is used, in DIS/DTC bit 7 shall be set to "0". */ #define T30_DIS_BIT_64_OCTET_ECM_FRAMES_PREFERRED 7 /* Bit 9 indicates that there is a facsimile document ready to be polled from the answering terrminal. It is not an indication of a capability. */ #define T30_DIS_BIT_READY_TO_TRANSMIT_FAX_DOCUMENT 9 /* In DIS/DTC bit 10 indicates that the answering terminal has receiving capabilities. In DCS it is a command to the receiving terminal to set itself in the receive mode. */ #define T30_DIS_BIT_READY_TO_RECEIVE_FAX_DOCUMENT 10 #define T30_DCS_BIT_RECEIVE_FAX_DOCUMENT 10 /* Bits 11, 12, 13, 14 - modem type */ #define T30_DIS_BIT_200_200_CAPABLE 15 #define T30_DCS_BIT_200_200 15 #define T30_DIS_BIT_2D_CAPABLE 16 #define T30_DCS_BIT_2D_MODE 16 /* Standard facsimile terminals conforming to ITU-T Rec. T.4 must have the following capability: Paper length = 297 mm. */ /* Bits 17, 18 - recording width */ /* Bits 19, 20 - paper length */ /* Bits 21, 22, 23 - min scan line time */ /* When ISDN mode is used, in DIS/DTC bits 21 to 23 shall be set to "1". */ #define T30_DIS_BIT_UNCOMPRESSED_CAPABLE 26 #define T30_DCS_BIT_UNCOMPRESSED_MODE 26 /* When ISDN mode is used, in DIS/DTC bit 27 shall be set to "1". */ #define T30_DIS_BIT_ECM_CAPABLE 27 #define T30_DCS_BIT_ECM 27 /* The value of bit 28 in the DCS command is only valid when ECM is selected. */ #define T30_DCS_BIT_64_OCTET_ECM_FRAMES 28 /* The value of bit 31 in the DCS command is only valid when ECM is selected. */ #define T30_DIS_BIT_T6_CAPABLE 31 #define T30_DCS_BIT_T6_MODE 31 #define T30_DIS_BIT_FNV_CAPABLE 33 #define T30_DCS_BIT_FNV_CAPABLE 33 #define T30_DIS_BIT_MULTIPLE_SELECTIVE_POLLING_CAPABLE 34 #define T30_DIS_BIT_POLLED_SUBADDRESSING_CAPABLE 35 #define T30_DIS_BIT_T43_CAPABLE 36 #define T30_DCS_BIT_T43_MODE 36 #define T30_DIS_BIT_PLANE_INTERLEAVE_CAPABLE 37 #define T30_DCS_BIT_PLANE_INTERLEAVE 37 #define T30_DIS_BIT_G726_CAPABLE 38 #define T30_DCS_BIT_G726 38 #define T30_DIS_BIT_200_400_CAPABLE 41 #define T30_DCS_BIT_200_400 41 #define T30_DIS_BIT_300_300_CAPABLE 42 #define T30_DCS_BIT_300_300 42 #define T30_DIS_BIT_400_400_CAPABLE 43 #define T30_DCS_BIT_400_400 43 /* Bits 44 and 45 are used only in conjunction with bits 15 and 43. Bit 44 in DCS, when used, shall correctly indicate the resolution of the transmitted document, which means that bit 44 in DCS may not always match the indication of bits 44 and 45 in DIS/DTC. Cross selection will cause the distortion and reduction of reproducible area. If a receiver indicates in DIS that it prefers to receive metric-based information, but the transmitter has only the equivalent inch-based information (or vice versa), then communication shall still take place. Bits 44 and 45 do not require the provision of any additional features on the terminal to indicate to the sending or receiving user whether the information was transmitted or received on a metric-metric, inch-inch, metric-inch, inch-metric basis. */ #define T30_DIS_BIT_INCH_RESOLUTION_PREFERRED 44 #define T30_DCS_BIT_INCH_RESOLUTION 44 #define T30_DIS_BIT_METRIC_RESOLUTION_PREFERRED 45 #define T30_DIS_BIT_MIN_SCAN_TIME_HALVES 46 #define T30_DIS_BIT_SELECTIVE_POLLING_CAPABLE 47 #define T30_DIS_BIT_SUBADDRESSING_CAPABLE 49 #define T30_DCS_BIT_SUBADDRESS_TRANSMISSION 49 #define T30_DIS_BIT_PASSWORD 50 #define T30_DCS_BIT_SENDER_ID_TRANSMISSION 50 /* Bit 51 indicates that there is a data file ready to be polled from the answering terminal. It is not an indication of a capability. This bit is used in conjunction with bits 53, 54, 55 and 57. */ #define T30_DIS_BIT_READY_TO_TRANSMIT_DATA_FILE 51 /* The binary file transfer protocol is described in ITU-T Rec. T.434. */ #define T30_DIS_BIT_BFT_CAPABLE 53 #define T30_DCS_BIT_BFT 53 #define T30_DIS_BIT_DTM_CAPABLE 54 #define T30_DCS_BIT_DTM 54 #define T30_DIS_BIT_EDI_CAPABLE 55 #define T30_DCS_BIT_EDI 55 #define T30_DIS_BIT_BTM_CAPABLE 57 #define T30_DCS_BIT_BTM 57 /* Bit 59 indicates that there is a character-coded or mixed-mode document ready to be polled from the answering terminal. It is not an indication of a capability. This bit is used in conjunction with bits 60, 62 and 65. */ #define T30_DIS_BIT_READY_TO_TRANSMIT_MIXED_MODE_DOCUMENT 59 #define T30_DIS_BIT_CHARACTER_MODE 60 #define T30_DCS_BIT_CHARACTER_MODE 60 #define T30_DIS_BIT_MIXED_MODE 62 #define T30_DCS_BIT_MIXED_MODE 62 #define T30_DIS_BIT_PROCESSABLE_MODE_26 65 #define T30_DIS_BIT_DIGITAL_NETWORK_CAPABLE 66 #define T30_DCS_BIT_DIGITAL_NETWORK_CAPABLE 66 #define T30_DIS_BIT_DUPLEX_CAPABLE 67 #define T30_DCS_BIT_DUPLEX_CAPABLE 67 #define T30_DIS_BIT_T81_CAPABLE 68 #define T30_DCS_BIT_FULL_COLOUR_MODEX 68 #define T30_DIS_BIT_FULL_COLOUR_CAPABLE 69 #define T30_DCS_BIT_FULL_COLOUR_MODE 69 /* In a DIS/DTC frame, setting bit 71 to "0" indicates that the called terminal can only accept image data which has been digitized to 8 bits/pel/component for JPEG mode. This is also true for T.43 mode if bit 36 is also set to "1". Setting bit 71 to "1" indicates that the called terminal can also accept image data that are digitized to 12 bits/pel/component for JPEG mode. This is also true for T.43 mode if bit 36 is also set to "1". In a DCS frame, setting bit 71 to "0" indicates that the calling terminal's image data are digitized to 8 bits/pel/component for JPEG mode. This is also true for T.43 mode if bit 36 is also set to "1". Setting bit 71 to "1" indicates that the calling terminal transmits image data which has been digitized to 12 bits/pel/component for JPEG mode. This is also true for T.43 mode if bit 36 is also set to "1". */ #define T30_DIS_BIT_12BIT_CAPABLE 71 #define T30_DCS_BIT_12BIT_COMPONENT 71 #define T30_DIS_BIT_NO_SUBSAMPLING 73 #define T30_DCS_BIT_NO_SUBSAMPLING 73 #define T30_DIS_BIT_CUSTOM_ILLUMINANT 74 #define T30_DCS_BIT_CUSTOM_ILLUMINANT 74 #define T30_DIS_BIT_CUSTOM_GAMUT_RANGE 75 #define T30_DCS_BIT_CUSTOM_GAMUT_RANGE 75 #define T30_DIS_BIT_NORTH_AMERICAN_LETTER_CAPABLE 76 #define T30_DCS_BIT_NORTH_AMERICAN_LETTER 76 #define T30_DIS_BIT_NORTH_AMERICAN_LEGAL_CAPABLE 77 #define T30_DCS_BIT_NORTH_AMERICAN_LEGAL 77 #define T30_DIS_BIT_T85_CAPABLE 78 #define T30_DCS_BIT_T85_MODE 78 #define T30_DIS_BIT_T85_L0_CAPABLE 79 #define T30_DCS_BIT_T85_L0_MODE 79 /* In a DIS/DTC frame, setting bit 97 to "0" indicates that the called terminal does not have the capability to accept 300 pels/25.4 mm x 300 lines/25.4 mm or 400 pels/25.4 mm x 400 lines/25.4 mm resolutions for colour/gray-scale images or T.44 Mixed Raster Content (MRC) mask layer. Setting bit 97 to "1" indicates that the called terminal does have the capability to accept 300 pels/25.4 mm x 300 lines/25.4 mm or 400 pels/25.4 mm x 400 lines/25.4 mm resolutions for colour/gray-scale images and MRC mask layer. Bit 97 is valid only when bits 68 and 42 or 43 (300 pels/25.4 mm x 300 lines/25.4 mm or 400 pels/25.4 mm x 400 lines/25.4 mm) are set to "1". In a DCS frame, setting bit 97 to "0" indicates that the calling terminal does not use 300 pels/25.4 mm x 300 lines/25.4 mm or 400 pels/25.4 mm x 400 lines/25.4 mm resolutions for colour/gray-scale images and mask layer. Setting bit 97 to "1" indicates that the calling terminal uses 300 pels/25.4 mm x 300 lines/25.4 mm or 400 pels/25.4 mm x 400 lines/25.4 mm resolutions for colour/gray-scale images and MRC mask layer. Bit 97 is valid only when bits 68 and 42 or 43 (300 pels/25.4 mm x 300 lines/25.4 mm and 400 pels/25.4 mm x 400 lines/25.4 mm) are set to "1". In a DIS/DTC frame, combinations of bit 42, bit 43 and bit 97 indicate that the called terminal has higher resolution capabilities as follows: Resolution capabilities (pels/25.4 mm) DIS/DTC Monochrome Colour/gray-scale 42 43 97 300 x 300 400 x 400 300 x 300 400 x 400 0 0 0 no no no no 1 0 0 yes no no no 0 1 0 no yes no no 1 1 0 yes yes no no 0 0 1 (invalid) 1 0 1 yes no yes no 0 1 1 no yes no yes 1 1 1 yes yes yes yes "yes" means that the called terminal has the corresponding capability. "no" means that the called terminal does not have the corresponding capability. */ #define T30_DIS_BIT_COLOUR_GREY_300_300_400_400_CAPABLE 97 #define T30_DCS_BIT_COLOUR_GREY_300_300_400_400 97 /* In a DIS/DTC frame, setting bit 98 to "0" indicates that the called terminal does not have the capability to accept 100 pels/25.4 mm x 100 lines/25.4 mm spatial resolution for colour or gray-scale images. Setting bit 98 to "1" indicates that the called terminal does have the capability to accept 100 pels/25.4 mm x 100 lines/25.4 mm spatial resolution for colour or gray-scale images. Bit 98 is valid only when bit 68 is set to "1". In a DCS frame, setting bit 98 to "0" indicates that the calling terminal does not use 100 pels/25.4 mm x 100 lines/25.4 mm spatial resolution for colour or gray-scale images. Setting bit 98 to "1" indicates that the calling terminal uses 100 pels/25.4 mm x 100 lines/25.4 mm spatial resolution for colour or gray-scale images. */ #define T30_DIS_BIT_COLOUR_GREY_100_100_CAPABLE 98 #define T30_DCS_BIT_COLOUR_GREY_100_100 98 /* To provide an error recovery mechanism, when PWD/SEP/SUB/SID/PSA/IRA/ISP frames are sent with DCS or DTC, bits 49, 102 and 50 in DCS or bits 47, 101, 50 and 35 in DTC shall be set to "1" with the following meaning: Bit DIS DTC DCS 35 Polled SubAddress capability Polled SubAddress transmission Not allowed - set to "0" 47 Selective polling capability Selective polling transmission Not allowed - set to "0" 49 Subaddressing capability Not allowed (Set to "0") Subaddressing transmission 50 Password Password transmission Sender Identification transmission 101 Internet Selective Polling Address capability Internet Selective Polling Address transmission Not allowed - set to "0" 102 Internet Routing Address capability Not allowed (Set to "0") Internet Routing Address transmission Terminals conforming to the 1993 version of T.30 may set the above bits to "0" even though PWD/SEP/SUB frames are transmitted. */ #define T30_DIS_BIT_INTERNET_SELECTIVE_POLLING_ADDRESS 101 #define T30_DIS_BIT_INTERNET_ROUTING_ADDRESS 102 #define T30_DCS_BIT_INTERNET_ROUTING_ADDRESS_TRANSMISSION 102 #define T30_DIS_BIT_600_600_CAPABLE 105 #define T30_DCS_BIT_600_600 105 #define T30_DIS_BIT_1200_1200_CAPABLE 106 #define T30_DCS_BIT_1200_1200 106 #define T30_DIS_BIT_300_600_CAPABLE 107 #define T30_DCS_BIT_300_600 107 #define T30_DIS_BIT_400_800_CAPABLE 108 #define T30_DCS_BIT_400_800 108 #define T30_DIS_BIT_600_1200_CAPABLE 109 #define T30_DCS_BIT_600_1200 109 #define T30_DIS_BIT_COLOUR_GREY_600_600_CAPABLE 110 #define T30_DCS_BIT_COLOUR_GREY_600_600 110 #define T30_DIS_BIT_COLOUR_GREY_1200_1200_CAPABLE 111 #define T30_DCS_BIT_COLOUR_GREY_1200_1200 111 #define T30_DIS_BIT_ALTERNATE_DOUBLE_SIDED_CAPABLE 113 #define T30_DCS_BIT_ALTERNATE_DOUBLE_SIDED_CAPABLE 113 #define T30_DIS_BIT_CONTINUOUS_DOUBLE_SIDED_CAPABLE 114 #define T30_DCS_BIT_CONTINUOUS_DOUBLE_SIDED_CAPABLE 114 #define T30_DIS_BIT_BLACK_AND_WHITE_MRC 115 #define T30_DIS_BIT_T45_CAPABLE 116 #define T30_DCS_BIT_T45_MODE 116 /* This bit defines the available colour space, when bit 92, 93 or 94 is set to "1". Available colour space for all combinations of bits 92, 93, 94 and 119 are shown in the following table. It should be noted that terminals which conform to the 2003 and earlier versions of this Recommendation will send LAB with "1" in bit 92, 93 or 94 even if bit 119 is set to "1". Available colour space for DIS/DTC bits 92, 93, 94 and 119 92 93 94 119 Mode of T.44 Available colour space 0 0 0 x Not available - 1 0 0 0 Mode 1 LAB only 1 0 0 1 Mode 1 YCC only x 1 x 0 Mode 2 or higher LAB only x x 1 0 Mode 2 or higher LAB only x 1 x 1 Mode 2 or higher LAB and YCC x x 1 1 Mode 2 or higher LAB and YCC Colour space for DCS bits 92, 93, 94 and 119 92 93 94 119 Mode of T.44 Colour space 0 0 0 x* Not available - 1 0 0 0 Mode 1 LAB 1 0 0 1 Mode 1 YCC x 1 x 0 Mode 2 or higher LAB x x 1 0 Mode 2 or higher LAB x 1 x 1 Mode 2 or higher YCC or mixing of YCC and LAB x x 1 1 Mode 2 or higher YCC or mixing of YCC and LAB */ #define T30_DIS_BIT_T44_COLOUR_SPACE 119 #define T30_DCS_BIT_T44_COLOUR_SPACE 119 /* Can only be set in the communication through the T.38 gateway, to cope with delay of network. T.x timer (12+-1s) should be used after emitting RNR or TNR. However, after receiving PPS signal in ECM mode, T.5 timer should be used. */ #define T30_DIS_BIT_T38_FLOW_CONTROL_CAPABLE 121 #define T30_DCS_BIT_T38_FLOW_CONTROL_CAPABLE 121 /* For resolutions greater than 200 lines/25.4 mm, 4.2.1.1/T.4 specifies the use of specific K factors for each standardized vertical resolution. To ensure backward compatibility with earlier versions of ITU-T Rec. T.4, bit 122 indicates when such K factors are being used. */ #define T30_DIS_BIT_K_GREATER_THAN_4 122 /* This bit should be set to "1" if the fax device is an Internet-Aware Fax Device as defined in ITU-T Rec. T.38 and if it is not affected by the data signal rate indicated by the DIS and DTC signals when communicating with another Internet-Aware Fax Device operating in T.38 mode. This bit shall not be used in GSTN mode. */ #define T30_DIS_BIT_T38_FAX_CAPABLE 123 /* This bit should be set to "1" if the fax device elects to operate in an Internet-Aware Fax mode as defined in ITU-T Rec. T.38 in response to a device which has set the related DIS bit to "1". When this bit is set to "1", the data signal rate of the modem (bits 11-14) should be set to "0". */ #define T30_DCS_BIT_T38_FAX_MODE 123 /* When either bit of 31, 36, 38, 51, 53, 54, 55, 57, 59, 60, 62, 65, 68, 78, 79, 115, 116 and 127 is set to "1", ECM must be used. If the value of bit field 92 to 94 is non-zero, then ECM must be used. Annex K describes the optional continuous-tone colour and gray scale images mode (sYCC-JPEG mode) protocol. When bit 127 in DIS/DTC frame is set to "1", the called terminal has the capability to accept sYCC-JPEG mode. This is defined with complete independent in the colour space CIELAB. In addition, when bit 127 in DCS frame is set to "1", ECM must be used and bits 15, 17, 18, 19, 20, 41, 42, 43, 45, 46, 68, 69, 71, 73, 74, 75, 76, 77, 97, 98, 105, 106, 107, 108, 109, 110 and 111 in DCS frame are "Don't care", and should be set to "0". In the case of transmission of multiple images, a post message signal PPS-MPS between pages, PPS-NULL between partial pages and PPS-EOP following the last page should be sent from the calling terminal to the called terminal. */ #define T30_DIS_BIT_SYCC_T81_CAPABLE 127 #define T30_DCS_BIT_SYCC_T81_MODE 127 #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/t38_terminal.h0000664000175000017500000001005212101200374016467 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/t38_terminal.h - T.38 termination, less the packet exchange part * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_PRIVATE_T38_TERMINAL_H_) #define _SPANDSP_PRIVATE_T38_TERMINAL_H_ typedef struct { /*! \brief Internet Aware FAX mode bit mask. */ int iaf; /*! \brief Required time between T.38 transmissions, in microseconds. */ int us_per_tx_chunk; /*! \brief Bit fields controlling the way data is packed into chunked for transmission. */ int chunking_modes; /*! \brief Core T.38 IFP support */ t38_core_state_t t38; /*! \brief The current transmit step being timed */ int timed_step; /*! \brief The timed step to go to when we reach idle from the current timed step */ int queued_timed_step; /*! \brief TRUE is there has been some T.38 data missed (i.e. lost packets) in the current reception period. */ int rx_data_missing; /*! \brief The number of octets to send in each image packet (non-ECM or ECM) at the current rate and the current specified packet interval. */ int octets_per_data_packet; struct { /*! \brief HDLC receive buffer */ uint8_t buf[T38_MAX_HDLC_LEN]; /*! \brief The length of the contents of the HDLC receive buffer */ int len; } hdlc_rx; struct { /*! \brief HDLC transmit buffer */ uint8_t buf[T38_MAX_HDLC_LEN]; /*! \brief The length of the contents of the HDLC transmit buffer */ int len; /*! \brief Current pointer within the contents of the HDLC transmit buffer */ int ptr; /*! \brief The number of extra bits in a fully stuffed version of the contents of the HDLC transmit buffer. This is needed to accurately estimate the playout time for this frame, through an analogue modem. */ int extra_bits; } hdlc_tx; /*! \brief Counter for trailing non-ECM bytes, used to flush out the far end's modem. */ int non_ecm_trailer_bytes; /*! \brief The next T.38 indicator queued for transmission. */ int next_tx_indicator; /*! \brief The current T.38 data type being transmitted. */ int current_tx_data_type; /*! \brief TRUE if a carrier is present. Otherwise FALSE. */ int rx_signal_present; /*! \brief The current operating mode of the receiver. */ int current_rx_type; /*! \brief The current operating mode of the transmitter. */ int current_tx_type; /*! \brief Current transmission bit rate. */ int tx_bit_rate; /*! \brief A "sample" count, used to time events. */ int32_t samples; /*! \brief The value for samples at the next transmission point. */ int32_t next_tx_samples; /*! \brief The current transmit timeout. */ int32_t timeout_tx_samples; /*! \brief The current receive timeout. */ int32_t timeout_rx_samples; } t38_terminal_front_end_state_t; /*! T.38 terminal state. */ struct t38_terminal_state_s { /*! \brief The T.30 back-end */ t30_state_t t30; /*! \brief The T.38 front-end */ t38_terminal_front_end_state_t t38_fe; /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/t4_t6_encode.h0000664000175000017500000000406611422612265016456 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/t4_t6_encode.h - definitions for T.4/T.6 fax compression * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_T4_T6_ENCODE_H_) #define _SPANDSP_PRIVATE_T4_T6_ENCODE_H_ /*! T.4 1D, T4 2D and T6 compressor state. */ struct t4_t6_encode_state_s { /*! \brief The minimum number of encoded bits per row. This is a timing thing for hardware FAX machines. */ int min_bits_per_row; /*! \brief The current maximum contiguous rows that may be 2D encoded. */ int max_rows_to_next_1d_row; /*! \brief Number of rows left that can be 2D encoded, before a 1D encoded row must be used. */ int rows_to_next_1d_row; /*! \brief The number of runs currently in the reference row. */ int ref_steps; /*! \brief Pointer to the byte containing the next image bit to transmit. */ int bit_pos; /*! \brief Pointer to the bit within the byte containing the next image bit to transmit. */ int bit_ptr; /*! \brief Callback function to read a row of pixels from the image source. */ t4_row_read_handler_t row_read_handler; /*! \brief Opaque pointer passed to row_read_handler. */ void *row_read_user_data; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/fsk.h0000664000175000017500000000610111422612265014754 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/fsk.h - FSK modem transmit and receive parts * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_FSK_H_) #define _SPANDSP_PRIVATE_FSK_H_ /*! FSK modem transmit descriptor. This defines the state of a single working instance of an FSK modem transmitter. */ struct fsk_tx_state_s { int baud_rate; /*! \brief The callback function used to get the next bit to be transmitted. */ get_bit_func_t get_bit; /*! \brief A user specified opaque pointer passed to the get_bit function. */ void *get_bit_user_data; /*! \brief The callback function used to report modem status changes. */ modem_tx_status_func_t status_handler; /*! \brief A user specified opaque pointer passed to the status function. */ void *status_user_data; int32_t phase_rates[2]; int16_t scaling; int32_t current_phase_rate; uint32_t phase_acc; int baud_frac; int shutdown; }; /*! FSK modem receive descriptor. This defines the state of a single working instance of an FSK modem receiver. */ struct fsk_rx_state_s { int baud_rate; /*! \brief Synchronous/asynchronous framing control */ int framing_mode; /*! \brief The callback function used to put each bit received. */ put_bit_func_t put_bit; /*! \brief A user specified opaque pointer passed to the put_bit routine. */ void *put_bit_user_data; /*! \brief The callback function used to report modem status changes. */ modem_tx_status_func_t status_handler; /*! \brief A user specified opaque pointer passed to the status function. */ void *status_user_data; int32_t carrier_on_power; int32_t carrier_off_power; power_meter_t power; /*! \brief The value of the last signal sample, using the a simple HPF for signal power estimation. */ int16_t last_sample; /*! \brief >0 if a signal above the minimum is present. It may or may not be a V.29 signal. */ int signal_present; int32_t phase_rate[2]; uint32_t phase_acc[2]; int correlation_span; complexi32_t window[2][FSK_MAX_WINDOW_LEN]; complexi32_t dot[2]; int buf_ptr; int frame_state; int frame_bits; int baud_phase; int last_bit; int scaling_shift; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/logging.h0000664000175000017500000000262311422612265015624 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/logging.h - definitions for error and debug logging. * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_LOGGING_H_) #define _SPANDSP_PRIVATE_LOGGING_H_ /*! Logging descriptor. This defines the working state for a single instance of the logging facility for spandsp. */ struct logging_state_s { int level; int samples_per_second; int64_t elapsed_samples; const char *tag; const char *protocol; message_handler_func_t span_message; error_handler_func_t span_error; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/adsi.h0000664000175000017500000000504111422612265015113 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/adsi.h - Analogue display services interface and other call ID related handling. * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_PRIVATE_ADSI_H_) #define _SPANDSP_PRIVATE_ADSI_H_ /*! ADSI transmitter descriptor. This contains all the state information for an ADSI (caller ID, CLASS, CLIP, ACLIP) transmit channel. */ struct adsi_tx_state_s { /*! */ int standard; /*! */ tone_gen_descriptor_t alert_tone_desc; /*! */ tone_gen_state_t alert_tone_gen; /*! */ fsk_tx_state_t fsktx; /*! */ dtmf_tx_state_t dtmftx; /*! */ async_tx_state_t asynctx; /*! */ int tx_signal_on; /*! */ int byte_no; /*! */ int bit_pos; /*! */ int bit_no; /*! */ uint8_t msg[256]; /*! */ int msg_len; /*! */ int preamble_len; /*! */ int preamble_ones_len; /*! */ int postamble_ones_len; /*! */ int stop_bits; /*! */ int baudot_shift; /*! */ logging_state_t logging; }; /*! ADSI receiver descriptor. This contains all the state information for an ADSI (caller ID, CLASS, CLIP, ACLIP, JCLIP) receive channel. */ struct adsi_rx_state_s { /*! */ int standard; /*! */ put_msg_func_t put_msg; /*! */ void *user_data; /*! */ fsk_rx_state_t fskrx; /*! */ dtmf_rx_state_t dtmfrx; /*! */ int consecutive_ones; /*! */ int bit_pos; /*! */ int in_progress; /*! */ uint8_t msg[256]; /*! */ int msg_len; /*! */ int baudot_shift; /*! A count of the framing errors. */ int framing_errors; /*! */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/v27ter_rx.h0000664000175000017500000002025712350624317016045 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/v27ter_rx.h - ITU V.27ter modem receive part * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_V27TER_RX_H_) #define _SPANDSP_PRIVATE_V27TER_RX_H_ /* Target length for the equalizer is about 43 taps for 4800bps and 32 taps for 2400bps to deal with the worst stuff in V.56bis. */ /*! The length of the equalizer buffer. Must be a power of 2 */ #define V27TER_EQUALIZER_LEN 32 /*! Samples before the target central position in the equalizer buffer */ #define V27TER_EQUALIZER_PRE_LEN 16 /*! The number of taps in the 4800bps pulse shaping/bandpass filter */ #define V27TER_RX_4800_FILTER_STEPS 27 /*! The number of taps in the 2400bps pulse shaping/bandpass filter */ #define V27TER_RX_2400_FILTER_STEPS 27 #if V27TER_RX_4800_FILTER_STEPS > V27TER_RX_2400_FILTER_STEPS #define V27TER_RX_FILTER_STEPS V27TER_RX_4800_FILTER_STEPS #else #define V27TER_RX_FILTER_STEPS V27TER_RX_2400_FILTER_STEPS #endif /*! V.27ter modem receive side descriptor. This defines the working state for a single instance of a V.27ter modem receiver. */ struct v27ter_rx_state_s { /*! \brief The bit rate of the modem. Valid values are 2400 and 4800. */ int bit_rate; /*! \brief The callback function used to put each bit received. */ put_bit_func_t put_bit; /*! \brief A user specified opaque pointer passed to the put_bit routine. */ void *put_bit_user_data; /*! \brief The callback function used to report modem status changes. */ modem_status_func_t status_handler; /*! \brief A user specified opaque pointer passed to the status function. */ void *status_user_data; /*! \brief A callback function which may be enabled to report every symbol's constellation position. */ qam_report_handler_t qam_report; /*! \brief A user specified opaque pointer passed to the qam_report callback routine. */ void *qam_user_data; #if defined(SPANDSP_USE_FIXED_POINT) /*! \brief The scaling factor assessed by the AGC algorithm. */ int16_t agc_scaling; /*! \brief The previous value of agc_scaling, needed to reuse old training. */ int16_t agc_scaling_save; /*! \brief The current delta factor for updating the equalizer coefficients. */ float eq_delta; /*! \brief The adaptive equalizer coefficients. */ /*complexi16_t*/ complexf_t eq_coeff[V27TER_EQUALIZER_LEN]; /*! \brief A saved set of adaptive equalizer coefficients for use after restarts. */ /*complexi16_t*/ complexf_t eq_coeff_save[V27TER_EQUALIZER_LEN]; /*! \brief The equalizer signal buffer. */ /*complexi16_t*/ complexf_t eq_buf[V27TER_EQUALIZER_LEN]; /*! \brief A measure of how much mismatch there is between the real constellation, and the decoded symbol positions. */ float training_error; /*! \brief The proportional part of the carrier tracking filter. */ float carrier_track_p; /*! \brief The integral part of the carrier tracking filter. */ float carrier_track_i; /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */ int16_t rrc_filter[V27TER_RX_FILTER_STEPS]; #else /*! \brief The scaling factor assessed by the AGC algorithm. */ float agc_scaling; /*! \brief The previous value of agc_scaling, needed to reuse old training. */ float agc_scaling_save; /*! \brief The current delta factor for updating the equalizer coefficients. */ float eq_delta; /*! \brief The adaptive equalizer coefficients. */ complexf_t eq_coeff[V27TER_EQUALIZER_LEN]; /*! \brief A saved set of adaptive equalizer coefficients for use after restarts. */ complexf_t eq_coeff_save[V27TER_EQUALIZER_LEN]; /*! \brief The equalizer signal buffer. */ complexf_t eq_buf[V27TER_EQUALIZER_LEN]; /*! \brief A measure of how much mismatch there is between the real constellation, and the decoded symbol positions. */ float training_error; /*! \brief The proportional part of the carrier tracking filter. */ float carrier_track_p; /*! \brief The integral part of the carrier tracking filter. */ float carrier_track_i; /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */ float rrc_filter[V27TER_RX_FILTER_STEPS]; #endif /*! \brief Current offset into the RRC pulse shaping filter buffer. */ int rrc_filter_step; /*! \brief The register for the training and data scrambler. */ uint32_t scramble_reg; /*! \brief A counter for the number of consecutive bits of repeating pattern through the scrambler. */ int scrambler_pattern_count; /*! \brief The current step in the table of BC constellation positions. */ int training_bc; /*! \brief TRUE if the previous trained values are to be reused. */ int old_train; /*! \brief The section of the training data we are currently in. */ int training_stage; /*! \brief A count of how far through the current training step we are. */ int training_count; /*! \brief The value of the last signal sample, using the a simple HPF for signal power estimation. */ int16_t last_sample; /*! \brief >0 if a signal above the minimum is present. It may or may not be a V.27ter signal. */ int signal_present; /*! \brief Whether or not a carrier drop was detected and the signal delivery is pending. */ int carrier_drop_pending; /*! \brief A count of the current consecutive samples below the carrier off threshold. */ int low_samples; /*! \brief A highest magnitude sample seen. */ int16_t high_sample; /*! \brief The position of the current symbol in the constellation, used for differential decoding. */ int constellation_state; /*! \brief The current phase of the carrier (i.e. the DDS parameter). */ uint32_t carrier_phase; /*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */ int32_t carrier_phase_rate; /*! \brief The carrier update rate saved for reuse when using short training. */ int32_t carrier_phase_rate_save; /*! \brief A power meter, to measure the HPF'ed signal power in the channel. */ power_meter_t power; /*! \brief The power meter level at which carrier on is declared. */ int32_t carrier_on_power; /*! \brief The power meter level at which carrier off is declared. */ int32_t carrier_off_power; /*! \brief Current read offset into the equalizer buffer. */ int eq_step; /*! \brief Current write offset into the equalizer buffer. */ int eq_put_step; /*! \brief Symbol counter to the next equalizer update. */ int eq_skip; /*! \brief The current half of the baud. */ int baud_half; /*! \brief Integration variable for damping the Gardner algorithm tests. */ int gardner_integrate; /*! \brief Current step size of Gardner algorithm integration. */ int gardner_step; /*! \brief The total symbol timing correction since the carrier came up. This is only for performance analysis purposes. */ int total_baud_timing_correction; /*! \brief The previous symbol phase angles for the coarse carrier aquisition step. */ int32_t last_angles[2]; /*! \brief History list of phase angle differences for the coarse carrier aquisition step. */ int32_t diff_angles[16]; /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/v27ter_tx.h0000664000175000017500000000745312101406235016041 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/v27ter_tx.h - ITU V.27ter modem transmit part * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_V27TER_TX_H_) #define _SPANDSP_PRIVATE_V27TER_TX_H_ /*! The number of taps in the pulse shaping/bandpass filter */ #define V27TER_TX_FILTER_STEPS 9 /*! V.27ter modem transmit side descriptor. This defines the working state for a single instance of a V.27ter modem transmitter. */ struct v27ter_tx_state_s { /*! \brief The bit rate of the modem. Valid values are 2400 and 4800. */ int bit_rate; /*! \brief The callback function used to get the next bit to be transmitted. */ get_bit_func_t get_bit; /*! \brief A user specified opaque pointer passed to the get_bit function. */ void *get_bit_user_data; /*! \brief The callback function used to report modem status changes. */ modem_status_func_t status_handler; /*! \brief A user specified opaque pointer passed to the status function. */ void *status_user_data; #if defined(SPANDSP_USE_FIXED_POINT) /*! \brief The gain factor needed to achieve the specified output power at 2400bps. */ int32_t gain_2400; /*! \brief The gain factor needed to achieve the specified output power at 4800bps. */ int32_t gain_4800; /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */ complexi16_t rrc_filter[2*V27TER_TX_FILTER_STEPS]; #else /*! \brief The gain factor needed to achieve the specified output power at 2400bps. */ float gain_2400; /*! \brief The gain factor needed to achieve the specified output power at 4800bps. */ float gain_4800; /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */ complexf_t rrc_filter[2*V27TER_TX_FILTER_STEPS]; #endif /*! \brief Current offset into the RRC pulse shaping filter buffer. */ int rrc_filter_step; /*! \brief The register for the training and data scrambler. */ uint32_t scramble_reg; /*! \brief A counter for the number of consecutive bits of repeating pattern through the scrambler. */ int scrambler_pattern_count; /*! \brief TRUE if transmitting the training sequence, or shutting down transmission. FALSE if transmitting user data. */ int in_training; /*! \brief A counter used to track progress through sending the training sequence. */ int training_step; /*! \brief The current phase of the carrier (i.e. the DDS parameter). */ uint32_t carrier_phase; /*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */ int32_t carrier_phase_rate; /*! \brief The current fractional phase of the baud timing. */ int baud_phase; /*! \brief The code number for the current position in the constellation. */ int constellation_state; /*! \brief The get_bit function in use at any instant. */ get_bit_func_t current_get_bit; /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/super_tone_rx.h0000664000175000017500000000343112100772140017061 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/super_tone_rx.h - Flexible telephony supervisory tone detection. * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_SUPER_TONE_RX_H_) #define _SPANDSP_PRIVATE_SUPER_TONE_RX_H_ #define SUPER_TONE_BINS 128 struct super_tone_rx_segment_s { int f1; int f2; int recognition_duration; int min_duration; int max_duration; }; struct super_tone_rx_descriptor_s { int used_frequencies; int monitored_frequencies; int pitches[SUPER_TONE_BINS/2][2]; int tones; super_tone_rx_segment_t **tone_list; int *tone_segs; goertzel_descriptor_t *desc; }; struct super_tone_rx_state_s { super_tone_rx_descriptor_t *desc; float energy; int detected_tone; int rotation; tone_report_func_t tone_callback; tone_segment_func_t segment_callback; void *callback_data; super_tone_rx_segment_t segments[11]; goertzel_state_t state[]; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/g722.h0000664000175000017500000000524511422612265014662 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/g722.h - The ITU G.722 codec. * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Based on a single channel G.722 codec which is: * ***** Copyright (c) CMU 1993 ***** * Computer Science, Speech Group * Chengxiang Lu and Alex Hauptmann */ /*! \file */ #if !defined(_SPANDSP_PRIVATE_G722_H_) #define _SPANDSP_PRIVATE_G722_H_ /*! The per band parameters for both encoding and decoding G.722 */ typedef struct { int16_t nb; int16_t det; int16_t s; int16_t sz; int16_t r; int16_t p[2]; int16_t a[2]; int16_t b[6]; int16_t d[7]; } g722_band_t; /*! G.722 encode state */ struct g722_encode_state_s { /*! TRUE if the operating in the special ITU test mode, with the band split filters disabled. */ int itu_test_mode; /*! TRUE if the G.722 data is packed */ int packed; /*! TRUE if encode from 8k samples/second */ int eight_k; /*! 6 for 48000kbps, 7 for 56000kbps, or 8 for 64000kbps. */ int bits_per_sample; /*! Signal history for the QMF */ int16_t x[12]; int16_t y[12]; int ptr; g722_band_t band[2]; uint32_t in_buffer; int in_bits; uint32_t out_buffer; int out_bits; }; /*! G.722 decode state */ struct g722_decode_state_s { /*! TRUE if the operating in the special ITU test mode, with the band split filters disabled. */ int itu_test_mode; /*! TRUE if the G.722 data is packed */ int packed; /*! TRUE if decode to 8k samples/second */ int eight_k; /*! 6 for 48000kbps, 7 for 56000kbps, or 8 for 64000kbps. */ int bits_per_sample; /*! Signal history for the QMF */ int16_t x[12]; int16_t y[12]; int ptr; g722_band_t band[2]; uint32_t in_buffer; int in_bits; uint32_t out_buffer; int out_bits; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/schedule.h0000664000175000017500000000251111422612265015766 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/schedule.h * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_SCHEDULE_H_) #define _SPANDSP_PRIVATE_SCHEDULE_H_ /*! A scheduled event entry. */ struct span_sched_s { uint64_t when; span_sched_callback_func_t callback; void *user_data; }; /*! A scheduled event queue. */ struct span_sched_state_s { uint64_t ticker; int allocated; int max_to_date; span_sched_t *sched; logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/t38_gateway.h0000664000175000017500000001565411422613736016351 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/t38_gateway.h - A T.38, less the packet exchange part * * Written by Steve Underwood * * Copyright (C) 2005, 2006, 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_PRIVATE_T38_GATEWAY_H_) #define _SPANDSP_PRIVATE_T38_GATEWAY_H_ /*! T.38 gateway T.38 side channel descriptor. */ typedef struct { /*! \brief Core T.38 IFP support */ t38_core_state_t t38; /*! \brief TRUE if the NSF, NSC, and NSS are to be suppressed by altering their contents to something the far end will not recognise. */ int suppress_nsx_len[2]; /*! \brief TRUE if we need to corrupt the HDLC frame in progress, so the receiver cannot interpret it. The two values are for the two directions. */ int corrupt_current_frame[2]; /*! \brief the current class of field being received - i.e. none, non-ECM or HDLC */ int current_rx_field_class; /*! \brief The T.38 indicator currently in use */ int in_progress_rx_indicator; /*! \brief The current T.38 data type being sent. */ int current_tx_data_type; } t38_gateway_t38_state_t; /*! T.38 gateway audio side channel descriptor. */ typedef struct { /*! \brief The FAX modem set for the audio side fo the gateway. */ fax_modems_state_t modems; /*! \brief The current receive signal handler. Actual receiving hops between this and a dummy receive routine. */ span_rx_handler_t *base_rx_handler; span_rx_fillin_handler_t *base_rx_fillin_handler; } t38_gateway_audio_state_t; /*! T.38 gateway T.38 side state. */ typedef struct { /*! \brief non-ECM and HDLC modem receive data buffer. */ uint8_t data[T38_RX_BUF_LEN]; /*! \brief Current pointer into the data buffer. */ int data_ptr; /*! \brief The current octet being received as non-ECM data. */ unsigned int bit_stream; /*! \brief The number of bits taken from the modem for the current scan row. This is used during non-ECM transmission will fill bit removal to see that T.38 packet transmissions do not stretch too far apart. */ int bits_absorbed; /*! \brief The current bit number in the current non-ECM octet. */ int bit_no; /*! \brief Progressively calculated CRC for HDLC messages received from a modem. */ uint16_t crc; /*! \brief TRUE if non-ECM fill bits are to be stripped when sending image data. */ int fill_bit_removal; /*! \brief The number of octets to send in each image packet (non-ECM or ECM) at the current rate and the current specified packet interval. */ int octets_per_data_packet; /*! \brief Bits into the non-ECM buffer */ int in_bits; /*! \brief Octets fed out from the non-ECM buffer */ int out_octets; } t38_gateway_to_t38_state_t; /*! T.38 gateway HDLC buffer. */ typedef struct { /*! \brief HDLC message buffers. */ uint8_t buf[T38_MAX_HDLC_LEN]; /*! \brief HDLC message lengths. */ int len; /*! \brief HDLC message status flags. */ int flags; /*! \brief HDLC buffer contents. */ int contents; } t38_gateway_hdlc_buf_t; /*! T.38 gateway HDLC state. */ typedef struct { /*! \brief HDLC message buffers. */ t38_gateway_hdlc_buf_t buf[T38_TX_HDLC_BUFS]; #if 0 /*! \brief HDLC message buffers. */ uint8_t buf[T38_TX_HDLC_BUFS][T38_MAX_HDLC_LEN]; /*! \brief HDLC message lengths. */ int len[T38_TX_HDLC_BUFS]; /*! \brief HDLC message status flags. */ int flags[T38_TX_HDLC_BUFS]; /*! \brief HDLC buffer contents. */ int contents[T38_TX_HDLC_BUFS]; #endif /*! \brief HDLC buffer number for input. */ int in; /*! \brief HDLC buffer number for output. */ int out; } t38_gateway_hdlc_state_t; /*! T.38 gateway core descriptor. */ typedef struct { /*! \brief A bit mask of the currently supported modem types. */ int supported_modems; /*! \brief TRUE if ECM FAX mode is allowed through the gateway. */ int ecm_allowed; /*! \brief Required time between T.38 transmissions, in ms. */ int ms_per_tx_chunk; /*! \brief TRUE if in image data modem is to use short training. This usually follows image_data_mode, but in ECM mode T.30 defines recovery conditions in which long training is used for image data. */ int short_train; /*! \brief TRUE if in image data mode, as opposed to TCF mode. */ int image_data_mode; /*! \brief The minimum permitted bits per FAX scan line row. */ int min_row_bits; /*! \brief TRUE if we should count the next MCF as a page end, else FALSE */ int count_page_on_mcf; /*! \brief The number of pages for which a confirm (MCF) message was returned. */ int pages_confirmed; /*! \brief TRUE if we are in error correcting (ECM) mode */ int ecm_mode; /*! \brief The current bit rate for the fast modem. */ int fast_bit_rate; /*! \brief The current fast receive modem type. */ int fast_rx_modem; /*! \brief The type of fast receive modem currently active, which may be T38_NONE */ int fast_rx_active; /*! \brief The current timed operation. */ int timed_mode; /*! \brief The number of samples until the next timeout event */ int samples_to_timeout; /*! Buffer for HDLC and non-ECM data going to the T.38 channel */ t38_gateway_to_t38_state_t to_t38; /*! Buffer for data going to an HDLC modem. */ t38_gateway_hdlc_state_t hdlc_to_modem; /*! Buffer for data going to a non-ECM mode modem. */ t38_non_ecm_buffer_state_t non_ecm_to_modem; /*! \brief A pointer to a callback routine to be called when frames are exchanged. */ t38_gateway_real_time_frame_handler_t *real_time_frame_handler; /*! \brief An opaque pointer supplied in real time frame callbacks. */ void *real_time_frame_user_data; } t38_gateway_core_state_t; /*! T.38 gateway state. */ struct t38_gateway_state_s { /*! T.38 side state */ t38_gateway_t38_state_t t38x; /*! Audio side state */ t38_gateway_audio_state_t audio; /*! T.38 core state */ t38_gateway_core_state_t core; /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/fax_modems.h0000664000175000017500000001137712100754672016331 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/fax_modems.h - definitions for the analogue modem set for fax processing * * Written by Steve Underwood * * Copyright (C) 2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_PRIVATE_FAX_MODEMS_H_) #define _SPANDSP_PRIVATE_FAX_MODEMS_H_ /*! The set of modems needed for FAX, plus the auxilliary stuff, like tone generation. */ struct fax_modems_state_s { /*! TRUE is talker echo protection should be sent for the image modems */ int use_tep; /*! If TRUE, transmit silence when there is nothing else to transmit. If FALSE return only the actual generated audio. Note that this only affects untimed silences. Timed silences (e.g. the 75ms silence between V.21 and a high speed modem) will alway be transmitted as silent audio. */ int transmit_on_idle; /*! \brief An HDLC context used when transmitting HDLC messages. */ hdlc_tx_state_t hdlc_tx; /*! \brief An HDLC context used when receiving HDLC messages. */ hdlc_rx_state_t hdlc_rx; /*! \brief A V.21 FSK modem context used when transmitting HDLC over V.21 messages. */ fsk_tx_state_t v21_tx; /*! \brief A V.21 FSK modem context used when receiving HDLC over V.21 messages. */ fsk_rx_state_t v21_rx; struct { /*! \brief A V.17 modem context used when sending FAXes at 7200bps, 9600bps 12000bps or 14400bps */ v17_tx_state_t v17_tx; /*! \brief A V.29 modem context used when receiving FAXes at 7200bps, 9600bps 12000bps or 14400bps */ v17_rx_state_t v17_rx; /*! \brief A V.29 modem context used when sending FAXes at 7200bps or 9600bps */ v29_tx_state_t v29_tx; /*! \brief A V.29 modem context used when receiving FAXes at 7200bps or 9600bps */ v29_rx_state_t v29_rx; /*! \brief A V.27ter modem context used when sending FAXes at 2400bps or 4800bps */ v27ter_tx_state_t v27ter_tx; /*! \brief A V.27ter modem context used when receiving FAXes at 2400bps or 4800bps */ v27ter_rx_state_t v27ter_rx; } fast_modems; /*! \brief Used to insert timed silences. */ silence_gen_state_t silence_gen; /*! \brief CED or CNG generator */ modem_connect_tones_tx_state_t connect_tx; /*! \brief CED or CNG detector */ modem_connect_tones_rx_state_t connect_rx; /*! \brief */ dc_restore_state_t dc_restore; /*! \brief The currently selected receiver type */ int current_rx_type; /*! \brief The currently selected transmitter type */ int current_tx_type; /*! \brief TRUE if a carrier is present. Otherwise FALSE. */ int rx_signal_present; /*! \brief TRUE if a modem has trained correctly. */ int rx_trained; /*! \brief TRUE if an HDLC frame has been received correctly. */ int rx_frame_received; /*! \brief The current receive signal handler */ span_rx_handler_t *rx_handler; /*! \brief The current receive missing signal fill-in handler */ span_rx_fillin_handler_t *rx_fillin_handler; void *rx_user_data; /*! \brief The current transmit signal handler */ span_tx_handler_t *tx_handler; void *tx_user_data; /*! \brief The next transmit signal handler, for two stage transmit operations. E.g. a short silence followed by a modem signal. */ span_tx_handler_t *next_tx_handler; void *next_tx_user_data; /*! \brief The current bit rate of the transmitter. */ int tx_bit_rate; /*! \brief The current bit rate of the receiver. */ int rx_bit_rate; /*! \brief If TRUE, transmission is in progress */ int transmit; /*! \brief Audio logging file handle for received audio. */ int audio_rx_log; /*! \brief Audio logging file handle for transmitted audio. */ int audio_tx_log; /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/v18.h0000664000175000017500000000344511422612265014617 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/v18.h - V.18 text telephony for the deaf. * * Written by Steve Underwood * * Copyright (C) 2004-2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_V18_H_) #define _SPANDSP_PRIVATE_V18_H_ struct v18_state_s { /*! \brief TRUE if we are the calling modem */ int calling_party; int mode; put_msg_func_t put_msg; void *user_data; union { queue_state_t queue; uint8_t buf[QUEUE_STATE_T_SIZE(128)]; } queue; tone_gen_descriptor_t alert_tone_desc; tone_gen_state_t alert_tone_gen; fsk_tx_state_t fsktx; dtmf_tx_state_t dtmftx; async_tx_state_t asynctx; int baudot_tx_shift; int tx_signal_on; int byte_no; fsk_rx_state_t fskrx; dtmf_rx_state_t dtmfrx; int baudot_rx_shift; int consecutive_ones; uint8_t rx_msg[256 + 1]; int rx_msg_len; int bit_pos; int in_progress; /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/super_tone_tx.h0000664000175000017500000000271211422612265017073 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/super_tone_tx.h - Flexible telephony supervisory tone generation. * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_SUPER_TONE_TX_H_) #define _SPANDSP_PRIVATE_SUPER_TONE_TX_H_ struct super_tone_tx_step_s { tone_gen_tone_descriptor_t tone[4]; int tone_on; int length; int cycles; super_tone_tx_step_t *next; super_tone_tx_step_t *nest; }; struct super_tone_tx_state_s { tone_gen_tone_descriptor_t tone[4]; uint32_t phase[4]; int current_position; int level; super_tone_tx_step_t *levels[4]; int cycles[4]; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/tone_generate.h0000664000175000017500000000326211422612265017015 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/tone_generate.h - General telephony tone generation. * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_TONE_GENERATE_H_) #define _SPANDSP_PRIVATE_TONE_GENERATE_H_ struct tone_gen_tone_descriptor_s { int32_t phase_rate; #if defined(SPANDSP_USE_FIXED_POINT) int16_t gain; #else float gain; #endif }; /*! Cadenced multi-tone generator descriptor. */ struct tone_gen_descriptor_s { tone_gen_tone_descriptor_t tone[4]; int duration[4]; int repeat; }; /*! Cadenced multi-tone generator state descriptor. This defines the state of a single working instance of a generator. */ struct tone_gen_state_s { tone_gen_tone_descriptor_t tone[4]; uint32_t phase[4]; int duration[4]; int repeat; int current_section; int current_position; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/image_translate.h0000664000175000017500000000315611422612265017337 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/image_translate.c - Image translation routines for reworking colour * and gray scale images to be bi-level images of an * appropriate size to be FAX compatible. * * Written by Steve Underwood * * Copyright (C) 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_IMAGE_TRANSLATE_H_) #define _SPANDSP_PRIVATE_IMAGE_TRANSLATE_H_ struct image_translate_state_s { int input_format; int input_width; int input_length; int output_width; int output_length; int resize; int bytes_per_pixel; int raw_input_row; int raw_output_row; int output_row; uint8_t *raw_pixel_row[2]; uint8_t *pixel_row[2]; t4_row_read_handler_t row_read_handler; void *row_read_user_data; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/t4_rx.h0000664000175000017500000000550012101033051015214 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/t4_rx.h - definitions for T.4 FAX receive processing * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_T4_RX_H_) #define _SPANDSP_PRIVATE_T4_RX_H_ #define t4_rx_state_s t4_state_s /*! T.4 FAX decompression metadata descriptor. This contains information about the image which may be relevant to the backend, but is not relevant to the image decoding process. */ typedef struct { /*! \brief The vendor of the machine which produced the file. */ const char *vendor; /*! \brief The model of machine which produced the file. */ const char *model; /*! \brief The local ident string. */ const char *local_ident; /*! \brief The remote end's ident string. */ const char *far_ident; /*! \brief The FAX sub-address. */ const char *sub_address; /*! \brief The FAX DCS information, as an ASCII hex string. */ const char *dcs; } t4_rx_metadata_t; /*! TIFF specific state information to go with T.4 compression or decompression handling. */ typedef struct { /*! \brief The current file name. */ const char *file; /*! \brief The libtiff context for the current TIFF file */ TIFF *tiff_file; /* Supporting information, like resolutions, which the backend may want. */ t4_rx_metadata_t metadata; /*! \brief The compression type for output to the TIFF file. */ int32_t output_compression; /*! \brief The TIFF photometric setting for the current page. */ uint16_t photo_metric; /*! \brief The TIFF fill order setting for the current page. */ uint16_t fill_order; /*! \brief The TIFF G3 FAX options. */ int32_t output_t4_options; /*! \brief The number of pages in the current image file. */ int pages_in_file; /*! \brief The first page to transfer. -1 to start at the beginning of the file. */ int start_page; /*! \brief The last page to transfer. -1 to continue to the end of the file. */ int stop_page; } t4_tiff_state_t; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/sig_tone.h0000664000175000017500000001751011422612265016006 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/sig_tone.h - Signalling tone processing for the 2280Hz, 2400Hz, 2600Hz * and similar signalling tones used in older protocols. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_SIG_TONE_H_) #define _SPANDSP_PRIVATE_SIG_TONE_H_ /*! \brief The coefficient set for a pair of cascaded bi-quads that make a signalling notch filter. */ typedef struct { #if defined(SPANDSP_USE_FIXED_POINT) int16_t a1[3]; int16_t b1[3]; int16_t a2[3]; int16_t b2[3]; int postscale; #else float a1[3]; float b1[3]; float a2[3]; float b2[3]; #endif } sig_tone_notch_coeffs_t; /*! \brief The coefficient set for a bi-quad that makes a signalling flat filter. Some signalling tone schemes require such a filter, and some don't. It is termed a flat filter, to distinguish it from the sharp filter, but obviously it is not actually flat. It is a broad band weighting filter. */ typedef struct { #if defined(SPANDSP_USE_FIXED_POINT) /*! \brief Flat mode bandpass bi-quad parameters */ int16_t a[3]; /*! \brief Flat mode bandpass bi-quad parameters */ int16_t b[3]; /*! \brief Post filter scaling */ int postscale; #else /*! \brief Flat mode bandpass bi-quad parameters */ float a[3]; /*! \brief Flat mode bandpass bi-quad parameters */ float b[3]; #endif } sig_tone_flat_coeffs_t; /*! signalling tone descriptor. This defines the working state for a single instance of the transmit and receive sides of a signalling tone processor. */ typedef struct { /*! \brief The tones used. */ int tone_freq[2]; /*! \brief The high and low tone amplitudes for each of the tones, in dBm0. */ int tone_amp[2][2]; /*! \brief The delay, in audio samples, before the high level tone drops to a low level tone. Some signalling protocols require the signalling tone be started at a high level, to ensure crisp initial detection at the receiver, but require the tone amplitude to drop by a number of dBs if it is sustained, to reduce crosstalk levels. */ int high_low_timeout; /*! \brief Some signalling tone detectors use a sharp initial filter, changing to a broader, flatter, filter after some delay. This parameter defines the delay. 0 means it never changes. */ int sharp_flat_timeout; /*! \brief Parameters to control the behaviour of the notch filter, used to remove the tone from the voice path in some protocols. The notch is applied as fast as possible, when the signalling tone is detected. Its removal is delayed by this timeout, to avoid clicky noises from repeated switching of the filter on rapid pulses of signalling tone. */ int notch_lag_time; /*! \brief The tone on persistence check, in audio samples. */ int tone_on_check_time; /*! \brief The tone off persistence check, in audio samples. */ int tone_off_check_time; /*! \brief The number of tones used. */ int tones; /*! \brief The coefficients for the cascaded bi-quads notch filter. */ const sig_tone_notch_coeffs_t *notch[2]; /*! \brief The coefficients for the single bi-quad flat mode filter. */ const sig_tone_flat_coeffs_t *flat; /*! \brief Minimum signalling tone to total power ratio, in dB */ int16_t detection_ratio; /*! \brief Minimum total power for detection in sharp mode, in dB */ int16_t sharp_detection_threshold; /*! \brief Minimum total power for detection in flat mode, in dB */ int16_t flat_detection_threshold; } sig_tone_descriptor_t; /*! Signalling tone transmit state */ struct sig_tone_tx_state_s { /*! \brief The callback function used to handle signalling changes. */ tone_report_func_t sig_update; /*! \brief A user specified opaque pointer passed to the callback function. */ void *user_data; /*! \brief Tone descriptor */ const sig_tone_descriptor_t *desc; /*! The phase rates for the one or two tones */ int32_t phase_rate[2]; /*! The phase accumulators for the one or two tones */ uint32_t phase_acc[2]; /*! The scaling values for the one or two tones, and the high and low level of each tone */ int16_t tone_scaling[2][2]; /*! The sample timer, used to switch between the high and low level tones. */ int high_low_timer; /*! \brief Current transmit tone */ int current_tx_tone; /*! \brief Current transmit timeout */ int current_tx_timeout; /*! \brief Time in current signalling state, in samples. */ int signalling_state_duration; }; /*! Signalling tone receive state */ struct sig_tone_rx_state_s { /*! \brief The callback function used to handle signalling changes. */ tone_report_func_t sig_update; /*! \brief A user specified opaque pointer passed to the callback function. */ void *user_data; /*! \brief Tone descriptor */ const sig_tone_descriptor_t *desc; /*! \brief The current receive tone */ int current_rx_tone; /*! \brief The timeout for switching from the high level to low level tone detector. */ int high_low_timer; /*! \brief ??? */ int current_notch_filter; struct { #if defined(SPANDSP_USE_FIXED_POINT) /*! \brief The z's for the notch filter */ int16_t notch_z1[2]; /*! \brief The z's for the notch filter */ int16_t notch_z2[2]; #else /*! \brief The z's for the notch filter */ float notch_z1[2]; /*! \brief The z's for the notch filter */ float notch_z2[2]; #endif /*! \brief The power output of the notch. */ power_meter_t power; } tone[3]; #if defined(SPANDSP_USE_FIXED_POINT) /*! \brief The z's for the weighting/bandpass filter. */ int16_t flat_z[2]; #else /*! \brief The z's for the weighting/bandpass filter. */ float flat_z[2]; #endif /*! \brief The output power of the flat (unfiltered or flat filtered) path. */ power_meter_t flat_power; /*! \brief Persistence check for tone present */ int tone_persistence_timeout; /*! \brief The tone pattern on the last audio sample */ int last_sample_tone_present; /*! \brief The minimum reading from the power meter for detection in flat mode */ int32_t flat_detection_threshold; /*! \brief The minimum reading from the power meter for detection in sharp mode */ int32_t sharp_detection_threshold; /*! \brief The minimum ratio between notched power and total power for detection */ int32_t detection_ratio; /*! \brief TRUE if in flat mode. FALSE if in sharp mode. */ int flat_mode; /*! \brief TRUE if the notch filter is enabled in the media path */ int notch_enabled; /*! \brief ??? */ int flat_mode_timeout; /*! \brief ??? */ int notch_insertion_timeout; /*! \brief ??? */ int signalling_state; /*! \brief ??? */ int signalling_state_duration; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/hdlc.h0000664000175000017500000001217611422612265015114 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/hdlc.h * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_HDLC_H_) #define _SPANDSP_PRIVATE_HDLC_H_ /*! HDLC receive descriptor. This contains all the state information for an HDLC receiver. */ struct hdlc_rx_state_s { /*! 2 for CRC-16, 4 for CRC-32 */ int crc_bytes; /*! \brief Maximum permitted frame length. */ size_t max_frame_len; /*! \brief The callback routine called to process each good received frame. */ hdlc_frame_handler_t frame_handler; /*! \brief An opaque parameter passed to the frame callback routine. */ void *frame_user_data; /*! \brief The callback routine called to report status changes. */ modem_rx_status_func_t status_handler; /*! \brief An opaque parameter passed to the status callback routine. */ void *status_user_data; /*! \brief TRUE if bad frames are to be reported. */ int report_bad_frames; /*! \brief The number of consecutive flags which must be seen before framing is declared OK. */ int framing_ok_threshold; /*! \brief TRUE if framing OK has been announced. */ int framing_ok_announced; /*! \brief Number of consecutive flags seen so far. */ int flags_seen; /*! \brief The raw (stuffed) bit stream buffer. */ unsigned int raw_bit_stream; /*! \brief The destuffed bit stream buffer. */ unsigned int byte_in_progress; /*! \brief The current number of bits in byte_in_progress. */ int num_bits; /*! \brief TRUE if in octet counting mode (e.g. for MTP). */ int octet_counting_mode; /*! \brief Octet count, to achieve the functionality needed for things like MTP. */ int octet_count; /*! \brief The number of octets to be allowed between octet count reports. */ int octet_count_report_interval; /*! \brief Buffer for a frame in progress. */ uint8_t buffer[HDLC_MAXFRAME_LEN + 4]; /*! \brief Length of a frame in progress. */ size_t len; /*! \brief The number of bytes of good frames received (CRC not included). */ unsigned long int rx_bytes; /*! \brief The number of good frames received. */ unsigned long int rx_frames; /*! \brief The number of frames with CRC errors received. */ unsigned long int rx_crc_errors; /*! \brief The number of too short and too long frames received. */ unsigned long int rx_length_errors; /*! \brief The number of HDLC aborts received. */ unsigned long int rx_aborts; }; /*! HDLC transmit descriptor. This contains all the state information for an HDLC transmitter. */ struct hdlc_tx_state_s { /*! 2 for CRC-16, 4 for CRC-32 */ int crc_bytes; /*! \brief The callback routine called to indicate transmit underflow. */ hdlc_underflow_handler_t underflow_handler; /*! \brief An opaque parameter passed to the callback routine. */ void *user_data; /*! \brief The minimum flag octets to insert between frames. */ int inter_frame_flags; /*! \brief TRUE if frame creation works in progressive mode. */ int progressive; /*! \brief Maximum permitted frame length. */ size_t max_frame_len; /*! \brief The stuffed bit stream being created. */ uint32_t octets_in_progress; /*! \brief The number of bits currently in octets_in_progress. */ int num_bits; /*! \brief The currently rotated state of the flag octet. */ int idle_octet; /*! \brief The number of flag octets to send for a timed burst of flags. */ int flag_octets; /*! \brief The number of abort octets to send for a timed burst of aborts. */ int abort_octets; /*! \brief TRUE if the next underflow of timed flag octets should be reported */ int report_flag_underflow; /*! \brief The current message being transmitted, with its CRC attached. */ uint8_t buffer[HDLC_MAXFRAME_LEN + 4]; /*! \brief The length of the message in the buffer. */ size_t len; /*! \brief The current send position within the buffer. */ size_t pos; /*! \brief The running CRC, as data fills the frame buffer. */ uint32_t crc; /*! \brief The current byte being broken into bits for transmission. */ int byte; /*! \brief The number of bits remaining in byte. */ int bits; /*! \brief TRUE if transmission should end on buffer underflow .*/ int tx_end; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/swept_tone.h0000664000175000017500000000237111422612265016365 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/swept_tone.h - Swept tone generation * * Written by Steve Underwood * * Copyright (C) 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_SWEPT_TONE_H_) #define _SPANDSP_PRIVATE_SWEPT_TONE_H_ struct swept_tone_state_s { int32_t starting_phase_inc; int32_t phase_inc_step; int scale; int duration; int repeating; int pos; int32_t current_phase_inc; uint32_t phase; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/timezone.h0000664000175000017500000000560211435757501016037 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/timezone.h - Timezone handling for time interpretation * * Written by Steve Underwood * * Copyright (C) 2010 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_TIMEZONE_H_) #define _SPANDSP_PRIVATE_TIMEZONE_H_ #define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */ #define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */ #define TZNAME_MAX 255 /* The TZ_MAX_TIMES value below is enough to handle a bit more than a * year's worth of solar time (corrected daily to the nearest second) or * 138 years of Pacific Presidential Election time * (where there are three time zone transitions every fourth year). */ #define TZ_MAX_TIMES 370 #if !defined(NOSOLAR) #define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */ #else /* Must be at least 14 for Europe/Riga as of Jan 12 1995, * as noted by Earl Chew . */ #define TZ_MAX_TYPES 20 /* Maximum number of local time types */ #endif #define TZ_BIGGEST(a, b) (((a) > (b)) ? (a) : (b)) /* Time type information */ struct tz_ttinfo_s { int32_t gmtoff; /* UTC offset in seconds */ int isdst; /* Used to set tm_isdst */ int abbrind; /* Abbreviation list index */ int ttisstd; /* TRUE if transition is std time */ int ttisgmt; /* TRUE if transition is UTC */ }; /* Leap second information */ struct tz_lsinfo_s { time_t trans; /* Transition time */ int32_t corr; /* Correction to apply */ }; struct tz_state_s { int leapcnt; int timecnt; int typecnt; int charcnt; time_t ats[TZ_MAX_TIMES]; uint8_t types[TZ_MAX_TIMES]; struct tz_ttinfo_s ttis[TZ_MAX_TYPES]; char chars[TZ_BIGGEST(TZ_MAX_CHARS + 1, (2*(TZNAME_MAX + 1)))]; struct tz_lsinfo_s lsis[TZ_MAX_LEAPS]; }; struct tz_s { struct tz_state_s state; char lcl_tzname[TZNAME_MAX + 1]; int lcl_is_set; const char *tzname[2]; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/ima_adpcm.h0000664000175000017500000000346411422612265016114 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/ima_adpcm.c - Conversion routines between linear 16 bit PCM data * and IMA/DVI/Intel ADPCM format. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Based on a bit from here, a bit from there, eye of toad, * ear of bat, etc - plus, of course, my own 2 cents. */ #if !defined(_SPANDSP_PRIVATE_IMA_ADPCM_H_) #define _SPANDSP_PRIVATE_IMA_ADPCM_H_ /*! IMA (DVI/Intel) ADPCM conversion state descriptor. This defines the state of a single working instance of the IMA ADPCM converter. This is used for either linear to ADPCM or ADPCM to linear conversion. */ struct ima_adpcm_state_s { int variant; /*! \brief The size of a chunk, in samples. */ int chunk_size; /*! \brief The last state of the ADPCM algorithm. */ int last; /*! \brief Current index into the step size table. */ int step_index; /*! \brief The current IMA code byte in progress. */ uint16_t ima_byte; int bits; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/queue.h0000664000175000017500000000315311422612265015321 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/queue.h - simple in process message queuing * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_QUEUE_H_) #define _SPANDSP_PRIVATE_QUEUE_H_ /*! Queue descriptor. This defines the working state for a single instance of a byte stream or message oriented queue. */ struct queue_state_s { /*! \brief Flags indicating the mode of the queue. */ int flags; /*! \brief The length of the data buffer. */ int len; /*! \brief The buffer input pointer. */ volatile int iptr; /*! \brief The buffer output pointer. */ volatile int optr; #if defined(SPANDSP_FULLY_DEFINE_QUEUE_STATE_T) /*! \brief The data buffer, sized at the time the structure is created. */ uint8_t data[]; #endif }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/t38_core.h0000664000175000017500000001341012100771413015613 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/t38_core.h - An implementation of T.38, less the packet exchange part * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_T38_CORE_H_) #define _SPANDSP_PRIVATE_T38_CORE_H_ /*! Core T.38 state, common to all modes of T.38. */ struct t38_core_state_s { /*! \brief Handler routine to transmit IFP packets generated by the T.38 protocol engine */ t38_tx_packet_handler_t *tx_packet_handler; /*! \brief An opaque pointer passed to tx_packet_handler */ void *tx_packet_user_data; /*! \brief Handler routine to process received indicator packets */ t38_rx_indicator_handler_t *rx_indicator_handler; /*! \brief Handler routine to process received data packets */ t38_rx_data_handler_t *rx_data_handler; /*! \brief Handler routine to process the missing packet condition */ t38_rx_missing_handler_t *rx_missing_handler; /*! \brief An opaque pointer passed to any of the above receive handling routines */ void *rx_user_data; /*! NOTE - Bandwidth reduction shall only be done on suitable Phase C data, i.e., MH, MR and - in the case of transcoding to JBIG - MMR. MMR and JBIG require reliable data transport such as that provided by TCP. When transcoding is selected, it shall be applied to every suitable page in a call. */ /*! \brief Method 1: Local generation of TCF (required for use with TCP). Method 2: Transfer of TCF is required for use with UDP (UDPTL or RTP). Method 2 is not recommended for use with TCP. */ int data_rate_management_method; /*! \brief The emitting gateway may indicate a preference for either UDP/UDPTL, or UDP/RTP, or TCP for transport of T.38 IFP Packets. The receiving device selects the transport protocol. */ int data_transport_protocol; /*! \brief Indicates the capability to remove and insert fill bits in Phase C, non-ECM data to reduce bandwidth in the packet network. */ int fill_bit_removal; /*! \brief Indicates the ability to convert to/from MMR from/to the line format to improve the compression of the data, and reduce the bandwidth, in the packet network. */ int mmr_transcoding; /*! \brief Indicates the ability to convert to/from JBIG to reduce bandwidth. */ int jbig_transcoding; /*! \brief For UDP (UDPTL or RTP) modes, this option indicates the maximum number of octets that can be stored on the remote device before an overflow condition occurs. It is the responsibility of the transmitting application to limit the transfer rate to prevent an overflow. The negotiated data rate should be used to determine the rate at which data is being removed from the buffer. */ int max_buffer_size; /*! \brief This option indicates the maximum size of a UDPTL packet or the maximum size of the payload within an RTP packet that can be accepted by the remote device. */ int max_datagram_size; /*! \brief This is the version number of ITU-T Rec. T.38. New versions shall be compatible with previous versions. */ int t38_version; /*! \brief Allow time for TEP playout */ int allow_for_tep; /*! \brief The fastest data rate supported by the T.38 channel. */ int fastest_image_data_rate; /*! \brief Pace transmission */ int pace_transmission; /*! \brief TRUE if IFP packet sequence numbers are relevant. For some transports, like TPKT over TCP they are not relevent. */ int check_sequence_numbers; /*! \brief The number of times each packet type will be sent (low byte). The depth of redundancy (2nd byte). Higher numbers may increase reliability for UDP transmission. Zero is valid for the indicator packet category, to suppress all indicator packets (typicaly for TCP transmission). */ int category_control[5]; /*! \brief The sequence number for the next packet to be transmitted */ int tx_seq_no; /*! \brief The sequence number expected in the next received packet */ int rx_expected_seq_no; /*! \brief The current receive indicator - i.e. the last indicator received */ int current_rx_indicator; /*! \brief The current receive data type - i.e. the last data type received */ int current_rx_data_type; /*! \brief The current receive field type - i.e. the last field_type received */ int current_rx_field_type; /*! \brief The current transmit indicator - i.e. the last indicator transmitted */ int current_tx_indicator; /*! \brief The bit rate for V.34 operation */ int v34_rate; /*! A count of missing receive packets. This count might not be accurate if the received packet numbers jump wildly. */ int missing_packets; /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/v8.h0000664000175000017500000000444112100754066014533 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/v8.h - V.8 modem negotiation processing. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_V8_H_) #define _SPANDSP_PRIVATE_V8_H_ struct v8_state_s { /*! \brief TRUE if we are the calling party */ int calling_party; /*! \brief A handler to process the V.8 signals */ v8_result_handler_t result_handler; /*! \brief An opaque pointer passed to result_handler */ void *result_handler_user_data; /*! \brief The current state of the V.8 protocol */ int state; int fsk_tx_on; int modem_connect_tone_tx_on; int negotiation_timer; int ci_timer; int ci_count; fsk_tx_state_t v21tx; fsk_rx_state_t v21rx; queue_state_t *tx_queue; modem_connect_tones_tx_state_t ansam_tx; modem_connect_tones_rx_state_t ansam_rx; v8_parms_t parms; v8_parms_t result; /*! \brief The number of modulation bytes to use when sending. */ int modulation_bytes; /* V.8 data parsing */ uint32_t bit_stream; int bit_cnt; /* Indicates the type of message coming up */ int preamble_type; uint8_t rx_data[64]; int rx_data_ptr; /*! \brief a reference copy of the last CM or JM message, used when testing for matches. */ uint8_t cm_jm_data[64]; int cm_jm_len; int got_cm_jm; int got_cj; int zero_byte_count; /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/v29rx.h0000664000175000017500000001776512101406061015173 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/v29rx.h - ITU V.29 modem receive part * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_V29RX_H_) #define _SPANDSP_PRIVATE_V29RX_H_ /* Target length for the equalizer is about 63 taps, to deal with the worst stuff in V.56bis. */ /*! The length of the equalizer buffer */ #define V29_EQUALIZER_LEN 33 /*! Samples before the target position in the equalizer buffer */ #define V29_EQUALIZER_PRE_LEN 16 /*! The number of taps in the pulse shaping/bandpass filter */ #define V29_RX_FILTER_STEPS 27 /*! V.29 modem receive side descriptor. This defines the working state for a single instance of a V.29 modem receiver. */ struct v29_rx_state_s { /*! \brief The bit rate of the modem. Valid values are 4800, 7200 and 9600. */ int bit_rate; /*! \brief The callback function used to put each bit received. */ put_bit_func_t put_bit; /*! \brief A user specified opaque pointer passed to the put_bit routine. */ void *put_bit_user_data; /*! \brief The callback function used to report modem status changes. */ modem_status_func_t status_handler; /*! \brief A user specified opaque pointer passed to the status function. */ void *status_user_data; /*! \brief A callback function which may be enabled to report every symbol's constellation position. */ qam_report_handler_t qam_report; /*! \brief A user specified opaque pointer passed to the qam_report callback routine. */ void *qam_user_data; #if defined(SPANDSP_USE_FIXED_POINT) /*! \brief The scaling factor accessed by the AGC algorithm. */ int16_t agc_scaling; /*! \brief The previous value of agc_scaling, needed to reuse old training. */ int16_t agc_scaling_save; /*! \brief The current delta factor for updating the equalizer coefficients. */ int16_t eq_delta; /*! \brief The adaptive equalizer coefficients. */ complexi16_t eq_coeff[V29_EQUALIZER_LEN]; /*! \brief A saved set of adaptive equalizer coefficients for use after restarts. */ complexi16_t eq_coeff_save[V29_EQUALIZER_LEN]; /*! \brief The equalizer signal buffer. */ complexi16_t eq_buf[V29_EQUALIZER_LEN]; /*! Low band edge filter for symbol sync. */ int32_t symbol_sync_low[2]; /*! High band edge filter for symbol sync. */ int32_t symbol_sync_high[2]; /*! DC filter for symbol sync. */ int32_t symbol_sync_dc_filter[2]; /*! Baud phase for symbol sync. */ int32_t baud_phase; /*! \brief A measure of how much mismatch there is between the real constellation, and the decoded symbol positions. */ float training_error; /*! \brief The proportional part of the carrier tracking filter. */ int32_t carrier_track_p; /*! \brief The integral part of the carrier tracking filter. */ int32_t carrier_track_i; /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */ int16_t rrc_filter[V29_RX_FILTER_STEPS]; #else /*! \brief The scaling factor accessed by the AGC algorithm. */ float agc_scaling; /*! \brief The previous value of agc_scaling, needed to reuse old training. */ float agc_scaling_save; /*! \brief The current delta factor for updating the equalizer coefficients. */ float eq_delta; /*! \brief The adaptive equalizer coefficients. */ complexf_t eq_coeff[V29_EQUALIZER_LEN]; /*! \brief A saved set of adaptive equalizer coefficients for use after restarts. */ complexf_t eq_coeff_save[V29_EQUALIZER_LEN]; /*! \brief The equalizer signal buffer. */ complexf_t eq_buf[V29_EQUALIZER_LEN]; /*! Low band edge filter for symbol sync. */ float symbol_sync_low[2]; /*! High band edge filter for symbol sync. */ float symbol_sync_high[2]; /*! DC filter for symbol sync. */ float symbol_sync_dc_filter[2]; /*! Baud phase for symbol sync. */ float baud_phase; /*! \brief A measure of how much mismatch there is between the real constellation, and the decoded symbol positions. */ float training_error; /*! \brief The proportional part of the carrier tracking filter. */ float carrier_track_p; /*! \brief The integral part of the carrier tracking filter. */ float carrier_track_i; /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */ float rrc_filter[V29_RX_FILTER_STEPS]; #endif /*! \brief Current offset into the RRC pulse shaping filter buffer. */ int rrc_filter_step; /*! \brief The register for the data scrambler. */ uint32_t scramble_reg; /*! \brief The register for the training scrambler. */ uint8_t training_scramble_reg; /*! \brief The current step in the table of CD constellation positions. */ int training_cd; /*! \brief TRUE if the previous trained values are to be reused. */ int old_train; /*! \brief The section of the training data we are currently in. */ int training_stage; /*! \brief A count of how far through the current training step we are. */ int training_count; /*! \brief The value of the last signal sample, using the a simple HPF for signal power estimation. */ int16_t last_sample; /*! \brief >0 if a signal above the minimum is present. It may or may not be a V.29 signal. */ int signal_present; /*! \brief Whether or not a carrier drop was detected and the signal delivery is pending. */ int carrier_drop_pending; /*! \brief A count of the current consecutive samples below the carrier off threshold. */ int low_samples; /*! \brief A highest magnitude sample seen. */ int16_t high_sample; /*! \brief The current phase of the carrier (i.e. the DDS parameter). */ uint32_t carrier_phase; /*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */ int32_t carrier_phase_rate; /*! \brief The carrier update rate saved for reuse when using short training. */ int32_t carrier_phase_rate_save; /*! \brief A power meter, to measure the HPF'ed signal power in the channel. */ power_meter_t power; /*! \brief The power meter level at which carrier on is declared. */ int32_t carrier_on_power; /*! \brief The power meter level at which carrier off is declared. */ int32_t carrier_off_power; /*! \brief Current read offset into the equalizer buffer. */ int eq_step; /*! \brief Current write offset into the equalizer buffer. */ int eq_put_step; /*! \brief Symbol counter to the next equalizer update. */ int eq_skip; /*! \brief The current half of the baud. */ int baud_half; /*! \brief The total symbol timing correction since the carrier came up. This is only for performance analysis purposes. */ int total_baud_timing_correction; /*! \brief Starting phase angles for the coarse carrier aquisition step. */ int32_t start_angles[2]; /*! \brief History list of phase angles for the coarse carrier aquisition step. */ int32_t angles[16]; /*! \brief The position of the current symbol in the constellation, used for differential decoding. */ int constellation_state; /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/silence_gen.h0000664000175000017500000000257112100772201016442 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/silence_gen.c - A silence generator, for inserting timed silences. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_SILENCE_GEN_H_) #define _SPANDSP_PRIVATE_SILENCE_GEN_H_ struct silence_gen_state_s { /*! \brief The callback function used to report status changes. */ modem_status_func_t status_handler; /*! \brief A user specified opaque pointer passed to the status function. */ void *status_user_data; int remaining_samples; int total_samples; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/v17tx.h0000664000175000017500000000773612101406547015200 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/v17tx.h - ITU V.17 modem transmit part * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_PRIVATE_V17TX_H_) #define _SPANDSP_PRIVATE_V17TX_H_ /*! The number of taps in the pulse shaping/bandpass filter */ #define V17_TX_FILTER_STEPS 9 /*! V.17 modem transmit side descriptor. This defines the working state for a single instance of a V.17 modem transmitter. */ struct v17_tx_state_s { /*! \brief The bit rate of the modem. Valid values are 4800, 7200 and 9600. */ int bit_rate; /*! \brief The callback function used to get the next bit to be transmitted. */ get_bit_func_t get_bit; /*! \brief A user specified opaque pointer passed to the get_bit function. */ void *get_bit_user_data; /*! \brief The callback function used to report modem status changes. */ modem_status_func_t status_handler; /*! \brief A user specified opaque pointer passed to the status function. */ void *status_user_data; #if defined(SPANDSP_USE_FIXED_POINT) /*! \brief The gain factor needed to achieve the specified output power. */ int32_t gain; /*! \brief A pointer to the constellation currently in use. */ const complexi16_t *constellation; /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */ complexi16_t rrc_filter[2*V17_TX_FILTER_STEPS]; #else /*! \brief The gain factor needed to achieve the specified output power. */ float gain; /*! \brief A pointer to the constellation currently in use. */ const complexf_t *constellation; /*! \brief The root raised cosine (RRC) pulse shaping filter buffer. */ complexf_t rrc_filter[2*V17_TX_FILTER_STEPS]; #endif /*! \brief Current offset into the RRC pulse shaping filter buffer. */ int rrc_filter_step; /*! \brief The current state of the differential encoder. */ int diff; /*! \brief The current state of the convolutional encoder. */ int convolution; /*! \brief The code number for the current position in the constellation. */ int constellation_state; /*! \brief The register for the data scrambler. */ uint32_t scramble_reg; /*! \brief Scrambler tap */ //int scrambler_tap; /*! \brief TRUE if transmitting the training sequence. FALSE if transmitting user data. */ int in_training; /*! \brief TRUE if the short training sequence is to be used. */ int short_train; /*! \brief A counter used to track progress through sending the training sequence. */ int training_step; /*! \brief The current phase of the carrier (i.e. the DDS parameter). */ uint32_t carrier_phase; /*! \brief The update rate for the phase of the carrier (i.e. the DDS increment). */ int32_t carrier_phase_rate; /*! \brief The current fractional phase of the baud timing. */ int baud_phase; /*! \brief The current number of data bits per symbol. This does not include the redundant bit. */ int bits_per_symbol; /*! \brief The get_bit function in use at any instant. */ get_bit_func_t current_get_bit; /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/t4_t6_decode.h0000664000175000017500000000743211422612265016444 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/t4_t6_decode.h - definitions for T.4/T.6 fax decoding * * Written by Steve Underwood * * Copyright (C) 2003, 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_T4_T6_DECODE_H_) #define _SPANDSP_PRIVATE_T4_T6_DECODE_H_ /*! T.4 1D, T4 2D and T6 decompressor state. */ struct t4_t6_decode_state_s { /*! \brief The type of compression used between the FAX machines. */ //int encoding; /*! \brief Width of the current page, in pixels. */ //int image_width; /*! \brief Callback function to write a row of pixels to the image destination. */ t4_row_write_handler_t row_write_handler; /*! \brief Opaque pointer passed to row_write_handler. */ void *row_write_user_data; /*! \brief A pointer into the image buffer indicating where the last row begins */ int last_row_starts_at; /*! \brief This variable is used to count the consecutive EOLS we have seen. If it reaches six, this is the end of the image. It is initially set to -1 for 1D and 2D decoding, as an indicator that we must wait for the first EOL, before decoding any image data. */ int consecutive_eols; /*! \brief The reference or starting changing element on the coding line. At the start of the coding line, a0 is set on an imaginary white changing element situated just before the first element on the line. During the coding of the coding line, the position of a0 is defined by the previous coding mode. (See T.4/4.2.1.3.2.). */ int a0; /*! \brief The first changing element on the reference line to the right of a0 and of opposite colour to a0. */ int b1; /*! \brief The length of the in-progress run of black or white. */ int run_length; /*! \brief 2D horizontal mode control. */ int black_white; /*! \brief TRUE if the current run is black */ int its_black; /*! \brief The current step into the current row run-lengths buffer. */ int a_cursor; /*! \brief The current step into the reference row run-lengths buffer. */ int b_cursor; /*! \brief Incoming bit buffer for decompression. */ uint32_t rx_bitstream; /*! \brief The number of bits currently in rx_bitstream. */ int rx_bits; /*! \brief The number of bits to be skipped before trying to match the next code word. */ int rx_skip_bits; /*! \brief Decoded pixel buffer. */ //uint32_t pixel_stream; /*! \brief The number of bits currently in pixel_stream. */ //int tx_bits; /*! \brief Current pixel row number. */ //int row; /*! \brief The current number of consecutive bad rows. */ int curr_bad_row_run; /*! \brief The longest run of consecutive bad rows seen in the current page. */ int longest_bad_row_run; /*! \brief The total number of bad rows in the current page. */ int bad_rows; /*! \brief Error and flow logging control */ //logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/dtmf.h0000664000175000017500000000772612100753225015135 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/dtmf.h - DTMF tone generation and detection * * Written by Steve Underwood * * Copyright (C) 2001, 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_DTMF_H_) #define _SPANDSP_PRIVATE_DTMF_H_ /*! DTMF generator state descriptor. This defines the state of a single working instance of a DTMF generator. */ struct dtmf_tx_state_s { tone_gen_state_t tones; float low_level; float high_level; int on_time; int off_time; union { queue_state_t queue; uint8_t buf[QUEUE_STATE_T_SIZE(MAX_DTMF_DIGITS)]; } queue; }; /*! DTMF digit detector descriptor. */ struct dtmf_rx_state_s { /*! Optional callback funcion to deliver received digits. */ digits_rx_callback_t digits_callback; /*! An opaque pointer passed to the callback function. */ void *digits_callback_data; /*! Optional callback funcion to deliver real time digit state changes. */ tone_report_func_t realtime_callback; /*! An opaque pointer passed to the real time callback function. */ void *realtime_callback_data; /*! TRUE if dialtone should be filtered before processing */ int filter_dialtone; #if defined(SPANDSP_USE_FIXED_POINT) /*! 350Hz filter state for the optional dialtone filter. */ float z350[2]; /*! 440Hz filter state for the optional dialtone filter. */ float z440[2]; /*! Maximum acceptable "normal" (lower bigger than higher) twist ratio. */ float normal_twist; /*! Maximum acceptable "reverse" (higher bigger than lower) twist ratio. */ float reverse_twist; /*! Minimum acceptable tone level for detection. */ int32_t threshold; /*! The accumlating total energy on the same period over which the Goertzels work. */ int32_t energy; #else /*! 350Hz filter state for the optional dialtone filter. */ float z350[2]; /*! 440Hz filter state for the optional dialtone filter. */ float z440[2]; /*! Maximum acceptable "normal" (lower bigger than higher) twist ratio. */ float normal_twist; /*! Maximum acceptable "reverse" (higher bigger than lower) twist ratio. */ float reverse_twist; /*! Minimum acceptable tone level for detection. */ float threshold; /*! The accumlating total energy on the same period over which the Goertzels work. */ float energy; #endif /*! Tone detector working states for the row tones. */ goertzel_state_t row_out[4]; /*! Tone detector working states for the column tones. */ goertzel_state_t col_out[4]; /*! The result of the last tone analysis. */ uint8_t last_hit; /*! The confirmed digit we are currently receiving */ uint8_t in_digit; /*! The current sample number within a processing block. */ int current_sample; /*! Tone state duration */ int duration; /*! The number of digits which have been lost due to buffer overflows. */ int lost_digits; /*! The number of digits currently in the digit buffer. */ int current_digits; /*! The received digits buffer. This is a NULL terminated string. */ char digits[MAX_DTMF_DIGITS + 1]; /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/oki_adpcm.h0000664000175000017500000000373011422612265016124 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/oki_adpcm.h - Conversion routines between linear 16 bit PCM data * and OKI (Dialogic) ADPCM format. * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_PRIVATE_OKI_ADPCM_H_) #define _SPANDSP_PRIVATE_OKI_ADPCM_H_ /*! Oki (Dialogic) ADPCM conversion state descriptor. This defines the state of a single working instance of the Oki ADPCM converter. This is used for either linear to ADPCM or ADPCM to linear conversion. */ struct oki_adpcm_state_s { /*! \brief The bit rate - 24000 or 32000. */ int bit_rate; /*! \brief The last state of the ADPCM algorithm. */ int16_t last; /*! \brief Current index into the step size table. */ int16_t step_index; /*! \brief The compressed data byte in progress. */ uint8_t oki_byte; /*! \brief The signal history for the sample rate converter. */ int16_t history[32]; /*! \brief Pointer into the history buffer. */ int ptr; /*! \brief Odd/even sample counter. */ int mark; /*! \brief Phase accumulator for the sample rate converter. */ int phase; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/modem_echo.h0000664000175000017500000000315011422612265016271 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/modem_echo.h - An echo cancellor, suitable for electrical echos in GSTN modems * * Written by Steve Underwood * * Copyright (C) 2001, 2004 Steve Underwood * * Based on a bit from here, a bit from there, eye of toad, * ear of bat, etc - plus, of course, my own 2 cents. * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_PRIVATE_MODEM_ECHO_H_) #define _SPANDSP_PRIVATE_MODEM_ECHO_H_ /*! Modem line echo canceller descriptor. This defines the working state for a line echo canceller. */ struct modem_echo_can_state_s { int adapt; int taps; fir16_state_t fir_state; /*! Echo FIR taps (16 bit version) */ int16_t *fir_taps16; /*! Echo FIR taps (32 bit version) */ int32_t *fir_taps32; int tx_power; int rx_power; int curr_pos; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/ademco_contactid.h0000664000175000017500000000515412101002733017444 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/ademco_contactid.h - Ademco ContactID alarm protocol * * Written by Steve Underwood * * Copyright (C) 2012 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_PRIVATE_ADEMCO_CONTACTID_H_) #define _SPANDSP_PRIVATE_ADEMCO_CONTACTID_H_ struct ademco_contactid_receiver_state_s { ademco_contactid_report_func_t callback; void *callback_user_data; int step; int remaining_samples; uint32_t tone_phase; int32_t tone_phase_rate; int16_t tone_level; dtmf_rx_state_t dtmf; char rx_digits[16 + 1]; int rx_digits_len; /*! \brief Error and flow logging control */ logging_state_t logging; }; struct ademco_contactid_sender_state_s { tone_report_func_t callback; void *callback_user_data; int step; int remaining_samples; dtmf_tx_state_t dtmf; #if defined(SPANDSP_USE_FIXED_POINT) /*! Minimum acceptable tone level for detection. */ int32_t threshold; /*! The accumlating total energy on the same period over which the Goertzels work. */ int32_t energy; #else /*! Minimum acceptable tone level for detection. */ float threshold; /*! The accumlating total energy on the same period over which the Goertzels work. */ float energy; #endif goertzel_state_t tone_1400; goertzel_state_t tone_2300; /*! The current sample number within a processing block. */ int current_sample; /*! \brief A buffer to save the sent message, in case we need to retry. */ char tx_digits[16 + 1]; int tx_digits_len; /*! \brief The number of consecutive retries. */ int tries; int tone_state; int duration; int last_hit; int in_tone; int clear_to_send; int timer; int busy; /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/README0000664000175000017500000000046211074644631014711 00000000000000The header files in this directory should only be used by code tightly integrating itself with the spandsp library to maximise performance. To maximise compatibility with futures revisions of spandsp, most users should avoid using these headers, or probing into the spandsp data structures in other ways.spandsp-0.0.6/src/spandsp/private/noise.h0000664000175000017500000000260511422612265015313 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/noise.h - A low complexity audio noise generator, suitable for * real time generation (current just approx AWGN) * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_PRIVATE_NOISE_H_) #define _SPANDSP_PRIVATE_NOISE_H_ /*! Noise generator descriptor. This contains all the state information for an instance of the noise generator. */ struct noise_state_s { int class_of_noise; int quality; int32_t rms; uint32_t rndnum; int32_t state; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/t31.h0000664000175000017500000001475711422612265014620 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/t31.h - A T.31 compatible class 1 FAX modem interface. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_T31_H_) #define _SPANDSP_PRIVATE_T31_H_ /*! Analogue FAX front end channel descriptor. This defines the state of a single working instance of an analogue line FAX front end. */ typedef struct { fax_modems_state_t modems; //v8_state_t v8; /*! The transmit signal handler to be used when the current one has finished sending. */ span_tx_handler_t *next_tx_handler; void *next_tx_user_data; /*! \brief No of data bits in current_byte. */ int bit_no; /*! \brief The current data byte in progress. */ int current_byte; /*! \brief Rx power meter, used to detect silence. */ power_meter_t rx_power; /*! \brief Last sample, used for an elementary HPF for the power meter. */ int16_t last_sample; /*! \brief The current silence threshold. */ int32_t silence_threshold_power; /*! \brief Samples of silence heard */ int silence_heard; } t31_audio_front_end_state_t; /*! Analogue FAX front end channel descriptor. This defines the state of a single working instance of an analogue line FAX front end. */ typedef struct { /*! \brief Internet Aware FAX mode bit mask. */ int iaf; /*! \brief Required time between T.38 transmissions, in ms. */ int ms_per_tx_chunk; /*! \brief Bit fields controlling the way data is packed into chunked for transmission. */ int chunking_modes; /*! \brief Core T.38 IFP support */ t38_core_state_t t38; /*! \brief The current transmit step being timed */ int timed_step; /*! \brief TRUE is there has been some T.38 data missed */ int rx_data_missing; /*! \brief The number of octets to send in each image packet (non-ECM or ECM) at the current rate and the current specified packet interval. */ int octets_per_data_packet; /*! \brief An HDLC context used when sending HDLC messages to the terminal port (ECM mode support). */ hdlc_tx_state_t hdlc_tx_term; /*! \brief An HDLC context used when receiving HDLC messages from the terminal port. (ECM mode support). */ hdlc_rx_state_t hdlc_rx_term; struct { uint8_t buf[T31_T38_MAX_HDLC_LEN]; int len; } hdlc_rx; struct { /*! \brief The number of extra bits in a fully stuffed version of the contents of the HDLC transmit buffer. This is needed to accurately estimate the playout time for this frame, through an analogue modem. */ int extra_bits; } hdlc_tx; /*! \brief TRUE if we are using ECM mode. This is used to select HDLC faking, necessary with clunky class 1 modems. */ int ecm_mode; /*! \brief Counter for trailing non-ECM bytes, used to flush out the far end's modem. */ int non_ecm_trailer_bytes; /*! \brief The next queued tramsit indicator */ int next_tx_indicator; /*! \brief The current T.38 data type being transmitted */ int current_tx_data_type; /*! \brief The current operating mode of the receiver. */ int current_rx_type; /*! \brief The current operating mode of the transmitter. */ int current_tx_type; /*! \brief Current transmission bit rate. */ int tx_bit_rate; /*! \brief A "sample" count, used to time events. */ int32_t samples; /*! \brief The value for samples at the next transmission point. */ int32_t next_tx_samples; /*! \brief The current receive timeout. */ int32_t timeout_rx_samples; } t31_t38_front_end_state_t; /*! T.31 descriptor. This defines the working state for a single instance of a T.31 FAX modem. */ struct t31_state_s { at_state_t at_state; t31_modem_control_handler_t *modem_control_handler; void *modem_control_user_data; t31_audio_front_end_state_t audio; t31_t38_front_end_state_t t38_fe; /*! TRUE if working in T.38 mode. */ int t38_mode; /*! HDLC buffer, for composing an HDLC frame from the computer to the channel. */ struct { uint8_t buf[T31_MAX_HDLC_LEN]; int len; int ptr; /*! \brief TRUE when the end of HDLC data from the computer has been detected. */ int final; } hdlc_tx; /*! Buffer for data from the computer to the channel. */ struct { uint8_t data[T31_TX_BUF_LEN]; /*! \brief The number of bytes stored in transmit buffer. */ int in_bytes; /*! \brief The number of bytes sent from the transmit buffer. */ int out_bytes; /*! \brief TRUE if the flow of real data has started. */ int data_started; /*! \brief TRUE if holding up further data into the buffer, for flow control. */ int holding; /*! \brief TRUE when the end of non-ECM data from the computer has been detected. */ int final; } tx; /*! TRUE if DLE prefix just used */ int dled; /*! \brief Samples of silence awaited, as specified in a "wait for silence" command */ int silence_awaited; /*! \brief The current bit rate for the FAX fast message transfer modem. */ int bit_rate; /*! \brief TRUE if a valid HDLC frame has been received in the current reception period. */ int rx_frame_received; /*! \brief Samples elapsed in the current call */ int64_t call_samples; int64_t dte_data_timeout; /*! \brief The currently queued modem type. */ int modem; /*! \brief TRUE when short training mode has been selected by the computer. */ int short_train; queue_state_t *rx_queue; /*! \brief Error and flow logging control */ logging_state_t logging; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/private/awgn.h0000664000175000017500000000244311422612265015132 00000000000000/* * SpanDSP - a series of DSP components for telephony * * private/awgn.h - An additive Gaussian white noise generator * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PRIVATE_AWGN_H_) #define _SPANDSP_PRIVATE_AWGN_H_ /*! AWGN generator descriptor. This contains all the state information for an AWGN generator. */ struct awgn_state_s { double rms; long int ix1; long int ix2; long int ix3; double r[98]; double gset; int iset; }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/v27ter_tx.h0000664000175000017500000001512012100763500014355 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v27ter_tx.h - ITU V.27ter modem transmit part * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_V27TER_TX_H_) #define _SPANDSP_V27TER_TX_H_ /*! \page v27ter_tx_page The V.27ter transmitter \section v27ter_tx_page_sec_1 What does it do? The V.27ter transmitter implements the transmit side of a V.27ter modem. This can operate at data rates of 4800 and 2400 bits/s. The audio output is a stream of 16 bit samples, at 8000 samples/second. The transmit and receive side of V.27ter modems operate independantly. V.27ter is used for FAX transmission, where it provides the standard 4800 and 2400 bits/s rates. \section v27ter_tx_page_sec_2 How does it work? V.27ter uses DPSK modulation. A common method of producing a DPSK modulated signal is to use a sampling rate which is a multiple of the baud rate. The raw signal is then a series of complex pulses, each an integer number of samples long. These can be shaped, using a suitable complex filter, and multiplied by a complex carrier signal to produce the final DPSK signal for transmission. The pulse shaping filter for V.27ter is defined in the spec. It is a root raised cosine filter with 50% excess bandwidth. The sampling rate for our transmitter is defined by the channel - 8000 samples/s. This is a multiple of the baud rate at 4800 bits/s (8-PSK at 1600 baud, 5 samples per symbol), but not at 2400 bits/s (4-PSK at 1200 baud, 20/3 samples per symbol). The baud interval is actually 20/3 sample periods at 2400bis/s. A symmetric FIR is used to apply root raised cosine filtering in the 4800bits/s mode. In the 2400bits/s mode a polyphase FIR filter is used. This consists of 20 sets of coefficients, offering zero to 19/20ths of a baud phase shift as well as root raised cosine filtering. The appropriate coefficient set is chosen for each signal sample generated. The carrier is generated using the DDS method. Using 2 second order resonators, started in quadrature, might be more efficient, as it would have less impact on the processor cache than a table lookup approach. However, the DDS approach suits the receiver better, so then same signal generator is also used for the transmitter. */ /*! V.27ter modem transmit side descriptor. This defines the working state for a single instance of a V.27ter modem transmitter. */ typedef struct v27ter_tx_state_s v27ter_tx_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Adjust a V.27ter modem transmit context's power output. \brief Adjust a V.27ter modem transmit context's output power. \param s The modem context. \param power The power level, in dBm0 */ SPAN_DECLARE(void) v27ter_tx_power(v27ter_tx_state_t *s, float power); /*! Initialise a V.27ter modem transmit context. \brief Initialise a V.27ter modem transmit context. \param s The modem context. \param bit_rate The bit rate of the modem. Valid values are 2400 and 4800. \param tep TRUE is the optional TEP tone is to be transmitted. \param get_bit The callback routine used to get the data to be transmitted. \param user_data An opaque pointer. \return A pointer to the modem context, or NULL if there was a problem. */ SPAN_DECLARE(v27ter_tx_state_t *) v27ter_tx_init(v27ter_tx_state_t *s, int bit_rate, int tep, get_bit_func_t get_bit, void *user_data); /*! Reinitialise an existing V.27ter modem transmit context, so it may be reused. \brief Reinitialise an existing V.27ter modem transmit context. \param s The modem context. \param bit_rate The bit rate of the modem. Valid values are 2400 and 4800. \param tep TRUE is the optional TEP tone is to be transmitted. \return 0 for OK, -1 for bad parameter */ SPAN_DECLARE(int) v27ter_tx_restart(v27ter_tx_state_t *s, int bit_rate, int tep); /*! Release a V.27ter modem transmit context. \brief Release a V.27ter modem transmit context. \param s The modem context. \return 0 for OK */ SPAN_DECLARE(int) v27ter_tx_release(v27ter_tx_state_t *s); /*! Free a V.27ter modem transmit context. \brief Free a V.27ter modem transmit context. \param s The modem context. \return 0 for OK */ SPAN_DECLARE(int) v27ter_tx_free(v27ter_tx_state_t *s); /*! Get the logging context associated with a V.27ter modem transmit context. \brief Get the logging context associated with a V.27ter modem transmit context. \param s The modem context. \return A pointer to the logging context */ SPAN_DECLARE(logging_state_t *) v27ter_tx_get_logging_state(v27ter_tx_state_t *s); /*! Change the get_bit function associated with a V.27ter modem transmit context. \brief Change the get_bit function associated with a V.27ter modem transmit context. \param s The modem context. \param get_bit The callback routine used to get the data to be transmitted. \param user_data An opaque pointer. */ SPAN_DECLARE(void) v27ter_tx_set_get_bit(v27ter_tx_state_t *s, get_bit_func_t get_bit, void *user_data); /*! Change the modem status report function associated with a V.27ter modem transmit context. \brief Change the modem status report function associated with a V.27ter modem transmit context. \param s The modem context. \param handler The callback routine used to report modem status changes. \param user_data An opaque pointer. */ SPAN_DECLARE(void) v27ter_tx_set_modem_status_handler(v27ter_tx_state_t *s, modem_status_func_t handler, void *user_data); /*! Generate a block of V.27ter modem audio samples. \brief Generate a block of V.27ter modem audio samples. \param s The modem context. \param amp The audio sample buffer. \param len The number of samples to be generated. \return The number of samples actually generated. */ SPAN_DECLARE_NONSTD(int) v27ter_tx(v27ter_tx_state_t *s, int16_t amp[], int len); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/complex_vector_int.h0000664000175000017500000001033611422612264016426 00000000000000/* * SpanDSP - a series of DSP components for telephony * * complex_vector_int.h * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_COMPLEX_VECTOR_INT_H_) #define _SPANDSP_COMPLEX_VECTOR_INT_H_ #if defined(__cplusplus) extern "C" { #endif static __inline__ void cvec_copyi(complexi_t z[], const complexi_t x[], int n) { memcpy(z, x, n*sizeof(z[0])); } /*- End of function --------------------------------------------------------*/ static __inline__ void cvec_copyi16(complexi16_t z[], const complexi16_t x[], int n) { memcpy(z, x, n*sizeof(z[0])); } /*- End of function --------------------------------------------------------*/ static __inline__ void cvec_copyi32(complexi32_t z[], const complexi32_t x[], int n) { memcpy(z, x, n*sizeof(z[0])); } /*- End of function --------------------------------------------------------*/ static __inline__ void cvec_zeroi(complexi_t z[], int n) { memset(z, 0, n*sizeof(z[0])); } /*- End of function --------------------------------------------------------*/ static __inline__ void cvec_zeroi16(complexi16_t z[], int n) { memset(z, 0, n*sizeof(z[0])); } /*- End of function --------------------------------------------------------*/ static __inline__ void cvec_zeroi32(complexi32_t z[], int n) { memset(z, 0, n*sizeof(z[0])); } /*- End of function --------------------------------------------------------*/ static __inline__ void cvec_seti(complexi_t z[], complexi_t *x, int n) { int i; for (i = 0; i < n; i++) z[i] = *x; } /*- End of function --------------------------------------------------------*/ static __inline__ void cvec_seti16(complexi16_t z[], complexi16_t *x, int n) { int i; for (i = 0; i < n; i++) z[i] = *x; } /*- End of function --------------------------------------------------------*/ static __inline__ void cvec_seti32(complexi32_t z[], complexi32_t *x, int n) { int i; for (i = 0; i < n; i++) z[i] = *x; } /*- End of function --------------------------------------------------------*/ /*! \brief Find the dot product of two complex int16_t vectors. \param x The first vector. \param y The first vector. \param n The number of elements in the vectors. \return The dot product of the two vectors. */ SPAN_DECLARE(complexi32_t) cvec_dot_prodi16(const complexi16_t x[], const complexi16_t y[], int n); /*! \brief Find the dot product of two complex int32_t vectors. \param x The first vector. \param y The first vector. \param n The number of elements in the vectors. \return The dot product of the two vectors. */ SPAN_DECLARE(complexi32_t) cvec_dot_prodi32(const complexi32_t x[], const complexi32_t y[], int n); /*! \brief Find the dot product of two complex int16_t vectors, where the first is a circular buffer with an offset for the starting position. \param x The first vector. \param y The first vector. \param n The number of elements in the vectors. \param pos The starting position in the x vector. \return The dot product of the two vectors. */ SPAN_DECLARE(complexi32_t) cvec_circular_dot_prodi16(const complexi16_t x[], const complexi16_t y[], int n, int pos); SPAN_DECLARE(void) cvec_lmsi16(const complexi16_t x[], complexi16_t y[], int n, const complexi16_t *error); SPAN_DECLARE(void) cvec_circular_lmsi16(const complexi16_t x[], complexi16_t y[], int n, int pos, const complexi16_t *error); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/super_tone_rx.h0000664000175000017500000001634712101220267015420 00000000000000/* * SpanDSP - a series of DSP components for telephony * * super_tone_rx.h - Flexible telephony supervisory tone detection. * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_SUPER_TONE_RX_H_) #define _SPANDSP_SUPER_TONE_RX_H_ /*! \page super_tone_rx_page Supervisory tone detection \section super_tone_rx_page_sec_1 What does it do? The supervisory tone detector may be configured to detect most of the world's telephone supervisory tones - things like ringback, busy, number unobtainable, and so on. \section super_tone_rx_page_sec_2 How does it work? The supervisory tone detector is passed a series of data structures describing the tone patterns - the frequencies and cadencing - of the tones to be searched for. It constructs one or more Goertzel filters to monitor the required tones. If tones are close in frequency a single Goertzel set to the centre of the frequency range will be used. This optimises the efficiency of the detector. The Goertzel filters are applied without applying any special window functional (i.e. they use a rectangular window), so they have a sinc like response. However, for most tone patterns their rejection qualities are adequate. The detector aims to meet the need of the standard call progress tones, to ITU-T E.180/Q.35 (busy, dial, ringback, reorder). Also, the extended tones, to ITU-T E.180, Supplement 2 and EIA/TIA-464-A (recall dial tone, special ringback tone, intercept tone, call waiting tone, busy verification tone, executive override tone, confirmation tone). */ /*! Tone detection indication callback routine */ typedef void (*tone_report_func_t)(void *user_data, int code, int level, int delay); typedef void (*tone_segment_func_t)(void *data, int f1, int f2, int duration); typedef struct super_tone_rx_segment_s super_tone_rx_segment_t; typedef struct super_tone_rx_descriptor_s super_tone_rx_descriptor_t; typedef struct super_tone_rx_state_s super_tone_rx_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Create a new supervisory tone detector descriptor. \param desc The supervisory tone set desciptor. If NULL, the routine will allocate space for a descriptor. \return The supervisory tone set descriptor. */ SPAN_DECLARE(super_tone_rx_descriptor_t *) super_tone_rx_make_descriptor(super_tone_rx_descriptor_t *desc); /*! Free a supervisory tone detector descriptor. \param desc The supervisory tone set desciptor. \return 0 for OK, -1 for fail. */ SPAN_DECLARE(int) super_tone_rx_free_descriptor(super_tone_rx_descriptor_t *desc); /*! Add a new tone pattern to a supervisory tone detector set. \param desc The supervisory tone set descriptor. \return The new tone ID. */ SPAN_DECLARE(int) super_tone_rx_add_tone(super_tone_rx_descriptor_t *desc); /*! Add a new tone pattern element to a tone pattern in a supervisory tone detector. \param desc The supervisory tone set desciptor. \param tone The tone ID within the descriptor. \param f1 Frequency 1 (-1 for a silent period). \param f2 Frequency 2 (-1 for a silent period, or only one frequency). \param min The minimum duration, in ms. \param max The maximum duration, in ms. \return The new number of elements in the tone description. */ SPAN_DECLARE(int) super_tone_rx_add_element(super_tone_rx_descriptor_t *desc, int tone, int f1, int f2, int min, int max); /*! Initialise a supervisory tone detector. \param s The supervisory tone detector context. \param desc The tone descriptor. \param callback The callback routine called to report the valid detection or termination of one of the monitored tones. \param user_data An opaque pointer passed when calling the callback routine. \return The supervisory tone detector context. */ SPAN_DECLARE(super_tone_rx_state_t *) super_tone_rx_init(super_tone_rx_state_t *s, super_tone_rx_descriptor_t *desc, tone_report_func_t callback, void *user_data); /*! Release a supervisory tone detector. \param s The supervisory tone context. \return 0 for OK, -1 for fail. */ SPAN_DECLARE(int) super_tone_rx_release(super_tone_rx_state_t *s); /*! Free a supervisory tone detector. \param s The supervisory tone context. \return 0 for OK, -1 for fail. */ SPAN_DECLARE(int) super_tone_rx_free(super_tone_rx_state_t *s); /*! Define a callback routine to be called to report the valid detection or termination of one of the monitored tones. \param s The supervisory tone context. \param callback The callback routine called to report the valid detection or termination of one of the monitored tones. \param user_data An opaque pointer passed when calling the callback routine. */ SPAN_DECLARE(void) super_tone_rx_tone_callback(super_tone_rx_state_t *s, tone_report_func_t callback, void *user_data); /*! Define a callback routine to be called each time a tone pattern element is complete. This is mostly used when analysing a tone. \param s The supervisory tone context. \param callback The callback routine. */ SPAN_DECLARE(void) super_tone_rx_segment_callback(super_tone_rx_state_t *s, tone_segment_func_t callback); /*! Apply supervisory tone detection processing to a block of audio samples. \brief Apply supervisory tone detection processing to a block of audio samples. \param super The supervisory tone context. \param amp The audio sample buffer. \param samples The number of samples in the buffer. \return The number of samples processed. */ SPAN_DECLARE(int) super_tone_rx(super_tone_rx_state_t *super, const int16_t amp[], int samples); /*! Allow for a missing block of samples to a supervisory tone detector. \brief Allow for a missing block of samples to a supervisory tone detector. \param super The supervisory tone context. \param samples The number of samples to allow for. \return The number of samples processed. */ SPAN_DECLARE(int) super_tone_rx_fillin(super_tone_rx_state_t *s, int samples); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/playout.h0000664000175000017500000001752011422612264014222 00000000000000/* * SpanDSP - a series of DSP components for telephony * * playout.h * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_PLAYOUT_H_) #define _SPANDSP_PLAYOUT_H_ /*! \page playout_page Play-out (jitter buffering) \section playout_page_sec_1 What does it do? The play-out module provides a static or dynamic length buffer for received frames of audio or video data. It's goal is to maximise the receiver's tolerance of jitter in the timing of the received frames. Dynamic buffers are generally good for speech, since they adapt to provide the smallest delay consistent with a low rate of packets arriving too late to be used. For things like FoIP and MoIP, a static length of buffer is normally necessary. Any attempt to elastically change the buffer length would wreck a modem's data flow. */ /* Return codes */ enum { PLAYOUT_OK = 0, PLAYOUT_ERROR, PLAYOUT_EMPTY, PLAYOUT_NOFRAME, PLAYOUT_FILLIN, PLAYOUT_DROP }; /* Frame types */ #define PLAYOUT_TYPE_CONTROL 0 #define PLAYOUT_TYPE_SILENCE 1 #define PLAYOUT_TYPE_SPEECH 2 typedef int timestamp_t; typedef struct playout_frame_s { /*! The actual frame data */ void *data; /*! The type of frame */ int type; /*! The timestamp assigned by the sending end */ timestamp_t sender_stamp; /*! The timespan covered by the data in this frame */ timestamp_t sender_len; /*! The timestamp assigned by the receiving end */ timestamp_t receiver_stamp; /*! Pointer to the next earlier frame */ struct playout_frame_s *earlier; /*! Pointer to the next later frame */ struct playout_frame_s *later; } playout_frame_t; /*! Playout (jitter buffer) descriptor. This defines the working state for a single instance of playout buffering. */ typedef struct { /*! TRUE if the buffer is dynamically sized */ int dynamic; /*! The minimum length (dynamic) or fixed length (static) of the buffer */ int min_length; /*! The maximum length (dynamic) or fixed length (static) of the buffer */ int max_length; /*! The target filter threshold for adjusting dynamic buffering. */ int dropable_threshold; int start; /*! The queued frame list */ playout_frame_t *first_frame; playout_frame_t *last_frame; /*! The free frame pool */ playout_frame_t *free_frames; /*! The total frames input to the buffer, to date. */ int frames_in; /*! The total frames output from the buffer, to date. */ int frames_out; /*! The number of frames received out of sequence. */ int frames_oos; /*! The number of frames which were discarded, due to late arrival. */ int frames_late; /*! The number of frames which were never received. */ int frames_missing; /*! The number of frames trimmed from the stream, due to buffer shrinkage. */ int frames_trimmed; timestamp_t latest_expected; /*! The present jitter adjustment */ timestamp_t current; /*! The sender_stamp of the last speech frame */ timestamp_t last_speech_sender_stamp; /*! The duration of the last speech frame */ timestamp_t last_speech_sender_len; int not_first; /*! The time since the target buffer length was last changed. */ timestamp_t since_last_step; /*! Filter state for tracking the packets arriving just in time */ int32_t state_just_in_time; /*! Filter state for tracking the packets arriving late */ int32_t state_late; /*! The current target length of the buffer */ int target_buffer_length; /*! The current actual length of the buffer, which may lag behind the target value */ int actual_buffer_length; } playout_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Queue a frame \param s The play-out context. \param data The frame data. \param sender_len Length of frame (for voice) in timestamp units. \param sender_stamp Sending end's time stamp. \param receiver_stamp Local time at which packet was received, in timestamp units. \return One of PLAYOUT_OK: Frame queued OK. PLAYOUT_ERROR: Some problem occured - e.g. out of memory. */ SPAN_DECLARE(int) playout_put(playout_state_t *s, void *data, int type, timestamp_t sender_len, timestamp_t sender_stamp, timestamp_t receiver_stamp); /*! Get the next frame. \param s The play-out context. \param frame The frame. \param sender_stamp The sender's timestamp. \return One of PLAYOUT_OK: Suitable frame found. PLAYOUT_DROP: A frame which should be dropped was found (e.g. it arrived too late). The caller should request the same time again when this occurs. PLAYOUT_NOFRAME: There's no frame scheduled for this time. PLAYOUT_FILLIN: Synthetic signal must be generated, as no real data is available for this time (either we need to grow, or there was a lost frame). PLAYOUT_EMPTY: The buffer is empty. */ SPAN_DECLARE(int) playout_get(playout_state_t *s, playout_frame_t *frame, timestamp_t sender_stamp); /*! Unconditionally get the first buffered frame. This may be used to clear out the queue, and free all its contents, before the context is freed. \param s The play-out context. \return The frame, or NULL is the queue is empty. */ SPAN_DECLARE(playout_frame_t *) playout_get_unconditional(playout_state_t *s); /*! Find the current length of the buffer. \param s The play-out context. \return The length of the buffer. */ SPAN_DECLARE(timestamp_t) playout_current_length(playout_state_t *s); /*! Find the time at which the next queued frame is due to play. Note: This value may change backwards as freshly received out of order frames are added to the buffer. \param s The play-out context. \return The next timestamp. */ SPAN_DECLARE(timestamp_t) playout_next_due(playout_state_t *s); /*! Reset an instance of play-out buffering. NOTE: The buffer should be empty before you call this function, otherwise you will leak queued frames, and some internal structures \param s The play-out context. \param min_length Minimum length of the buffer, in samples. \param max_length Maximum length of the buffer, in samples. If this equals min_length, static length buffering is used. */ SPAN_DECLARE(void) playout_restart(playout_state_t *s, int min_length, int max_length); /*! Create a new instance of play-out buffering. \param min_length Minimum length of the buffer, in samples. \param max_length Maximum length of the buffer, in samples. If this equals min_length, static length buffering is used. \return The new context */ SPAN_DECLARE(playout_state_t *) playout_init(int min_length, int max_length); /*! Release an instance of play-out buffering. \param s The play-out context to be releaased \return 0 if OK, else -1 */ SPAN_DECLARE(int) playout_release(playout_state_t *s); /*! Free an instance of play-out buffering. \param s The play-out context to be destroyed \return 0 if OK, else -1 */ SPAN_DECLARE(int) playout_free(playout_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/g722.h0000664000175000017500000001007311422612264013202 00000000000000/* * SpanDSP - a series of DSP components for telephony * * g722.h - The ITU G.722 codec. * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Based on a single channel G.722 codec which is: * ***** Copyright (c) CMU 1993 ***** * Computer Science, Speech Group * Chengxiang Lu and Alex Hauptmann */ /*! \file */ #if !defined(_SPANDSP_G722_H_) #define _SPANDSP_G722_H_ /*! \page g722_page G.722 encoding and decoding \section g722_page_sec_1 What does it do? The G.722 module is a bit exact implementation of the ITU G.722 specification for all three specified bit rates - 64000bps, 56000bps and 48000bps. It passes the ITU tests. To allow fast and flexible interworking with narrow band telephony, the encoder and decoder support an option for the linear audio to be an 8k samples/second stream. In this mode the codec is considerably faster, and still fully compatible with wideband terminals using G.722. \section g722_page_sec_2 How does it work? ???. */ enum { G722_SAMPLE_RATE_8000 = 0x0001, G722_PACKED = 0x0002 }; /*! G.722 encode state */ typedef struct g722_encode_state_s g722_encode_state_t; /*! G.722 decode state */ typedef struct g722_decode_state_s g722_decode_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Initialise an G.722 encode context. \param s The G.722 encode context. \param rate The required bit rate for the G.722 data. The valid rates are 64000, 56000 and 48000. \param options \return A pointer to the G.722 encode context, or NULL for error. */ SPAN_DECLARE(g722_encode_state_t *) g722_encode_init(g722_encode_state_t *s, int rate, int options); /*! Release a G.722 encode context. \param s The G.722 encode context. \return 0 for OK. */ SPAN_DECLARE(int) g722_encode_release(g722_encode_state_t *s); /*! Free a G.722 encode context. \param s The G.722 encode context. \return 0 for OK. */ SPAN_DECLARE(int) g722_encode_free(g722_encode_state_t *s); /*! Encode a buffer of linear PCM data to G.722 \param s The G.722 context. \param g722_data The G.722 data produced. \param amp The audio sample buffer. \param len The number of samples in the buffer. \return The number of bytes of G.722 data produced. */ SPAN_DECLARE(int) g722_encode(g722_encode_state_t *s, uint8_t g722_data[], const int16_t amp[], int len); /*! Initialise an G.722 decode context. \param s The G.722 decode context. \param rate The bit rate of the G.722 data. The valid rates are 64000, 56000 and 48000. \param options \return A pointer to the G.722 decode context, or NULL for error. */ SPAN_DECLARE(g722_decode_state_t *) g722_decode_init(g722_decode_state_t *s, int rate, int options); /*! Release a G.722 decode context. \param s The G.722 decode context. \return 0 for OK. */ SPAN_DECLARE(int) g722_decode_release(g722_decode_state_t *s); /*! Free a G.722 decode context. \param s The G.722 decode context. \return 0 for OK. */ SPAN_DECLARE(int) g722_decode_free(g722_decode_state_t *s); /*! Decode a buffer of G.722 data to linear PCM. \param s The G.722 context. \param amp The audio sample buffer. \param g722_data \param len \return The number of samples returned. */ SPAN_DECLARE(int) g722_decode(g722_decode_state_t *s, int16_t amp[], const uint8_t g722_data[], int len); #if defined(__cplusplus) } #endif #endif spandsp-0.0.6/src/spandsp/saturated.h0000664000175000017500000002145711422612264014525 00000000000000/* * SpanDSP - a series of DSP components for telephony * * saturated.h - General saturated arithmetic routines. * * Written by Steve Underwood * * Copyright (C) 2001, 2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_SATURATED_H_) #define _SPANDSP_SATURATED_H_ /*! \page saturated_page Saturated arithmetic \section saturated_page_sec_1 What does it do? \section saturated_page_sec_2 How does it work? */ #if defined(__cplusplus) extern "C" { #endif /* This is the same as saturate16(), but is here for historic reasons */ static __inline__ int16_t saturate(int32_t amp) { int16_t amp16; /* Hopefully this is optimised for the common case - not clipping */ amp16 = (int16_t) amp; if (amp == amp16) return amp16; if (amp > INT16_MAX) return INT16_MAX; return INT16_MIN; } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t saturate16(int32_t amp) { int16_t amp16; /* Hopefully this is optimised for the common case - not clipping */ amp16 = (int16_t) amp; if (amp == amp16) return amp16; if (amp > INT16_MAX) return INT16_MAX; return INT16_MIN; } /*- End of function --------------------------------------------------------*/ /*! Saturate to 15 bits, rather than the usual 16 bits. This is often a useful function. */ static __inline__ int16_t saturate15(int32_t amp) { if (amp > 16383) return 16383; if (amp < -16384) return -16384; return (int16_t) amp; } /*- End of function --------------------------------------------------------*/ static __inline__ uint16_t saturateu16(int32_t amp) { uint16_t amp16; /* Hopefully this is optimised for the common case - not clipping */ amp16 = (uint16_t) amp; if (amp == amp16) return amp16; if (amp > UINT16_MAX) return UINT16_MAX; return 0; } /*- End of function --------------------------------------------------------*/ static __inline__ uint8_t saturateu8(int32_t amp) { uint8_t amp8; /* Hopefully this is optimised for the common case - not clipping */ amp8 = (uint8_t) amp; if (amp == amp8) return amp8; if (amp > UINT8_MAX) return UINT8_MAX; return 0; } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t fsaturatef(float famp) { if (famp > (float) INT16_MAX) return INT16_MAX; if (famp < (float) INT16_MIN) return INT16_MIN; return (int16_t) lrintf(famp); } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t fsaturate(double damp) { if (damp > (double) INT16_MAX) return INT16_MAX; if (damp < (double) INT16_MIN) return INT16_MIN; return (int16_t) lrint(damp); } /*- End of function --------------------------------------------------------*/ /* Saturate to a 16 bit integer, using the fastest float to int conversion */ static __inline__ int16_t ffastsaturatef(float famp) { if (famp > (float) INT16_MAX) return INT16_MAX; if (famp < (float) INT16_MIN) return INT16_MIN; return (int16_t) lfastrintf(famp); } /*- End of function --------------------------------------------------------*/ /* Saturate to a 16 bit integer, using the fastest double to int conversion */ static __inline__ int16_t ffastsaturate(double damp) { if (damp > (double) INT16_MAX) return INT16_MAX; if (damp < (double) INT16_MIN) return INT16_MIN; return (int16_t) lfastrint(damp); } /*- End of function --------------------------------------------------------*/ /* Saturate to a 16 bit integer, using the closest float to int conversion */ static __inline__ float ffsaturatef(float famp) { if (famp > (float) INT16_MAX) return (float) INT16_MAX; if (famp < (float) INT16_MIN) return (float) INT16_MIN; return famp; } /*- End of function --------------------------------------------------------*/ /* Saturate to a 16 bit integer, using the closest double to int conversion */ static __inline__ double ffsaturate(double famp) { if (famp > (double) INT16_MAX) return (double) INT16_MAX; if (famp < (double) INT16_MIN) return (double) INT16_MIN; return famp; } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t saturated_add16(int16_t a, int16_t b) { #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) __asm__ __volatile__( " addw %2,%0;\n" " jno 0f;\n" " movw $0x7fff,%0;\n" " adcw $0,%0;\n" "0:" : "=r" (a) : "0" (a), "ir" (b) : "cc" ); return a; #elif defined(__GNUC__) && defined(__arm5__) int16_t result; __asm__ __volatile__( " sadd16 %0,%1,%2;\n" : "=r" (result) : "0" (a), "ir" (b) ); return result; #else return saturate((int32_t) a + (int32_t) b); #endif } /*- End of function --------------------------------------------------------*/ static __inline__ int32_t saturated_add32(int32_t a, int32_t b) { #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) __asm__ __volatile__( " addl %2,%0;\n" " jno 0f;\n" " movl $0x7fffffff,%0;\n" " adcl $0,%0;\n" "0:" : "=r" (a) : "0" (a), "ir" (b) : "cc" ); return a; #elif defined(__GNUC__) && defined(__arm5__) int32_t result; __asm__ __volatile__( " qadd %0,%1,%2;\n" : "=r" (result) : "0" (a), "ir" (b) ); return result; #else int32_t sum; sum = a + b; if ((a ^ b) >= 0) { if ((sum ^ a) < 0) sum = (a < 0) ? INT32_MIN : INT32_MAX; } return sum; #endif } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t saturated_sub16(int16_t a, int16_t b) { #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) __asm__ __volatile__( " subw %2,%0;\n" " jno 0f;\n" " movw $0x8000,%0;\n" " sbbw $0,%0;\n" "0:" : "=r" (a) : "0" (a), "ir" (b) : "cc" ); return a; #elif defined(__GNUC__) && defined(__arm5__) int16_t result; __asm__ __volatile__( " ssub16 %0,%1,%2;\n" : "=r" (result) : "0" (a), "ir" (b) ); return result; #else return saturate((int32_t) a - (int32_t) b); #endif } /*- End of function --------------------------------------------------------*/ static __inline__ int32_t saturated_sub32(int32_t a, int32_t b) { #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) __asm__ __volatile__( " subl %2,%0;\n" " jno 0f;\n" " movl $0x80000000,%0;\n" " sbbl $0,%0;\n" "0:" : "=r" (a) : "0" (a), "ir" (b) : "cc" ); return a; #elif defined(__GNUC__) && defined(__arm5__) int32_t result; __asm__ __volatile__( " qsub %0,%1,%2;\n" : "=r" (result) : "0" (a), "ir" (b) ); return result; #else int32_t diff; diff = a - b; if ((a ^ b) < 0) { if ((diff ^ a) & INT32_MIN) diff = (a < 0L) ? INT32_MIN : INT32_MAX; } return diff; #endif } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t saturated_mul16(int16_t a, int16_t b) { if (a == INT16_MIN && b == INT16_MIN) return INT16_MAX; /*endif*/ return (int16_t) (((int32_t) a*(int32_t) b) >> 15); } /*- End of function --------------------------------------------------------*/ static __inline__ int32_t saturated_mul16_32(int16_t a, int16_t b) { return ((int32_t) a*(int32_t) b) << 1; } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t saturated_abs16(int16_t a) { return (a == INT16_MIN) ? INT16_MAX : (int16_t) abs(a); } /*- End of function --------------------------------------------------------*/ #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/schedule.h0000664000175000017500000000406311422612264014317 00000000000000/* * SpanDSP - a series of DSP components for telephony * * schedule.h * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page schedule_page Scheduling \section schedule_page_sec_1 What does it do? ???. \section schedule_page_sec_2 How does it work? ???. */ #if !defined(_SPANDSP_SCHEDULE_H_) #define _SPANDSP_SCHEDULE_H_ /*! A scheduled event entry. */ typedef struct span_sched_s span_sched_t; /*! A scheduled event queue. */ typedef struct span_sched_state_s span_sched_state_t; typedef void (*span_sched_callback_func_t)(span_sched_state_t *s, void *user_data); #if defined(__cplusplus) extern "C" { #endif SPAN_DECLARE(uint64_t) span_schedule_next(span_sched_state_t *s); SPAN_DECLARE(uint64_t) span_schedule_time(span_sched_state_t *s); SPAN_DECLARE(int) span_schedule_event(span_sched_state_t *s, int us, span_sched_callback_func_t function, void *user_data); SPAN_DECLARE(void) span_schedule_update(span_sched_state_t *s, int us); SPAN_DECLARE(void) span_schedule_del(span_sched_state_t *s, int id); SPAN_DECLARE(span_sched_state_t *) span_schedule_init(span_sched_state_t *s); SPAN_DECLARE(int) span_schedule_release(span_sched_state_t *s); SPAN_DECLARE(int) span_schedule_free(span_sched_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/t38_gateway.h0000664000175000017500000002275611422612264014673 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t38_gateway.h - A T.38, less the packet exchange part * * Written by Steve Underwood * * Copyright (C) 2005, 2006, 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_T38_GATEWAY_H_) #define _SPANDSP_T38_GATEWAY_H_ /*! \page t38_gateway_page T.38 real time FAX over IP PSTN gateway \section t38_gateway_page_sec_1 What does it do? The T.38 gateway facility provides a robust interface between T.38 IP packet streams and and 8k samples/second audio streams. It provides the buffering and flow control features needed to maximum the tolerance of jitter and packet loss on the IP network. \section t38_gateway_page_sec_2 How does it work? */ /*! The receive buffer length */ #define T38_RX_BUF_LEN 2048 /*! The number of HDLC transmit buffers */ #define T38_TX_HDLC_BUFS 256 /*! The maximum length of an HDLC frame buffer. This must be big enough for ECM frames. */ #define T38_MAX_HDLC_LEN 260 typedef struct t38_gateway_state_s t38_gateway_state_t; /*! T.30 real time frame handler. \brief T.30 real time frame handler. \param s The T.30 context. \param user_data An opaque pointer. \param direction TRUE for incoming, FALSE for outgoing. \param msg The HDLC message. \param len The length of the message. */ typedef void (t38_gateway_real_time_frame_handler_t)(t38_gateway_state_t *s, void *user_data, int direction, const uint8_t *msg, int len); /*! T.38 gateway results. */ typedef struct { /*! \brief The current bit rate for image transfer. */ int bit_rate; /*! \brief TRUE if error correcting mode is used. */ int error_correcting_mode; /*! \brief The number of pages transferred so far. */ int pages_transferred; } t38_stats_t; #if defined(__cplusplus) extern "C" { #endif /*! \brief Initialise a gateway mode T.38 context. \param s The T.38 context. \param tx_packet_handler A callback routine to encapsulate and transmit T.38 packets. \param tx_packet_user_data An opaque pointer passed to the tx_packet_handler routine. \return A pointer to the termination mode T.38 context, or NULL if there was a problem. */ SPAN_DECLARE(t38_gateway_state_t *) t38_gateway_init(t38_gateway_state_t *s, t38_tx_packet_handler_t *tx_packet_handler, void *tx_packet_user_data); /*! Release a gateway mode T.38 context. \brief Release a T.38 context. \param s The T.38 context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t38_gateway_release(t38_gateway_state_t *s); /*! Free a gateway mode T.38 context. \brief Free a T.38 context. \param s The T.38 context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t38_gateway_free(t38_gateway_state_t *s); /*! Process a block of received FAX audio samples. \brief Process a block of received FAX audio samples. \param s The T.38 context. \param amp The audio sample buffer. \param len The number of samples in the buffer. \return The number of samples unprocessed. */ SPAN_DECLARE_NONSTD(int) t38_gateway_rx(t38_gateway_state_t *s, int16_t amp[], int len); /*! Apply fake processing when a block of audio samples is missing (e.g due to packet loss). \brief Apply fake received audio processing. \param s The T.38 context. \param len The number of samples to fake. \return The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call. */ SPAN_DECLARE_NONSTD(int) t38_gateway_rx_fillin(t38_gateway_state_t *s, int len); /*! Generate a block of FAX audio samples. \brief Generate a block of FAX audio samples. \param s The T.38 context. \param amp The audio sample buffer. \param max_len The number of samples to be generated. \return The number of samples actually generated. */ SPAN_DECLARE_NONSTD(int) t38_gateway_tx(t38_gateway_state_t *s, int16_t amp[], int max_len); /*! Control whether error correcting mode (ECM) is allowed. \brief Control whether error correcting mode (ECM) is allowed. \param s The T.38 context. \param ecm_allowed TRUE is ECM is to be allowed. */ SPAN_DECLARE(void) t38_gateway_set_ecm_capability(t38_gateway_state_t *s, int ecm_allowed); /*! Select whether silent audio will be sent when transmit is idle. \brief Select whether silent audio will be sent when transmit is idle. \param s The T.38 context. \param transmit_on_idle TRUE if silent audio should be output when the FAX transmitter is idle. FALSE to transmit zero length audio when the FAX transmitter is idle. The default behaviour is FALSE. */ SPAN_DECLARE(void) t38_gateway_set_transmit_on_idle(t38_gateway_state_t *s, int transmit_on_idle); /*! Specify which modem types are supported by a T.30 context. \brief Specify supported modems. \param s The T.38 context. \param supported_modems Bit field list of the supported modems. */ SPAN_DECLARE(void) t38_gateway_set_supported_modems(t38_gateway_state_t *s, int supported_modems); /*! Select whether NSC, NSF, and NSS should be suppressed. It selected, the contents of these messages are forced to zero for all octets beyond the message type. This makes them look like manufacturer specific messages, from a manufacturer which does not exist. \brief Select whether NSC, NSF, and NSS should be suppressed. \param s The T.38 context. \param from_t38 A string of bytes to overwrite the header of any NSC, NSF, and NSS frames passing through the gateway from T.38 the the modem. \param from_t38_len The length of the overwrite string. \param from_modem A string of bytes to overwrite the header of any NSC, NSF, and NSS frames passing through the gateway from the modem to T.38. \param from_modem_len The length of the overwrite string. */ SPAN_DECLARE(void) t38_gateway_set_nsx_suppression(t38_gateway_state_t *s, const uint8_t *from_t38, int from_t38_len, const uint8_t *from_modem, int from_modem_len); /*! Select whether talker echo protection tone will be sent for the image modems. \brief Select whether TEP will be sent for the image modems. \param s The T.38 context. \param use_tep TRUE if TEP should be sent. */ SPAN_DECLARE(void) t38_gateway_set_tep_mode(t38_gateway_state_t *s, int use_tep); /*! Select whether non-ECM fill bits are to be removed during transmission. \brief Select whether non-ECM fill bits are to be removed during transmission. \param s The T.38 context. \param remove TRUE if fill bits are to be removed. */ SPAN_DECLARE(void) t38_gateway_set_fill_bit_removal(t38_gateway_state_t *s, int remove); /*! Get the current transfer statistics for the current T.38 session. \brief Get the current transfer statistics. \param s The T.38 context. \param t A pointer to a buffer for the statistics. */ SPAN_DECLARE(void) t38_gateway_get_transfer_statistics(t38_gateway_state_t *s, t38_stats_t *t); /*! Get a pointer to the T.38 core IFP packet engine associated with a gateway mode T.38 context. \brief Get a pointer to the T.38 core IFP packet engine associated with a T.38 context. \param s The T.38 context. \return A pointer to the T.38 core context, or NULL. */ SPAN_DECLARE(t38_core_state_t *) t38_gateway_get_t38_core_state(t38_gateway_state_t *s); /*! Get a pointer to the logging context associated with a T.38 context. \brief Get a pointer to the logging context associated with a T.38 context. \param s The T.38 context. \return A pointer to the logging context, or NULL. */ SPAN_DECLARE(logging_state_t *) t38_gateway_get_logging_state(t38_gateway_state_t *s); /*! Set a callback function for T.30 frame exchange monitoring. This is called from the heart of the signal processing, so don't take too long in the handler routine. \brief Set a callback function for T.30 frame exchange monitoring. \param s The T.30 context. \param handler The callback function. \param user_data An opaque pointer passed to the callback function. */ SPAN_DECLARE(void) t38_gateway_set_real_time_frame_handler(t38_gateway_state_t *s, t38_gateway_real_time_frame_handler_t *handler, void *user_data); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/plc.h0000664000175000017500000001720211422612264013300 00000000000000/* * SpanDSP - a series of DSP components for telephony * * plc.h * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_PLC_H_) #define _SPANDSP_PLC_H_ /*! \page plc_page Packet loss concealment \section plc_page_sec_1 What does it do? The packet loss concealment module provides a synthetic fill-in signal, to minimise the audible effect of lost packets in VoIP applications. It is not tied to any particular codec, and could be used with almost any codec which does not specify its own procedure for packet loss concealment. Where a codec specific concealment procedure exists, that algorithm is usually built around knowledge of the characteristics of the particular codec. It will, therefore, generally give better results for that particular codec than this generic concealer will. The PLC code implements an algorithm similar to the one described in Appendix 1 of G.711. However, the G.711 algorithm is optimised for 10ms packets. Few people use such small packets. 20ms is a much more common value, and longer packets are also quite common. The algorithm has been adjusted with this in mind. Also, the G.711 approach causes an algorithmic delay, and requires significant buffer manipulation when there is no packet loss. The algorithm used here avoids this. It causes no delay, and achieves comparable quality with normal speech. Note that both this algorithm, and the one in G.711 are optimised for speech. For most kinds of music a much slower decay on bursts of lost packets give better results. \section plc_page_sec_2 How does it work? While good packets are being received, the plc_rx() routine keeps a record of the trailing section of the known speech signal. If a packet is missed, plc_fillin() is called to produce a synthetic replacement for the real speech signal. The average mean difference function (AMDF) is applied to the last known good signal, to determine its effective pitch. Based on this, the last pitch period of signal is saved. Essentially, this cycle of speech will be repeated over and over until the real speech resumes. However, several refinements are needed to obtain smooth pleasant sounding results. - The two ends of the stored cycle of speech will not always fit together smoothly. This can cause roughness, or even clicks, at the joins between cycles. To soften this, the 1/4 pitch period of real speech preceeding the cycle to be repeated is blended with the last 1/4 pitch period of the cycle to be repeated, using an overlap-add (OLA) technique (i.e. in total, the last 5/4 pitch periods of real speech are used). - The start of the synthetic speech will not always fit together smoothly with the tail of real speech passed on before the erasure was identified. Ideally, we would like to modify the last 1/4 pitch period of the real speech, to blend it into the synthetic speech. However, it is too late for that. We could have delayed the real speech a little, but that would require more buffer manipulation, and hurt the efficiency of the no-lost-packets case (which we hope is the dominant case). Instead we use a degenerate form of OLA to modify the start of the synthetic data. The last 1/4 pitch period of real speech is time reversed, and OLA is used to blend it with the first 1/4 pitch period of synthetic speech. The result seems quite acceptable. - As we progress into the erasure, the chances of the synthetic signal being anything like correct steadily fall. Therefore, the volume of the synthesized signal is made to decay linearly, such that after 50ms of missing audio it is reduced to silence. - When real speech resumes, an extra 1/4 pitch period of synthetic speech is blended with the start of the real speech. If the erasure is small, this smoothes the transition. If the erasure is long, and the synthetic signal has faded to zero, the blending softens the start up of the real signal, avoiding a kind of "click" or "pop" effect that might occur with a sudden onset. \section plc_page_sec_3 How do I use it? Before audio is processed, call plc_init() to create an instance of the packet loss concealer. For each received audio packet that is acceptable (i.e. not including those being dropped for being too late) call plc_rx() to record the content of the packet. Note this may modify the packet a little after a period of packet loss, to blend real synthetic data smoothly. When a real packet is not available in time, call plc_fillin() to create a sythetic substitute. That's it! */ /*! Minimum allowed pitch (66 Hz) */ #define PLC_PITCH_MIN 120 /*! Maximum allowed pitch (200 Hz) */ #define PLC_PITCH_MAX 40 /*! Maximum pitch OLA window */ #define PLC_PITCH_OVERLAP_MAX (PLC_PITCH_MIN >> 2) /*! The length over which the AMDF function looks for similarity (20 ms) */ #define CORRELATION_SPAN 160 /*! History buffer length. The buffer much also be at leat 1.25 times PLC_PITCH_MIN, but that is much smaller than the buffer needs to be for the pitch assessment. */ #define PLC_HISTORY_LEN (CORRELATION_SPAN + PLC_PITCH_MIN) /*! The generic packet loss concealer context. */ typedef struct { /*! Consecutive erased samples */ int missing_samples; /*! Current offset into pitch period */ int pitch_offset; /*! Pitch estimate */ int pitch; /*! Buffer for a cycle of speech */ float pitchbuf[PLC_PITCH_MIN]; /*! History buffer */ int16_t history[PLC_HISTORY_LEN]; /*! Current pointer into the history buffer */ int buf_ptr; } plc_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Process a block of received audio samples for PLC. \brief Process a block of received audio samples for PLC. \param s The packet loss concealer context. \param amp The audio sample buffer. \param len The number of samples in the buffer. \return The number of samples in the buffer. */ SPAN_DECLARE(int) plc_rx(plc_state_t *s, int16_t amp[], int len); /*! Fill-in a block of missing audio samples. \brief Fill-in a block of missing audio samples. \param s The packet loss concealer context. \param amp The audio sample buffer. \param len The number of samples to be synthesised. \return The number of samples synthesized. */ SPAN_DECLARE(int) plc_fillin(plc_state_t *s, int16_t amp[], int len); /*! Initialise a packet loss concealer context. \brief Initialise a PLC context. \param s The packet loss concealer context. \return A pointer to the the packet loss concealer context. */ SPAN_DECLARE(plc_state_t *) plc_init(plc_state_t *s); /*! Release a packet loss concealer context. \param s The packet loss concealer context. \return 0 for OK. */ SPAN_DECLARE(int) plc_release(plc_state_t *s); /*! Free a packet loss concealer context. \param s The packet loss concealer context. \return 0 for OK. */ SPAN_DECLARE(int) plc_free(plc_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/fax_modems.h0000664000175000017500000000760112343632503014647 00000000000000/* * SpanDSP - a series of DSP components for telephony * * fax_modems.h - definitions for the analogue modem set for fax processing * * Written by Steve Underwood * * Copyright (C) 2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_FAX_MODEMS_H_) #define _SPANDSP_FAX_MODEMS_H_ enum { FAX_MODEM_NONE = -1, FAX_MODEM_FLUSH = 0, FAX_MODEM_SILENCE_TX, FAX_MODEM_SILENCE_RX, FAX_MODEM_CED_TONE, FAX_MODEM_CNG_TONE, FAX_MODEM_NOCNG_TONE, FAX_MODEM_V21_TX, FAX_MODEM_V17_TX, FAX_MODEM_V27TER_TX, FAX_MODEM_V29_TX, FAX_MODEM_V21_RX, FAX_MODEM_V17_RX, FAX_MODEM_V27TER_RX, FAX_MODEM_V29_RX }; /*! The set of modems needed for FAX, plus the auxilliary stuff, like tone generation. */ typedef struct fax_modems_state_s fax_modems_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Convert a FAX modem type to a short text description. \brief Convert a FAX modem type to a short text description. \param modem The modem code. \return A pointer to the description. */ SPAN_DECLARE(const char *) fax_modem_to_str(int modem); /* N.B. the following are currently a work in progress */ SPAN_DECLARE_NONSTD(int) fax_modems_v17_v21_rx(void *user_data, const int16_t amp[], int len); SPAN_DECLARE_NONSTD(int) fax_modems_v27ter_v21_rx(void *user_data, const int16_t amp[], int len); SPAN_DECLARE_NONSTD(int) fax_modems_v29_v21_rx(void *user_data, const int16_t amp[], int len); SPAN_DECLARE_NONSTD(int) fax_modems_v17_v21_rx_fillin(void *user_data, int len); SPAN_DECLARE_NONSTD(int) fax_modems_v27ter_v21_rx_fillin(void *user_data, int len); SPAN_DECLARE_NONSTD(int) fax_modems_v29_v21_rx_fillin(void *user_data, int len); SPAN_DECLARE_NONSTD(void) fax_modems_hdlc_tx_frame(void *user_data, const uint8_t *msg, int len); SPAN_DECLARE(void) fax_modems_start_rx_modem(fax_modems_state_t *s, int which); SPAN_DECLARE(void) fax_modems_set_tep_mode(fax_modems_state_t *s, int use_tep); SPAN_DECLARE(int) fax_modems_restart(fax_modems_state_t *s); /*! Get a pointer to the logging context associated with a FAX modems context. \brief Get a pointer to the logging context associated with a FAX modems context. \param s The FAX modems context. \return A pointer to the logging context, or NULL. */ SPAN_DECLARE(logging_state_t *) fax_modems_get_logging_state(fax_modems_state_t *s); SPAN_DECLARE(fax_modems_state_t *) fax_modems_init(fax_modems_state_t *s, int use_tep, hdlc_frame_handler_t hdlc_accept, hdlc_underflow_handler_t hdlc_tx_underflow, put_bit_func_t non_ecm_put_bit, get_bit_func_t non_ecm_get_bit, tone_report_func_t tone_callback, void *user_data); SPAN_DECLARE(int) fax_modems_release(fax_modems_state_t *s); SPAN_DECLARE(int) fax_modems_free(fax_modems_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/v18.h0000664000175000017500000001247411422612265013147 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v18.h - V.18 text telephony for the deaf. * * Written by Steve Underwood * * Copyright (C) 2004-2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page v18_page The V.18 text telephony protocols \section v18_page_sec_1 What does it do? \section v18_page_sec_2 How does it work? */ #if !defined(_SPANDSP_V18_H_) #define _SPANDSP_V18_H_ typedef struct v18_state_s v18_state_t; enum { V18_MODE_NONE = 0, /* V.18 Annex A - Weitbrecht TDD at 45.45bps, half-duplex, 5 bit baudot. */ V18_MODE_5BIT_45 = 1, /* V.18 Annex A - Weitbrecht TDD at 50bps, half-duplex, 5 bit baudot. */ V18_MODE_5BIT_50 = 2, /* V.18 Annex B - DTMF encoding of ASCII. */ V18_MODE_DTMF = 3, /* V.18 Annex C - EDT 110bps, V.21, half-duplex, ASCII. */ V18_MODE_EDT = 4, /* V.18 Annex D - 300bps, Bell 103, duplex, ASCII. */ V18_MODE_BELL103 = 5, /* V.18 Annex E - 1200bps Videotex terminals, ASCII. */ V18_MODE_V23VIDEOTEX = 6, /* V.18 Annex F - V.21 text telephone, V.21, duplex, ASCII. */ V18_MODE_V21TEXTPHONE = 7, /* V.18 Annex G - V.18 text telephone mode. */ V18_MODE_V18TEXTPHONE = 8 }; #if defined(__cplusplus) extern "C" { #endif SPAN_DECLARE(logging_state_t *) v18_get_logging_state(v18_state_t *s); /*! Initialise a V.18 context. \brief Initialise a V.18 context. \param s The V.18 context. \param calling_party TRUE if caller mode, else answerer mode. \param mode Mode of operation. \param put_msg A callback routine called to deliver the received text to the application. \param user_data An opaque pointer for the callback routine. \return A pointer to the V.18 context, or NULL if there was a problem. */ SPAN_DECLARE(v18_state_t *) v18_init(v18_state_t *s, int calling_party, int mode, put_msg_func_t put_msg, void *user_data); /*! Release a V.18 context. \brief Release a V.18 context. \param s The V.18 context. \return 0 for OK. */ SPAN_DECLARE(int) v18_release(v18_state_t *s); /*! Free a V.18 context. \brief Release a V.18 context. \param s The V.18 context. \return 0 for OK. */ SPAN_DECLARE(int) v18_free(v18_state_t *s); /*! Generate a block of V.18 audio samples. \brief Generate a block of V.18 audio samples. \param s The V.18 context. \param amp The audio sample buffer. \param max_len The number of samples to be generated. \return The number of samples actually generated. */ SPAN_DECLARE_NONSTD(int) v18_tx(v18_state_t *s, int16_t amp[], int max_len); /*! Process a block of received V.18 audio samples. \brief Process a block of received V.18 audio samples. \param s The V.18 context. \param amp The audio sample buffer. \param len The number of samples in the buffer. */ SPAN_DECLARE_NONSTD(int) v18_rx(v18_state_t *s, const int16_t amp[], int len); /*! \brief Put a string to a V.18 context's input buffer. \param s The V.18 context. \param msg The string to be added. \param len The length of the string. If negative, the string is assumed to be a NULL terminated string. \return The number of characters actually added. This may be less than the length of the digit string, if the buffer fills up. If the string is invalid, this function will return -1. */ SPAN_DECLARE(int) v18_put(v18_state_t *s, const char msg[], int len); /*! Convert a text string to a V.18 DTMF string. \brief Convert a text string to a V.18 DTMF string. \param s The V.18 context. \param dtmf The resulting DTMF string. \param msg The text string to be converted. \return The length of the DTMF string. */ SPAN_DECLARE(int) v18_encode_dtmf(v18_state_t *s, char dtmf[], const char msg[]); /*! Convert a V.18 DTMF string to a text string. \brief Convert a V.18 DTMF string to a text string. \param s The V.18 context. \param msg The resulting test string. \param dtmf The DTMF string to be converted. \return The length of the text string. */ SPAN_DECLARE(int) v18_decode_dtmf(v18_state_t *s, char msg[], const char dtmf[]); SPAN_DECLARE(uint16_t) v18_encode_baudot(v18_state_t *s, uint8_t ch); SPAN_DECLARE(uint8_t) v18_decode_baudot(v18_state_t *s, uint8_t ch); /*! \brief Return a short name for an V.18 mode \param mode The code for the V.18 mode. \return A pointer to the name. */ SPAN_DECLARE(const char *) v18_mode_to_str(int mode); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/super_tone_tx.h0000664000175000017500000000626011422612264015422 00000000000000/* * SpanDSP - a series of DSP components for telephony * * super_tone_tx.h - Flexible telephony supervisory tone generation. * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_SUPER_TONE_TX_H_) #define _SPANDSP_SUPER_TONE_TX_H_ /*! \page super_tone_tx_page Supervisory tone generation \section super_tone_tx_page_sec_1 What does it do? The supervisory tone generator may be configured to generate most of the world's telephone supervisory tones - things like ringback, busy, number unobtainable, and so on. It uses tree structure tone descriptions, which can deal with quite complex cadence patterns. \section super_tone_tx_page_sec_2 How does it work? */ typedef struct super_tone_tx_step_s super_tone_tx_step_t; typedef struct super_tone_tx_state_s super_tone_tx_state_t; #if defined(__cplusplus) extern "C" { #endif SPAN_DECLARE(super_tone_tx_step_t *) super_tone_tx_make_step(super_tone_tx_step_t *s, float f1, float l1, float f2, float l2, int length, int cycles); SPAN_DECLARE(int) super_tone_tx_free_tone(super_tone_tx_step_t *s); /*! Initialise a supervisory tone generator. \brief Initialise a supervisory tone generator. \param s The supervisory tone generator context. \param tree The supervisory tone tree to be generated. \return The supervisory tone generator context. */ SPAN_DECLARE(super_tone_tx_state_t *) super_tone_tx_init(super_tone_tx_state_t *s, super_tone_tx_step_t *tree); SPAN_DECLARE(int) super_tone_tx_release(super_tone_tx_state_t *s); SPAN_DECLARE(int) super_tone_tx_free(super_tone_tx_state_t *s); /*! Generate a block of audio samples for a supervisory tone pattern. \brief Generate a block of audio samples for a supervisory tone pattern. \param s The supervisory tone context. \param amp The audio sample buffer. \param max_samples The maximum number of samples to be generated. \return The number of samples generated. */ SPAN_DECLARE(int) super_tone_tx(super_tone_tx_state_t *s, int16_t amp[], int max_samples); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/power_meter.h0000664000175000017500000001305511422612264015054 00000000000000/* * SpanDSP - a series of DSP components for telephony * * power_meter.h * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_POWER_METER_H_) #define _POWER_METER_H_ /*! \page power_meter_page Power metering \section power_meter_page_sec_1 What does it do? The power metering module implements a simple IIR type running power meter. The damping factor of the IIR is selectable when the meter instance is created. Note that the definition of dBOv is quite vague in most places - is it peak since wave, peak square wave, etc.? This code is based on the well defined wording in RFC3389: "For example, in the case of a u-law system, the reference would be a square wave with values +/-8031, and this square wave represents 0dBov. This translates into 6.18dBm0". \section power_meter_page_sec_2 How does it work? */ /*! Power meter descriptor. This defines the working state for a single instance of a power measurement device. */ typedef struct { /*! The shift factor, which controls the damping of the power meter. */ int shift; /*! The current power reading. */ int32_t reading; } power_meter_t; typedef struct { power_meter_t short_term; power_meter_t medium_term; int signal_present; int32_t surge; int32_t sag; int32_t min; } power_surge_detector_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Initialise a power meter context. \brief Initialise a power meter context. \param s The power meter context. \param shift The shift to be used by the IIR filter. \return The power meter context. */ SPAN_DECLARE(power_meter_t *) power_meter_init(power_meter_t *s, int shift); SPAN_DECLARE(int) power_meter_release(power_meter_t *s); SPAN_DECLARE(int) power_meter_free(power_meter_t *s); /*! Change the damping factor of a power meter context. \brief Change the damping factor of a power meter context. \param s The power meter context. \param shift The new shift to be used by the IIR filter. \return The power meter context. */ SPAN_DECLARE(power_meter_t *) power_meter_damping(power_meter_t *s, int shift); /*! Update a power meter. \brief Update a power meter. \param s The power meter context. \param amp The amplitude of the new audio sample. \return The current power meter reading. */ SPAN_DECLARE(int32_t) power_meter_update(power_meter_t *s, int16_t amp); /*! Get the current power meter reading. \brief Get the current power meter reading. \param s The power meter context. \return The current power meter reading. */ SPAN_DECLARE(int32_t) power_meter_current(power_meter_t *s); /*! Get the current power meter reading, in dBm0. \brief Get the current power meter reading, in dBm0. \param s The power meter context. \return The current power meter reading, in dBm0. */ SPAN_DECLARE(float) power_meter_current_dbm0(power_meter_t *s); /*! Get the current power meter reading, in dBOv. \brief Get the current power meter reading, in dBOv. \param s The power meter context. \return The current power meter reading, in dBOv. */ SPAN_DECLARE(float) power_meter_current_dbov(power_meter_t *s); /*! Get the power meter reading which represents a specified power level in dBm0. \brief Get the current power meter reading, in dBm0. \param level A power level, in dB0m. \return The equivalent power meter reading. */ SPAN_DECLARE(int32_t) power_meter_level_dbm0(float level); /*! Get the power meter reading which represents a specified power level in dBOv. \brief Get the current power meter reading, in dBOv. \param level A power level, in dBOv. \return The equivalent power meter reading. */ SPAN_DECLARE(int32_t) power_meter_level_dbov(float level); SPAN_DECLARE(int32_t) power_surge_detector(power_surge_detector_state_t *s, int16_t amp); /*! Get the current surge detector short term meter reading, in dBm0. \brief Get the current surge detector meter reading, in dBm0. \param s The power surge detector context. \return The current power surge detector power reading, in dBm0. */ SPAN_DECLARE(float) power_surge_detector_current_dbm0(power_surge_detector_state_t *s); /*! Get the current surge detector short term meter reading, in dBOv. \brief Get the current surge detector meter reading, in dBOv. \param s The power surge detector context. \return The current power surge detector power reading, in dBOv. */ SPAN_DECLARE(float) power_surge_detector_current_dbov(power_surge_detector_state_t *s); SPAN_DECLARE(power_surge_detector_state_t *) power_surge_detector_init(power_surge_detector_state_t *s, float min, float surge); SPAN_DECLARE(int) power_surge_detector_release(power_surge_detector_state_t *s); SPAN_DECLARE(int) power_surge_detector_free(power_surge_detector_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/tone_generate.h0000664000175000017500000001001211422612264015331 00000000000000/* * SpanDSP - a series of DSP components for telephony * * tone_generate.h - General telephony tone generation. * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_TONE_GENERATE_H_) #define _SPANDSP_TONE_GENERATE_H_ /*! \page tone_generation_page Tone generation \section tone_generation_page_sec_1 What does it do? The tone generation module provides for the generation of cadenced tones, suitable for a wide range of telephony applications. \section tone_generation_page_sec_2 How does it work? Oscillators are a problem. They oscillate due to instability, and yet we need them to behave in a stable manner. A look around the web will reveal many papers on this subject. Many describe rather complex solutions to the problem. However, we are only concerned with telephony applications. It is possible to generate the tones we need with a very simple efficient scheme. It is also practical to use an exhaustive test to prove the oscillator is stable under all the conditions in which we will use it. */ typedef struct tone_gen_tone_descriptor_s tone_gen_tone_descriptor_t; /*! Cadenced multi-tone generator descriptor. */ typedef struct tone_gen_descriptor_s tone_gen_descriptor_t; /*! Cadenced multi-tone generator state descriptor. This defines the state of a single working instance of a generator. */ typedef struct tone_gen_state_s tone_gen_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Create a tone generator descriptor \brief Create a tone generator descriptor \param s The descriptor \param f1 The first frequency, in Hz \param l1 The level of the first frequency, in dBm0 \param f2 0 for no second frequency, a positive number for the second frequency, in Hz, or a negative number for an AM modulation frequency, in Hz \param l2 The level of the second frequency, in dBm0, or the percentage modulation depth for an AM modulated tone. \param d1 x \param d2 x \param d3 x \param d4 x \param repeat x */ SPAN_DECLARE(tone_gen_descriptor_t *) tone_gen_descriptor_init(tone_gen_descriptor_t *s, int f1, int l1, int f2, int l2, int d1, int d2, int d3, int d4, int repeat); /* For backwards compatibility */ #define make_tone_gen_descriptor tone_gen_descriptor_init SPAN_DECLARE(void) tone_gen_descriptor_free(tone_gen_descriptor_t *s); SPAN_DECLARE_NONSTD(int) tone_gen(tone_gen_state_t *s, int16_t amp[], int max_samples); SPAN_DECLARE(tone_gen_state_t *) tone_gen_init(tone_gen_state_t *s, tone_gen_descriptor_t *t); SPAN_DECLARE(int) tone_gen_release(tone_gen_state_t *s); SPAN_DECLARE(int) tone_gen_free(tone_gen_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/image_translate.h0000664000175000017500000001063411422612264015663 00000000000000/* * SpanDSP - a series of DSP components for telephony * * image_translate.h - Image translation routines for reworking colour * and gray scale images to be bi-level images of an * appropriate size to be FAX compatible. * * Written by Steve Underwood * * Copyright (C) 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_IMAGE_TRANSLATE_H_) #define _SPANDSP_IMAGE_TRANSLATE_H_ /*! \page image_translate_page Image translation \section image_translate_page_sec_1 What does it do? \section image_translate_page_sec_2 How does it work? \section image_translate_page_sec_3 How do I use it? */ typedef struct image_translate_state_s image_translate_state_t; enum { IMAGE_TRANSLATE_FROM_MONO = 1, IMAGE_TRANSLATE_FROM_GRAY_8 = 2, IMAGE_TRANSLATE_FROM_GRAY_16 = 3, IMAGE_TRANSLATE_FROM_COLOUR_8 = 4, IMAGE_TRANSLATE_FROM_COLOUR_16 = 5 }; #if defined(__cplusplus) extern "C" { #endif /*! \brief Get the next row of a translated image. \param s The image translation context. \return the length of the row buffer, in bytes */ SPAN_DECLARE(int) image_translate_row(image_translate_state_t *s, uint8_t buf[], size_t len); /*! \brief Get the width of the image being produced by an image translation context. \param s The image translation context. \return The width of the output image, in pixel. */ SPAN_DECLARE(int) image_translate_get_output_width(image_translate_state_t *s); /*! \brief Get the length of the image being produced by an image translation context. \param s The image translation context. \return The length of the output image, in pixel. */ SPAN_DECLARE(int) image_translate_get_output_length(image_translate_state_t *s); /*! \brief Initialise an image translation context for rescaling and squashing a gray scale or colour image to a bi-level FAX type image. \param s The image translation context. \param input_format x \param input_width The width of the source image, in pixels. \param input_length The length of the source image, in pixels. \param output_width The width of the output image, in pixels. The length of the output image will be derived automatically from this and the source image dimension, to main the geometry of the original image. \param row_read_handler A callback routine used to pull rows of pixels from the source image into the translation process. \param row_read_user_data An opaque point passed to read_row_handler \return A pointer to the context, or NULL if there was a problem. */ SPAN_DECLARE(image_translate_state_t *) image_translate_init(image_translate_state_t *s, int input_format, int input_width, int input_length, int output_width, t4_row_read_handler_t row_read_handler, void *row_read_user_data); /*! \brief Release the resources associated with an image translation context. \param s The image translation context. \return 0 for success, otherwise -1. */ SPAN_DECLARE(int) image_translate_release(image_translate_state_t *s); /*! \brief Free the resources associated with an image translation context. \param s The image translation context. \return 0 for success, otherwise -1. */ SPAN_DECLARE(int) image_translate_free(image_translate_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/t4_rx.h0000664000175000017500000003222712101412507013557 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t4_rx.h - definitions for T.4 FAX receive processing * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_T4_RX_H_) #define _SPANDSP_T4_RX_H_ /*! \page t4_page T.4 image compression and decompression \section t4_page_sec_1 What does it do? The T.4 image compression and decompression routines implement the 1D and 2D encoding methods defined in ITU specification T.4. They also implement the pure 2D encoding method defined in T.6. These are image compression algorithms used for FAX transmission. \section t4_page_sec_1 How does it work? */ /*! This function is a callback from the image decoders, to write the decoded bi-level image, row by row. It is called for each row, with len set to the number of bytes per row. At the end of the image it is called with len set to zero, to indicate the end of image condition. \return 0 for OK, or non-zero for a problem that requires the image be interrupted. */ typedef int (*t4_row_write_handler_t)(void *user_data, const uint8_t buf[], size_t len); /*! Supported compression modes. */ typedef enum { /*! No compression */ T4_COMPRESSION_NONE = 0, /*! T.1 1D compression */ T4_COMPRESSION_ITU_T4_1D = 1, /*! T.4 2D compression */ T4_COMPRESSION_ITU_T4_2D = 2, /*! T.6 2D compression */ T4_COMPRESSION_ITU_T6 = 3, /*! T.85 monochrome JBIG coding with L0 fixed. */ T4_COMPRESSION_ITU_T85 = 4, /*! T.85 monochrome JBIG coding with L0 variable. */ T4_COMPRESSION_ITU_T85_L0 = 5, /*! T.43 colour JBIG coding */ T4_COMPRESSION_ITU_T43 = 6, /*! T.45 run length colour compression */ T4_COMPRESSION_ITU_T45 = 7, /*! T.42 + T.81 + T.30 Annex E colour JPEG coding */ T4_COMPRESSION_ITU_T42 = 8, /*! T.42 + T.81 + T.30 Annex K colour sYCC-JPEG coding */ T4_COMPRESSION_ITU_SYCC_T42 = 9 } t4_image_compression_t; /*! Image type */ typedef enum { T4_IMAGE_TYPE_BILEVEL = 0, T4_IMAGE_TYPE_GRAY_8BIT = 1, T4_IMAGE_TYPE_GRAY_12BIT = 2, T4_IMAGE_TYPE_COLOUR_8BIT = 3, T4_IMAGE_TYPE_COLOUR_12BIT = 4 } t4_image_types_t; /*! Supported X resolutions, in pixels per metre. */ typedef enum { T4_X_RESOLUTION_R4 = 4016, T4_X_RESOLUTION_R8 = 8031, T4_X_RESOLUTION_300 = 11811, T4_X_RESOLUTION_R16 = 16063, T4_X_RESOLUTION_600 = 23622, T4_X_RESOLUTION_800 = 31496, T4_X_RESOLUTION_1200 = 47244 } t4_image_x_resolution_t; /*! Supported Y resolutions, in pixels per metre. */ typedef enum { T4_Y_RESOLUTION_STANDARD = 3850, T4_Y_RESOLUTION_FINE = 7700, T4_Y_RESOLUTION_300 = 11811, T4_Y_RESOLUTION_SUPERFINE = 15400, /* 400 is 15748 */ T4_Y_RESOLUTION_600 = 23622, T4_Y_RESOLUTION_800 = 31496, T4_Y_RESOLUTION_1200 = 47244 } t4_image_y_resolution_t; /*! Exact widths in PELs for the difference resolutions, and page widths. Note: The A4 widths also apply to North American letter and legal. The R4 resolution widths are not supported in recent versions of T.30 Only images of exactly these widths are acceptable for FAX transmisson. R4 864 pels/215mm for ISO A4, North American Letter and Legal R4 1024 pels/255mm for ISO B4 R4 1216 pels/303mm for ISO A3 R8 1728 pels/215mm for ISO A4, North American Letter and Legal R8 2048 pels/255mm for ISO B4 R8 2432 pels/303mm for ISO A3 R16 3456 pels/215mm for ISO A4, North American Letter and Legal R16 4096 pels/255mm for ISO B4 R16 4864 pels/303mm for ISO A3 */ typedef enum { T4_WIDTH_R4_A4 = 864, T4_WIDTH_R4_B4 = 1024, T4_WIDTH_R4_A3 = 1216, T4_WIDTH_R8_A4 = 1728, T4_WIDTH_R8_B4 = 2048, T4_WIDTH_R8_A3 = 2432, T4_WIDTH_300_A4 = 2592, T4_WIDTH_300_B4 = 3072, T4_WIDTH_300_A3 = 3648, T4_WIDTH_R16_A4 = 3456, T4_WIDTH_R16_B4 = 4096, T4_WIDTH_R16_A3 = 4864, T4_WIDTH_600_A4 = 5184, T4_WIDTH_600_B4 = 6144, T4_WIDTH_600_A3 = 7296, T4_WIDTH_1200_A4 = 10368, T4_WIDTH_1200_B4 = 12288, T4_WIDTH_1200_A3 = 14592 } t4_image_width_t; /*! Length of the various supported paper sizes, in pixels at the various Y resolutions. Paper sizes are A4 (215mm x 297mm) B4 (255mm x 364mm) A3 (303mm x 418.56mm) North American Letter (215.9mm x 279.4mm) North American Legal (215.9mm x 355.6mm) Unlimited T.4 does not accurately define the maximum number of scan lines in a page. A wide variety of maximum row counts are used in the real world. It is important not to set our sending limit too high, or a receiving machine might split pages. It is important not to set it too low, or we might clip pages. Values seen for standard resolution A4 pages include 1037, 1045, 1109, 1126 and 1143. 1109 seems the most-popular. At fine res 2150, 2196, 2200, 2237, 2252-2262, 2264, 2286, and 2394 are used. 2255 seems the most popular. We try to use balanced choices here. */ typedef enum { /* A4 is 297mm long */ T4_LENGTH_STANDARD_A4 = 1143, T4_LENGTH_FINE_A4 = 2286, T4_LENGTH_300_A4 = 4665, T4_LENGTH_SUPERFINE_A4 = 4573, T4_LENGTH_600_A4 = 6998, T4_LENGTH_800_A4 = 9330, T4_LENGTH_1200_A4 = 13996, /* B4 is 364mm long */ T4_LENGTH_STANDARD_B4 = 1401, T4_LENGTH_FINE_B4 = 2802, T4_LENGTH_300_B4 = 0, T4_LENGTH_SUPERFINE_B4 = 5605, T4_LENGTH_600_B4 = 0, T4_LENGTH_800_B4 = 0, T4_LENGTH_1200_B4 = 0, /* North American letter is 279.4mm long */ T4_LENGTH_STANDARD_US_LETTER = 1075, T4_LENGTH_FINE_US_LETTER = 2151, T4_LENGTH_300_US_LETTER = 0, T4_LENGTH_SUPERFINE_US_LETTER = 4302, T4_LENGTH_600_US_LETTER = 0, T4_LENGTH_800_US_LETTER = 0, T4_LENGTH_1200_US_LETTER = 0, /* North American legal is 355.6mm long */ T4_LENGTH_STANDARD_US_LEGAL = 1369, T4_LENGTH_FINE_US_LEGAL = 2738, T4_LENGTH_300_US_LEGAL = 0, T4_LENGTH_SUPERFINE_US_LEGAL = 5476, T4_LENGTH_600_US_LEGAL = 0, T4_LENGTH_800_US_LEGAL = 0, T4_LENGTH_1200_US_LEGAL = 0 } t4_image_length_t; /*! T.4 FAX compression/decompression descriptor. This defines the working state for a single instance of a T.4 FAX compression or decompression channel. */ typedef struct t4_state_s t4_state_t; typedef struct t4_state_s t4_rx_state_t; /*! T.4 FAX compression/decompression statistics. */ typedef struct { /*! \brief The number of pages transferred so far. */ int pages_transferred; /*! \brief The number of pages in the file (<0 if unknown). */ int pages_in_file; /*! \brief The number of horizontal pixels in the most recent page. */ int width; /*! \brief The number of vertical pixels in the most recent page. */ int length; /*! \brief The number of bad pixel rows in the most recent page. */ int bad_rows; /*! \brief The largest number of bad pixel rows in a block in the most recent page. */ int longest_bad_row_run; /*! \brief The horizontal resolution of the page in pixels per metre */ int x_resolution; /*! \brief The vertical resolution of the page in pixels per metre */ int y_resolution; /*! \brief The type of compression used between the FAX machines */ int encoding; /*! \brief The size of the image on the line, in bytes */ int line_image_size; } t4_stats_t; #if defined(__cplusplus) extern "C" { #endif /*! \brief Prepare to receive the next page of the current document. \param s The T.4 context. \return zero for success, -1 for failure. */ SPAN_DECLARE(int) t4_rx_start_page(t4_rx_state_t *s); /*! \brief Put a bit of the current document page. \param s The T.4 context. \param bit The data bit. \return TRUE when the bit ends the document page, otherwise FALSE. */ SPAN_DECLARE(int) t4_rx_put_bit(t4_rx_state_t *s, int bit); /*! \brief Put a byte of the current document page. \param s The T.4 context. \param byte The data byte. \return TRUE when the byte ends the document page, otherwise FALSE. */ SPAN_DECLARE(int) t4_rx_put_byte(t4_rx_state_t *s, uint8_t byte); /*! \brief Put a byte of the current document page. \param s The T.4 context. \param buf The buffer containing the chunk. \param len The length of the chunk. \return TRUE when the byte ends the document page, otherwise FALSE. */ SPAN_DECLARE(int) t4_rx_put_chunk(t4_rx_state_t *s, const uint8_t buf[], int len); /*! \brief Complete the reception of a page. \param s The T.4 receive context. \return 0 for success, otherwise -1. */ SPAN_DECLARE(int) t4_rx_end_page(t4_rx_state_t *s); /*! \brief Set the row write handler for a T.4 receive context. \param s The T.4 receive context. \param handler A pointer to the handler routine. \param user_data An opaque pointer passed to the handler routine. \return 0 for success, otherwise -1. */ SPAN_DECLARE(int) t4_rx_set_row_write_handler(t4_rx_state_t *s, t4_row_write_handler_t handler, void *user_data); /*! \brief Set the encoding for the received data. \param s The T.4 context. \param encoding The encoding. */ SPAN_DECLARE(void) t4_rx_set_rx_encoding(t4_rx_state_t *s, int encoding); /*! \brief Set the expected width of the received image, in pixel columns. \param s The T.4 context. \param width The number of pixels across the image. */ SPAN_DECLARE(void) t4_rx_set_image_width(t4_rx_state_t *s, int width); /*! \brief Set the row-to-row (y) resolution to expect for a received image. \param s The T.4 context. \param resolution The resolution, in pixels per metre. */ SPAN_DECLARE(void) t4_rx_set_y_resolution(t4_rx_state_t *s, int resolution); /*! \brief Set the column-to-column (x) resolution to expect for a received image. \param s The T.4 context. \param resolution The resolution, in pixels per metre. */ SPAN_DECLARE(void) t4_rx_set_x_resolution(t4_rx_state_t *s, int resolution); /*! \brief Set the DCS information of the fax, for inclusion in the file. \param s The T.4 context. \param dcs The DCS information, formatted as an ASCII string. */ SPAN_DECLARE(void) t4_rx_set_dcs(t4_rx_state_t *s, const char *dcs); /*! \brief Set the sub-address of the fax, for inclusion in the file. \param s The T.4 context. \param sub_address The sub-address string. */ SPAN_DECLARE(void) t4_rx_set_sub_address(t4_rx_state_t *s, const char *sub_address); /*! \brief Set the identity of the remote machine, for inclusion in the file. \param s The T.4 context. \param ident The identity string. */ SPAN_DECLARE(void) t4_rx_set_far_ident(t4_rx_state_t *s, const char *ident); /*! \brief Set the vendor of the remote machine, for inclusion in the file. \param s The T.4 context. \param vendor The vendor string, or NULL. */ SPAN_DECLARE(void) t4_rx_set_vendor(t4_rx_state_t *s, const char *vendor); /*! \brief Set the model of the remote machine, for inclusion in the file. \param s The T.4 context. \param model The model string, or NULL. */ SPAN_DECLARE(void) t4_rx_set_model(t4_rx_state_t *s, const char *model); /*! Get the current image transfer statistics. \brief Get the current transfer statistics. \param s The T.4 context. \param t A pointer to a statistics structure. */ SPAN_DECLARE(void) t4_rx_get_transfer_statistics(t4_rx_state_t *s, t4_stats_t *t); /*! Get the short text name of an encoding format. \brief Get the short text name of an encoding format. \param encoding The encoding type. \return A pointer to the string. */ SPAN_DECLARE(const char *) t4_encoding_to_str(int encoding); /*! \brief Prepare for reception of a document. \param s The T.4 context. \param file The name of the file to be received. \param output_encoding The output encoding. \return A pointer to the context, or NULL if there was a problem. */ SPAN_DECLARE(t4_rx_state_t *) t4_rx_init(t4_rx_state_t *s, const char *file, int output_encoding); /*! \brief End reception of a document. Tidy up and close the file. This should be used to end T.4 reception started with t4_rx_init. \param s The T.4 receive context. \return 0 for success, otherwise -1. */ SPAN_DECLARE(int) t4_rx_release(t4_rx_state_t *s); /*! \brief End reception of a document. Tidy up, close the file and free the context. This should be used to end T.4 reception started with t4_rx_init. \param s The T.4 receive context. \return 0 for success, otherwise -1. */ SPAN_DECLARE(int) t4_rx_free(t4_rx_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/sig_tone.h0000664000175000017500000001723311422612264014335 00000000000000/* * SpanDSP - a series of DSP components for telephony * * sig_tone.h - Signalling tone processing for the 2280Hz, 2400Hz, 2600Hz * and similar signalling tones used in older protocols. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page sig_tone_page The 2280/2400/2600Hz signalling tone processor \section sig_tone_sec_1 What does it do? The signalling tone processor handles the 2280Hz, 2400Hz and 2600Hz tones, used in many analogue signalling procotols, and digital ones derived from them. \section sig_tone_sec_2 How does it work? Most single and two voice frequency signalling systems share many features, as these features have developed in similar ways over time, to address the limitations of early tone signalling systems. The usual practice is to start the generation of tone at a high energy level, so a strong signal is available at the receiver, for crisp tone detection. If the tone remains on for a significant period, the energy level is reduced, to minimise crosstalk. During the signalling transitions, only the tone is sent through the channel, and the media signal is suppressed. This means the signalling receiver has a very clean signal to work with, allowing for crisp detection of the signalling tone. However, when the signalling tone is on for extended periods, there may be supervisory information in the media signal, such as voice announcements. To allow these to pass through the system, the signalling tone is mixed with the media signal. It is the job of the signalling receiver to separate the signalling tone and the media. The necessary filtering may degrade the quality of the voice signal, but at least supervisory information may be heard. */ #if !defined(_SPANDSP_SIG_TONE_H_) #define _SPANDSP_SIG_TONE_H_ /* The optional tone sets */ enum { /*! European 2280Hz signalling tone. Tone 1 is 2280Hz. Tone 2 is not used. */ SIG_TONE_2280HZ = 1, /*! US 2600Hz signalling tone. Tone 1 is 2600Hz. Tone 2 is not used. */ SIG_TONE_2600HZ, /*! US 2400Hz + 2600Hz signalling tones. Tone 1 is 2600Hz. Tone 2 is 2400Hz. */ SIG_TONE_2400HZ_2600HZ }; /* Mode control and report bits for transmit and receive */ enum { /*! Signalling tone 1 is present */ SIG_TONE_1_PRESENT = 0x001, /*! Signalling tone 1 has changed state (ignored when setting tx mode) */ SIG_TONE_1_CHANGE = 0x002, /*! Signalling tone 2 is present */ SIG_TONE_2_PRESENT = 0x004, /*! Signalling tone 2 has changed state (ignored when setting tx mode) */ SIG_TONE_2_CHANGE = 0x008, /*! The media signal is passing through. Tones might be added to it. */ SIG_TONE_TX_PASSTHROUGH = 0x010, /*! The media signal is passing through. Tones might be extracted from it, if detected. */ SIG_TONE_RX_PASSTHROUGH = 0x040, /*! Force filtering of the signalling tone, whether signalling is being detected or not. This is mostly useful for test purposes. */ SIG_TONE_RX_FILTER_TONE = 0x080, /*! Request an update of the transmit status, upon timeout of the previous status. */ SIG_TONE_TX_UPDATE_REQUEST = 0x100, /*! Request an update of the receiver status, upon timeout of the previous status. */ SIG_TONE_RX_UPDATE_REQUEST = 0x200 }; typedef struct sig_tone_tx_state_s sig_tone_tx_state_t; typedef struct sig_tone_rx_state_s sig_tone_rx_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Process a block of received audio samples. \brief Process a block of received audio samples. \param s The signalling tone context. \param amp The audio sample buffer. \param len The number of samples in the buffer. \return The number of samples unprocessed. */ SPAN_DECLARE(int) sig_tone_rx(sig_tone_rx_state_t *s, int16_t amp[], int len); /*! Set the receive mode. \brief Set the receive mode. \param s The signalling tone context. \param mode The new mode for the receiver. \param duration The duration for this mode, before an update is requested. A duration of zero means forever. */ SPAN_DECLARE(void) sig_tone_rx_set_mode(sig_tone_rx_state_t *s, int mode, int duration); /*! Initialise a signalling tone receiver context. \brief Initialise a signalling tone context. \param s The signalling tone context. \param tone_type The type of signalling tone. \param sig_update Callback function to handle signalling updates. \param user_data An opaque pointer. \return A pointer to the signalling tone context, or NULL if there was a problem. */ SPAN_DECLARE(sig_tone_rx_state_t *) sig_tone_rx_init(sig_tone_rx_state_t *s, int tone_type, tone_report_func_t sig_update, void *user_data); /*! Release a signalling tone receiver context. \brief Release a signalling tone receiver context. \param s The signalling tone context. \return 0 for OK */ SPAN_DECLARE(int) sig_tone_rx_release(sig_tone_rx_state_t *s); /*! Free a signalling tone receiver context. \brief Free a signalling tone receiver context. \param s The signalling tone context. \return 0 for OK */ SPAN_DECLARE(int) sig_tone_rx_free(sig_tone_rx_state_t *s); /*! Generate a block of signalling tone audio samples. \brief Generate a block of signalling tone audio samples. \param s The signalling tone context. \param amp The audio sample buffer. \param len The number of samples to be generated. \return The number of samples actually generated. */ SPAN_DECLARE(int) sig_tone_tx(sig_tone_tx_state_t *s, int16_t amp[], int len); /*! Set the tone mode. \brief Set the tone mode. \param s The signalling tone context. \param mode The new mode for the transmitted tones. \param duration The duration for this mode, before an update is requested. A duration of zero means forever. */ SPAN_DECLARE(void) sig_tone_tx_set_mode(sig_tone_tx_state_t *s, int mode, int duration); /*! Initialise a signalling tone transmitter context. \brief Initialise a signalling tone context. \param s The signalling tone context. \param tone_type The type of signalling tone. \param sig_update Callback function to handle signalling updates. \param user_data An opaque pointer. \return A pointer to the signalling tone context, or NULL if there was a problem. */ SPAN_DECLARE(sig_tone_tx_state_t *) sig_tone_tx_init(sig_tone_tx_state_t *s, int tone_type, tone_report_func_t sig_update, void *user_data); /*! Release a signalling tone transmitter context. \brief Release a signalling tone transmitter context. \param s The signalling tone context. \return 0 for OK */ SPAN_DECLARE(int) sig_tone_tx_release(sig_tone_tx_state_t *s); /*! Free a signalling tone transmitter context. \brief Free a signalling tone transmitter context. \param s The signalling tone context. \return 0 for OK */ SPAN_DECLARE(int) sig_tone_tx_free(sig_tone_tx_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/hdlc.h0000664000175000017500000002533412343631173013444 00000000000000/* * SpanDSP - a series of DSP components for telephony * * hdlc.h * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page hdlc_page HDLC \section hdlc_page_sec_1 What does it do? The HDLC module provides bit stuffing, destuffing, framing and deframing, according to the HDLC protocol. It also provides 16 and 32 bit CRC generation and checking services for HDLC frames. HDLC may not be a DSP function, but is needed to accompany several DSP components. \section hdlc_page_sec_2 How does it work? */ #if !defined(_SPANDSP_HDLC_H_) #define _SPANDSP_HDLC_H_ /*! HDLC_MAXFRAME_LEN is the maximum length of a stuffed HDLC frame, excluding the CRC. */ #define HDLC_MAXFRAME_LEN 400 typedef void (*hdlc_frame_handler_t)(void *user_data, const uint8_t *pkt, int len, int ok); typedef void (*hdlc_underflow_handler_t)(void *user_data); /*! HDLC receive descriptor. This contains all the state information for an HDLC receiver. */ typedef struct hdlc_rx_state_s hdlc_rx_state_t; /*! HDLC received data statistics. */ typedef struct { /*! \brief The number of bytes of good frames received (CRC not included). */ unsigned long int bytes; /*! \brief The number of good frames received. */ unsigned long int good_frames; /*! \brief The number of frames with CRC errors received. */ unsigned long int crc_errors; /*! \brief The number of too short and too long frames received. */ unsigned long int length_errors; /*! \brief The number of HDLC aborts received. */ unsigned long int aborts; } hdlc_rx_stats_t; /*! HDLC transmit descriptor. This contains all the state information for an HDLC transmitter. */ typedef struct hdlc_tx_state_s hdlc_tx_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Initialise an HDLC receiver context. \brief Initialise an HDLC receiver context. \param s A pointer to an HDLC receiver context. \param crc32 TRUE to use ITU CRC32. FALSE to use ITU CRC16. \param report_bad_frames TRUE to request the reporting of bad frames. \param framing_ok_threshold The number of back-to-back flags needed to start the framing OK condition. This may be used where a series of flag octets is used as a preamble, such as in the T.30 protocol. \param handler The function to be called when a good HDLC frame is received. \param user_data An opaque parameter for the callback routine. \return A pointer to the HDLC receiver context. */ SPAN_DECLARE(hdlc_rx_state_t *) hdlc_rx_init(hdlc_rx_state_t *s, int crc32, int report_bad_frames, int framing_ok_threshold, hdlc_frame_handler_t handler, void *user_data); /*! Re-initialise an HDLC receiver context. This does not reset the usage statistics. \brief Re-initialise an HDLC receiver context. \param s A pointer to an HDLC receiver context. \return 0 for success. */ SPAN_DECLARE(int) hdlc_rx_restart(hdlc_rx_state_t *s); /*! Change the put_bit function associated with an HDLC receiver context. \brief Change the put_bit function associated with an HDLC receiver context. \param s A pointer to an HDLC receiver context. \param handler The function to be called when a good HDLC frame is received. \param user_data An opaque parameter for the callback routine. */ SPAN_DECLARE(void) hdlc_rx_set_frame_handler(hdlc_rx_state_t *s, hdlc_frame_handler_t handler, void *user_data); /*! Change the status report function associated with an HDLC receiver context. \brief Change the status report function associated with an HDLC receiver context. \param s A pointer to an HDLC receiver context. \param handler The callback routine used to report status changes. \param user_data An opaque parameter for the callback routine. */ SPAN_DECLARE(void) hdlc_rx_set_status_handler(hdlc_rx_state_t *s, modem_status_func_t handler, void *user_data); /*! Release an HDLC receiver context. \brief Release an HDLC receiver context. \param s A pointer to an HDLC receiver context. \return 0 for OK */ SPAN_DECLARE(int) hdlc_rx_release(hdlc_rx_state_t *s); /*! Free an HDLC receiver context. \brief Free an HDLC receiver context. \param s A pointer to an HDLC receiver context. \return 0 for OK */ SPAN_DECLARE(int) hdlc_rx_free(hdlc_rx_state_t *s); /*! \brief Set the maximum frame length for an HDLC receiver context. \param s A pointer to an HDLC receiver context. \param max_len The maximum permitted length of a frame. */ SPAN_DECLARE(void) hdlc_rx_set_max_frame_len(hdlc_rx_state_t *s, size_t max_len); /*! \brief Set the octet counting report interval. \param s A pointer to an HDLC receiver context. \param interval The interval, in octets. */ SPAN_DECLARE(void) hdlc_rx_set_octet_counting_report_interval(hdlc_rx_state_t *s, int interval); /*! \brief Get the current receive statistics. \param s A pointer to an HDLC receiver context. \param t A pointer to the buffer for the statistics. \return 0 for OK, else -1. */ SPAN_DECLARE(int) hdlc_rx_get_stats(hdlc_rx_state_t *s, hdlc_rx_stats_t *t); /*! \brief Put a single bit of data to an HDLC receiver. \param s A pointer to an HDLC receiver context. \param new_bit The bit. */ SPAN_DECLARE_NONSTD(void) hdlc_rx_put_bit(hdlc_rx_state_t *s, int new_bit); /*! \brief Put a byte of data to an HDLC receiver. \param s A pointer to an HDLC receiver context. \param new_byte The byte of data. */ SPAN_DECLARE_NONSTD(void) hdlc_rx_put_byte(hdlc_rx_state_t *s, int new_byte); /*! \brief Put a series of bytes of data to an HDLC receiver. \param s A pointer to an HDLC receiver context. \param buf The buffer of data. \param len The length of the data in the buffer. */ SPAN_DECLARE_NONSTD(void) hdlc_rx_put(hdlc_rx_state_t *s, const uint8_t buf[], int len); /*! Initialise an HDLC transmitter context. \brief Initialise an HDLC transmitter context. \param s A pointer to an HDLC transmitter context. \param crc32 TRUE to use ITU CRC32. FALSE to use ITU CRC16. \param inter_frame_flags The minimum flag octets to insert between frames (usually one). \param progressive TRUE if frame creation works in progressive mode. \param handler The callback function called when the HDLC transmitter underflows. \param user_data An opaque parameter for the callback routine. \return A pointer to the HDLC transmitter context. */ SPAN_DECLARE(hdlc_tx_state_t *) hdlc_tx_init(hdlc_tx_state_t *s, int crc32, int inter_frame_flags, int progressive, hdlc_underflow_handler_t handler, void *user_data); /*! Re-initialise an HDLC transmitter context. \brief Re-initialise an HDLC transmitter context. \param s A pointer to an HDLC transmitter context. \return 0 for success. */ SPAN_DECLARE(int) hdlc_tx_restart(hdlc_tx_state_t *s); /*! Release an HDLC transmitter context. \brief Release an HDLC transmitter context. \param s A pointer to an HDLC transmitter context. \return 0 for OK */ SPAN_DECLARE(int) hdlc_tx_release(hdlc_tx_state_t *s); /*! Free an HDLC transmitter context. \brief Free an HDLC transmitter context. \param s A pointer to an HDLC transmitter context. \return 0 for OK */ SPAN_DECLARE(int) hdlc_tx_free(hdlc_tx_state_t *s); /*! \brief Set the maximum frame length for an HDLC transmitter context. \param s A pointer to an HDLC transmitter context. \param max_len The maximum length. */ SPAN_DECLARE(void) hdlc_tx_set_max_frame_len(hdlc_tx_state_t *s, size_t max_len); /*! \brief Transmit a frame. \param s A pointer to an HDLC transmitter context. \param frame A pointer to the frame to be transmitted. \param len The length of the frame to be transmitted. \return 0 if the frame was accepted for transmission, else -1. */ SPAN_DECLARE(int) hdlc_tx_frame(hdlc_tx_state_t *s, const uint8_t *frame, size_t len); /*! \brief Corrupt the frame currently being transmitted, by giving it the wrong CRC. \param s A pointer to an HDLC transmitter context. \return 0 if the frame was corrupted, else -1. */ SPAN_DECLARE(int) hdlc_tx_corrupt_frame(hdlc_tx_state_t *s); /*! \brief Transmit a specified quantity of flag octets, typically as a preamble. \param s A pointer to an HDLC transmitter context. \param len The length of the required period of flags, in flag octets. If len is zero this requests that HDLC transmission be terminated when the buffers have fully drained. \return 0 if the flags were accepted for transmission, else -1. */ SPAN_DECLARE(int) hdlc_tx_flags(hdlc_tx_state_t *s, int len); /*! \brief Send an abort. \param s A pointer to an HDLC transmitter context. \return 0 if the frame was aborted, else -1. */ SPAN_DECLARE(int) hdlc_tx_abort(hdlc_tx_state_t *s); /*! \brief Get the next bit for transmission. \param s A pointer to an HDLC transmitter context. \return The next bit for transmission. */ SPAN_DECLARE_NONSTD(int) hdlc_tx_get_bit(hdlc_tx_state_t *s); /*! \brief Get the next byte for transmission. \param s A pointer to an HDLC transmitter context. \return The next byte for transmission. */ SPAN_DECLARE_NONSTD(int) hdlc_tx_get_byte(hdlc_tx_state_t *s); /*! \brief Get the next sequence of bytes for transmission. \param s A pointer to an HDLC transmitter context. \param buf The buffer for the data. \param max_len The number of bytes to get. \return The number of bytes actually got. */ SPAN_DECLARE_NONSTD(int) hdlc_tx_get(hdlc_tx_state_t *s, uint8_t buf[], size_t max_len); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/stdbool.h0000644000175000017500000000251712343627363014202 00000000000000/* * SpanDSP - a series of DSP components for telephony * * stdbool.h - A version for systems which lack their own stdbool.h * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /* * ISO C Standard: 7.16 Boolean type and values */ #if !defined(_STDBOOL_H) #define _STDBOOL_H #if !defined(__cplusplus) #define _Bool int #define bool int #define false 0 #define true (!false) #else #define _Bool bool #define bool bool #define false false #define true true #endif /* Signal that all the definitions are present. */ #define __bool_true_false_are_defined 1 #endif spandsp-0.0.6/src/spandsp/swept_tone.h0000664000175000017500000000325511422612264014714 00000000000000/* * SpanDSP - a series of DSP components for telephony * * swept_tone.h - Swept tone generation * * Written by Steve Underwood * * Copyright (C) 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_SWEPT_TONE_H_) #define _SPANDSP_SWEPT_TONE_H_ /*! \page swept_tone_page The swept tone generator \section swept_tone_page_sec_1 What does it do? */ typedef struct swept_tone_state_s swept_tone_state_t; #if defined(__cplusplus) extern "C" { #endif SPAN_DECLARE(swept_tone_state_t *) swept_tone_init(swept_tone_state_t *s, float start, float end, float level, int duration, int repeating); SPAN_DECLARE(int) swept_tone(swept_tone_state_t *s, int16_t amp[], int len); SPAN_DECLARE(float) swept_tone_current_frequency(swept_tone_state_t *s); SPAN_DECLARE(int) swept_tone_release(swept_tone_state_t *s); SPAN_DECLARE(int) swept_tone_free(swept_tone_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/version.h0000664000175000017500000000240611516506100014202 00000000000000/* * SpanDSP - a series of DSP components for telephony * * version.h - A tag file, so the exact installed revision can be assertained. * * Written by Steve Underwood * * Copyright (C) 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_VERSION_H_) #define _SPANDSP_VERSION_H_ /* The date and time of the version are in UTC form. */ #define SPANDSP_RELEASE_DATE 20110122 #define SPANDSP_RELEASE_TIME 075024 #define SPANDSP_RELEASE_DATETIME_STRING "20110122 075024" #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/timezone.h0000664000175000017500000000355611435757501014373 00000000000000/* * SpanDSP - a series of DSP components for telephony * * timezone.h - Timezone handling for time interpretation * * Written by Steve Underwood * * Copyright (C) 2010 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_TIMEZONE_H_) #define _SPANDSP_TIMEZONE_H_ /*! \page timezone_page Timezone handling \section timezone_sec_1 What does it do? \section timezone_sec_2 How does it work? */ typedef struct tz_s tz_t; enum { TM_SUNDAY = 0, TM_MONDAY, TM_TUESDAY, TM_WEDNESDAY, TM_THURSDAY, TM_FRIDAY, TM_SATURDAY }; enum { TM_JANUARY = 0, TM_FEBRUARY, TM_MARCH, TM_APRIL, TM_MAY, TM_JUNE, TM_JULY, TM_AUGUST, TM_SEPTEMBER, TM_OCTOBER, TM_NOVEMBER, TM_DECEMBER }; #if defined(__cplusplus) extern "C" { #endif SPAN_DECLARE(tz_t *) tz_init(tz_t *tz, const char *tzstring); SPAN_DECLARE(int) tz_release(tz_t *tz); SPAN_DECLARE(int) tz_free(tz_t *tz); SPAN_DECLARE(int) tz_localtime(tz_t *tz, struct tm *tm, time_t t); SPAN_DECLARE(const char *) tz_tzname(tz_t *tz, int isdst); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/ima_adpcm.h0000664000175000017500000001000411422612264014425 00000000000000/* * SpanDSP - a series of DSP components for telephony * * ima_adpcm.c - Conversion routines between linear 16 bit PCM data and * IMA/DVI/Intel ADPCM format. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Based on a bit from here, a bit from there, eye of toad, * ear of bat, etc - plus, of course, my own 2 cents. */ /*! \file */ #if !defined(_SPANDSP_IMA_ADPCM_H_) #define _SPANDSP_IMA_ADPCM_H_ /*! \page ima_adpcm_page IMA/DVI/Intel ADPCM encoding and decoding \section ima_adpcm_page_sec_1 What does it do? IMA ADPCM offers a good balance of simplicity and quality at a rate of 32kbps. \section ima_adpcm_page_sec_2 How does it work? \section ima_adpcm_page_sec_3 How do I use it? */ enum { /*! IMA4 is the original IMA ADPCM variant */ IMA_ADPCM_IMA4 = 0, /*! DVI4 is the IMA ADPCM variant defined in RFC3551 */ IMA_ADPCM_DVI4 = 1, /*! VDVI is the variable bit rate IMA ADPCM variant defined in RFC3551 */ IMA_ADPCM_VDVI = 2 }; /*! IMA (DVI/Intel) ADPCM conversion state descriptor. This defines the state of a single working instance of the IMA ADPCM converter. This is used for either linear to ADPCM or ADPCM to linear conversion. */ typedef struct ima_adpcm_state_s ima_adpcm_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Initialise an IMA ADPCM encode or decode context. \param s The IMA ADPCM context. \param variant IMA_ADPCM_IMA4, IMA_ADPCM_DVI4, or IMA_ADPCM_VDVI. \param chunk_size The size of a chunk, in samples. A chunk size of zero sample samples means treat each encode or decode operation as a chunk. \return A pointer to the IMA ADPCM context, or NULL for error. */ SPAN_DECLARE(ima_adpcm_state_t *) ima_adpcm_init(ima_adpcm_state_t *s, int variant, int chunk_size); /*! Release an IMA ADPCM encode or decode context. \param s The IMA ADPCM context. \return 0 for OK. */ SPAN_DECLARE(int) ima_adpcm_release(ima_adpcm_state_t *s); /*! Free an IMA ADPCM encode or decode context. \param s The IMA ADPCM context. \return 0 for OK. */ SPAN_DECLARE(int) ima_adpcm_free(ima_adpcm_state_t *s); /*! Encode a buffer of linear PCM data to IMA ADPCM. \param s The IMA ADPCM context. \param ima_data The IMA ADPCM data produced. \param amp The audio sample buffer. \param len The number of samples in the buffer. \return The number of bytes of IMA ADPCM data produced. */ SPAN_DECLARE(int) ima_adpcm_encode(ima_adpcm_state_t *s, uint8_t ima_data[], const int16_t amp[], int len); /*! Decode a buffer of IMA ADPCM data to linear PCM. \param s The IMA ADPCM context. \param amp The audio sample buffer. \param ima_data The IMA ADPCM data \param ima_bytes The number of bytes of IMA ADPCM data \return The number of samples returned. */ SPAN_DECLARE(int) ima_adpcm_decode(ima_adpcm_state_t *s, int16_t amp[], const uint8_t ima_data[], int ima_bytes); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/vector_float.h0000664000175000017500000001636711422612265015225 00000000000000/* * SpanDSP - a series of DSP components for telephony * * vector_float.h * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_VECTOR_FLOAT_H_) #define _SPANDSP_VECTOR_FLOAT_H_ #if defined(__cplusplus) extern "C" { #endif SPAN_DECLARE(void) vec_copyf(float z[], const float x[], int n); SPAN_DECLARE(void) vec_copy(double z[], const double x[], int n); #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_copyl(long double z[], const long double x[], int n); #endif SPAN_DECLARE(void) vec_negatef(float z[], const float x[], int n); SPAN_DECLARE(void) vec_negate(double z[], const double x[], int n); #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_negatel(long double z[], const long double x[], int n); #endif SPAN_DECLARE(void) vec_zerof(float z[], int n); SPAN_DECLARE(void) vec_zero(double z[], int n); #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_zerol(long double z[], int n); #endif SPAN_DECLARE(void) vec_setf(float z[], float x, int n); SPAN_DECLARE(void) vec_set(double z[], double x, int n); #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_setl(long double z[], long double x, int n); #endif SPAN_DECLARE(void) vec_addf(float z[], const float x[], const float y[], int n); SPAN_DECLARE(void) vec_add(double z[], const double x[], const double y[], int n); #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_addl(long double z[], const long double x[], const long double y[], int n); #endif SPAN_DECLARE(void) vec_scaledxy_addf(float z[], const float x[], float x_scale, const float y[], float y_scale, int n); SPAN_DECLARE(void) vec_scaledxy_add(double z[], const double x[], double x_scale, const double y[], double y_scale, int n); #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_scaledxy_addl(long double z[], const long double x[], long double x_scale, const long double y[], long double y_scale, int n); #endif SPAN_DECLARE(void) vec_scaledy_addf(float z[], const float x[], const float y[], float y_scale, int n); SPAN_DECLARE(void) vec_scaledy_add(double z[], const double x[], const double y[], double y_scale, int n); #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_scaledy_addl(long double z[], const long double x[], const long double y[], long double y_scale, int n); #endif SPAN_DECLARE(void) vec_subf(float z[], const float x[], const float y[], int n); SPAN_DECLARE(void) vec_sub(double z[], const double x[], const double y[], int n); #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_subl(long double z[], const long double x[], const long double y[], int n); #endif SPAN_DECLARE(void) vec_scaledxy_subf(float z[], const float x[], float x_scale, const float y[], float y_scale, int n); SPAN_DECLARE(void) vec_scaledxy_sub(double z[], const double x[], double x_scale, const double y[], double y_scale, int n); #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_scaledxy_subl(long double z[], const long double x[], long double x_scale, const long double y[], long double y_scale, int n); #endif SPAN_DECLARE(void) vec_scaledx_subf(float z[], const float x[], float x_scale, const float y[], int n); SPAN_DECLARE(void) vec_scaledx_sub(double z[], const double x[], double x_scale, const double y[], int n); #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_scaledx_subl(long double z[], const long double x[], long double x_scale, const long double y[], int n); #endif SPAN_DECLARE(void) vec_scaledy_subf(float z[], const float x[], const float y[], float y_scale, int n); SPAN_DECLARE(void) vec_scaledy_sub(double z[], const double x[], const double y[], double y_scale, int n); #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_scaledy_subl(long double z[], const long double x[], const long double y[], long double y_scale, int n); #endif SPAN_DECLARE(void) vec_scalar_mulf(float z[], const float x[], float y, int n); SPAN_DECLARE(void) vec_scalar_mul(double z[], const double x[], double y, int n); #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_scalar_mull(long double z[], const long double x[], long double y, int n); #endif SPAN_DECLARE(void) vec_scalar_addf(float z[], const float x[], float y, int n); SPAN_DECLARE(void) vec_scalar_add(double z[], const double x[], double y, int n); #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_scalar_addl(long double z[], const long double x[], long double y, int n); #endif SPAN_DECLARE(void) vec_scalar_subf(float z[], const float x[], float y, int n); SPAN_DECLARE(void) vec_scalar_sub(double z[], const double x[], double y, int n); #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_scalar_subl(long double z[], const long double x[], long double y, int n); #endif SPAN_DECLARE(void) vec_mulf(float z[], const float x[], const float y[], int n); SPAN_DECLARE(void) vec_mul(double z[], const double x[], const double y[], int n); #if defined(HAVE_LONG_DOUBLE) SPAN_DECLARE(void) vec_mull(long double z[], const long double x[], const long double y[], int n); #endif /*! \brief Find the dot product of two float vectors. \param x The first vector. \param y The first vector. \param n The number of elements in the vectors. \return The dot product of the two vectors. */ SPAN_DECLARE(float) vec_dot_prodf(const float x[], const float y[], int n); /*! \brief Find the dot product of two double vectors. \param x The first vector. \param y The first vector. \param n The number of elements in the vectors. \return The dot product of the two vectors. */ SPAN_DECLARE(double) vec_dot_prod(const double x[], const double y[], int n); #if defined(HAVE_LONG_DOUBLE) /*! \brief Find the dot product of two long double vectors. \param x The first vector. \param y The first vector. \param n The number of elements in the vectors. \return The dot product of the two vectors. */ SPAN_DECLARE(long double) vec_dot_prodl(const long double x[], const long double y[], int n); #endif /*! \brief Find the dot product of two float vectors, where the first is a circular buffer with an offset for the starting position. \param x The first vector. \param y The first vector. \param n The number of elements in the vectors. \param pos The starting position in the x vector. \return The dot product of the two vectors. */ SPAN_DECLARE(float) vec_circular_dot_prodf(const float x[], const float y[], int n, int pos); SPAN_DECLARE(void) vec_lmsf(const float x[], float y[], int n, float error); SPAN_DECLARE(void) vec_circular_lmsf(const float x[], float y[], int n, int pos, float error); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/dc_restore.h0000664000175000017500000000564411422612264014662 00000000000000/* * SpanDSP - a series of DSP components for telephony * * dc_restore.h - General telephony routines to restore the zero D.C. * level to audio which has a D.C. bias. * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_DC_RESTORE_H_) #define _SPANDSP_DC_RESTORE_H_ /*! \page dc_restore_page Removing DC bias from a signal \section dc_restore_page_sec_1 What does it do? Telecoms signals often contain considerable DC, but DC upsets a lot of signal processing functions. Placing a zero DC restorer at the front of the processing chain can often simplify the downstream processing. \section dc_restore_page_sec_2 How does it work? The DC restorer uses a leaky integrator to provide a long-ish term estimate of the DC bias in the signal. A 32 bit estimate is used for the 16 bit audio, so the noise introduced by the estimation can be keep in the lower bits, and the 16 bit DC value, which is subtracted from the signal, is fairly clean. The following code fragment shows the algorithm used. dc_bias is a 32 bit integer, while the sample and the resulting clean_sample are 16 bit integers. dc_bias += ((((int32_t) sample << 15) - dc_bias) >> 14); clean_sample = sample - (dc_bias >> 15); */ /*! Zero DC restoration descriptor. This defines the working state for a single instance of DC content filter. */ typedef struct { int32_t state; } dc_restore_state_t; #if defined(__cplusplus) extern "C" { #endif static __inline__ void dc_restore_init(dc_restore_state_t *dc) { dc->state = 0; } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t dc_restore(dc_restore_state_t *dc, int16_t sample) { dc->state += ((((int32_t) sample << 15) - dc->state) >> 14); return (int16_t) (sample - (dc->state >> 15)); } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t dc_restore_estimate(dc_restore_state_t *dc) { return (int16_t) (dc->state >> 15); } /*- End of function --------------------------------------------------------*/ #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/queue.h0000664000175000017500000001476011422612264013654 00000000000000/* * SpanDSP - a series of DSP components for telephony * * queue.h - simple in process message queuing * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page queue_page Queuing \section queue_page_sec_1 What does it do? This module provides lock free queuing for either octet streams or messages. Specifically, lock free means one thread can write and another can read without locking the queue. It does NOT means a free-for-all is possible, with many threads writing or many threads reading. Those things would require locking, to avoid conflicts between the multiple threads acting on one end of the queue. \section queue_page_sec_2 How does it work? ???. */ #if !defined(_SPANDSP_QUEUE_H_) #define _SPANDSP_QUEUE_H_ /*! Flag bit to indicate queue reads are atomic operations. This must be set if the queue is to be used with the message oriented functions. */ #define QUEUE_READ_ATOMIC 0x0001 /*! Flag bit to indicate queue writes are atomic operations. This must be set if the queue is to be used with the message oriented functions. */ #define QUEUE_WRITE_ATOMIC 0x0002 /*! Queue descriptor. This defines the working state for a single instance of a byte stream or message oriented queue. */ typedef struct queue_state_s queue_state_t; #define QUEUE_STATE_T_SIZE(len) (sizeof(queue_state_t) + len + 1) #if defined(__cplusplus) extern "C" { #endif /*! Check if a queue is empty. \brief Check if a queue is empty. \param s The queue context. \return TRUE if empty, else FALSE. */ SPAN_DECLARE(int) queue_empty(queue_state_t *s); /*! Check the available free space in a queue's buffer. \brief Check available free space. \param s The queue context. \return The number of bytes of free space. */ SPAN_DECLARE(int) queue_free_space(queue_state_t *s); /*! Check the contents of a queue. \brief Check the contents of a queue. \param s The queue context. \return The number of bytes in the queue. */ SPAN_DECLARE(int) queue_contents(queue_state_t *s); /*! Flush the contents of a queue. \brief Flush the contents of a queue. \param s The queue context. */ SPAN_DECLARE(void) queue_flush(queue_state_t *s); /*! Copy bytes from a queue. This is similar to queue_read, but the data remains in the queue. \brief Copy bytes from a queue. \param s The queue context. \param buf The buffer into which the bytes will be read. \param len The length of the buffer. \return the number of bytes returned. */ SPAN_DECLARE(int) queue_view(queue_state_t *s, uint8_t *buf, int len); /*! Read bytes from a queue. \brief Read bytes from a queue. \param s The queue context. \param buf The buffer into which the bytes will be read. \param len The length of the buffer. \return the number of bytes returned. */ SPAN_DECLARE(int) queue_read(queue_state_t *s, uint8_t *buf, int len); /*! Read a byte from a queue. \brief Read a byte from a queue. \param s The queue context. \return the byte, or -1 if the queue is empty. */ SPAN_DECLARE(int) queue_read_byte(queue_state_t *s); /*! Write bytes to a queue. \brief Write bytes to a queue. \param s The queue context. \param buf The buffer containing the bytes to be written. \param len The length of the buffer. \return the number of bytes actually written. */ SPAN_DECLARE(int) queue_write(queue_state_t *s, const uint8_t *buf, int len); /*! Write a byte to a queue. \brief Write a byte to a queue. \param s The queue context. \param byte The byte to be written. \return the number of bytes actually written. */ SPAN_DECLARE(int) queue_write_byte(queue_state_t *s, uint8_t byte); /*! Test the length of the message at the head of a queue. \brief Test message length. \param s The queue context. \return The length of the next message, in byte. If there are no messages in the queue, -1 is returned. */ SPAN_DECLARE(int) queue_state_test_msg(queue_state_t *s); /*! Read a message from a queue. If the message is longer than the buffer provided, only the first len bytes of the message will be returned. The remainder of the message will be discarded. \brief Read a message from a queue. \param s The queue context. \param buf The buffer into which the message will be read. \param len The length of the buffer. \return The number of bytes returned. If there are no messages in the queue, -1 is returned. */ SPAN_DECLARE(int) queue_read_msg(queue_state_t *s, uint8_t *buf, int len); /*! Write a message to a queue. \brief Write a message to a queue. \param s The queue context. \param buf The buffer from which the message will be written. \param len The length of the message. \return The number of bytes actually written. */ SPAN_DECLARE(int) queue_write_msg(queue_state_t *s, const uint8_t *buf, int len); /*! Initialise a queue. \brief Initialise a queue. \param s The queue context. If is imperative that the context this points to is immediately followed by a buffer of the required size + 1 octet. \param len The length of the queue's buffer. \param flags Flags controlling the operation of the queue. Valid flags are QUEUE_READ_ATOMIC and QUEUE_WRITE_ATOMIC. \return A pointer to the context if OK, else NULL. */ SPAN_DECLARE(queue_state_t *) queue_init(queue_state_t *s, int len, int flags); /*! Release a queue. \brief Release a queue. \param s The queue context. \return 0 if OK, else -1. */ SPAN_DECLARE(int) queue_release(queue_state_t *s); /*! Free a queue. \brief Delete a queue. \param s The queue context. \return 0 if OK, else -1. */ SPAN_DECLARE(int) queue_free(queue_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/t38_core.h0000664000175000017500000004265012100771114014147 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t38_core.h - An implementation of T.38, less the packet exchange part * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_T38_CORE_H_) #define _SPANDSP_T38_CORE_H_ /*! \page t38_core_page T.38 real time FAX over IP message handling There are two ITU recommendations which address sending FAXes over IP networks. T.37 specifies a method of encapsulating FAX images in e-mails, and transporting them to the recipient (an e-mail box, or another FAX machine) in a store-and-forward manner. T.38 defines a protocol for transmitting a FAX across an IP network in real time. The core T.38 modules implements the basic message handling for the T.38, real time, FAX over IP (FoIP) protocol. The T.38 protocol can operate between: - Internet-aware FAX terminals, which connect directly to an IP network. The T.38 terminal module extends this module to provide a complete T.38 terminal. - FAX gateways, which allow traditional PSTN FAX terminals to communicate through the Internet. The T.38 gateway module extends this module to provide a T.38 gateway. - A combination of terminals and gateways. T.38 is the only standardised protocol which exists for real-time FoIP. Reliably transporting a FAX between PSTN FAX terminals, through an IP network, requires use of the T.38 protocol at FAX gateways. VoIP connections are not robust for modem use, including FAX modem use. Most use low bit rate codecs, which cannot convey the modem signals accurately. Even when high bit rate codecs are used, VoIP connections suffer dropouts and timing adjustments, which modems cannot tolerate. In a LAN environment the dropout rate may be very low, but the timing adjustments which occur in VoIP connections still make modem operation unreliable. T.38 FAX gateways deal with the delays, timing jitter, and packet loss experienced in packet networks, and isolate the PSTN FAX terminals from these as far as possible. In addition, by sending FAXes as image data, rather than digitised audio, they reduce the required bandwidth of the IP network. \section t38_core_page_sec_1 What does it do? \section t38_core_page_sec_2 How does it work? Timing differences and jitter between two T.38 entities can be a serious problem, if one of those entities is a PSTN gateway. Flow control for non-ECM image data takes advantage of several features of the T.30 specification. First, an unspecified number of 0xFF octets may be sent at the start of transmission. This means we can add endless extra 0xFF bytes at this point, without breaking the T.30 spec. In practice, we cannot add too many, or we will affect the timing tolerance of the T.30 protocol by delaying the response at the end of each image. Secondly, just before an end of line (EOL) marker we can pad with zero bits. Again, the number is limited only by need to avoid upsetting the timing of the step following the non-ECM data. */ /*! T.38 indicator types */ enum t30_indicator_types_e { T38_IND_NO_SIGNAL = 0, T38_IND_CNG, T38_IND_CED, T38_IND_V21_PREAMBLE, T38_IND_V27TER_2400_TRAINING, T38_IND_V27TER_4800_TRAINING, T38_IND_V29_7200_TRAINING, T38_IND_V29_9600_TRAINING, T38_IND_V17_7200_SHORT_TRAINING, T38_IND_V17_7200_LONG_TRAINING, T38_IND_V17_9600_SHORT_TRAINING, T38_IND_V17_9600_LONG_TRAINING, T38_IND_V17_12000_SHORT_TRAINING, T38_IND_V17_12000_LONG_TRAINING, T38_IND_V17_14400_SHORT_TRAINING, T38_IND_V17_14400_LONG_TRAINING, T38_IND_V8_ANSAM, T38_IND_V8_SIGNAL, T38_IND_V34_CNTL_CHANNEL_1200, T38_IND_V34_PRI_CHANNEL, T38_IND_V34_CC_RETRAIN, T38_IND_V33_12000_TRAINING, T38_IND_V33_14400_TRAINING }; /*! T.38 data types */ enum t38_data_types_e { T38_DATA_NONE = -1, T38_DATA_V21 = 0, T38_DATA_V27TER_2400, T38_DATA_V27TER_4800, T38_DATA_V29_7200, T38_DATA_V29_9600, T38_DATA_V17_7200, T38_DATA_V17_9600, T38_DATA_V17_12000, T38_DATA_V17_14400, T38_DATA_V8, T38_DATA_V34_PRI_RATE, T38_DATA_V34_CC_1200, T38_DATA_V34_PRI_CH, T38_DATA_V33_12000, T38_DATA_V33_14400 }; /*! T.38 data field types */ enum t38_field_types_e { T38_FIELD_HDLC_DATA = 0, T38_FIELD_HDLC_SIG_END, T38_FIELD_HDLC_FCS_OK, T38_FIELD_HDLC_FCS_BAD, T38_FIELD_HDLC_FCS_OK_SIG_END, T38_FIELD_HDLC_FCS_BAD_SIG_END, T38_FIELD_T4_NON_ECM_DATA, T38_FIELD_T4_NON_ECM_SIG_END, T38_FIELD_CM_MESSAGE, T38_FIELD_JM_MESSAGE, T38_FIELD_CI_MESSAGE, T38_FIELD_V34RATE }; /*! T.38 field classes */ enum t38_field_classes_e { T38_FIELD_CLASS_NONE = 0, T38_FIELD_CLASS_HDLC, T38_FIELD_CLASS_NON_ECM }; /*! T.38 message types */ enum t38_message_types_e { T38_TYPE_OF_MSG_T30_INDICATOR = 0, T38_TYPE_OF_MSG_T30_DATA }; /*! T.38 transport types */ enum t38_transport_types_e { T38_TRANSPORT_UDPTL = 0, T38_TRANSPORT_RTP, T38_TRANSPORT_TCP, T38_TRANSPORT_TCP_TPKT }; /*! T.38 TCF management types */ enum t38_data_rate_management_types_e { T38_DATA_RATE_MANAGEMENT_LOCAL_TCF = 1, T38_DATA_RATE_MANAGEMENT_TRANSFERRED_TCF = 2 }; /*! T.38 Packet categories used for setting the redundancy level and packet repeat counts on a packet by packet basis. */ enum t38_packet_categories_e { /*! \brief Indicator packet */ T38_PACKET_CATEGORY_INDICATOR = 0, /*! \brief Control data packet */ T38_PACKET_CATEGORY_CONTROL_DATA = 1, /*! \brief Terminating control data packet */ T38_PACKET_CATEGORY_CONTROL_DATA_END = 2, /*! \brief Image data packet */ T38_PACKET_CATEGORY_IMAGE_DATA = 3, /*! \brief Terminating image data packet */ T38_PACKET_CATEGORY_IMAGE_DATA_END = 4 }; #define T38_RX_BUF_LEN 2048 #define T38_TX_BUF_LEN 16384 /*! T.38 data field */ typedef struct { /*! Field type */ int field_type; /*! Field contents */ const uint8_t *field; /*! Field length */ int field_len; } t38_data_field_t; /*! Core T.38 state, common to all modes of T.38. */ typedef struct t38_core_state_s t38_core_state_t; typedef int (t38_tx_packet_handler_t)(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count); typedef int (t38_rx_indicator_handler_t)(t38_core_state_t *s, void *user_data, int indicator); typedef int (t38_rx_data_handler_t)(t38_core_state_t *s, void *user_data, int data_type, int field_type, const uint8_t *buf, int len); typedef int (t38_rx_missing_handler_t)(t38_core_state_t *s, void *user_data, int rx_seq_no, int expected_seq_no); #if defined(__cplusplus) extern "C" { #endif /*! \brief Convert the code for an indicator to a short text name. \param indicator The type of indicator. \return A pointer to a short text name for the indicator. */ SPAN_DECLARE(const char *) t38_indicator_to_str(int indicator); /*! \brief Convert the code for a type of data to a short text name. \param data_type The data type. \return A pointer to a short text name for the data type. */ SPAN_DECLARE(const char *) t38_data_type_to_str(int data_type); /*! \brief Convert the code for a type of data field to a short text name. \param field_type The field type. \return A pointer to a short text name for the field type. */ SPAN_DECLARE(const char *) t38_field_type_to_str(int field_type); /*! \brief Convert the code for a CM profile code to text description. \param profile The profile code from a CM message. \return A pointer to a short text description of the profile. */ SPAN_DECLARE(const char *) t38_cm_profile_to_str(int profile); /*! \brief Convert a JM message code to text description. \param data The data field of the message. \param len The length of the data field. \return A pointer to a short text description of the profile. */ SPAN_DECLARE(const char *) t38_jm_to_str(const uint8_t *data, int len); /*! \brief Convert a V34rate message to an actual bit rate. \param data The data field of the message. \param len The length of the data field. \return The bit rate, or -1 for a bad message. */ SPAN_DECLARE(int) t38_v34rate_to_bps(const uint8_t *data, int len); /*! \brief Send an indicator packet \param s The T.38 context. \param indicator The indicator to send. \return The delay to allow after this indicator is sent. */ SPAN_DECLARE(int) t38_core_send_indicator(t38_core_state_t *s, int indicator); /*! \brief Find the delay to allow for HDLC flags after sending an indicator \param s The T.38 context. \param indicator The indicator to check. \return The delay to allow for initial HDLC flags after this indicator is sent. */ SPAN_DECLARE(int) t38_core_send_flags_delay(t38_core_state_t *s, int indicator); /*! \brief Find the delay to allow for modem training after sending an indicator \param s The T.38 context. \param indicator The indicator to check. \return The delay to allow for modem training after this indicator is sent. */ SPAN_DECLARE(int) t38_core_send_training_delay(t38_core_state_t *s, int indicator); /*! \brief Send a data packet \param s The T.38 context. \param data_type The packet's data type. \param field_type The packet's field type. \param field The message data content for the packet. \param field_len The length of the message data, in bytes. \param category The category of the packet being sent. This should be one of the values defined for t38_packet_categories_e. \return 0 for OK, else -1 */ SPAN_DECLARE(int) t38_core_send_data(t38_core_state_t *s, int data_type, int field_type, const uint8_t field[], int field_len, int category); /*! \brief Send a data packet \param s The T.38 context. \param data_type The packet's data type. \param field The list of fields. \param fields The number of fields in the list. \param category The category of the packet being sent. This should be one of the values defined for t38_packet_categories_e. \return 0 for OK, else -1 */ SPAN_DECLARE(int) t38_core_send_data_multi_field(t38_core_state_t *s, int data_type, const t38_data_field_t field[], int fields, int category); /*! \brief Process a received T.38 IFP packet from an unreliable packet stream (e.g. UDPTL or RTP). This processing includes packet sequence number checking, missing packet recovery, and skipping repeat packets. \param s The T.38 context. \param buf The packet contents. \param len The length of the packet contents. \param seq_no The packet sequence number. \return 0 for OK, else -1. */ SPAN_DECLARE_NONSTD(int) t38_core_rx_ifp_packet(t38_core_state_t *s, const uint8_t *buf, int len, uint16_t seq_no); /*! \brief Process a received T.38 IFP packet from a reliable stream (e.g. TCP). \param s The T.38 context. \param buf The packet contents. \param len The length of the packet contents. \param seq_no The packet sequence number, used for logging purposes. \return The length of the packet processed, or -1 if there is an error in the packet, or too few bytes of data to complete it. */ SPAN_DECLARE_NONSTD(int) t38_core_rx_ifp_stream(t38_core_state_t *s, const uint8_t *buf, int len, uint16_t log_seq_no); /*! Set the method to be used for data rate management, as per the T.38 spec. \param s The T.38 context. \param method 1 for pass TCF across the T.38 link, 2 for handle TCF locally. */ SPAN_DECLARE(void) t38_set_data_rate_management_method(t38_core_state_t *s, int method); /*! Set the data transport protocol. \param s The T.38 context. \param data_transport_protocol UDPTL, RTP or TPKT. */ SPAN_DECLARE(void) t38_set_data_transport_protocol(t38_core_state_t *s, int data_transport_protocol); /*! Set the non-ECM fill bit removal mode. \param s The T.38 context. \param fill_bit_removal TRUE to remove fill bits across the T.38 link, else FALSE. */ SPAN_DECLARE(void) t38_set_fill_bit_removal(t38_core_state_t *s, int fill_bit_removal); /*! Set the MMR transcoding mode. \param s The T.38 context. \param mmr_transcoding TRUE to transcode to MMR across the T.38 link, else FALSE. */ SPAN_DECLARE(void) t38_set_mmr_transcoding(t38_core_state_t *s, int mmr_transcoding); /*! Set the JBIG transcoding mode. \param s The T.38 context. \param jbig_transcoding TRUE to transcode to JBIG across the T.38 link, else FALSE. */ SPAN_DECLARE(void) t38_set_jbig_transcoding(t38_core_state_t *s, int jbig_transcoding); /*! Set the maximum buffer size for received data at the far end. \param s The T.38 context. \param max_buffer_size The maximum buffer size. */ SPAN_DECLARE(void) t38_set_max_buffer_size(t38_core_state_t *s, int max_buffer_size); /*! Set the maximum size of an IFP packet that is acceptable by the far end. \param s The T.38 context. \param max_datagram_size The maximum IFP packet length, in bytes. */ SPAN_DECLARE(void) t38_set_max_datagram_size(t38_core_state_t *s, int max_datagram_size); /*! \brief Send a data packet \param s The T.38 context. \param category The category of the packet being sent. This should be one of the values defined for t38_packet_categories_e. \param setting The repeat count for the category. This should be at least one for all categories other an indicator packets. Zero is valid for indicator packets, as it suppresses the sending of indicator packets, as an application using TCP for the transport would require. As the setting is passed through to the transmission channel, additional information may be encoded in it, such as the redundancy depth for the particular packet category. */ SPAN_DECLARE(void) t38_set_redundancy_control(t38_core_state_t *s, int category, int setting); SPAN_DECLARE(void) t38_set_pace_transmission(t38_core_state_t *s, int pace_transmission); SPAN_DECLARE(void) t38_set_fastest_image_data_rate(t38_core_state_t *s, int max_rate); SPAN_DECLARE(int) t38_get_fastest_image_data_rate(t38_core_state_t *s); /*! Set the T.38 version to be emulated. \param s The T.38 context. \param t38_version Version number, as in the T.38 spec. */ SPAN_DECLARE(void) t38_set_t38_version(t38_core_state_t *s, int t38_version); /*! Set the sequence number handling option. \param s The T.38 context. \param check TRUE to check sequence numbers, and handle gaps reasonably. FALSE for no sequence number processing (e.g. for TPKT over TCP transport). */ SPAN_DECLARE(void) t38_set_sequence_number_handling(t38_core_state_t *s, int check); /*! Set the TEP handling option. \param s The T.38 context. \param allow_for_tep TRUE to allow for TEP playout, else FALSE. */ SPAN_DECLARE(void) t38_set_tep_handling(t38_core_state_t *s, int allow_for_tep); /*! Get a pointer to the logging context associated with a T.38 context. \brief Get a pointer to the logging context associated with a T.38 context. \param s The T.38 context. \return A pointer to the logging context, or NULL. */ SPAN_DECLARE(logging_state_t *) t38_core_get_logging_state(t38_core_state_t *s); /*! Restart a T.38 core context. \brief Restart a T.38 core context. \param s The T.38 context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) t38_core_restart(t38_core_state_t *s); /*! Initialise a T.38 core context. \brief Initialise a T.38 core context. \param s The T.38 context. \param rx_indicator_handler Receive indicator handling routine. \param rx_data_handler Receive data packet handling routine. \param rx_rx_missing_handler Missing receive packet handling routine. \param rx_packet_user_data An opaque pointer passed to the rx packet handling routines. \param tx_packet_handler Packet transmit handling routine. \param tx_packet_user_data An opaque pointer passed to the tx_packet_handler. \return A pointer to the T.38 context, or NULL if there was a problem. */ SPAN_DECLARE(t38_core_state_t *) t38_core_init(t38_core_state_t *s, t38_rx_indicator_handler_t *rx_indicator_handler, t38_rx_data_handler_t *rx_data_handler, t38_rx_missing_handler_t *rx_missing_handler, void *rx_user_data, t38_tx_packet_handler_t *tx_packet_handler, void *tx_packet_user_data); /*! Release a signaling tone transmitter context. \brief Release a signaling tone transmitter context. \param s The T.38 context. \return 0 for OK */ SPAN_DECLARE(int) t38_core_release(t38_core_state_t *s); /*! Free a signaling tone transmitter context. \brief Free a signaling tone transmitter context. \param s The T.38 context. \return 0 for OK */ SPAN_DECLARE(int) t38_core_free(t38_core_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/v8.h0000664000175000017500000001546112100754056013064 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v8.h - V.8 modem negotiation processing. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page v8_page The V.8 modem negotiation protocol \section v8_page_sec_1 What does it do? The V.8 specification defines a procedure to be used as PSTN modem answer phone calls, which allows the modems to negotiate the optimum modem standard, which both ends can support. \section v8_page_sec_2 How does it work? At startup the modems communicate using the V.21 standard at 300 bits/second. They exchange simple messages about their capabilities, and choose the modem standard they will use for data communication. The V.8 protocol then terminates, and the modems being negotiating and training with their chosen modem standard. */ #if !defined(_SPANDSP_V8_H_) #define _SPANDSP_V8_H_ typedef struct v8_parms_s v8_parms_t; typedef void (*v8_result_handler_t)(void *user_data, v8_parms_t *result); enum v8_call_function_e { V8_CALL_TBS = 0, V8_CALL_H324 = 1, V8_CALL_V18 = 2, V8_CALL_T101 = 3, V8_CALL_T30_TX = 4, V8_CALL_T30_RX = 5, V8_CALL_V_SERIES = 6, V8_CALL_FUNCTION_EXTENSION = 7 }; enum v8_modulation_e { V8_MOD_V17 = (1 << 0), /* V.17 half-duplex */ V8_MOD_V21 = (1 << 1), /* V.21 duplex */ V8_MOD_V22 = (1 << 2), /* V.22/V22.bis duplex */ V8_MOD_V23HDX = (1 << 3), /* V.23 half-duplex */ V8_MOD_V23 = (1 << 4), /* V.23 duplex */ V8_MOD_V26BIS = (1 << 5), /* V.23 duplex */ V8_MOD_V26TER = (1 << 6), /* V.23 duplex */ V8_MOD_V27TER = (1 << 7), /* V.23 duplex */ V8_MOD_V29 = (1 << 8), /* V.29 half-duplex */ V8_MOD_V32 = (1 << 9), /* V.32/V32.bis duplex */ V8_MOD_V34HDX = (1 << 10), /* V.34 half-duplex */ V8_MOD_V34 = (1 << 11), /* V.34 duplex */ V8_MOD_V90 = (1 << 12), /* V.90 duplex */ V8_MOD_V92 = (1 << 13) /* V.92 duplex */ }; enum v8_protocol_e { V8_PROTOCOL_NONE = 0, V8_PROTOCOL_LAPM_V42 = 1, V8_PROTOCOL_EXTENSION = 7 }; enum v8_pstn_access_e { V8_PSTN_ACCESS_CALL_DCE_CELLULAR = 0x01, V8_PSTN_ACCESS_ANSWER_DCE_CELLULAR = 0x02, V8_PSTN_ACCESS_DCE_ON_DIGITAL = 0x04 }; enum v8_pcm_modem_availability_e { V8_PSTN_PCM_MODEM_V90_V92_ANALOGUE = 0x01, V8_PSTN_PCM_MODEM_V90_V92_DIGITAL = 0x02, V8_PSTN_PCM_MODEM_V91 = 0x04 }; enum v8_status_e { /*! V.8 negotiation is in progress. */ V8_STATUS_IN_PROGRESS = 0, /*! V.8 has been offered by the other (calling) party. */ V8_STATUS_V8_OFFERED = 1, /*! V.8 has been successfully negotiated. Note that this only means the V.8 message exchange has successfully completed. The actual exchanged parameters must be checked, to see if the call can proceed properly. */ V8_STATUS_V8_CALL = 2, /*! A non-V.8 is being received. */ V8_STATUS_NON_V8_CALL = 3, /*! V.8 negotiation failed. */ V8_STATUS_FAILED = 4 }; typedef struct v8_state_s v8_state_t; struct v8_parms_s { int status; int modem_connect_tone; int send_ci; int v92; int call_function; unsigned int modulations; int protocol; int pstn_access; int pcm_modem_availability; int nsf; int t66; }; #if defined(__cplusplus) extern "C" { #endif SPAN_DECLARE(int) v8_restart(v8_state_t *s, int calling_party, v8_parms_t *parms); /*! Initialise a V.8 context. \brief Initialise a V.8 context. \param s The V.8 context. \param calling_party TRUE if caller mode, else answerer mode. \param parms The allowed parameters for the call. \param result_handler The callback routine used to handle the results of negotiation. \param user_data An opaque pointer passed to the result_handler routine. \return A pointer to the V.8 context, or NULL if there was a problem. */ SPAN_DECLARE(v8_state_t *) v8_init(v8_state_t *s, int calling_party, v8_parms_t *parms, v8_result_handler_t result_handler, void *user_data); /*! Release a V.8 context. \brief Release a V.8 context. \param s The V.8 context. \return 0 for OK. */ SPAN_DECLARE(int) v8_release(v8_state_t *s); /*! Free a V.8 context. \brief Release a V.8 context. \param s The V.8 context. \return 0 for OK. */ SPAN_DECLARE(int) v8_free(v8_state_t *s); SPAN_DECLARE(logging_state_t *) v8_get_logging_state(v8_state_t *s); /*! Generate a block of V.8 audio samples. \brief Generate a block of V.8 audio samples. \param s The V.8 context. \param amp The audio sample buffer. \param max_len The number of samples to be generated. \return The number of samples actually generated. */ SPAN_DECLARE_NONSTD(int) v8_tx(v8_state_t *s, int16_t *amp, int max_len); /*! Process a block of received V.8 audio samples. \brief Process a block of received V.8 audio samples. \param s The V.8 context. \param amp The audio sample buffer. \param len The number of samples in the buffer. */ SPAN_DECLARE_NONSTD(int) v8_rx(v8_state_t *s, const int16_t *amp, int len); /*! Log the list of supported modulations. \brief Log the list of supported modulations. \param s The V.8 context. \param modulation_schemes The list of supported modulations. */ SPAN_DECLARE(void) v8_log_supported_modulations(v8_state_t *s, int modulation_schemes); SPAN_DECLARE(const char *) v8_call_function_to_str(int call_function); SPAN_DECLARE(const char *) v8_modulation_to_str(int modulation_scheme); SPAN_DECLARE(const char *) v8_protocol_to_str(int protocol); SPAN_DECLARE(const char *) v8_pstn_access_to_str(int pstn_access); SPAN_DECLARE(const char *) v8_nsf_to_str(int nsf); SPAN_DECLARE(const char *) v8_pcm_modem_availability_to_str(int pcm_modem_availability); SPAN_DECLARE(const char *) v8_t66_to_str(int t66); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/v29rx.h0000664000175000017500000003030312100763610013505 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v29rx.h - ITU V.29 modem receive part * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_V29RX_H_) #define _SPANDSP_V29RX_H_ /*! \page v29rx_page The V.29 receiver \section v29rx_page_sec_1 What does it do? The V.29 receiver implements the receive side of a V.29 modem. This can operate at data rates of 9600, 7200 and 4800 bits/s. The audio input is a stream of 16 bit samples, at 8000 samples/second. The transmit and receive side of V.29 modems operate independantly. V.29 is mostly used for FAX transmission, where it provides the standard 9600 and 7200 bits/s rates (the 4800 bits/s mode is not used for FAX). \section v29rx_page_sec_2 How does it work? V.29 operates at 2400 baud for all three bit rates. It uses 16-QAM modulation for 9600bps, 8-QAM for 7200bps, and 4-PSK for 4800bps. A training sequence is specified at the start of transmission, which makes the design of a V.29 receiver relatively straightforward. The first stage of the training sequence consists of 128 symbols, alternating between two constellation positions. The receiver monitors the signal power, to sense the possible presence of a valid carrier. When the alternating signal begins, the power rising above a minimum threshold (-26dBm0) causes the main receiver computation to begin. The initial measured power is used to quickly set the gain of the receiver. After this initial settling, the front end gain is locked, and the adaptive equalizer tracks any subsequent signal level variation. The signal is oversampled to 24000 samples/second (i.e. signal, zero, zero, signal, zero, zero, ...) and fed to a complex root raised cosine pulse shaping filter. This filter has been modified from the conventional root raised cosine filter, by shifting it up the band, to be centred at the nominal carrier frequency. This filter interpolates the samples, pulse shapes, and performs a fractional sample delay at the same time. 48 sets of filter coefficients are used to achieve a set of finely spaces fractional sample delays, between zero and one sample. By choosing every fifth sample, and the appropriate set of filter coefficients, the properly tuned symbol tracker can select data samples at 4800 samples/second from points within 1.125 degrees of the centre and mid-points of each symbol. The output of the filter is multiplied by a complex carrier, generated by a DDS. The result is a baseband signal, requiring no further filtering, apart from an adaptive equalizer. The baseband signal is fed to a T/2 adaptive equalizer. A band edge component maximisation algorithm is used to tune the sampling, so the samples fed to the equalizer are close to the mid point and edges of each symbol. Initially the algorithm is very lightly damped, to ensure the symbol alignment pulls in quickly. Because the sampling rate will not be precisely the same as the transmitter's (the spec. says the symbol timing should be within 0.01%), the receiver constantly evaluates and corrects this sampling throughout its operation. During the symbol timing maintainence phase, the algorithm uses a heavier damping. The carrier is specified as 1700Hz +-1Hz at the transmitter, and 1700 +-7Hz at the receiver. The receive carrier would only be this inaccurate if the link includes FDM sections. These are being phased out, but the design must still allow for the worst case. Using an initial 1700Hz signal for demodulation gives a worst case rotation rate for the constellation of about one degree per symbol. Once the symbol timing synchronisation algorithm has been given time to lock to the symbol timing of the initial alternating pattern, the phase of the demodulated signal is recorded on two successive symbols - once for each of the constellation positions. The receiver then tracks the symbol alternations, until a large phase jump occurs. This signifies the start of the next phase of the training sequence. At this point the total phase shift between the original recorded symbol phase, and the symbol phase just before the phase jump occurred is used to provide a coarse estimation of the rotation rate of the constellation, and it current absolute angle of rotation. These are used to update the current carrier phase and phase update rate in the carrier DDS. The working data already in the pulse shaping filter and equalizer buffers is given a similar step rotation to pull it all into line. From this point on, a heavily damped integrate and dump approach, based on the angular difference between each received constellation position and its expected position, is sufficient to track the carrier, and maintain phase alignment. A fast rough approximator for the arc-tangent function is adequate for the estimation of the angular error. The next phase of the training sequence is a scrambled sequence of two particular symbols. We train the T/2 adaptive equalizer using this sequence. The scrambling makes the signal sufficiently diverse to ensure the equalizer converges to the proper generalised solution. At the end of this sequence, the equalizer should be sufficiently well adapted that is can correctly resolve the full QAM constellation. However, the equalizer continues to adapt throughout operation of the modem, fine tuning on the more complex data patterns of the full QAM constellation. In the last phase of the training sequence, the modem enters normal data operation, with a short defined period of all ones as data. As in most high speed modems, data in a V.29 modem passes through a scrambler, to whiten the spectrum of the signal. The transmitter should initialise its data scrambler, and pass the ones through it. At the end of the ones, real data begins to pass through the scrambler, and the transmit modem is in normal operation. The receiver tests that ones are really received, in order to verify the modem trained correctly. If all is well, the data following the ones is fed to the application, and the receive modem is up and running. Unfortunately, some transmit side of some real V.29 modems fail to initialise their scrambler before sending the ones. This means the first 23 received bits (the length of the scrambler register) cannot be trusted for the test. The receive modem, therefore, only tests that bits starting at bit 24 are really ones. */ typedef void (*qam_report_handler_t)(void *user_data, const complexf_t *constel, const complexf_t *target, int symbol); /*! V.29 modem receive side descriptor. This defines the working state for a single instance of a V.29 modem receiver. */ typedef struct v29_rx_state_s v29_rx_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Initialise a V.29 modem receive context. \brief Initialise a V.29 modem receive context. \param s The modem context. \param bit_rate The bit rate of the modem. Valid values are 4800, 7200 and 9600. \param put_bit The callback routine used to put the received data. \param user_data An opaque pointer passed to the put_bit routine. \return A pointer to the modem context, or NULL if there was a problem. */ SPAN_DECLARE(v29_rx_state_t *) v29_rx_init(v29_rx_state_t *s, int bit_rate, put_bit_func_t put_bit, void *user_data); /*! Reinitialise an existing V.29 modem receive context. \brief Reinitialise an existing V.29 modem receive context. \param s The modem context. \param bit_rate The bit rate of the modem. Valid values are 4800, 7200 and 9600. \param old_train TRUE if a previous trained values are to be reused. \return 0 for OK, -1 for bad parameter */ SPAN_DECLARE(int) v29_rx_restart(v29_rx_state_t *s, int bit_rate, int old_train); /*! Release a V.29 modem receive context. \brief Release a V.29 modem receive context. \param s The modem context. \return 0 for OK */ SPAN_DECLARE(int) v29_rx_release(v29_rx_state_t *s); /*! Free a V.29 modem receive context. \brief Free a V.29 modem receive context. \param s The modem context. \return 0 for OK */ SPAN_DECLARE(int) v29_rx_free(v29_rx_state_t *s); /*! Get the logging context associated with a V.29 modem receive context. \brief Get the logging context associated with a V.29 modem receive context. \param s The modem context. \return A pointer to the logging context */ SPAN_DECLARE(logging_state_t *) v29_rx_get_logging_state(v29_rx_state_t *s); /*! Change the put_bit function associated with a V.29 modem receive context. \brief Change the put_bit function associated with a V.29 modem receive context. \param s The modem context. \param put_bit The callback routine used to handle received bits. \param user_data An opaque pointer. */ SPAN_DECLARE(void) v29_rx_set_put_bit(v29_rx_state_t *s, put_bit_func_t put_bit, void *user_data); /*! Change the modem status report function associated with a V.29 modem receive context. \brief Change the modem status report function associated with a V.29 modem receive context. \param s The modem context. \param handler The callback routine used to report modem status changes. \param user_data An opaque pointer. */ SPAN_DECLARE(void) v29_rx_set_modem_status_handler(v29_rx_state_t *s, modem_status_func_t handler, void *user_data); /*! Process a block of received V.29 modem audio samples. \brief Process a block of received V.29 modem audio samples. \param s The modem context. \param amp The audio sample buffer. \param len The number of samples in the buffer. \return The number of samples unprocessed. */ SPAN_DECLARE_NONSTD(int) v29_rx(v29_rx_state_t *s, const int16_t amp[], int len); /*! Fake processing of a missing block of received V.29 modem audio samples. (e.g due to packet loss). \brief Fake processing of a missing block of received V.29 modem audio samples. \param s The modem context. \param len The number of samples to fake. \return The number of samples unprocessed. */ SPAN_DECLARE_NONSTD(int) v29_rx_fillin(v29_rx_state_t *s, int len); /*! Get a snapshot of the current equalizer coefficients. \brief Get a snapshot of the current equalizer coefficients. \param s The modem context. \param coeffs The vector of complex coefficients. \return The number of coefficients in the vector. */ #if defined(SPANDSP_USE_FIXED_POINT) SPAN_DECLARE(int) v29_rx_equalizer_state(v29_rx_state_t *s, complexi16_t **coeffs); #else SPAN_DECLARE(int) v29_rx_equalizer_state(v29_rx_state_t *s, complexf_t **coeffs); #endif /*! Get the current received carrier frequency. \param s The modem context. \return The frequency, in Hertz. */ SPAN_DECLARE(float) v29_rx_carrier_frequency(v29_rx_state_t *s); /*! Get the current symbol timing correction since startup. \param s The modem context. \return The correction. */ SPAN_DECLARE(float) v29_rx_symbol_timing_correction(v29_rx_state_t *s); /*! Get the current received signal power. \param s The modem context. \return The signal power, in dBm0. */ SPAN_DECLARE(float) v29_rx_signal_power(v29_rx_state_t *s); /*! Set the power level at which the carrier detection will cut in \param s The modem context. \param cutoff The signal cutoff power, in dBm0. */ SPAN_DECLARE(void) v29_rx_signal_cutoff(v29_rx_state_t *s, float cutoff); /*! Set a handler routine to process QAM status reports \param s The modem context. \param handler The handler routine. \param user_data An opaque pointer passed to the handler routine. */ SPAN_DECLARE(void) v29_rx_set_qam_report_handler(v29_rx_state_t *s, qam_report_handler_t handler, void *user_data); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/silence_gen.h0000664000175000017500000001302312100762145014770 00000000000000/* * SpanDSP - a series of DSP components for telephony * * silence_gen.c - A silence generator, for inserting timed silences. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_SILENCE_GEN_H_) #define _SPANDSP_SILENCE_GEN_H_ typedef struct silence_gen_state_s silence_gen_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Generate a block of silent audio samples. \brief Generate a block of silent audio samples. \param s The silence generator context. \param amp The audio sample buffer. \param max_len The number of samples to be generated. \return The number of samples actually generated. This will be zero when there is nothing to send. */ SPAN_DECLARE_NONSTD(int) silence_gen(silence_gen_state_t *s, int16_t *amp, int max_len); /*! Set a silence generator context to output continuous silence. \brief Set a silence generator context to output continuous silence. \param s The silence generator context. */ SPAN_DECLARE(void) silence_gen_always(silence_gen_state_t *s); /*! Set a silence generator context to output a specified period of silence. \brief Set a silence generator context to output a specified period of silence. \param s The silence generator context. \param silent_samples The number of samples to be generated. */ SPAN_DECLARE(void) silence_gen_set(silence_gen_state_t *s, int silent_samples); /*! Alter the period of a silence generator context by a specified amount. \brief Alter the period of a silence generator context by a specified amount. \param s The silence generator context. \param silent_samples The number of samples to change the setting by. A positive number increases the duration. A negative number reduces it. The duration is prevented from going negative. */ SPAN_DECLARE(void) silence_gen_alter(silence_gen_state_t *s, int silent_samples); /*! Find how long a silence generator context has to run. \brief Find how long a silence generator context has to run. \param s The silence generator context. \return The number of samples remaining. */ SPAN_DECLARE(int) silence_gen_remainder(silence_gen_state_t *s); /*! Find the total silence generated to date by a silence generator context. \brief Find the total silence generated to date. \param s The silence generator context. \return The number of samples generated. */ SPAN_DECLARE(int) silence_gen_generated(silence_gen_state_t *s); /*! Change the status reporting function associated with a silence generator context. \brief Change the status reporting function associated with a silence generator context. \param s The silence generator context. \param handler The callback routine used to report status changes. \param user_data An opaque pointer. */ SPAN_DECLARE(void) silence_gen_status_handler(silence_gen_state_t *s, modem_status_func_t handler, void *user_data); /*! Initialise a timed silence generator context. \brief Initialise a timed silence generator context. \param s The silence generator context. \param silent_samples The initial number of samples to set the silence to. \return A pointer to the silence generator context. */ SPAN_DECLARE(silence_gen_state_t *) silence_gen_init(silence_gen_state_t *s, int silent_samples); SPAN_DECLARE(int) silence_gen_release(silence_gen_state_t *s); SPAN_DECLARE(int) silence_gen_free(silence_gen_state_t *s); /* The following dummy routines, to absorb data, don't really have a proper home, so they have been put here. */ /*! A dummy routine to use as a receive callback, when we aren't really trying to process what is received. It just absorbs and ignores the data. \brief Dummy receive callback. \param user_data The context. \param amp The signal.buffer \param len The length of the signal buffer \return 0. */ SPAN_DECLARE_NONSTD(int) span_dummy_rx(void *user_data, const int16_t amp[], int len); /*! A dummy routine to use as a signal modifier callback, when we aren't really trying to process the signal. It just returns without affecting anything. \brief Dummy signal modifier callback. \param user_data The context. \param amp The signal.buffer \param len The length of the signal buffer \return 0. */ SPAN_DECLARE(int) span_dummy_mod(void *user_data, int16_t amp[], int len); /*! A dummy routine to use as a receive fillin callback, when we aren't really trying to process what is received. It just absorbs and ignores the request. \brief Dummy receive fillin callback. \param user_data The context. \param len The length of the signal buffer \return 0. */ SPAN_DECLARE_NONSTD(int) span_dummy_rx_fillin(void *user_data, int len); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/v17tx.h0000664000175000017500000001721212100763657013523 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v17tx.h - ITU V.17 modem transmit part * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_V17TX_H_) #define _SPANDSP_V17TX_H_ /*! \page v17tx_page The V.17 transmitter \section v17tx_page_sec_1 What does it do? The V.17 transmitter implements the transmit side of a V.17 modem. This can operate at data rates of 14400, 12000, 9600 and 7200 bits/second. The audio output is a stream of 16 bit samples, at 8000 samples/second. The transmit and receive side of V.17 modems operate independantly. V.17 is mostly used for FAX transmission, where it provides the standard 14400 bits/second rate. \section v17tx_page_sec_2 How does it work? V.17 uses QAM modulation and trellis coding. The data to be transmitted is scrambled, to whiten it. The least significant 2 bits of each symbol are then differentially encoded, using a simple lookup approach. The resulting 2 bits are convolutionally encoded, producing 3 bits. The extra bit is the redundant bit of the trellis code. The other bits of the symbol pass by the differential and convolutional coding unchanged. The resulting bits define the constellation point to be transmitted for the symbol. The redundant bit doubles the size of the constellation, and so increases the error rate for detecting individual symbols at the receiver. However, when a number of successive symbols are processed at the receiver, the redundancy actually provides several dB of improved error performance. The standard method of producing a QAM modulated signal is to use a sampling rate which is a multiple of the baud rate. The raw signal is then a series of complex pulses, each an integer number of samples long. These can be shaped, using a suitable complex filter, and multiplied by a complex carrier signal to produce the final QAM signal for transmission. The pulse shaping filter is only vaguely defined by the V.17 spec. Some of the other ITU modem specs. fully define the filter, typically specifying a root raised cosine filter, with 50% excess bandwidth. This is a pity, since it increases the variability of the received signal. However, the receiver's adaptive equalizer will compensate for these differences. The current design uses a root raised cosine filter with 25% excess bandwidth. Greater excess bandwidth will not allow the tranmitted signal to meet the spectral requirements. The sampling rate for our transmitter is defined by the channel - 8000 per second. This is not a multiple of the baud rate (i.e. 2400 baud). The baud interval is actually 10/3 sample periods. Instead of using a symmetric FIR to pulse shape the signal, a polyphase filter is used. This consists of 10 sets of coefficients, offering zero to 9/10ths of a baud phase shift as well as root raised cosine filtering. The appropriate coefficient set is chosen for each signal sample generated. The carrier is generated using the DDS method. Using two second order resonators, started in quadrature, might be more efficient, as it would have less impact on the processor cache than a table lookup approach. However, the DDS approach suits the receiver better, so the same signal generator is also used for the transmitter. */ /*! V.17 modem transmit side descriptor. This defines the working state for a single instance of a V.17 modem transmitter. */ typedef struct v17_tx_state_s v17_tx_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Adjust a V.17 modem transmit context's power output. \brief Adjust a V.17 modem transmit context's output power. \param s The modem context. \param power The power level, in dBm0 */ SPAN_DECLARE(void) v17_tx_power(v17_tx_state_t *s, float power); /*! Initialise a V.17 modem transmit context. This must be called before the first use of the context, to initialise its contents. \brief Initialise a V.17 modem transmit context. \param s The modem context. \param bit_rate The bit rate of the modem. Valid values are 7200, 9600, 12000 and 14400. \param tep TRUE is the optional TEP tone is to be transmitted. \param get_bit The callback routine used to get the data to be transmitted. \param user_data An opaque pointer. \return A pointer to the modem context, or NULL if there was a problem. */ SPAN_DECLARE(v17_tx_state_t *) v17_tx_init(v17_tx_state_t *s, int bit_rate, int tep, get_bit_func_t get_bit, void *user_data); /*! Reinitialise an existing V.17 modem transmit context, so it may be reused. \brief Reinitialise an existing V.17 modem transmit context. \param s The modem context. \param bit_rate The bit rate of the modem. Valid values are 7200, 9600, 12000 and 14400. \param tep TRUE is the optional TEP tone is to be transmitted. \param short_train TRUE if the short training sequence should be used. \return 0 for OK, -1 for parameter error. */ SPAN_DECLARE(int) v17_tx_restart(v17_tx_state_t *s, int bit_rate, int tep, int short_train); /*! Release a V.17 modem transmit context. \brief Release a V.17 modem transmit context. \param s The modem context. \return 0 for OK */ SPAN_DECLARE(int) v17_tx_release(v17_tx_state_t *s); /*! Free a V.17 modem transmit context. \brief Free a V.17 modem transmit context. \param s The modem context. \return 0 for OK */ SPAN_DECLARE(int) v17_tx_free(v17_tx_state_t *s); /*! Get the logging context associated with a V.17 modem transmit context. \brief Get the logging context associated with a V.17 modem transmit context. \param s The modem context. \return A pointer to the logging context */ SPAN_DECLARE(logging_state_t *) v17_tx_get_logging_state(v17_tx_state_t *s); /*! Change the get_bit function associated with a V.17 modem transmit context. \brief Change the get_bit function associated with a V.17 modem transmit context. \param s The modem context. \param get_bit The callback routine used to get the data to be transmitted. \param user_data An opaque pointer. */ SPAN_DECLARE(void) v17_tx_set_get_bit(v17_tx_state_t *s, get_bit_func_t get_bit, void *user_data); /*! Change the modem status report function associated with a V.17 modem transmit context. \brief Change the modem status report function associated with a V.17 modem transmit context. \param s The modem context. \param handler The callback routine used to report modem status changes. \param user_data An opaque pointer. */ SPAN_DECLARE(void) v17_tx_set_modem_status_handler(v17_tx_state_t *s, modem_status_func_t handler, void *user_data); /*! Generate a block of V.17 modem audio samples. \brief Generate a block of V.17 modem audio samples. \param s The modem context. \param amp The audio sample buffer. \param len The number of samples to be generated. \return The number of samples actually generated. */ SPAN_DECLARE_NONSTD(int) v17_tx(v17_tx_state_t *s, int16_t amp[], int len); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/t4_t6_decode.h0000664000175000017500000000316311422612264014766 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t4_t6_decode.h - definitions for T.4/T.6 fax decoding * * Written by Steve Underwood * * Copyright (C) 2003, 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_T4_T6_DECODE_H_) #define _SPANDSP_T4_T6_DECODE_H_ /*! \page t4_t6_decode_page T.4 and T.6 FAX image decompression \section t4_t6_decode_page_sec_1 What does it do? The T.4 image compression and decompression routines implement the 1D and 2D encoding methods defined in ITU specification T.4. They also implement the pure 2D encoding method defined in T.6. These are image compression algorithms used for FAX transmission. \section t4_t6_decode_page_sec_1 How does it work? */ typedef struct t4_t6_decode_state_s t4_t6_decode_state_t; #if defined(__cplusplus) extern "C" { #endif #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/dtmf.h0000664000175000017500000002266212100764746013471 00000000000000/* * SpanDSP - a series of DSP components for telephony * * dtmf.h - DTMF tone generation and detection. * * Written by Steve Underwood * * Copyright (C) 2001, 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_DTMF_H_) #define _SPANDSP_DTMF_H_ /*! \page dtmf_rx_page DTMF receiver \section dtmf_rx_page_sec_1 What does it do? The DTMF receiver detects the standard DTMF digits. It is compliant with ITU-T Q.23, ITU-T Q.24, and the local DTMF specifications of most administrations. Its passes the test suites. It also scores *very* well on the standard talk-off tests. The current design uses floating point extensively. It is not tolerant of DC. It is expected that a DC restore stage will be placed before the DTMF detector. Unless the dial tone filter is switched on, the detector has poor tolerance of dial tone. Whether this matter depends on your application. If you are using the detector in an IVR application you will need proper echo cancellation to get good performance in the presence of speech prompts, so dial tone will not exist. If you do need good dial tone tolerance, a dial tone filter can be enabled in the detector. The DTMF receiver's design assumes the channel is free of any DC component. \section dtmf_rx_page_sec_2 How does it work? Like most other DSP based DTMF detector's, this one uses the Goertzel algorithm to look for the DTMF tones. What makes each detector design different is just how that algorithm is used. Basic DTMF specs: - Minimum tone on = 40ms - Minimum tone off = 50ms - Maximum digit rate = 10 per second - Normal twist <= 8dB accepted - Reverse twist <= 4dB accepted - S/N >= 15dB will detect OK - Attenuation <= 26dB will detect OK - Frequency tolerance +- 1.5% will detect, +-3.5% will reject TODO: */ /*! \page dtmf_tx_page DTMF tone generation \section dtmf_tx_page_sec_1 What does it do? The DTMF tone generation module provides for the generation of the repertoire of 16 DTMF dual tones. \section dtmf_tx_page_sec_2 How does it work? */ #define MAX_DTMF_DIGITS 128 typedef void (*digits_rx_callback_t)(void *user_data, const char *digits, int len); /*! DTMF generator state descriptor. This defines the state of a single working instance of a DTMF generator. */ typedef struct dtmf_tx_state_s dtmf_tx_state_t; /*! DTMF digit detector descriptor. */ typedef struct dtmf_rx_state_s dtmf_rx_state_t; #if defined(__cplusplus) extern "C" { #endif /*! \brief Generate a buffer of DTMF tones. \param s The DTMF generator context. \param amp The buffer for the generated signal. \param max_samples The required number of generated samples. \return The number of samples actually generated. This may be less than max_samples if the input buffer empties. */ SPAN_DECLARE(int) dtmf_tx(dtmf_tx_state_t *s, int16_t amp[], int max_samples); /*! \brief Put a string of digits in a DTMF generator's input buffer. \param s The DTMF generator context. \param digits The string of digits to be added. \param len The length of the string of digits. If negative, the string is assumed to be a NULL terminated string. \return The number of digits actually added. This may be less than the length of the digit string, if the buffer fills up. */ SPAN_DECLARE(int) dtmf_tx_put(dtmf_tx_state_t *s, const char *digits, int len); /*! \brief Change the transmit level for a DTMF tone generator context. \param s The DTMF generator context. \param level The level of the low tone, in dBm0. \param twist The twist, in dB. */ SPAN_DECLARE(void) dtmf_tx_set_level(dtmf_tx_state_t *s, int level, int twist); /*! \brief Change the transmit on and off time for a DTMF tone generator context. \param s The DTMF generator context. \param on-time The on time, in ms. \param off_time The off time, in ms. */ SPAN_DECLARE(void) dtmf_tx_set_timing(dtmf_tx_state_t *s, int on_time, int off_time); /*! \brief Initialise a DTMF tone generator context. \param s The DTMF generator context. \return A pointer to the DTMF generator context. */ SPAN_DECLARE(dtmf_tx_state_t *) dtmf_tx_init(dtmf_tx_state_t *s); /*! \brief Release a DTMF tone generator context. \param s The DTMF tone generator context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) dtmf_tx_release(dtmf_tx_state_t *s); /*! \brief Free a DTMF tone generator context. \param s The DTMF tone generator context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) dtmf_tx_free(dtmf_tx_state_t *s); /*! Set a optional realtime callback for a DTMF receiver context. This function is called immediately a confirmed state change occurs in the received DTMF. It is called with the ASCII value for a DTMF tone pair, or zero to indicate no tone is being received. \brief Set a realtime callback for a DTMF receiver context. \param s The DTMF receiver context. \param callback Callback routine used to report the start and end of digits. \param user_data An opaque pointer which is associated with the context, and supplied in callbacks. */ SPAN_DECLARE(void) dtmf_rx_set_realtime_callback(dtmf_rx_state_t *s, tone_report_func_t callback, void *user_data); /*! \brief Adjust a DTMF receiver context. \param s The DTMF receiver context. \param filter_dialtone TRUE to enable filtering of dialtone, FALSE to disable, < 0 to leave unchanged. \param twist Acceptable twist, in dB. < 0 to leave unchanged. \param reverse_twist Acceptable reverse twist, in dB. < 0 to leave unchanged. \param threshold The minimum acceptable tone level for detection, in dBm0. <= -99 to leave unchanged. */ SPAN_DECLARE(void) dtmf_rx_parms(dtmf_rx_state_t *s, int filter_dialtone, int twist, int reverse_twist, int threshold); /*! Process a block of received DTMF audio samples. \brief Process a block of received DTMF audio samples. \param s The DTMF receiver context. \param amp The audio sample buffer. \param samples The number of samples in the buffer. \return The number of samples unprocessed. */ SPAN_DECLARE(int) dtmf_rx(dtmf_rx_state_t *s, const int16_t amp[], int samples); /*! Fake processing of a missing block of received DTMF audio samples. (e.g due to packet loss). \brief Fake processing of a missing block of received DTMF audio samples. \param s The DTMF receiver context. \param len The number of samples to fake. \return The number of samples unprocessed. */ SPAN_DECLARE(int) dtmf_rx_fillin(dtmf_rx_state_t *s, int samples); /*! Get the status of DTMF detection during processing of the last audio chunk. \brief Get the status of DTMF detection during processing of the last audio chunk. \param s The DTMF receiver context. \return The current digit status. Either 'x' for a "maybe" condition, or the digit being detected. */ SPAN_DECLARE(int) dtmf_rx_status(dtmf_rx_state_t *s); /*! \brief Get a string of digits from a DTMF receiver's output buffer. \param s The DTMF receiver context. \param digits The buffer for the received digits. \param max The maximum number of digits to be returned, \return The number of digits actually returned. */ SPAN_DECLARE(size_t) dtmf_rx_get(dtmf_rx_state_t *s, char *digits, int max); /*! \brief Get the logging context associated with a DTMF receiver context. \param s The DTMF receiver context. \return A pointer to the logging context */ SPAN_DECLARE(logging_state_t *) dtmf_rx_get_logging_state(dtmf_rx_state_t *s); /*! \brief Initialise a DTMF receiver context. \param s The DTMF receiver context. \param callback An optional callback routine, used to report received digits. If no callback routine is set, digits may be collected, using the dtmf_rx_get() function. \param user_data An opaque pointer which is associated with the context, and supplied in callbacks. \return A pointer to the DTMF receiver context. */ SPAN_DECLARE(dtmf_rx_state_t *) dtmf_rx_init(dtmf_rx_state_t *s, digits_rx_callback_t callback, void *user_data); /*! \brief Release a DTMF receiver context. \param s The DTMF receiver context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) dtmf_rx_release(dtmf_rx_state_t *s); /*! \brief Free a DTMF receiver context. \param s The DTMF receiver context. \return 0 for OK, else -1. */ SPAN_DECLARE(int) dtmf_rx_free(dtmf_rx_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/biquad.h0000664000175000017500000000551411422612263013771 00000000000000/* * SpanDSP - a series of DSP components for telephony * * biquad.h - General telephony bi-quad section routines (currently this just * handles canonic/type 2 form) * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page biquad_page Bi-quadratic filter sections \section biquad_page_sec_1 What does it do? ???. \section biquad_page_sec_2 How does it work? ???. */ #if !defined(_SPANDSP_BIQUAD_H_) #define _SPANDSP_BIQUAD_H_ typedef struct { int32_t gain; int32_t a1; int32_t a2; int32_t b1; int32_t b2; int32_t z1; int32_t z2; #if FIRST_ORDER_NOISE_SHAPING int32_t residue; #elif SECOND_ORDER_NOISE_SHAPING int32_t residue1; int32_t residue2; #endif } biquad2_state_t; #if defined(__cplusplus) extern "C" { #endif static __inline__ void biquad2_init(biquad2_state_t *bq, int32_t gain, int32_t a1, int32_t a2, int32_t b1, int32_t b2) { bq->gain = gain; bq->a1 = a1; bq->a2 = a2; bq->b1 = b1; bq->b2 = b2; bq->z1 = 0; bq->z2 = 0; #if FIRST_ORDER_NOISE_SHAPING bq->residue = 0; #elif SECOND_ORDER_NOISE_SHAPING bq->residue1 = 0; bq->residue2 = 0; #endif } /*- End of function --------------------------------------------------------*/ static __inline__ int16_t biquad2(biquad2_state_t *bq, int16_t sample) { int32_t y; int32_t z0; z0 = sample*bq->gain + bq->z1*bq->a1 + bq->z2*bq->a2; y = z0 + bq->z1*bq->b1 + bq->z2*bq->b2; bq->z2 = bq->z1; bq->z1 = z0 >> 15; #if FIRST_ORDER_NOISE_SHAPING y += bq->residue; bq->residue = y & 0x7FFF; #elif SECOND_ORDER_NOISE_SHAPING y += (2*bq->residue1 - bq->residue2); bq->residue2 = bq->residue1; bq->residue1 = y & 0x7FFF; #endif y >>= 15; return (int16_t) y; } /*- End of function --------------------------------------------------------*/ #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/t35.h0000664000175000017500000000735012100765655013147 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t35.h - ITU T.35 FAX non-standard facility processing. * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_T35_H_) #define _SPANDSP_T35_H_ /*! \page t35_page T.35 manufacturer specific processing for FAX machines \section t35_page_sec_1 What does it do? ???. \section t35_page_sec_2 How does it work? ???. */ #if defined(__cplusplus) extern "C" { #endif /*! Resolve a T.35 country code its probable likely real value, using heuristics to try to resolve issues of broken bit order in the country code. \brief Resolve a T.35 country code with bit reversal resolution. \param country_code The country code. \param country_code_extension The country code extension. \return The true country code, or -1 for an invalid code. */ SPAN_DECLARE(int) t35_real_country_code(int country_code, int country_code_extension); /*! Decode a T.35 country code to a country name, using heuristics to try to resolve issues of broken bit order in the country code. \brief Decode a T.35 country code to a country name, with bit reversal resolution. \param country_code The country code. \param country_code_extension The country code extension. \return The country name, or NULL for an invalid country code. */ SPAN_DECLARE(const char *) t35_real_country_code_to_str(int country_code, int country_code_extension); /*! Decode a T.35 country code to a country name. \brief Decode a T.35 country code to a country name. \param country_code The country code. \param country_code_extension The country code extension. \return The country name, or NULL for an invalid country code. */ SPAN_DECLARE(const char *) t35_country_code_to_str(int country_code, int country_code_extension); SPAN_DECLARE(const char *) t35_vendor_to_str(const uint8_t *msg, int len); /*! Decode an NSF field to try to determine the make and model of the remote machine. \brief Decode an NSF field. \param msg The NSF message. \param len The length of the NSF message. \param country A pointer which will be pointed to the identified country of origin. If a NULL pointer is given, the country of origin will not be returned. If the country of origin is not identified, NULL will be returned. \param vendor A pointer which will be pointed to the identified vendor. If a NULL pointer is given, the vendor ID will not be returned. If the vendor is not identified, NULL will be returned. \param model A pointer which will be pointed to the identified model. If a NULL pointer is given, the model will not be returned. If the model is not identified, NULL will be returned. \return TRUE if the machine was identified, otherwise FALSE. */ SPAN_DECLARE(int) t35_decode(const uint8_t *msg, int len, const char **country, const char **vendor, const char **model); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/oki_adpcm.h0000664000175000017500000000752211422612264014454 00000000000000/* * SpanDSP - a series of DSP components for telephony * * oki_adpcm.h - Conversion routines between linear 16 bit PCM data and * OKI (Dialogic) ADPCM format. * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_OKI_ADPCM_H_) #define _SPANDSP_OKI_ADPCM_H_ /*! \page okiadpcm_page OKI (Dialogic) ADPCM encoding and decoding \section okiadpcm_page_sec_1 What does it do? OKI ADPCM is widely used in the CTI industry because it is the principal format supported by Dialogic. As the market leader, they tend to define "common practice". It offers a good balance of simplicity and quality at rates of 24kbps or 32kbps. 32kbps is obtained by ADPCM compressing 8k samples/second linear PCM. 24kbps is obtained by resampling to 6k samples/second and using the same ADPCM compression algorithm on the slower samples. The algorithms for this ADPCM codec can be found in "PC Telephony - The complete guide to designing, building and programming systems using Dialogic and Related Hardware" by Bob Edgar. pg 272-276. */ /*! Oki (Dialogic) ADPCM conversion state descriptor. This defines the state of a single working instance of the Oki ADPCM converter. This is used for either linear to ADPCM or ADPCM to linear conversion. */ typedef struct oki_adpcm_state_s oki_adpcm_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Initialise an Oki ADPCM encode or decode context. \param s The Oki ADPCM context. \param bit_rate The required bit rate for the ADPCM data. The valid rates are 24000 and 32000. \return A pointer to the Oki ADPCM context, or NULL for error. */ SPAN_DECLARE(oki_adpcm_state_t *) oki_adpcm_init(oki_adpcm_state_t *s, int bit_rate); /*! Release an Oki ADPCM encode or decode context. \param s The Oki ADPCM context. \return 0 for OK. */ SPAN_DECLARE(int) oki_adpcm_release(oki_adpcm_state_t *s); /*! Free an Oki ADPCM encode or decode context. \param s The Oki ADPCM context. \return 0 for OK. */ SPAN_DECLARE(int) oki_adpcm_free(oki_adpcm_state_t *s); /*! Decode a buffer of Oki ADPCM data to linear PCM. \param s The Oki ADPCM context. \param amp The audio sample buffer. \param oki_data \param oki_bytes \return The number of samples returned. */ SPAN_DECLARE(int) oki_adpcm_decode(oki_adpcm_state_t *s, int16_t amp[], const uint8_t oki_data[], int oki_bytes); /*! Encode a buffer of linear PCM data to Oki ADPCM. \param s The Oki ADPCM context. \param oki_data The Oki ADPCM data produced \param amp The audio sample buffer. \param len The number of samples in the buffer. \return The number of bytes of Oki ADPCM data produced. */ SPAN_DECLARE(int) oki_adpcm_encode(oki_adpcm_state_t *s, uint8_t oki_data[], const int16_t amp[], int len); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/timing.h0000664000175000017500000000432111422612264014007 00000000000000/* * SpanDSP - a series of DSP components for telephony * * timing.h - Provide access to the Pentium/Athlon TSC timer register * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_TIMING_H_) #define _SPANDSP_TIMING_H_ #if defined(__cplusplus) extern "C" { #endif #if defined(__MSVC__) __declspec(naked) unsigned __int64 __cdecl rdtscll(void) { __asm { rdtsc ret ; return value at EDX:EAX } } /*- End of function --------------------------------------------------------*/ #elif defined(__GNUC__) #if defined(__i386__) static __inline__ uint64_t rdtscll(void) { uint64_t now; __asm__ __volatile__(" rdtsc\n" : "=A" (now)); return now; } /*- End of function --------------------------------------------------------*/ #elif defined(__x86_64__) static __inline__ uint64_t rdtscll(void) { uint32_t a; uint32_t d; /* For x86_64 we need to merge the result in 2 32 bit registers into one clean 64 bit result. */ __asm__ __volatile__(" rdtsc\n" : "=a" (a), "=d" (d)); return ((uint64_t) a) | (((uint64_t) d) << 32); } /*- End of function --------------------------------------------------------*/ #else static __inline__ uint64_t rdtscll(void) { /* This architecture doesn't have a suitable timer */ return 0llu; } /*- End of function --------------------------------------------------------*/ #endif #endif #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/fast_convert.h0000664000175000017500000002507511422612264015226 00000000000000/* * SpanDSP - a series of DSP components for telephony * * fast_convert.h - Quick ways to convert floating point numbers to integers * * Written by Steve Underwood * * Copyright (C) 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_FAST_CONVERT_H_) #define _SPANDSP_FAST_CONVERT_H_ #if defined(__cplusplus) extern "C" { #endif /* The following code, to handle issues with lrint() and lrintf() on various * platforms, is adapted from similar code in libsndfile, which is: * * Copyright (C) 2001-2004 Erik de Castro Lopo * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. */ /* * On Intel Pentium processors (especially PIII and probably P4), converting * from float to int is very slow. To meet the C specs, the code produced by * most C compilers targeting Pentium needs to change the FPU rounding mode * before the float to int conversion is performed. * * Changing the FPU rounding mode causes the FPU pipeline to be flushed. It * is this flushing of the pipeline which is so slow. * * Fortunately the ISO C99 specification defines the functions lrint, lrintf, * llrint and llrintf which fix this problem as a side effect. * * On Unix-like systems, the configure process should have detected the * presence of these functions. If they weren't found we have to replace them * here with a standard C cast. */ /* * The C99 prototypes for these functions are as follows: * * int rintf(float x); * int rint(double x); * long int lrintf(float x); * long int lrint(double x); * long long int llrintf(float x); * long long int llrint(double x); * * The presence of the required functions are detected during the configure * process and the values HAVE_LRINT and HAVE_LRINTF are set accordingly in * the config file. */ #if defined(__CYGWIN__) #if !defined(__cplusplus) && (__GNUC__ < 4) /* * CYGWIN versions prior to 1.7.1 have lrint and lrintf functions, but * they are slow and buggy: * http://sourceware.org/ml/cygwin/2005-06/msg00153.html * http://sourceware.org/ml/cygwin/2005-09/msg00047.html * These replacement functions (pulled from the Public Domain MinGW * math.h header) replace the native versions. */ static __inline__ long int lrint(double x) { long int retval; __asm__ __volatile__ ( "fistpl %0" : "=m" (retval) : "t" (x) : "st" ); return retval; } static __inline__ long int lrintf(float x) { long int retval; __asm__ __volatile__ ( "fistpl %0" : "=m" (retval) : "t" (x) : "st" ); return retval; } #endif /* The fastest way to convert is the equivalent of lrint() */ static __inline__ long int lfastrint(double x) { long int retval; __asm__ __volatile__ ( "fistpl %0" : "=m" (retval) : "t" (x) : "st" ); return retval; } static __inline__ long int lfastrintf(float x) { long int retval; __asm__ __volatile__ ( "fistpl %0" : "=m" (retval) : "t" (x) : "st" ); return retval; } #elif defined(__GNUC__) || (__SUNPRO_C >= 0x0590) #if defined(__i386__) /* These routines are guaranteed fast on an i386 machine. Using the built in lrint() and lrintf() should be similar, but they may not always be enabled. Sometimes, especially with "-O0", you might get slow calls to routines. */ static __inline__ long int lfastrint(double x) { long int retval; __asm__ __volatile__ ( "fistpl %0" : "=m" (retval) : "t" (x) : "st" ); return retval; } static __inline__ long int lfastrintf(float x) { long int retval; __asm__ __volatile__ ( "fistpl %0" : "=m" (retval) : "t" (x) : "st" ); return retval; } #elif defined(__x86_64__) /* On an x86_64 machine, the fastest thing seems to be a pure assignment from a double or float to an int. It looks like the design on the x86_64 took account of the default behaviour specified for C. */ static __inline__ long int lfastrint(double x) { return (long int) (x); } static __inline__ long int lfastrintf(float x) { return (long int) (x); } #elif defined(__ppc__) || defined(__powerpc__) static __inline__ long int lfastrint(register double x) { int res[2]; __asm__ __volatile__ ( "fctiw %1, %1\n\t" "stfd %1, %0" : "=m" (res) /* Output */ : "f" (x) /* Input */ : "memory" ); return res[1]; } static __inline__ long int lfastrintf(register float x) { int res[2]; __asm__ __volatile__ ( "fctiw %1, %1\n\t" "stfd %1, %0" : "=m" (res) /* Output */ : "f" (x) /* Input */ : "memory" ); return res[1]; } #else /* Fallback routines, for unrecognised platforms */ static __inline__ long int lfastrint(double x) { return (long int) x; } static __inline__ long int lfastrintf(float x) { return (long int) x; } #endif #elif defined(_M_IX86) /* Visual Studio i386 */ /* * Win32 doesn't seem to have the lrint() and lrintf() functions. * Therefore implement inline versions of these functions here. */ __inline long int lrint(double x) { long int i; _asm { fld x fistp i }; return i; } __inline long int lrintf(float x) { long int i; _asm { fld x fistp i }; return i; } __inline float rintf(float flt) { _asm { fld flt frndint } } __inline double rint(double dbl) { _asm { fld dbl frndint } } __inline long int lfastrint(double x) { long int i; _asm { fld x fistp i }; return i; } __inline long int lfastrintf(float x) { long int i; _asm { fld x fistp i }; return i; } #elif defined(_M_X64) /* Visual Studio x86_64 */ /* x86_64 machines will do best with a simple assignment. */ #include __inline long int lrint(double x) { return (long int)_mm_cvtsd_si64x( _mm_loadu_pd ((const double*)&x) ); } __inline long int lrintf(float x) { return _mm_cvt_ss2si( _mm_load_ss((const float*)&x) ); } __inline long int lfastrint(double x) { return (long int) (x); } __inline long int lfastrintf(float x) { return (long int) (x); } #elif defined(__MWERKS__) && defined(macintosh) /* This MacOS 9 solution was provided by Stephane Letz */ long int __inline__ lfastrint(register double x) { long int res[2]; asm { fctiw x, x stfd x, res } return res[1]; } long int __inline__ lfastrintf(register float x) { long int res[2]; asm { fctiw x, x stfd x, res } return res[1]; } #elif defined(__MACH__) && defined(__APPLE__) && (defined(__ppc__) || defined(__powerpc__)) /* For Apple Mac OS/X - do recent versions still need this? */ static __inline__ long int lfastrint(register double x) { int res[2]; __asm__ __volatile__ ( "fctiw %1, %1\n\t" "stfd %1, %0" : "=m" (res) /* Output */ : "f" (x) /* Input */ : "memory" ); return res[1]; } static __inline__ long int lfastrintf(register float x) { int res[2]; __asm__ __volatile__ ( "fctiw %1, %1\n\t" "stfd %1, %0" : "=m" (res) /* Output */ : "f" (x) /* Input */ : "memory" ); return res[1]; } #else /* There is nothing else to do, but use a simple casting operation, instead of a real rint() type function. Since we are only trying to use rint() to speed up conversions, the accuracy issues related to changing the rounding scheme are of little concern to us. */ #if !defined(__sgi) && !defined(__sunos) && !defined(__solaris) && !defined(__sun) #warning "No usable lrint() and lrintf() functions available." #warning "Replacing these functions with a simple C cast." #endif static __inline__ long int lrint(double x) { return (long int) (x); } static __inline__ long int lrintf(float x) { return (long int) (x); } static __inline__ long int lfastrint(double x) { return (long int) (x); } static __inline__ long int lfastrintf(float x) { return (long int) (x); } #endif #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/modem_echo.h0000664000175000017500000001205311422612264014620 00000000000000/* * SpanDSP - a series of DSP components for telephony * * modem_echo.h - An echo cancellor, suitable for electrical echos in GSTN modems * * Written by Steve Underwood * * Copyright (C) 2001, 2004 Steve Underwood * * Based on a bit from here, a bit from there, eye of toad, * ear of bat, etc - plus, of course, my own 2 cents. * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_MODEM_ECHO_H_) #define _SPANDSP_MODEM_ECHO_H_ /*! \page modem_echo_can_page Line echo cancellation for modems \section modem_echo_can_page_sec_1 What does it do? This module aims to cancel electrical echoes (e.g. from 2-4 wire hybrids) in modem applications. It is not very suitable for speech applications, which require additional refinements for satisfactory performance. It is, however, more efficient and better suited to modem applications. \section modem_echo_can_page_sec_2 How does it work? The heart of the echo cancellor is an adaptive FIR filter. This is adapted to match the impulse response of the environment being cancelled. It must be long enough to adequately cover the duration of that impulse response. The signal being transmitted into the environment being cancelled is passed through the FIR filter. The resulting output is an estimate of the echo signal. This is then subtracted from the received signal, and the result should be an estimate of the signal which originates within the environment being cancelled (people talking in the room, or the signal from the far end of a telephone line) free from the echos of our own transmitted signal. The FIR filter is adapted using the least mean squares (LMS) algorithm. This algorithm is attributed to Widrow and Hoff, and was introduced in 1960. It is the commonest form of filter adaption used in things like modem line equalisers and line echo cancellers. It works very well if the signal level is constant, which is true for a modem signal. To ensure good performa certain conditions must be met: - The transmitted signal has weak self-correlation. - There is no signal being generated within the environment being cancelled. The difficulty is that neither of these can be guaranteed. If the adaption is performed while transmitting noise (or something fairly noise like, such as voice) the adaption works very well. If the adaption is performed while transmitting something highly correlative (e.g. tones, like DTMF), the adaption can go seriously wrong. The reason is there is only one solution for the adaption on a near random signal. For a repetitive signal, there are a number of solutions which converge the adaption, and nothing guides the adaption to choose the correct one. \section modem_echo_can_page_sec_3 How do I use it? The echo cancellor processes both the transmit and receive streams sample by sample. The processing function is not declared inline. Unfortunately, cancellation requires many operations per sample, so the call overhead is only a minor burden. */ #include "fir.h" /*! Modem line echo canceller descriptor. This defines the working state for a line echo canceller. */ typedef struct modem_echo_can_state_s modem_echo_can_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Create a modem echo canceller context. \param len The length of the canceller, in samples. eturn The new canceller context, or NULL if the canceller could not be created. */ SPAN_DECLARE(modem_echo_can_state_t *) modem_echo_can_init(int len); /*! Free a modem echo canceller context. \param ec The echo canceller context. */ SPAN_DECLARE(void) modem_echo_can_free(modem_echo_can_state_t *ec); /*! Flush (reinitialise) a modem echo canceller context. \param ec The echo canceller context. */ SPAN_DECLARE(void) modem_echo_can_flush(modem_echo_can_state_t *ec); /*! Set the adaption mode of a modem echo canceller context. \param ec The echo canceller context. \param adapt The mode. */ SPAN_DECLARE(void) modem_echo_can_adaption_mode(modem_echo_can_state_t *ec, int adapt); /*! Process a sample through a modem echo canceller. \param ec The echo canceller context. \param tx The transmitted audio sample. \param rx The received audio sample. eturn The clean (echo cancelled) received sample. */ SPAN_DECLARE(int16_t) modem_echo_can_update(modem_echo_can_state_t *ec, int16_t tx, int16_t rx); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/ademco_contactid.h0000664000175000017500000003744012101002722015773 00000000000000/* * SpanDSP a series of DSP components for telephony * * ademco_contactid.h Ademco ContactID alarm protocol * * Written by Steve Underwood * * Copyright (C) 2012 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_ADEMCO_CONTACTID_H_) #define _SPANDSP_ADEMCO_CONTACTID_H_ enum { ADEMCO_CONTACTID_MESSAGE_TYPE_18 = 0x18, ADEMCO_CONTACTID_MESSAGE_TYPE_98 = 0x98 }; enum { ADEMCO_CONTACTID_QUALIFIER_NEW_EVENT = 1, ADEMCO_CONTACTID_QUALIFIER_NEW_RESTORE = 3, ADEMCO_CONTACTID_QUALIFIER_STATUS_REPORT = 6 }; enum { ADEMCO_CONTACTID_DATA_IS_ZONE = 0, ADEMCO_CONTACTID_DATA_IS_USER = 1 }; enum { ADEMCO_CONTACTID_MEDICAL = 0x100, ADEMCO_CONTACTID_PERSONAL_EMERGENCY = 0x101, ADEMCO_CONTACTID_FAIL_TO_REPORT_IN = 0x102, ADEMCO_CONTACTID_FIRE = 0x110, ADEMCO_CONTACTID_SMOKE = 0x111, ADEMCO_CONTACTID_COMBUSTION = 0x112, ADEMCO_CONTACTID_WATER_FLOW = 0x113, ADEMCO_CONTACTID_HEAT = 0x114, ADEMCO_CONTACTID_PULL_STATION = 0x115, ADEMCO_CONTACTID_DUCT = 0x116, ADEMCO_CONTACTID_FLAME = 0x117, ADEMCO_CONTACTID_NEAR_ALARM_A = 0x118, ADEMCO_CONTACTID_PANIC = 0x120, ADEMCO_CONTACTID_DURESS = 0x121, ADEMCO_CONTACTID_SILENT = 0x122, ADEMCO_CONTACTID_AUDIBLE = 0x123, ADEMCO_CONTACTID_DURESS_ACCESS_GRANTED = 0x124, ADEMCO_CONTACTID_DURESS_EGRESS_GRANTED = 0x125, ADEMCO_CONTACTID_BURGLARY = 0x130, ADEMCO_CONTACTID_PERIMETER = 0x131, ADEMCO_CONTACTID_INTERIOR = 0x132, ADEMCO_CONTACTID_24_HOUR_SAFE = 0x133, ADEMCO_CONTACTID_ENTRY_EXIT = 0x134, ADEMCO_CONTACTID_DAY_NIGHT = 0x135, ADEMCO_CONTACTID_OUTDOOR = 0x136, ADEMCO_CONTACTID_TAMPER = 0x137, ADEMCO_CONTACTID_NEAR_ALARM_B = 0x138, ADEMCO_CONTACTID_INTRUSION_VERIFIER = 0x139, ADEMCO_CONTACTID_GENERAL_ALARM = 0x140, ADEMCO_CONTACTID_POLLING_LOOP_OPEN_A = 0x141, ADEMCO_CONTACTID_POLLING_LOOP_SHORT_A = 0x142, ADEMCO_CONTACTID_EXPANSION_MODULE_FAILURE_A = 0x143, ADEMCO_CONTACTID_SENSOR_TAMPER_A = 0x144, ADEMCO_CONTACTID_EXPANSION_MODULE_TAMPER = 0x145, ADEMCO_CONTACTID_SILENT_BURGLARY = 0x146, ADEMCO_CONTACTID_SENSOR_SUPERVISION_FAILURE = 0x147, ADEMCO_CONTACTID_24_HOUR_NONBURGLARY = 0x150, ADEMCO_CONTACTID_GAS_DETECTED = 0x151, ADEMCO_CONTACTID_REFRIGERATION = 0x152, ADEMCO_CONTACTID_LOSS_OF_HEAT = 0x153, ADEMCO_CONTACTID_WATER_LEAKAGE = 0x154, ADEMCO_CONTACTID_FOIL_BREAK = 0x155, ADEMCO_CONTACTID_DAY_TROUBLE = 0x156, ADEMCO_CONTACTID_LOW_BOTTLED_GAS_LEVEL = 0x157, ADEMCO_CONTACTID_HIGH_TEMP = 0x158, ADEMCO_CONTACTID_LOW_TEMP = 0x159, ADEMCO_CONTACTID_LOSS_OF_AIR_FLOW = 0x161, ADEMCO_CONTACTID_CARBON_MONOXIDE_DETECTED = 0x162, ADEMCO_CONTACTID_TANK_LEVEL = 0x163, ADEMCO_CONTACTID_FIRE_SUPERVISORY = 0x200, ADEMCO_CONTACTID_LOW_WATER_PRESSURE = 0x201, ADEMCO_CONTACTID_LOW_CO2 = 0x202, ADEMCO_CONTACTID_GATE_VALVE_SENSOR = 0x203, ADEMCO_CONTACTID_LOW_WATER_LEVEL = 0x204, ADEMCO_CONTACTID_PUMP_ACTIVATED = 0x205, ADEMCO_CONTACTID_PUMP_FAILURE = 0x206, ADEMCO_CONTACTID_SYSTEM_TROUBLE = 0x300, ADEMCO_CONTACTID_AC_LOSS = 0x301, ADEMCO_CONTACTID_LOW_SYSTEM_BATTERY = 0x302, ADEMCO_CONTACTID_RAM_CHECKSUM_BAD = 0x303, ADEMCO_CONTACTID_ROM_CHECKSUM_BAD = 0x304, ADEMCO_CONTACTID_SYSTEM_RESET = 0x305, ADEMCO_CONTACTID_PANEL_PROGRAMMING_CHANGED = 0x306, ADEMCO_CONTACTID_SELFTEST_FAILURE = 0x307, ADEMCO_CONTACTID_SYSTEM_SHUTDOWN = 0x308, ADEMCO_CONTACTID_BATTERY_TEST_FAILURE = 0x309, ADEMCO_CONTACTID_GROUND_FAULT = 0x310, ADEMCO_CONTACTID_BATTERY_MISSING_DEAD = 0x311, ADEMCO_CONTACTID_POWER_SUPPLY_OVERCURRENT = 0x312, ADEMCO_CONTACTID_ENGINEER_RESET = 0x313, ADEMCO_CONTACTID_SOUNDER_RELAY = 0x320, ADEMCO_CONTACTID_BELL_1 = 0x321, ADEMCO_CONTACTID_BELL_2 = 0x322, ADEMCO_CONTACTID_ALARM_RELAY = 0x323, ADEMCO_CONTACTID_TROUBLE_RELAY = 0x324, ADEMCO_CONTACTID_REVERSING_RELAY = 0x325, ADEMCO_CONTACTID_NOTIFICATION_APPLIANCE_CKT_3 = 0x326, ADEMCO_CONTACTID_NOTIFICATION_APPLIANCE_CKT_4 = 0x327, ADEMCO_CONTACTID_SYSTEM_PERIPHERAL_TROUBLE = 0x330, ADEMCO_CONTACTID_POLLING_LOOP_OPEN_B = 0x331, ADEMCO_CONTACTID_POLLING_LOOP_SHORT_B = 0x332, ADEMCO_CONTACTID_EXPANSION_MODULE_FAILURE_B = 0x333, ADEMCO_CONTACTID_REPEATER_FAILURE = 0x334, ADEMCO_CONTACTID_LOCAL_PRINTER_OUT_OF_PAPER = 0x335, ADEMCO_CONTACTID_LOCAL_PRINTER_FAILURE = 0x336, ADEMCO_CONTACTID_EXP_MODULE_DC_LOSS = 0x337, ADEMCO_CONTACTID_EXP_MODULE_LOW_BATTERY = 0x338, ADEMCO_CONTACTID_EXP_MODULE_RESET = 0x339, ADEMCO_CONTACTID_EXP_MODULE_TAMPER = 0x341, ADEMCO_CONTACTID_EXP_MODULE_AC_LOSS = 0x342, ADEMCO_CONTACTID_EXP_MODULE_SELFTEST_FAIL = 0x343, ADEMCO_CONTACTID_RF_RECEIVER_JAM_DETECT = 0x344, ADEMCO_CONTACTID_COMMUNICATION_TROUBLE = 0x350, ADEMCO_CONTACTID_TELCO_1_FAULT = 0x351, ADEMCO_CONTACTID_TELCO_2_FAULT = 0x352, ADEMCO_CONTACTID_LONG_RANGE_RADIO_TRANSMITTER_FAULT = 0x353, ADEMCO_CONTACTID_FAILURE_TO_COMMUNICATE_EVENT = 0x354, ADEMCO_CONTACTID_LOSS_OF_RADIO_SUPERVISION = 0x355, ADEMCO_CONTACTID_LOSS_OF_CENTRAL_POLLING = 0x356, ADEMCO_CONTACTID_LONG_RANGE_RADIO_VSWR_PROBLEM = 0x357, ADEMCO_CONTACTID_PROTECTION_LOOP = 0x370, ADEMCO_CONTACTID_PROTECTION_LOOP_OPEN = 0x371, ADEMCO_CONTACTID_PROTECTION_LOOP_SHORT = 0x372, ADEMCO_CONTACTID_FIRE_TROUBLE = 0x373, ADEMCO_CONTACTID_EXIT_ERROR_ALARM_ZONE = 0x374, ADEMCO_CONTACTID_PANIC_ZONE_TROUBLE = 0x375, ADEMCO_CONTACTID_HOLDUP_ZONE_TROUBLE = 0x376, ADEMCO_CONTACTID_SWINGER_TROUBLE = 0x377, ADEMCO_CONTACTID_CROSSZONE_TROUBLE = 0x378, ADEMCO_CONTACTID_SENSOR_TROUBLE = 0x380, ADEMCO_CONTACTID_LOSS_OF_SUPERVISION__RF = 0x381, ADEMCO_CONTACTID_LOSS_OF_SUPERVISION__RPM = 0x382, ADEMCO_CONTACTID_SENSOR_TAMPER_B = 0x383, ADEMCO_CONTACTID_RF_LOW_BATTERY = 0x384, ADEMCO_CONTACTID_SMOKE_DETECTOR_HIGH_SENSITIVITY = 0x385, ADEMCO_CONTACTID_SMOKE_DETECTOR_LOW_SENSITIVITY = 0x386, ADEMCO_CONTACTID_INTRUSION_DETECTOR_HIGH_SENSITIVITY = 0x387, ADEMCO_CONTACTID_INTRUSION_DETECTOR_LOW_SENSITIVITY = 0x388, ADEMCO_CONTACTID_SENSOR_SELFTEST_FAILURE = 0x389, ADEMCO_CONTACTID_SENSOR_WATCH_TROUBLE = 0x391, ADEMCO_CONTACTID_DRIFT_COMPENSATION_ERROR = 0x392, ADEMCO_CONTACTID_MAINTENANCE_ALERT = 0x393, ADEMCO_CONTACTID_OPEN_CLOSE = 0x400, ADEMCO_CONTACTID_OC_BY_USER = 0x401, ADEMCO_CONTACTID_GROUP_OC = 0x402, ADEMCO_CONTACTID_AUTOMATIC_OC = 0x403, ADEMCO_CONTACTID_LATE_TO_OC = 0x404, ADEMCO_CONTACTID_DEFERRED_OC = 0x405, ADEMCO_CONTACTID_CANCEL = 0x406, ADEMCO_CONTACTID_REMOTE_ARM_DISARM = 0x407, ADEMCO_CONTACTID_QUICK_ARM = 0x408, ADEMCO_CONTACTID_KEYSWITCH_OC = 0x409, ADEMCO_CONTACTID_ARMED_STAY = 0x441, ADEMCO_CONTACTID_KEYSWITCH_ARMED_STAY = 0x442, ADEMCO_CONTACTID_EXCEPTION_OC = 0x450, ADEMCO_CONTACTID_EARLY_OC = 0x451, ADEMCO_CONTACTID_LATE_OC = 0x452, ADEMCO_CONTACTID_FAILED_TO_OPEN = 0x453, ADEMCO_CONTACTID_FAILED_TO_CLOSE = 0x454, ADEMCO_CONTACTID_AUTOARM_FAILED = 0x455, ADEMCO_CONTACTID_PARTIAL_ARM = 0x456, ADEMCO_CONTACTID_EXIT_ERROR_USER = 0x457, ADEMCO_CONTACTID_USER_ON_PREMISES = 0x458, ADEMCO_CONTACTID_RECENT_CLOSE = 0x459, ADEMCO_CONTACTID_WRONG_CODE_ENTRY = 0x461, ADEMCO_CONTACTID_LEGAL_CODE_ENTRY = 0x462, ADEMCO_CONTACTID_REARM_AFTER_ALARM = 0x463, ADEMCO_CONTACTID_AUTOARM_TIME_EXTENDED = 0x464, ADEMCO_CONTACTID_PANIC_ALARM_RESET = 0x465, ADEMCO_CONTACTID_SERVICE_ON_OFF_PREMISES = 0x466, ADEMCO_CONTACTID_CALLBACK_REQUEST_MADE = 0x411, ADEMCO_CONTACTID_SUCCESSFUL_DOWNLOAD_ACCESS = 0x412, ADEMCO_CONTACTID_UNSUCCESSFUL_ACCESS = 0x413, ADEMCO_CONTACTID_SYSTEM_SHUTDOWN_COMMAND_RECEIVED = 0x414, ADEMCO_CONTACTID_DIALER_SHUTDOWN_COMMAND_RECEIVED = 0x415, ADEMCO_CONTACTID_SUCCESSFUL_UPLOAD = 0x416, ADEMCO_CONTACTID_ACCESS_DENIED = 0x421, ADEMCO_CONTACTID_ACCESS_REPORT_BY_USER = 0x422, ADEMCO_CONTACTID_FORCED_ACCESS = 0x423, ADEMCO_CONTACTID_EGRESS_DENIED = 0x424, ADEMCO_CONTACTID_EGRESS_GRANTED = 0x425, ADEMCO_CONTACTID_ACCESS_DOOR_PROPPED_OPEN = 0x426, ADEMCO_CONTACTID_ACCESS_POINT_DOOR_STATUS_MONITOR_TROUBLE = 0x427, ADEMCO_CONTACTID_ACCESS_POINT_REQUEST_TO_EXIT_TROUBLE = 0x428, ADEMCO_CONTACTID_ACCESS_PROGRAM_MODE_ENTRY = 0x429, ADEMCO_CONTACTID_ACCESS_PROGRAM_MODE_EXIT = 0x430, ADEMCO_CONTACTID_ACCESS_THREAT_LEVEL_CHANGE = 0x431, ADEMCO_CONTACTID_ACCESS_RELAY_TRIGGER_FAIL = 0x432, ADEMCO_CONTACTID_ACCESS_RTE_SHUNT = 0x433, ADEMCO_CONTACTID_ACCESS_DSM_SHUNT = 0x434, ADEMCO_CONTACTID_ACCESS_READER_DISABLE = 0x501, ADEMCO_CONTACTID_SOUNDER_RELAY_DISABLE = 0x520, ADEMCO_CONTACTID_BELL_1_DISABLE = 0x521, ADEMCO_CONTACTID_BELL_2_DISABLE = 0x522, ADEMCO_CONTACTID_ALARM_RELAY_DISABLE = 0x523, ADEMCO_CONTACTID_TROUBLE_RELAY_DISABLE = 0x524, ADEMCO_CONTACTID_REVERSING_RELAY_DISABLE = 0x525, ADEMCO_CONTACTID_NOTIFICATION_APPLIANCE_CKT_3_DISABLE = 0x526, ADEMCO_CONTACTID_NOTIFICATION_APPLIANCE_CKT_4_DISABLE = 0x527, ADEMCO_CONTACTID_MODULE_ADDED = 0x531, ADEMCO_CONTACTID_MODULE_REMOVED = 0x532, ADEMCO_CONTACTID_DIALER_DISABLED = 0x551, ADEMCO_CONTACTID_RADIO_TRANSMITTER_DISABLED = 0x552, ADEMCO_CONTACTID_REMOTE_UPLOAD_DOWNLOAD_DISABLED = 0x553, ADEMCO_CONTACTID_ZONE_SENSOR_BYPASS = 0x570, ADEMCO_CONTACTID_FIRE_BYPASS = 0x571, ADEMCO_CONTACTID_24_HOUR_ZONE_BYPASS = 0x572, ADEMCO_CONTACTID_BURG_BYPASS = 0x573, ADEMCO_CONTACTID_GROUP_BYPASS = 0x574, ADEMCO_CONTACTID_SWINGER_BYPASS = 0x575, ADEMCO_CONTACTID_ACCESS_ZONE_SHUNT = 0x576, ADEMCO_CONTACTID_ACCESS_POINT_BYPASS = 0x577, ADEMCO_CONTACTID_MANUAL_TRIGGER_TEST_REPORT = 0x601, ADEMCO_CONTACTID_PERIODIC_TEST_REPORT = 0x602, ADEMCO_CONTACTID_PERIODIC_RF_TRANSMISSION = 0x603, ADEMCO_CONTACTID_FIRE_TEST = 0x604, ADEMCO_CONTACTID_STATUS_REPORT_TO_FOLLOW = 0x605, ADEMCO_CONTACTID_LISTENIN_TO_FOLLOW = 0x606, ADEMCO_CONTACTID_WALK_TEST_MODE = 0x607, ADEMCO_CONTACTID_PERIODIC_TEST__SYSTEM_TROUBLE_PRESENT = 0x608, ADEMCO_CONTACTID_VIDEO_TRANSMITTER_ACTIVE = 0x609, ADEMCO_CONTACTID_POINT_TESTED_OK = 0x611, ADEMCO_CONTACTID_POINT_NOT_TESTED = 0x612, ADEMCO_CONTACTID_INTRUSION_ZONE_WALK_TESTED = 0x613, ADEMCO_CONTACTID_FIRE_ZONE_WALK_TESTED = 0x614, ADEMCO_CONTACTID_PANIC_ZONE_WALK_TESTED = 0x615, ADEMCO_CONTACTID_SERVICE_REQUEST = 0x616, ADEMCO_CONTACTID_EVENT_LOG_RESET = 0x621, ADEMCO_CONTACTID_EVENT_LOG_50PC_FULL = 0x622, ADEMCO_CONTACTID_EVENT_LOG_90PC_FULL = 0x623, ADEMCO_CONTACTID_EVENT_LOG_OVERFLOW = 0x624, ADEMCO_CONTACTID_TIME_DATE_RESET = 0x625, ADEMCO_CONTACTID_TIME_DATE_INACCURATE = 0x626, ADEMCO_CONTACTID_PROGRAM_MODE_ENTRY = 0x627, ADEMCO_CONTACTID_PROGRAM_MODE_EXIT = 0x628, ADEMCO_CONTACTID_32_HOUR_EVENT_LOG_MARKER = 0x629, ADEMCO_CONTACTID_SCHEDULE_CHANGE = 0x630, ADEMCO_CONTACTID_EXCEPTION_SCHEDULE_CHANGE = 0x631, ADEMCO_CONTACTID_ACCESS_SCHEDULE_CHANGE = 0x632, ADEMCO_CONTACTID_SENIOR_WATCH_TROUBLE = 0x641, ADEMCO_CONTACTID_LATCHKEY_SUPERVISION = 0x642, ADEMCO_CONTACTID_RESERVED_FOR_ADEMCO_USE_1 = 0x651, ADEMCO_CONTACTID_RESERVED_FOR_ADEMCO_USE_2 = 0x652, ADEMCO_CONTACTID_RESERVED_FOR_ADEMCO_USE_3 = 0x653, ADEMCO_CONTACTID_SYSTEM_INACTIVITY = 0x654, ADEMCO_CONTACTID_DOWNLOAD_ABORT = 0x900, ADEMCO_CONTACTID_DOWNLOAD_START_END = 0x901, ADEMCO_CONTACTID_DOWNLOAD_INTERRUPTED = 0x902, ADEMCO_CONTACTID_AUTOCLOSE_WITH_BYPASS = 0x910, ADEMCO_CONTACTID_BYPASS_CLOSING = 0x911, ADEMCO_CONTACTID_32_HOUR_NO_READ_OF_EVENT_LOG = 0x999 }; typedef struct ademco_contactid_sender_state_s ademco_contactid_sender_state_t; typedef struct ademco_contactid_receiver_state_s ademco_contactid_receiver_state_t; typedef struct { int acct; int mt; int q; int xyz; int gg; int ccc; } ademco_contactid_report_t; typedef void (*ademco_contactid_report_func_t)(void *user_data, const ademco_contactid_report_t *report); #if defined(__cplusplus) extern "C" { #endif SPAN_DECLARE(const char *) ademco_contactid_msg_qualifier_to_str(int q); SPAN_DECLARE(const char *) ademco_contactid_event_to_str(int xyz); SPAN_DECLARE(int) encode_msg(char buf[], const ademco_contactid_report_t *report); SPAN_DECLARE(int) decode_msg(ademco_contactid_report_t *report, const char buf[]); SPAN_DECLARE(int) ademco_contactid_receiver_log_msg(ademco_contactid_receiver_state_t *s, const ademco_contactid_report_t *report); SPAN_DECLARE(int) ademco_contactid_receiver_tx(ademco_contactid_receiver_state_t *s, int16_t amp[], int max_samples); SPAN_DECLARE(int) ademco_contactid_receiver_rx(ademco_contactid_receiver_state_t *s, const int16_t amp[], int samples); SPAN_DECLARE(int) ademco_contactid_receiver_fillin(ademco_contactid_receiver_state_t *s, int samples); SPAN_DECLARE(logging_state_t *) ademco_contactid_receiver_get_logging_state(ademco_contactid_receiver_state_t *s); SPAN_DECLARE(void) ademco_contactid_receiver_set_realtime_callback(ademco_contactid_receiver_state_t *s, ademco_contactid_report_func_t callback, void *user_data); SPAN_DECLARE(ademco_contactid_receiver_state_t *) ademco_contactid_receiver_init(ademco_contactid_receiver_state_t *s, ademco_contactid_report_func_t callback, void *user_data); SPAN_DECLARE(int) ademco_contactid_receiver_release(ademco_contactid_receiver_state_t *s); SPAN_DECLARE(int) ademco_contactid_receiver_free(ademco_contactid_receiver_state_t *s); SPAN_DECLARE(int) ademco_contactid_sender_tx(ademco_contactid_sender_state_t *s, int16_t amp[], int max_samples); SPAN_DECLARE(int) ademco_contactid_sender_rx(ademco_contactid_sender_state_t *s, const int16_t amp[], int samples); SPAN_DECLARE(int) ademco_contactid_sender_fillin(ademco_contactid_sender_state_t *s, int samples); SPAN_DECLARE(int) ademco_contactid_sender_put(ademco_contactid_sender_state_t *s, const ademco_contactid_report_t *report); SPAN_DECLARE(logging_state_t *) ademco_contactid_sender_get_logging_state(ademco_contactid_sender_state_t *s); SPAN_DECLARE(void) ademco_contactid_sender_set_realtime_callback(ademco_contactid_sender_state_t *s, tone_report_func_t callback, void *user_data); SPAN_DECLARE(ademco_contactid_sender_state_t *) ademco_contactid_sender_init(ademco_contactid_sender_state_t *s, tone_report_func_t callback, void *user_data); SPAN_DECLARE(int) ademco_contactid_sender_release(ademco_contactid_sender_state_t *s); SPAN_DECLARE(int) ademco_contactid_sender_free(ademco_contactid_sender_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/arctan2.h0000664000175000017500000000635712100750333014057 00000000000000/* * SpanDSP - a series of DSP components for telephony * * arctan2.h - A quick rough approximate arc tan * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_ARCTAN2_H_) #define _SPANDSP_ARCTAN2_H_ /*! \page arctan2_page Fast approximate four quadrant arc-tangent \section arctan2_page_sec_1 What does it do? This module provides a fast approximate 4-quadrant arc tangent function, based on something at dspguru.com. The worst case error is about 4.07 degrees. This is fine for many "where am I" type evaluations in comms. work. \section arctan2_page_sec_2 How does it work? ???. */ #if defined(__cplusplus) extern "C" { #endif /* This returns its answer as a signed 32 bit integer phase value. */ static __inline__ int32_t arctan2(float y, float x) { float abs_y; float angle; if (y == 0.0f) { if (x < 0.0f) return 0x80000000; return 0x00000000; } if (x == 0.0f) { if (y < 0.0f) return 0xc0000000; return 0x40000000; } abs_y = fabsf(y); /* If we are in quadrant II or III, flip things around */ if (x < 0.0f) angle = 3.0f - (x + abs_y)/(abs_y - x); else angle = 1.0f - (x - abs_y)/(abs_y + x); angle *= 536870912.0f; /* If we are in quadrant III or IV, negate to return an answer in the range +-pi */ if (y < 0.0f) angle = -angle; return (int32_t) angle; } /*- End of function --------------------------------------------------------*/ #if 0 /* This returns its answer in radians, in the range +-pi. */ static __inline__ float arctan2f(float y, float x) { float angle; float fx; float fy; if (y == 0.0f) { if (x < 0.0f) return 3.1415926f; return 0.0f; } if (x == 0.0f) { if (y < 0.0f) return 3.1415926f*1.5f; return 3.1415926f*0.5f; } fx = fabsf(x); fy = fabsf(y); /* Deal with the octants */ /* N.B. 0.28125 == (1/4 + 1/32) */ if (fy > fx) angle = 3.1415926f/2.0f - fx*fy/(y*y + 0.28125f*x*x); else angle = fy*fx/(x*x + 0.28125f*y*y); /* Deal with the quadrants, to bring the final answer to the range +-pi */ if (x < 0.0f) angle = 3.1415926f - angle; if (y < 0.0f) angle = -angle; return angle; } /*- End of function --------------------------------------------------------*/ #endif #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/g168models.h0000664000175000017500000003531112100762361014412 00000000000000/* * SpanDSP - a series of DSP components for telephony * * g168models.h - line models for echo cancellation tests against the G.168 * spec. * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_G168MODELS_H_) #define _SPANDSP_G168MODELS_H_ /*! \page g168_test_data_page The test data from the G.168 specification */ /*! The line model from section D.2 of G.168. These are the coefficients for the line simulation model defined in section D.2 of G.168. It may be used with the fir32_xxx routines to build a line simulator. */ const int32_t line_model_d2_coeffs[] = { -436, -829, -2797, -4208, -17968, -11215, 46150, 34480, -10427, 9049, -1309, -6320, 390, -8191, -1751, -6051, -3796, -4055, -3948, -2557, -3372, -1808, -2259, -1300, -1098, -618, -340, -61, 323, 419, 745, 716, 946, 880, 1014, 976, 1033, 1091, 1053, 1042, 794, 831, 899, 716, 390, 313, 304, 304, 73, -119, -109, -176, -359, -407, -512, -580, -704, -618, -685, -791, -772, -820, -839, -724 }; #define LINE_MODEL_D2_GAIN 1.39E-5f /*! The line model from section D.3 of G.168. These are the coefficients for the line simulation model defined in section D.3 of G.168. It may be used with the fir32_xxx routines to build a line simulator. */ const int32_t line_model_d3_coeffs[] = { -381, 658, 1730, -51, -3511, -1418, 7660, 8861, -8106, -21370, -5307, 23064, 24020, 1020, -12374, -16296, -19524, -7480, 13509, 17115, 13952, 13952, 97, -9326, -9046, -15208, -9853, -3858, -1979, 6029, 5616, 7214, 6820, 3935, 3919, 921, 1316, -693, -759, -1517, -2176, -2028, -2654, -1814, -2077, -1468, -1221, -842, -463, -298, -68, 64, 493, 723, 789, 954, 756, 839, 872, 1020, 789, 822, 558, 658, 476, 377, 377, 262, 97, -68, -183, -232, -331, -347, -430, -314, -430, -463, -463, -414, -381, -479, -479, -512, -479, -397, -430, -397, -298, -265, -249, -216, -249, -265, -166, -232 }; #define LINE_MODEL_D3_GAIN 1.44E-5f /*! The line model from section D.4 of G.168. These are the coefficients for the line simulation model defined in section D.4 of G.168. It may be used with the fir32_xxx routines to build a line simulator. */ const int32_t line_model_d4_coeffs[] = { -448, -436, 2230, 2448, -4178, -7050, 5846, 18581, 2322, -26261, -16249, 21637, 25649, -2267, -10311, -4693, -12690, -7428, 14164, 13467, 4438, 8627, 456, -11879, -6352, -5104, -7496, 3271, 6566, 4277, 11131, 7562, 1475, 3728, -3525, -7301, -3101, -9269, -6146, -2553, -6272, 811, 124, 788, 5147, 2172, 5387, 4598, 3535, 4004, 2311, 2150, 1017, 330, -139, -573, -1100, -1157, -1180, -1455, -1123, -1386, -1123, -1066, -1020, -1100, -1008, -1077, -1088, -917, -917, -963, -814, -871, -734, -642, -562, -356, -379, -345, -230, -233, -333, -356, -390, -310, -265, -368, -310, -310, -390, -482, -459, -482, -551, -573 }; #define LINE_MODEL_D4_GAIN 1.52E-5f /*! The line model from section D.5 of G.168. These are the coefficients for the line simulation model defined in section D.5 of G.168. It may be used with the fir32_xxx routines to build a line simulator. */ const int32_t line_model_d5_coeffs[] = { 160, 312, -241, -415, 897, 908, -1326, -1499, 2405, 3347, -3624, -7733, 4041, 14484, -1477, -21739, -4470, 25356, 11458, -19696, -11800, 5766, 789, 6633, 14624, -6975, -17156, -187, 149, 1515, 14907, 4345, -7128, -2757, -10185, -7083, 6850, 3944, 6969, 8694, -4068, -3852, -5793, -9371, 453, 1060, 3965, 9463, 2393, 2784, -892, -7366, -3376, -5847, -2399, 3011, 1537, 6623, 4205, 1602, 1592, -4752, -3646, -5207, -5577, -501, -1174, 4041, 5647, 4628, 7252, 2123, 2654, -881, -4113, -3244, -7289, -3830, -4600, -2508, 431, -144, 4184, 2372, 4617, 3576, 2382, 2839, -404, 539, -1803, -1401, -1705, -2269, -783, -1608, -220, -306, 257, 615, 225, 561, 8, 344, 127, -57, 182, 41, 203, -111, 95, -79, 30, 84, -13, -68, -241, -68, -24, 19, -57, -24, 30, -68, 84, -155, -68, 19 }; #define LINE_MODEL_D5_GAIN 1.77E-5f /*! The line model from section D.6 of G.168. These are the coefficients for the line simulation model defined in section D.6 of G.168. It may be used with the fir32_xxx routines to build a line simulator. */ const int32_t line_model_d6_coeffs[] = { 293, 268, 475, 460, 517, 704, 581, 879, 573, 896, 604, 787, 561, 538, 440, 97, 265, -385, 20, -938, -523, -1438, -1134, -1887, -1727, -1698, -4266, -22548, -43424, 2743, 25897, 7380, 21499, 11983, 10400, 11667, 3889, 7241, 925, 2018, -821, -2068, -2236, -4283, -3406, -5022, -4039, -4842, -4104, -4089, -3582, -2978, -2734, -1805, -1608, -645, -495, 279, 471, 947, 1186, 1438, 1669, 1640, 1901, 1687, 1803, 1543, 1566, 1342, 1163, 963, 733, 665, 323, 221, -14, -107, -279, -379, -468, -513, -473, -588, -612, -652, -616, -566, -515, -485, -404, -344, -290, -202, -180, -123 }; #define LINE_MODEL_D6_GAIN 9.33E-6f /*! The line model from section D.7 of G.168. These are the coefficients for the line simulation model defined in section D.8 of G.168. It may be used with the fir32_xxx routines to build a line simulator. */ const int32_t line_model_d7_coeffs[] = { 29, 109, -83, 198, -294, -135, -415, -202, -444, -337, -313, -450, -105, -503, 145, -490, 267, -231, 340, 77, 343, 783, 158, 1341, 195, 1798, 344, 1845, 629, 1604, 1182, 940, 5163, 19522, 8421, -50953, -9043, 18046, -13553, 13336, -3471, -107, 1788, -7409, 2469, -7994, 490, -3860, -837, 490, -636, 3682, 1141, 5019, 2635, 5025, 3946, 4414, 4026, 3005, 3380, 1616, 2007, 158, 388, -1198, -1117, -2134, -2547, -2589, -3310, -2778, -3427, -2779, -3116, -2502, -2399, -1956, -1539, -1239, -570, -377, 251, 331, 964, 1177, 1449, 1564, 1724, 1871, 1767, 1802, 1630, 1632, 1379, 1271, 1063, 856, 711, 482, 289, 54, -137, -321, -490, -638, -764, -836, -800, -859, -838, -837, -834, -740, -673, -581, -493, -436, -327, -201 }; #define LINE_MODEL_D7_GAIN 1.51E-5f /*! The line model from section D.8 of G.168. These are the coefficients for the line simulation model defined in section D.8 of G.168. It may be used with the fir32_xxx routines to build a line simulator. */ const int32_t line_model_d8_coeffs[] = { 258, -111, 337, -319, 347, -434, 192, -450, -108, -343, -596, -177, -1187, -52, -1781, -147, -1959, -326, -1601, -1389, -13620, -720, 33818, -10683, -6742, 12489, -9862, 8950, -1574, 758, 3526, -3118, 2421, -8966, -4901, 11385, 18072, -14410, -7473, 19836, -16854, -3115, 9483, -17799, 7399, -4342, -7415, 7929, -10726, 6239, -2526, -1317, 5345, -4565, 6868, -2195, 3425, 1969, -109, 3963, -1275, 3087, -892, 1239, 2, -427, 596, -1184, 551, -1244, 141, -743, -415, -372, -769, -183, -785, -270, -659, -377, -523, -325, -245, -255, -60, 35, 218, 149, 340, 233, 365, 303, 251, 230, 209, 179 }; #define LINE_MODEL_D8_GAIN 2.33E-5f /*! The line model from section D.9 of G.168. These are the coefficients for the line simulation model defined in section D.9 of G.168. It may be used with the fir32_xxx routines to build a line simulator. */ const int32_t line_model_d9_coeffs[] = { 80, 31, 4, 42, 42, -61, -81, -64, -121, -102, -26, 1002, -9250, -22562, 39321, 35681, -35289, 25312, -1457, -229, 15659, -6786, 16791, 3860, 2239, -28730, -11885, 33871, -176, -16421, 18173, -9669, -10163, 9941, -19365, 3592, -5907, -10257, 5336, -12933, 4348, -4802, -1791, 3035, -4433, 5553, -2596, 3992, 1255, 1450, 4079, 324, 4340, 1059, 3083, 1917, 1756, 2478, 1027, 1871, 845, 1284, 813, 806, 869, 471, 646, 438, 449, 432, 473, 394, 452, 538, 717, 723, 850, 756, 753, 899, 555, 669, 619, 500, 650, 615, 516, 492, 427, 291, 356, 147, 107, -50, -88, -59, -238, -165, -183 }; #define LINE_MODEL_D9_GAIN 1.33E-5f /*! The filter coefficients for the bandpass filter specified for level measurements in section 6.4.1.2.1 of G.168. */ const float level_measurement_bp_coeffs[] = { 0.0000, 0.0006, 0.0005, 0.0004, 0.0011, 0.0000, 0.0015, -0.0003, 0.0012, -0.0002, 0.0000, 0.0002, -0.0020, 0.0005, -0.0040, 0.0000, -0.0047, -0.0019, -0.0033, -0.0047, 0.0000, -0.0068, 0.0036, -0.0057, 0.0054, 0.0000, 0.0044, 0.0095, 0.0017, 0.0188, 0.0000, 0.0225, 0.0024, 0.0163, 0.0092, 0.0000, 0.0164, -0.0210, 0.0161, -0.0375, 0.0000, -0.0406, -0.0357, -0.0267, -0.0871, 0.0000, -0.1420, 0.0289, -0.1843, 0.0475, 0.8006, 0.0475, -0.1843, 0.0289, -0.1420, 0.0000, -0.0871, -0.0267, -0.0357, -0.0406, 0.0000, -0.0375, 0.0161, -0.0210, 0.0164, 0.0000, 0.0092, 0.0163, 0.0024, 0.0225, 0.0000, 0.0188, 0.0017, 0.0095, 0.0044, 0.0000, 0.0054, -0.0057, 0.0036, -0.0068, 0.0000, -0.0047, -0.0033, -0.0019, -0.0047, 0.0000, -0.0040, 0.0005, -0.0020, 0.0002, 0.0000, -0.0002, 0.0012, -0.0003, 0.0015, 0.0000, 0.0011, 0.0004, 0.0005, 0.0006, 0.0000 }; /*! The composite source signal "voiced" section from table C.1 of G.168. */ const int css_c1[] = { -155, 276, 517, 578, 491, 302, 86, -103, -207, -198, 60, 190, 543, 948, 1362, 1741, 2043, 2276, 2422, 2500, 2552, 2595, 2655, 2758, 2896, 3060, 3224, 3370, 3500, 3569, 3603, 3603, 3595, 3586, 3595, 3638, 3724, 3819, 3922, 4000, 4043, 4034, 3974, 3862, 3724, 3577, 3439, 3336, 3267, 3224, 3198, 3172, 3129, 3043, 2914, 2750, 2560, 2353, 2155, 1991, 1853, 1750, 1672, 1603, 1534, 1440, 1310, 1146, 965, 776, 603, 448, 345, 276, 250, 250, 267, 267, 241, 190, 103, -9, -138, -267, -388, -491, -569, -638, -698, -759, -813, -888, -957, -1034, -1103, -1146, -1181, -1190, -1198, -1215, -1259, -1327, -1457, -1629, -1853, -2121, -2414, -2707, -3017, -3319, -3612, -3913, -4224, -4560, -4922, -5301, -5715, -6137, -6560, -6948, -7301, -7568, -7732, -7758, -7620, -7310, -6810, -6155, -5344, -4439, -3474, -2508, -1595, -802 }; /*! The composite source signal "voiced" section from table C.3 of G.168. */ const int css_c3[] = { -198, -112, -9, 103, 233, 388, 543, 724, 896, 1060, 1233, 1388, 1517, 1638, 1747, 1810, 1845, 1845, 1802, 1707, 1569, 1379, 1146, 871, 560, 233, -121, -491, -871, -1250, -1638, -2043, -2465, -2896, -3345, -3819, -4310, -4810, -5319, -5836, -6353, -6853, -7353, -7836, -8292, -8715, -9077, -9370, -9542, -9542, -9361, -8956, -8327, -7465, -6396, -5163, -3827, -2448, -1103, 155, 1293, 2241, 3034, 3655, 4138, 4517, 4827, 5094, 5344, 5594, 5827, 6043, 6215, 6344, 6413, 6422, 6379, 6310, 6215, 6120, 6051, 6000, 5991, 5991, 6000, 6008, 5991, 5939, 5853, 5715, 5560, 5387, 5215, 5043, 4879, 4732, 4586, 4439, 4276, 4086, 3870, 3629, 3370, 3086, 2801, 2534, 2267, 2034, 1819, 1612, 1422, 1224, 1026, 819, 603, 388, 181, 9, -181, -328, -448, -543, -629, -707, -784, -871, -948, -1026, -1112, -1181, -1241, -1276, -1293, -1302, -1293, -1267, -1250, -1233, -1224, -1224, -1224, -1224, -1215, -1198, -1172, -1129, -1077, -1026, -974, -922, -888, -871, -845, -828, -810, -793, -767, -741, -698, -672, -638, -603, -595, -586, -595, -603, -621, -629, -938, -638, -638, -638, -638, -638, -647, -664, -690, -724, -767, -793, -819, -845, -853, -871, -879, -888, -896, -922, -948, -974, -1009, -1026, -1052, -1069, -1077, -1069, -1060, -1060, -1052, -1043, -1043, -1052, -1060, -1060, -1060, -1052, -1034, -1017, -991, -957, -931, -905, -888, -862, -845, -819, -793, -767, -724, -672, -621, -560, -509, -457, -397, -345, -276, -207, -112 }; /*! From section 6.4.2.7 of G.168 - Test No. 6 Non-divergence on narrow-band signals. These tones and tone pairs are each applied for 5 seconds. */ const int tones_6_4_2_7[][2] = { { 697, 0}, { 941, 0}, {1336, 0}, {1633, 0}, { 697, 1209}, { 770, 1336}, { 852, 1477}, { 941, 1633}, { 0, 0} }; #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/noise.h0000664000175000017500000001120611422612264013635 00000000000000/* * SpanDSP - a series of DSP components for telephony * * noise.h - A low complexity audio noise generator, suitable for * real time generation (current just approx AWGN) * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_NOISE_H_) #define _SPANDSP_NOISE_H_ /*! \page noise_page Noise generation \section noise_page_sec_1 What does it do? It generates audio noise. Currently it only generates reasonable quality AWGN. It is designed to be of sufficiently low complexity to generate large volumes of reasonable quality noise, in real time. Hoth noise is used to model indoor ambient noise when evaluating communications systems such as telephones. It is named after D.F. Hoth, who made the first systematic study of this. The official definition of Hoth noise is IEEE standard 269-2001 (revised from 269-1992), "Draft Standard Methods for Measuring Transmission Performance of Analog and Digital Telephone Sets, Handsets and Headsets." The table below gives the spectral density of Hoth noise, adjusted in level to produce a reading of 50 dBA. Freq (Hz) Spectral Bandwidth Total power in density 10 log_f each 1/3 octave band (dB SPL/Hz) (dB) (dB SPL) 100 32.4 13.5 45.9 125 30.9 14.7 45.5 160 29.1 15.7 44.9 200 27.6 16.5 44.1 250 26.0 17.6 43.6 315 24.4 18.7 43.1 400 22.7 19.7 42.3 500 21.1 20.6 41.7 630 19.5 21.7 41.2 800 17.8 22.7 40.4 1000 16.2 23.5 39.7 1250 14.6 24.7 39.3 1600 12.9 25.7 38.7 2000 11.3 26.5 37.8 2500 9.6 27.6 37.2 3150 7.8 28.7 36.5 4000 5.4 29.7 34.8 5000 2.6 30.6 33.2 6300 -1.3 31.7 30.4 8000 -6.6 32.7 26.0 The tolerance for each 1/3rd octave band is 3dB. \section awgn_page_sec_2 How does it work? The central limit theorem says if you add a few random numbers together, the result starts to look Gaussian. In this case we sum 8 random numbers. The result is fast, and perfectly good as a noise source for many purposes. It should not be trusted as a high quality AWGN generator, for elaborate modelling purposes. */ enum { NOISE_CLASS_AWGN = 1, NOISE_CLASS_HOTH }; /*! Noise generator descriptor. This contains all the state information for an instance of the noise generator. */ typedef struct noise_state_s noise_state_t; #if defined(__cplusplus) extern "C" { #endif /*! Initialise an audio noise generator. \brief Initialise an audio noise generator. \param s The noise generator context. \param seed A seed for the underlying random number generator. \param level The noise power level in dBmO. \param class_of_noise The class of noise (e.g. AWGN). \param quality A parameter which permits speed and accuracy of the noise generation to be adjusted. \return A pointer to the noise generator context. */ SPAN_DECLARE(noise_state_t *) noise_init_dbm0(noise_state_t *s, int seed, float level, int class_of_noise, int quality); SPAN_DECLARE(noise_state_t *) noise_init_dbov(noise_state_t *s, int seed, float level, int class_of_noise, int quality); SPAN_DECLARE(int) noise_release(noise_state_t *s); SPAN_DECLARE(int) noise_free(noise_state_t *s); /*! Generate a sample of audio noise. \brief Generate a sample of audio noise. \param s The noise generator context. \return The generated sample. */ SPAN_DECLARE(int16_t) noise(noise_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/t31.h0000664000175000017500000001413311422612264013131 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t31.h - A T.31 compatible class 1 FAX modem interface. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_T31_H_) #define _SPANDSP_T31_H_ /*! \page t31_page T.31 Class 1 FAX modem protocol handling \section t31_page_sec_1 What does it do? The T.31 class 1 FAX modem modules implements a class 1 interface to the FAX modems in spandsp. \section t31_page_sec_2 How does it work? */ /*! T.31 descriptor. This defines the working state for a single instance of a T.31 FAX modem. */ typedef struct t31_state_s t31_state_t; typedef int (t31_modem_control_handler_t)(t31_state_t *s, void *user_data, int op, const char *num); #define T31_TX_BUF_LEN (4096) #define T31_TX_BUF_HIGH_TIDE (4096 - 1024) #define T31_TX_BUF_LOW_TIDE (1024) #define T31_MAX_HDLC_LEN 284 #define T31_T38_MAX_HDLC_LEN 260 #if defined(__cplusplus) extern "C" { #endif SPAN_DECLARE(void) t31_call_event(t31_state_t *s, int event); SPAN_DECLARE(int) t31_at_rx(t31_state_t *s, const char *t, int len); /*! Process a block of received T.31 modem audio samples. \brief Process a block of received T.31 modem audio samples. \param s The T.31 modem context. \param amp The audio sample buffer. \param len The number of samples in the buffer. \return The number of samples unprocessed. */ SPAN_DECLARE_NONSTD(int) t31_rx(t31_state_t *s, int16_t amp[], int len); /*! Fake processing of a missing block of received T.31 modem audio samples (e.g due to packet loss). \brief Fake processing of a missing block of received T.31 modem audio samples. \param s The T.31 modem context. \param len The number of samples to fake. \return The number of samples unprocessed. */ SPAN_DECLARE_NONSTD(int) t31_rx_fillin(t31_state_t *s, int len); /*! Generate a block of T.31 modem audio samples. \brief Generate a block of T.31 modem audio samples. \param s The T.31 modem context. \param amp The audio sample buffer. \param max_len The number of samples to be generated. \return The number of samples actually generated. */ SPAN_DECLARE_NONSTD(int) t31_tx(t31_state_t *s, int16_t amp[], int max_len); SPAN_DECLARE(int) t31_t38_send_timeout(t31_state_t *s, int samples); /*! Select whether silent audio will be sent when transmit is idle. \brief Select whether silent audio will be sent when transmit is idle. \param s The T.31 modem context. \param transmit_on_idle TRUE if silent audio should be output when the transmitter is idle. FALSE to transmit zero length audio when the transmitter is idle. The default behaviour is FALSE. */ SPAN_DECLARE(void) t31_set_transmit_on_idle(t31_state_t *s, int transmit_on_idle); /*! Select whether TEP mode will be used (or time allowed for it (when transmitting). \brief Select whether TEP mode will be used. \param s The T.31 modem context. \param use_tep TRUE if TEP is to be ised. */ SPAN_DECLARE(void) t31_set_tep_mode(t31_state_t *s, int use_tep); /*! Select whether T.38 data will be paced as it is transmitted. \brief Select whether T.38 data will be paced. \param s The T.31 modem context. \param without_pacing TRUE if data is to be sent as fast as possible. FALSE if it is to be paced. */ SPAN_DECLARE(void) t31_set_t38_config(t31_state_t *s, int without_pacing); SPAN_DECLARE(void) t31_set_mode(t31_state_t *s, int t38_mode); /*! Get a pointer to the logging context associated with a T.31 context. \brief Get a pointer to the logging context associated with a T.31 context. \param s The T.31 context. \return A pointer to the logging context, or NULL. */ SPAN_DECLARE(logging_state_t *) t31_get_logging_state(t31_state_t *s); SPAN_DECLARE(t38_core_state_t *) t31_get_t38_core_state(t31_state_t *s); /*! Initialise a T.31 context. This must be called before the first use of the context, to initialise its contents. \brief Initialise a T.31 context. \param s The T.31 context. \param at_tx_handler A callback routine to handle AT interpreter channel output. \param at_tx_user_data An opaque pointer passed in called to at_tx_handler. \param modem_control_handler A callback routine to handle control of the modem (off-hook, etc). \param modem_control_user_data An opaque pointer passed in called to modem_control_handler. \param tx_t38_packet_handler ??? \param tx_t38_packet_user_data ??? \return A pointer to the T.31 context. */ SPAN_DECLARE(t31_state_t *) t31_init(t31_state_t *s, at_tx_handler_t *at_tx_handler, void *at_tx_user_data, t31_modem_control_handler_t *modem_control_handler, void *modem_control_user_data, t38_tx_packet_handler_t *tx_t38_packet_handler, void *tx_t38_packet_user_data); /*! Release a T.31 context. \brief Release a T.31 context. \param s The T.31 context. \return 0 for OK */ SPAN_DECLARE(int) t31_release(t31_state_t *s); /*! Free a T.31 context. \brief Release a T.31 context. \param s The T.31 context. \return 0 for OK */ SPAN_DECLARE(int) t31_free(t31_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/spandsp/awgn.h0000664000175000017500000000637111422612263013462 00000000000000/* * SpanDSP - a series of DSP components for telephony * * awgn.h - An additive Gaussian white noise generator * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /* This code is based on some demonstration code in a research paper somewhere. I can't track down where I got the original from, so that due recognition can be given. The original had no explicit copyright notice, and I hope nobody objects to its use here. Having a reasonable Gaussian noise generator is pretty important for telephony testing (in fact, pretty much any DSP testing), and this one seems to have served me OK. Since the generation of Gaussian noise is only for test purposes, and not a core system component, I don't intend to worry excessively about copyright issues, unless someone worries me. The non-core nature of this code also explains why it is unlikely to ever be optimised. */ #if !defined(_SPANDSP_AWGN_H_) #define _SPANDSP_AWGN_H_ /*! \page awgn_page Additive white gaussian noise (AWGN) generation \section awgn_page_sec_1 What does it do? Adding noise is not the most useful thing in most DSP applications, but it is awfully useful for test suites. \section awgn_page_sec_2 How does it work? This code is based on some demonstration code in a research paper somewhere. I can't track down where I got the original from, so that due recognition can be given. The original had no explicit copyright notice, and I hope nobody objects to its use here. Having a reasonable Gaussian noise generator is pretty important for telephony testing (in fact, pretty much any DSP testing), and this one seems to have served me OK. Since the generation of Gaussian noise is only for test purposes, and not a core system component, I don't intend to worry excessively about copyright issues, unless someone worries me. The non-core nature of this code also explains why it is unlikely to ever be optimised. */ /*! AWGN generator descriptor. This contains all the state information for an AWGN generator. */ typedef struct awgn_state_s awgn_state_t; #if defined(__cplusplus) extern "C" { #endif SPAN_DECLARE(awgn_state_t *) awgn_init_dbm0(awgn_state_t *s, int idum, float level); SPAN_DECLARE(awgn_state_t *) awgn_init_dbov(awgn_state_t *s, int idum, float level); SPAN_DECLARE(int) awgn_release(awgn_state_t *s); SPAN_DECLARE(int) awgn_free(awgn_state_t *s); SPAN_DECLARE(int16_t) awgn(awgn_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/lpc10_analyse.c0000664000175000017500000005642112101035104013471 00000000000000/* * SpanDSP - a series of DSP components for telephony * * lpc10_analyse.c - LPC10 low bit rate speech codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * This code is based on the U.S. Department of Defense reference * implementation of the LPC-10 2400 bps Voice Coder. They do not * exert copyright claims on their code, and it may be freely used. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include "spandsp/telephony.h" #include "spandsp/dc_restore.h" #include "spandsp/lpc10.h" #include "spandsp/private/lpc10.h" #include "lpc10_encdecs.h" static __inline__ float energyf(float amp[], int len) { int i; float rms; rms = 0.0f; for (i = 0; i < len; i++) rms += amp[i]*amp[i]; rms = sqrtf(rms/len); return rms; } /*- End of function --------------------------------------------------------*/ static void remove_dc_bias(float speech[], int len, float sigout[]) { float bias; int i; bias = 0.0f; for (i = 0; i < len; i++) bias += speech[i]; bias /= len; for (i = 0; i < len; i++) sigout[i] = speech[i] - bias; } /*- End of function --------------------------------------------------------*/ static void eval_amdf(float speech[], int32_t lpita, const int32_t tau[], int32_t ltau, int32_t maxlag, float amdf[], int32_t *minptr, int32_t *maxptr) { float sum; int i; int j; int n1; int n2; *minptr = 0; *maxptr = 0; for (i = 0; i < ltau; i++) { n1 = (maxlag - tau[i])/2 + 1; n2 = n1 + lpita - 1; sum = 0.0f; for (j = n1; j <= n2; j += 4) sum += fabsf(speech[j - 1] - speech[j + tau[i] - 1]); amdf[i] = sum; if (amdf[i] < amdf[*minptr]) *minptr = i; if (amdf[i] > amdf[*maxptr]) *maxptr = i; } } /*- End of function --------------------------------------------------------*/ static void eval_highres_amdf(float speech[], int32_t lpita, const int32_t tau[], int32_t ltau, float amdf[], int32_t *minptr, int32_t *maxptr, int32_t *mintau) { float amdf2[6]; int32_t tau2[6]; int32_t minp2; int32_t ltau2; int32_t maxp2; int32_t minamd; int i; int i2; int ptr; /* Compute full AMDF using log spaced lags, find coarse minimum */ eval_amdf(speech, lpita, tau, ltau, tau[ltau - 1], amdf, minptr, maxptr); *mintau = tau[*minptr]; minamd = (int32_t) amdf[*minptr]; /* Build table containing all lags within +/- 3 of the AMDF minimum, excluding all that have already been computed */ ltau2 = 0; ptr = *minptr - 2; i2 = min(*mintau + 4, tau[ltau - 1]); for (i = max(*mintau - 3, 41); i < i2; i++) { while (tau[ptr] < i) ptr++; if (tau[ptr] != i) tau2[ltau2++] = i; } /* Compute AMDF of the new lags, if there are any, and choose one if it is better than the coarse minimum */ if (ltau2 > 0) { eval_amdf(speech, lpita, tau2, ltau2, tau[ltau - 1], amdf2, &minp2, &maxp2); if (amdf2[minp2] < (float) minamd) { *mintau = tau2[minp2]; minamd = (int32_t) amdf2[minp2]; } } /* Check one octave up, if there are any lags not yet computed */ if (*mintau >= 80) { i = *mintau/2; if ((i & 1) == 0) { ltau2 = 2; tau2[0] = i - 1; tau2[1] = i + 1; } else { ltau2 = 1; tau2[0] = i; } eval_amdf(speech, lpita, tau2, ltau2, tau[ltau - 1], amdf2, &minp2, &maxp2); if (amdf2[minp2] < (float) minamd) { *mintau = tau2[minp2]; minamd = (int32_t) amdf2[minp2]; *minptr -= 20; } } /* Force minimum of the AMDF array to the high resolution minimum */ amdf[*minptr] = (float) minamd; /* Find maximum of AMDF within 1/2 octave of minimum */ *maxptr = max(*minptr - 5, 0); i2 = min(*minptr + 6, ltau); for (i = *maxptr; i < i2; i++) { if (amdf[i] > amdf[*maxptr]) *maxptr = i; } } /*- End of function --------------------------------------------------------*/ static void dynamic_pitch_tracking(lpc10_encode_state_t *s, float amdf[], int32_t ltau, int32_t *minptr, int32_t voice, int32_t *pitch, int32_t *midx) { int32_t pbar; float sbar; int32_t i; int32_t j; float alpha; float minsc; float maxsc; /* Calculate the confidence factor ALPHA, used as a threshold slope in */ /* SEESAW. If unvoiced, set high slope so that every point in P array */ /*is marked as a potential pitch frequency. A scaled up version (ALPHAX )*/ /* is used to maintain arithmetic precision. */ if (voice == 1) s->alphax = s->alphax*0.75f + amdf[*minptr - 1]*0.5f; else s->alphax *= 0.984375f; alpha = s->alphax/16; if (voice == 0 && s->alphax < 128.0f) alpha = 8.0f; /* SEESAW: Construct a pitch pointer array and intermediate winner function */ /* Left to right pass: */ s->p[s->ipoint][0] = 1; pbar = 1; sbar = s->s[0]; for (i = 0; i < ltau; i++) { sbar += alpha; if (sbar < s->s[i]) { s->s[i] = sbar; } else { pbar = i + 1; sbar = s->s[i]; } s->p[s->ipoint][i] = pbar; } /* Right to left pass: */ sbar = s->s[pbar - 1]; for (i = pbar - 2; i >= 0; i--) { sbar += alpha; if (sbar < s->s[i]) { s->s[i] = sbar; s->p[s->ipoint][i] = pbar; } else { pbar = s->p[s->ipoint][i]; i = pbar - 1; sbar = s->s[i]; } } /* Update S using AMDF */ /* Find maximum, minimum, and location of minimum */ s->s[0] += amdf[0]/2; minsc = s->s[0]; maxsc = minsc; *midx = 1; for (i = 1; i < ltau; i++) { s->s[i] += amdf[i]/2; if (s->s[i] > maxsc) maxsc = s->s[i]; if (s->s[i] < minsc) { *midx = i + 1; minsc = s->s[i]; } } /* Subtract MINSC from S to prevent overflow */ for (i = 0; i < ltau; i++) s->s[i] -= minsc; maxsc -= minsc; /* Use higher octave pitch if significant null there */ j = 0; for (i = 20; i <= 40; i += 10) { if (*midx > i) { if (s->s[*midx - i - 1] < maxsc / 4) j = i; } } *midx -= j; /* TRACE: look back two frames to find minimum cost pitch estimate */ *pitch = *midx; for (i = 0, j = s->ipoint; i < 2; i++, j++) *pitch = s->p[j & 1][*pitch - 1]; /* The following statement subtracts one from IPOINT, mod DEPTH. I */ /* think the author chose to add DEPTH-1, instead of subtracting 1, */ /* because then it will work even if MOD doesn't work as desired on */ /* negative arguments. */ s->ipoint = (s->ipoint + 1) & 1; } /*- End of function --------------------------------------------------------*/ /* Detection of onsets in (or slightly preceding) the futuremost frame of speech. */ static void onset(lpc10_encode_state_t *s, float *pebuf, int32_t osbuf[], int32_t *osptr, int32_t oslen, int32_t sbufl, int32_t sbufh, int32_t lframe) { int32_t i; float r1; float l2sum2; pebuf -= sbufl; if (s->hyst) s->lasti -= lframe; for (i = sbufh - lframe + 1; i <= sbufh; i++) { /* Compute FPC; Use old FPC on divide by zero; Clamp FPC to +/- 1. */ s->n = (pebuf[i]*pebuf[i - 1] + s->n*63.0f)/64.0f; /* Computing 2nd power */ r1 = pebuf[i - 1]; s->d__ = (r1*r1 + s->d__*63.0f)/64.0f; if (s->d__ != 0.0f) { if (fabsf(s->n) > s->d__) s->fpc = r_sign(1.0f, s->n); else s->fpc = s->n/s->d__; } /* Filter FPC */ l2sum2 = s->l2buf[s->l2ptr1 - 1]; s->l2sum1 = s->l2sum1 - s->l2buf[s->l2ptr2 - 1] + s->fpc; s->l2buf[s->l2ptr2 - 1] = s->l2sum1; s->l2buf[s->l2ptr1 - 1] = s->fpc; s->l2ptr1 = (s->l2ptr1 & 0xF) + 1; s->l2ptr2 = (s->l2ptr2 & 0xF) + 1; if (fabsf(s->l2sum1 - l2sum2) > 1.7f) { if (!s->hyst) { /* Ignore if buffer full */ if (*osptr <= oslen) { osbuf[*osptr - 1] = i - 9; (*osptr)++; } s->hyst = TRUE; } s->lasti = i; /* After one onset detection, at least OSHYST sample times must go */ /* by before another is allowed to occur. */ } else if (s->hyst && i - s->lasti >= 10) { s->hyst = FALSE; } } } /*- End of function --------------------------------------------------------*/ /* Load a covariance matrix. */ static void mload(int32_t order, int32_t awins, int32_t awinf, float speech[], float phi[], float psi[]) { int32_t start; int i; int r; start = awins + order; for (r = 1; r <= order; r++) { phi[r - 1] = 0.0f; for (i = start; i <= awinf; i++) phi[r - 1] += speech[i - 2]*speech[i - r - 1]; } /* Load last element of vector PSI */ psi[order - 1] = 0.0f; for (i = start - 1; i < awinf; i++) psi[order - 1] += speech[i]*speech[i - order]; /* End correct to get additional columns of phi */ for (r = 1; r < order; r++) { for (i = 1; i <= r; i++) { phi[i*order + r] = phi[(i - 1)*order + r - 1] - speech[awinf - (r + 1)]*speech[awinf - (i + 1)] + speech[start - (r + 2)]*speech[start - (i + 2)]; } } /* End correct to get additional elements of PSI */ for (i = 0; i < order - 1; i++) { psi[i] = phi[i + 1] - speech[start - 2]*speech[start - i - 3] + speech[awinf - 1]*speech[awinf - i - 2]; } } /*- End of function --------------------------------------------------------*/ /* Preemphasize speech with a single-zero filter. */ /* (When coef = .9375, preemphasis is as in LPC43.) */ static float preemp(float inbuf[], float pebuf[], int nsamp, float coeff, float z) { float temp; int i; for (i = 0; i < nsamp; i++) { temp = inbuf[i] - coeff*z; z = inbuf[i]; pebuf[i] = temp; } return z; } /*- End of function --------------------------------------------------------*/ /* Invert a covariance matrix using Choleski decomposition method. */ static void invert(int32_t order, float phi[], float psi[], float rc[]) { float r1; int32_t i; int32_t j; int32_t k; float v[10][10]; for (j = 0; j < order; j++) { for (i = j; i < order; i++) v[j][i] = phi[i + j*order]; for (k = 0; k < j; k++) { r1 = v[k][j]*v[k][k]; for (i = j; i <= order; i++) v[j][i] -= v[k][i]*r1; } /* Compute intermediate results, which are similar to RC's */ if (fabsf(v[j][j]) < 1.0e-10f) { for (i = j; i < order; i++) rc[i] = 0.0f; return; } rc[j] = psi[j]; for (k = 0; k < j; k++) rc[j] -= rc[k]*v[k][j]; v[j][j] = 1.0f/v[j][j]; rc[j] *= v[j][j]; r1 = min(rc[j], 0.999f); rc[j] = max(r1, -0.999f); } } /*- End of function --------------------------------------------------------*/ /* Check RC's, repeat previous frame's RC's if unstable */ static int rcchk(int order, float rc1f[], float rc2f[]) { int i; for (i = 0; i < order; i++) { if (fabsf(rc2f[i]) > 0.99f) { for (i = 0; i < order; i++) rc2f[i] = rc1f[i]; break; } } return 0; } /*- End of function --------------------------------------------------------*/ static void lpfilt(float inbuf[], float lpbuf[], int32_t len, int32_t nsamp) { int32_t j; float t; /* 31 point equiripple FIR LPF */ /* Linear phase, delay = 15 samples */ /* Passband: ripple = 0.25 dB, cutoff = 800 Hz */ /* Stopband: atten. = 40. dB, cutoff = 1240 Hz */ for (j = len - nsamp; j < len; j++) { t = (inbuf[j] + inbuf[j - 30]) * -0.0097201988f; t += (inbuf[j - 1] + inbuf[j - 29]) * -0.0105179986f; t += (inbuf[j - 2] + inbuf[j - 28]) * -0.0083479648f; t += (inbuf[j - 3] + inbuf[j - 27]) * 5.860774e-4f; t += (inbuf[j - 4] + inbuf[j - 26]) * 0.0130892089f; t += (inbuf[j - 5] + inbuf[j - 25]) * 0.0217052232f; t += (inbuf[j - 6] + inbuf[j - 24]) * 0.0184161253f; t += (inbuf[j - 7] + inbuf[j - 23]) * 3.39723e-4f; t += (inbuf[j - 8] + inbuf[j - 22]) * -0.0260797087f; t += (inbuf[j - 9] + inbuf[j - 21]) * -0.0455563702f; t += (inbuf[j - 10] + inbuf[j - 20]) * -0.040306855f; t += (inbuf[j - 11] + inbuf[j - 19]) * 5.029835e-4f; t += (inbuf[j - 12] + inbuf[j - 18]) * 0.0729262903f; t += (inbuf[j - 13] + inbuf[j - 17]) * 0.1572008878f; t += (inbuf[j - 14] + inbuf[j - 16]) * 0.2247288674f; t += inbuf[j - 15] * 0.250535965f; lpbuf[j] = t; } } /*- End of function --------------------------------------------------------*/ /* 2nd order inverse filter, speech is decimated 4:1 */ static void ivfilt(float lpbuf[], float ivbuf[], int32_t len, int32_t nsamp, float ivrc[]) { int32_t i; int32_t j; int32_t k; float r[3]; float pc1; float pc2; /* Calculate autocorrelations */ for (i = 1; i <= 3; i++) { r[i - 1] = 0.0f; k = (i - 1) << 2; for (j = (i << 2) + len - nsamp; j <= len; j += 2) r[i - 1] += lpbuf[j - 1]*lpbuf[j - k - 1]; } /* Calculate predictor coefficients */ pc1 = 0.0f; pc2 = 0.0f; ivrc[0] = 0.0f; ivrc[1] = 0.0f; if (r[0] > 1.0e-10f) { ivrc[0] = r[1]/r[0]; ivrc[1] = (r[2] - ivrc[0]*r[1])/(r[0] - ivrc[0]*r[1]); pc1 = ivrc[0] - ivrc[0]*ivrc[1]; pc2 = ivrc[1]; } /* Inverse filter LPBUF into IVBUF */ for (i = len - nsamp; i < len; i++) ivbuf[i] = lpbuf[i] - pc1*lpbuf[i - 4] - pc2*lpbuf[i - 8]; } /*- End of function --------------------------------------------------------*/ void lpc10_analyse(lpc10_encode_state_t *s, float speech[], int32_t voice[], int32_t *pitch, float *rms, float rc[]) { static const int32_t tau[60] = { 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 84, 88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 144, 148, 152, 156 }; static const int32_t buflim[4] = { 181, 720, 25, 720 }; static const float precoef = 0.9375f; float amdf[60]; float abuf[156]; float ivrc[2]; float temp; float phi[100] /* was [10][10] */; float psi[10]; int32_t half; int32_t midx; int32_t ewin[3][2]; int32_t i; int32_t j; int32_t lanal; int32_t ipitch; int32_t mintau; int32_t minptr; int32_t maxptr; /* Calculations are done on future frame due to requirements of the pitch tracker. Delay RMS and RC's 2 frames to give current frame parameters on return. */ for (i = 0; i <= 720 - LPC10_SAMPLES_PER_FRAME - 181; i++) { s->inbuf[i] = s->inbuf[LPC10_SAMPLES_PER_FRAME + i]; s->pebuf[i] = s->pebuf[LPC10_SAMPLES_PER_FRAME + i]; } for (i = 0; i <= 540 - LPC10_SAMPLES_PER_FRAME - 229; i++) s->ivbuf[i] = s->ivbuf[LPC10_SAMPLES_PER_FRAME + i]; for (i = 0; i <= 720 - LPC10_SAMPLES_PER_FRAME - 25; i++) s->lpbuf[i] = s->lpbuf[LPC10_SAMPLES_PER_FRAME + i]; for (i = 0, j = 0; i < s->osptr - 1; i++) { if (s->osbuf[i] > LPC10_SAMPLES_PER_FRAME) s->osbuf[j++] = s->osbuf[i] - LPC10_SAMPLES_PER_FRAME; } s->osptr = j + 1; s->voibuf[0][0] = s->voibuf[1][0]; s->voibuf[0][1] = s->voibuf[1][1]; for (i = 0; i < 2; i++) { s->vwin[i][0] = s->vwin[i + 1][0] - LPC10_SAMPLES_PER_FRAME; s->vwin[i][1] = s->vwin[i + 1][1] - LPC10_SAMPLES_PER_FRAME; s->awin[i][0] = s->awin[i + 1][0] - LPC10_SAMPLES_PER_FRAME; s->awin[i][1] = s->awin[i + 1][1] - LPC10_SAMPLES_PER_FRAME; s->obound[i] = s->obound[i + 1]; s->voibuf[i + 1][0] = s->voibuf[i + 2][0]; s->voibuf[i + 1][1] = s->voibuf[i + 2][1]; s->rmsbuf[i] = s->rmsbuf[i + 1]; for (j = 0; j < LPC10_ORDER; j++) s->rcbuf[i][j] = s->rcbuf[i + 1][j]; } /* If the average value in the frame was over 1/4096 (after current BIAS correction), then subtract that much more from samples in the next frame. If the average value in the frame was under -1/4096, add 1/4096 more to samples in next frame. In all other cases, keep BIAS the same. */ temp = 0.0f; for (i = 0; i < LPC10_SAMPLES_PER_FRAME; i++) { s->inbuf[720 - 2*LPC10_SAMPLES_PER_FRAME + i] = speech[i]*4096.0f - s->bias; temp += s->inbuf[720 - 2*LPC10_SAMPLES_PER_FRAME + i]; } if (temp > (float) LPC10_SAMPLES_PER_FRAME) s->bias++; else if (temp < (float) (-LPC10_SAMPLES_PER_FRAME)) s->bias--; /* Place voicing window */ i = 721 - LPC10_SAMPLES_PER_FRAME; s->zpre = preemp(&s->inbuf[i - 181], &s->pebuf[i - 181], LPC10_SAMPLES_PER_FRAME, precoef, s->zpre); onset(s, s->pebuf, s->osbuf, &s->osptr, 10, 181, 720, LPC10_SAMPLES_PER_FRAME); lpc10_placev(s->osbuf, &s->osptr, 10, &s->obound[2], s->vwin, 3, LPC10_SAMPLES_PER_FRAME, 90, 156, 307, 462); /* The Pitch Extraction algorithm estimates the pitch for a frame of speech by locating the minimum of the average magnitude difference function (AMDF). The AMDF operates on low-pass, inverse filtered speech. (The low-pass filter is an 800 Hz, 19 tap, equiripple, FIR filter and the inverse filter is a 2nd-order LPC filter.) The pitch estimate is later refined by dynamic tracking. However, since some of the tracking parameters are a function of the voicing decisions, a voicing decision must precede the final pitch estimation. */ /* See subroutines LPFILT, IVFILT, and eval_highres_amdf. */ /* LPFILT reads indices LBUFH-LFRAME-29 = 511 through LBUFH = 720 of INBUF, and writes indices LBUFH+1-LFRAME = 541 through LBUFH = 720 of LPBUF. */ lpfilt(&s->inbuf[228], &s->lpbuf[384], 312, LPC10_SAMPLES_PER_FRAME); /* IVFILT reads indices (PWINH-LFRAME-7) = 353 through PWINH = 540 of LPBUF, and writes indices (PWINH-LFRAME+1) = 361 through PWINH = 540 of IVBUF. */ ivfilt(&s->lpbuf[204], s->ivbuf, 312, LPC10_SAMPLES_PER_FRAME, ivrc); /* eval_highres_amdf reads indices PWINL = 229 through (PWINL-1)+MAXWIN+(TAU(LTAU)-TAU(1))/2 = 452 of IVBUF, and writes indices 1 through LTAU = 60 of AMDF. */ eval_highres_amdf(s->ivbuf, 156, tau, 60, amdf, &minptr, &maxptr, &mintau); /* Voicing decisions are made for each half frame of input speech. An initial voicing classification is made for each half of the analysis frame, and the voicing decisions for the present frame are finalized. See subroutine VOICIN. */ /* The voicing detector (VOICIN) classifies the input signal as unvoiced (including silence) or voiced using the AMDF windowed maximum-to-minimum ratio, the zero crossing rate, energy measures, reflection coefficients, and prediction gains. */ /* The pitch and voicing rules apply smoothing and isolated corrections to the pitch and voicing estimates and, in the process, introduce two frames of delay into the corrected pitch estimates and voicing decisions. */ for (half = 0; half < 2; half++) { lpc10_voicing(s, &s->vwin[2][0], s->inbuf, s->lpbuf, buflim, half, &amdf[minptr], &amdf[maxptr], &mintau, ivrc, s->obound); } /* Find the minimum cost pitch decision over several frames, given the current voicing decision and the AMDF array */ minptr++; dynamic_pitch_tracking(s, amdf, 60, &minptr, s->voibuf[3][1], pitch, &midx); ipitch = tau[midx - 1]; /* Place spectrum analysis and energy windows */ lpc10_placea(&ipitch, s->voibuf, &s->obound[2], 3, s->vwin, s->awin, ewin, LPC10_SAMPLES_PER_FRAME, 156); /* Remove short term DC bias over the analysis window. */ lanal = s->awin[2][1] + 1 - s->awin[2][0]; remove_dc_bias(&s->pebuf[s->awin[2][0] - 181], lanal, abuf); /* Compute RMS over integer number of pitch periods within the analysis window. */ /* Note that in a hardware implementation this computation may be simplified by using diagonal elements of phi computed by mload(). */ s->rmsbuf[2] = energyf(&abuf[ewin[2][0] - s->awin[2][0]], ewin[2][1] - ewin[2][0] + 1); /* Matrix load and invert, check RC's for stability */ mload(LPC10_ORDER, 1, lanal, abuf, phi, psi); invert(LPC10_ORDER, phi, psi, &s->rcbuf[2][0]); rcchk(LPC10_ORDER, &s->rcbuf[1][0], &s->rcbuf[2][0]); /* Set return parameters */ voice[0] = s->voibuf[1][0]; voice[1] = s->voibuf[1][1]; *rms = s->rmsbuf[0]; for (i = 0; i < LPC10_ORDER; i++) rc[i] = s->rcbuf[0][i]; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/t4_t6_decode_states.h0000664000175000017500000130261711422612262014706 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t4_t6_decode_states.h - state tables for T.4/T.6 FAX image decoding * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* Legitimate runs of zero bits which are the tail end of one code plus the start of the next code do not exceed 10 bits. */ /* Finite state machine state codes */ enum { S_Null = 0, S_Pass = 1, S_Horiz = 2, S_Vert = 3, S_Ext = 4, S_TermW = 5, S_TermB = 6, S_MakeUpW = 7, S_MakeUpB = 8, S_MakeUp = 9, S_EOL = 10 }; /*! T.4 finite state machine state table entry */ typedef struct { /*! State */ uint8_t state; /*! Width of code in bits */ uint8_t width; /*! Run length in bits */ int16_t param; } t4_table_entry_t; static const t4_table_entry_t t4_2d_table[128] = { {S_Null, 1, 0}, {S_Vert, 1, 0}, {S_Vert, 3, -1}, {S_Vert, 1, 0}, {S_Horiz, 3, 0}, {S_Vert, 1, 0}, {S_Vert, 3, 1}, {S_Vert, 1, 0}, {S_Pass, 4, 0}, {S_Vert, 1, 0}, {S_Vert, 3, -1}, {S_Vert, 1, 0}, {S_Horiz, 3, 0}, {S_Vert, 1, 0}, {S_Vert, 3, 1}, {S_Vert, 1, 0}, {S_Vert, 6, -2}, {S_Vert, 1, 0}, {S_Vert, 3, -1}, {S_Vert, 1, 0}, {S_Horiz, 3, 0}, {S_Vert, 1, 0}, {S_Vert, 3, 1}, {S_Vert, 1, 0}, {S_Pass, 4, 0}, {S_Vert, 1, 0}, {S_Vert, 3, -1}, {S_Vert, 1, 0}, {S_Horiz, 3, 0}, {S_Vert, 1, 0}, {S_Vert, 3, 1}, {S_Vert, 1, 0}, {S_Vert, 7, -3}, {S_Vert, 1, 0}, {S_Vert, 3, -1}, {S_Vert, 1, 0}, {S_Horiz, 3, 0}, {S_Vert, 1, 0}, {S_Vert, 3, 1}, {S_Vert, 1, 0}, {S_Pass, 4, 0}, {S_Vert, 1, 0}, {S_Vert, 3, -1}, {S_Vert, 1, 0}, {S_Horiz, 3, 0}, {S_Vert, 1, 0}, {S_Vert, 3, 1}, {S_Vert, 1, 0}, {S_Vert, 6, 2}, {S_Vert, 1, 0}, {S_Vert, 3, -1}, {S_Vert, 1, 0}, {S_Horiz, 3, 0}, {S_Vert, 1, 0}, {S_Vert, 3, 1}, {S_Vert, 1, 0}, {S_Pass, 4, 0}, {S_Vert, 1, 0}, {S_Vert, 3, -1}, {S_Vert, 1, 0}, {S_Horiz, 3, 0}, {S_Vert, 1, 0}, {S_Vert, 3, 1}, {S_Vert, 1, 0}, {S_Ext, 7, 0}, {S_Vert, 1, 0}, {S_Vert, 3, -1}, {S_Vert, 1, 0}, {S_Horiz, 3, 0}, {S_Vert, 1, 0}, {S_Vert, 3, 1}, {S_Vert, 1, 0}, {S_Pass, 4, 0}, {S_Vert, 1, 0}, {S_Vert, 3, -1}, {S_Vert, 1, 0}, {S_Horiz, 3, 0}, {S_Vert, 1, 0}, {S_Vert, 3, 1}, {S_Vert, 1, 0}, {S_Vert, 6, -2}, {S_Vert, 1, 0}, {S_Vert, 3, -1}, {S_Vert, 1, 0}, {S_Horiz, 3, 0}, {S_Vert, 1, 0}, {S_Vert, 3, 1}, {S_Vert, 1, 0}, {S_Pass, 4, 0}, {S_Vert, 1, 0}, {S_Vert, 3, -1}, {S_Vert, 1, 0}, {S_Horiz, 3, 0}, {S_Vert, 1, 0}, {S_Vert, 3, 1}, {S_Vert, 1, 0}, {S_Vert, 7, 3}, {S_Vert, 1, 0}, {S_Vert, 3, -1}, {S_Vert, 1, 0}, {S_Horiz, 3, 0}, {S_Vert, 1, 0}, {S_Vert, 3, 1}, {S_Vert, 1, 0}, {S_Pass, 4, 0}, {S_Vert, 1, 0}, {S_Vert, 3, -1}, {S_Vert, 1, 0}, {S_Horiz, 3, 0}, {S_Vert, 1, 0}, {S_Vert, 3, 1}, {S_Vert, 1, 0}, {S_Vert, 6, 2}, {S_Vert, 1, 0}, {S_Vert, 3, -1}, {S_Vert, 1, 0}, {S_Horiz, 3, 0}, {S_Vert, 1, 0}, {S_Vert, 3, 1}, {S_Vert, 1, 0}, {S_Pass, 4, 0}, {S_Vert, 1, 0}, {S_Vert, 3, -1}, {S_Vert, 1, 0}, {S_Horiz, 3, 0}, {S_Vert, 1, 0}, {S_Vert, 3, 1}, {S_Vert, 1, 0} }; static const t4_table_entry_t t4_1d_white_table[4096] = { {S_Null, 1, 0}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 39}, {S_TermW, 6, 16}, {S_MakeUpW, 8, 576}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 55}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 45}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 53}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 448}, {S_TermW, 4, 6}, {S_TermW, 8, 35}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 51}, {S_TermW, 6, 15}, {S_TermW, 8, 63}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1472}, {S_TermW, 4, 5}, {S_TermW, 8, 43}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1216}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 29}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 33}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 49}, {S_TermW, 6, 14}, {S_TermW, 8, 61}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 47}, {S_TermW, 4, 3}, {S_TermW, 8, 59}, {S_TermW, 4, 5}, {S_TermW, 8, 41}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 960}, {S_TermW, 4, 6}, {S_TermW, 8, 31}, {S_TermW, 5, 8}, {S_TermW, 8, 57}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 9, 704}, {S_TermW, 4, 6}, {S_TermW, 8, 37}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 320}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_MakeUp, 11, 1792}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 40}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 832}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 56}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 46}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 54}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 512}, {S_TermW, 4, 6}, {S_TermW, 8, 36}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 52}, {S_TermW, 6, 15}, {S_TermW, 8, 0}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1600}, {S_TermW, 4, 5}, {S_TermW, 8, 44}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1344}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 30}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 34}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 50}, {S_TermW, 6, 14}, {S_TermW, 8, 62}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 48}, {S_TermW, 4, 3}, {S_TermW, 8, 60}, {S_TermW, 4, 5}, {S_TermW, 8, 42}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1088}, {S_TermW, 4, 6}, {S_TermW, 8, 32}, {S_TermW, 5, 8}, {S_TermW, 8, 58}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 640}, {S_TermW, 4, 6}, {S_TermW, 8, 38}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 384}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_Null, 1, 0}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 39}, {S_TermW, 6, 16}, {S_MakeUpW, 8, 576}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 55}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 45}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 53}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 448}, {S_TermW, 4, 6}, {S_TermW, 8, 35}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 51}, {S_TermW, 6, 15}, {S_TermW, 8, 63}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1536}, {S_TermW, 4, 5}, {S_TermW, 8, 43}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1280}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 29}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 33}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 49}, {S_TermW, 6, 14}, {S_TermW, 8, 61}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 47}, {S_TermW, 4, 3}, {S_TermW, 8, 59}, {S_TermW, 4, 5}, {S_TermW, 8, 41}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1024}, {S_TermW, 4, 6}, {S_TermW, 8, 31}, {S_TermW, 5, 8}, {S_TermW, 8, 57}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 9, 768}, {S_TermW, 4, 6}, {S_TermW, 8, 37}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 320}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_MakeUp, 11, 1856}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 40}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 896}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 56}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 46}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 54}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 512}, {S_TermW, 4, 6}, {S_TermW, 8, 36}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 52}, {S_TermW, 6, 15}, {S_TermW, 8, 0}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1728}, {S_TermW, 4, 5}, {S_TermW, 8, 44}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1408}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 30}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 34}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 50}, {S_TermW, 6, 14}, {S_TermW, 8, 62}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 48}, {S_TermW, 4, 3}, {S_TermW, 8, 60}, {S_TermW, 4, 5}, {S_TermW, 8, 42}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1152}, {S_TermW, 4, 6}, {S_TermW, 8, 32}, {S_TermW, 5, 8}, {S_TermW, 8, 58}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 640}, {S_TermW, 4, 6}, {S_TermW, 8, 38}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 384}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_Null, 1, 0}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 39}, {S_TermW, 6, 16}, {S_MakeUpW, 8, 576}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 55}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 45}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 53}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 448}, {S_TermW, 4, 6}, {S_TermW, 8, 35}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 51}, {S_TermW, 6, 15}, {S_TermW, 8, 63}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1472}, {S_TermW, 4, 5}, {S_TermW, 8, 43}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1216}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 29}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 33}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 49}, {S_TermW, 6, 14}, {S_TermW, 8, 61}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 47}, {S_TermW, 4, 3}, {S_TermW, 8, 59}, {S_TermW, 4, 5}, {S_TermW, 8, 41}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 960}, {S_TermW, 4, 6}, {S_TermW, 8, 31}, {S_TermW, 5, 8}, {S_TermW, 8, 57}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 9, 704}, {S_TermW, 4, 6}, {S_TermW, 8, 37}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 320}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_MakeUp, 12, 2112}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 40}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 832}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 56}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 46}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 54}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 512}, {S_TermW, 4, 6}, {S_TermW, 8, 36}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 52}, {S_TermW, 6, 15}, {S_TermW, 8, 0}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1600}, {S_TermW, 4, 5}, {S_TermW, 8, 44}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1344}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 30}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 34}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 50}, {S_TermW, 6, 14}, {S_TermW, 8, 62}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 48}, {S_TermW, 4, 3}, {S_TermW, 8, 60}, {S_TermW, 4, 5}, {S_TermW, 8, 42}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1088}, {S_TermW, 4, 6}, {S_TermW, 8, 32}, {S_TermW, 5, 8}, {S_TermW, 8, 58}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 640}, {S_TermW, 4, 6}, {S_TermW, 8, 38}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 384}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_Null, 1, 0}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 39}, {S_TermW, 6, 16}, {S_MakeUpW, 8, 576}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 55}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 45}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 53}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 448}, {S_TermW, 4, 6}, {S_TermW, 8, 35}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 51}, {S_TermW, 6, 15}, {S_TermW, 8, 63}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1536}, {S_TermW, 4, 5}, {S_TermW, 8, 43}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1280}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 29}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 33}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 49}, {S_TermW, 6, 14}, {S_TermW, 8, 61}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 47}, {S_TermW, 4, 3}, {S_TermW, 8, 59}, {S_TermW, 4, 5}, {S_TermW, 8, 41}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1024}, {S_TermW, 4, 6}, {S_TermW, 8, 31}, {S_TermW, 5, 8}, {S_TermW, 8, 57}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 9, 768}, {S_TermW, 4, 6}, {S_TermW, 8, 37}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 320}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_MakeUp, 12, 2368}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 40}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 896}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 56}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 46}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 54}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 512}, {S_TermW, 4, 6}, {S_TermW, 8, 36}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 52}, {S_TermW, 6, 15}, {S_TermW, 8, 0}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1728}, {S_TermW, 4, 5}, {S_TermW, 8, 44}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1408}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 30}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 34}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 50}, {S_TermW, 6, 14}, {S_TermW, 8, 62}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 48}, {S_TermW, 4, 3}, {S_TermW, 8, 60}, {S_TermW, 4, 5}, {S_TermW, 8, 42}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1152}, {S_TermW, 4, 6}, {S_TermW, 8, 32}, {S_TermW, 5, 8}, {S_TermW, 8, 58}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 640}, {S_TermW, 4, 6}, {S_TermW, 8, 38}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 384}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_Null, 1, 0}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 39}, {S_TermW, 6, 16}, {S_MakeUpW, 8, 576}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 55}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 45}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 53}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 448}, {S_TermW, 4, 6}, {S_TermW, 8, 35}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 51}, {S_TermW, 6, 15}, {S_TermW, 8, 63}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1472}, {S_TermW, 4, 5}, {S_TermW, 8, 43}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1216}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 29}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 33}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 49}, {S_TermW, 6, 14}, {S_TermW, 8, 61}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 47}, {S_TermW, 4, 3}, {S_TermW, 8, 59}, {S_TermW, 4, 5}, {S_TermW, 8, 41}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 960}, {S_TermW, 4, 6}, {S_TermW, 8, 31}, {S_TermW, 5, 8}, {S_TermW, 8, 57}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 9, 704}, {S_TermW, 4, 6}, {S_TermW, 8, 37}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 320}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_MakeUp, 12, 1984}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 40}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 832}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 56}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 46}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 54}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 512}, {S_TermW, 4, 6}, {S_TermW, 8, 36}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 52}, {S_TermW, 6, 15}, {S_TermW, 8, 0}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1600}, {S_TermW, 4, 5}, {S_TermW, 8, 44}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1344}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 30}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 34}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 50}, {S_TermW, 6, 14}, {S_TermW, 8, 62}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 48}, {S_TermW, 4, 3}, {S_TermW, 8, 60}, {S_TermW, 4, 5}, {S_TermW, 8, 42}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1088}, {S_TermW, 4, 6}, {S_TermW, 8, 32}, {S_TermW, 5, 8}, {S_TermW, 8, 58}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 640}, {S_TermW, 4, 6}, {S_TermW, 8, 38}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 384}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_Null, 1, 0}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 39}, {S_TermW, 6, 16}, {S_MakeUpW, 8, 576}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 55}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 45}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 53}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 448}, {S_TermW, 4, 6}, {S_TermW, 8, 35}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 51}, {S_TermW, 6, 15}, {S_TermW, 8, 63}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1536}, {S_TermW, 4, 5}, {S_TermW, 8, 43}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1280}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 29}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 33}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 49}, {S_TermW, 6, 14}, {S_TermW, 8, 61}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 47}, {S_TermW, 4, 3}, {S_TermW, 8, 59}, {S_TermW, 4, 5}, {S_TermW, 8, 41}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1024}, {S_TermW, 4, 6}, {S_TermW, 8, 31}, {S_TermW, 5, 8}, {S_TermW, 8, 57}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 9, 768}, {S_TermW, 4, 6}, {S_TermW, 8, 37}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 320}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_MakeUp, 11, 1920}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 40}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 896}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 56}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 46}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 54}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 512}, {S_TermW, 4, 6}, {S_TermW, 8, 36}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 52}, {S_TermW, 6, 15}, {S_TermW, 8, 0}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1728}, {S_TermW, 4, 5}, {S_TermW, 8, 44}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1408}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 30}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 34}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 50}, {S_TermW, 6, 14}, {S_TermW, 8, 62}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 48}, {S_TermW, 4, 3}, {S_TermW, 8, 60}, {S_TermW, 4, 5}, {S_TermW, 8, 42}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1152}, {S_TermW, 4, 6}, {S_TermW, 8, 32}, {S_TermW, 5, 8}, {S_TermW, 8, 58}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 640}, {S_TermW, 4, 6}, {S_TermW, 8, 38}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 384}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_Null, 1, 0}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 39}, {S_TermW, 6, 16}, {S_MakeUpW, 8, 576}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 55}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 45}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 53}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 448}, {S_TermW, 4, 6}, {S_TermW, 8, 35}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 51}, {S_TermW, 6, 15}, {S_TermW, 8, 63}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1472}, {S_TermW, 4, 5}, {S_TermW, 8, 43}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1216}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 29}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 33}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 49}, {S_TermW, 6, 14}, {S_TermW, 8, 61}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 47}, {S_TermW, 4, 3}, {S_TermW, 8, 59}, {S_TermW, 4, 5}, {S_TermW, 8, 41}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 960}, {S_TermW, 4, 6}, {S_TermW, 8, 31}, {S_TermW, 5, 8}, {S_TermW, 8, 57}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 9, 704}, {S_TermW, 4, 6}, {S_TermW, 8, 37}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 320}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_MakeUp, 12, 2240}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 40}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 832}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 56}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 46}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 54}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 512}, {S_TermW, 4, 6}, {S_TermW, 8, 36}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 52}, {S_TermW, 6, 15}, {S_TermW, 8, 0}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1600}, {S_TermW, 4, 5}, {S_TermW, 8, 44}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1344}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 30}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 34}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 50}, {S_TermW, 6, 14}, {S_TermW, 8, 62}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 48}, {S_TermW, 4, 3}, {S_TermW, 8, 60}, {S_TermW, 4, 5}, {S_TermW, 8, 42}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1088}, {S_TermW, 4, 6}, {S_TermW, 8, 32}, {S_TermW, 5, 8}, {S_TermW, 8, 58}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 640}, {S_TermW, 4, 6}, {S_TermW, 8, 38}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 384}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_Null, 1, 0}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 39}, {S_TermW, 6, 16}, {S_MakeUpW, 8, 576}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 55}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 45}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 53}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 448}, {S_TermW, 4, 6}, {S_TermW, 8, 35}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 51}, {S_TermW, 6, 15}, {S_TermW, 8, 63}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1536}, {S_TermW, 4, 5}, {S_TermW, 8, 43}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1280}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 29}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 33}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 49}, {S_TermW, 6, 14}, {S_TermW, 8, 61}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 47}, {S_TermW, 4, 3}, {S_TermW, 8, 59}, {S_TermW, 4, 5}, {S_TermW, 8, 41}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1024}, {S_TermW, 4, 6}, {S_TermW, 8, 31}, {S_TermW, 5, 8}, {S_TermW, 8, 57}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 9, 768}, {S_TermW, 4, 6}, {S_TermW, 8, 37}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 320}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_MakeUp, 12, 2496}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 40}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 896}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 56}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 46}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 54}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 512}, {S_TermW, 4, 6}, {S_TermW, 8, 36}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 52}, {S_TermW, 6, 15}, {S_TermW, 8, 0}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1728}, {S_TermW, 4, 5}, {S_TermW, 8, 44}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1408}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 30}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 34}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 50}, {S_TermW, 6, 14}, {S_TermW, 8, 62}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 48}, {S_TermW, 4, 3}, {S_TermW, 8, 60}, {S_TermW, 4, 5}, {S_TermW, 8, 42}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1152}, {S_TermW, 4, 6}, {S_TermW, 8, 32}, {S_TermW, 5, 8}, {S_TermW, 8, 58}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 640}, {S_TermW, 4, 6}, {S_TermW, 8, 38}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 384}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_EOL, 12, 0}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 39}, {S_TermW, 6, 16}, {S_MakeUpW, 8, 576}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 55}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 45}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 53}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 448}, {S_TermW, 4, 6}, {S_TermW, 8, 35}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 51}, {S_TermW, 6, 15}, {S_TermW, 8, 63}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1472}, {S_TermW, 4, 5}, {S_TermW, 8, 43}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1216}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 29}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 33}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 49}, {S_TermW, 6, 14}, {S_TermW, 8, 61}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 47}, {S_TermW, 4, 3}, {S_TermW, 8, 59}, {S_TermW, 4, 5}, {S_TermW, 8, 41}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 960}, {S_TermW, 4, 6}, {S_TermW, 8, 31}, {S_TermW, 5, 8}, {S_TermW, 8, 57}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 9, 704}, {S_TermW, 4, 6}, {S_TermW, 8, 37}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 320}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_MakeUp, 11, 1792}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 40}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 832}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 56}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 46}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 54}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 512}, {S_TermW, 4, 6}, {S_TermW, 8, 36}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 52}, {S_TermW, 6, 15}, {S_TermW, 8, 0}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1600}, {S_TermW, 4, 5}, {S_TermW, 8, 44}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1344}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 30}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 34}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 50}, {S_TermW, 6, 14}, {S_TermW, 8, 62}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 48}, {S_TermW, 4, 3}, {S_TermW, 8, 60}, {S_TermW, 4, 5}, {S_TermW, 8, 42}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1088}, {S_TermW, 4, 6}, {S_TermW, 8, 32}, {S_TermW, 5, 8}, {S_TermW, 8, 58}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 640}, {S_TermW, 4, 6}, {S_TermW, 8, 38}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 384}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_Null, 1, 0}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 39}, {S_TermW, 6, 16}, {S_MakeUpW, 8, 576}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 55}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 45}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 53}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 448}, {S_TermW, 4, 6}, {S_TermW, 8, 35}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 51}, {S_TermW, 6, 15}, {S_TermW, 8, 63}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1536}, {S_TermW, 4, 5}, {S_TermW, 8, 43}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1280}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 29}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 33}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 49}, {S_TermW, 6, 14}, {S_TermW, 8, 61}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 47}, {S_TermW, 4, 3}, {S_TermW, 8, 59}, {S_TermW, 4, 5}, {S_TermW, 8, 41}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1024}, {S_TermW, 4, 6}, {S_TermW, 8, 31}, {S_TermW, 5, 8}, {S_TermW, 8, 57}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 9, 768}, {S_TermW, 4, 6}, {S_TermW, 8, 37}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 320}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_MakeUp, 11, 1856}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 40}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 896}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 56}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 46}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 54}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 512}, {S_TermW, 4, 6}, {S_TermW, 8, 36}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 52}, {S_TermW, 6, 15}, {S_TermW, 8, 0}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1728}, {S_TermW, 4, 5}, {S_TermW, 8, 44}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1408}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 30}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 34}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 50}, {S_TermW, 6, 14}, {S_TermW, 8, 62}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 48}, {S_TermW, 4, 3}, {S_TermW, 8, 60}, {S_TermW, 4, 5}, {S_TermW, 8, 42}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1152}, {S_TermW, 4, 6}, {S_TermW, 8, 32}, {S_TermW, 5, 8}, {S_TermW, 8, 58}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 640}, {S_TermW, 4, 6}, {S_TermW, 8, 38}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 384}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_Null, 1, 0}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 39}, {S_TermW, 6, 16}, {S_MakeUpW, 8, 576}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 55}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 45}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 53}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 448}, {S_TermW, 4, 6}, {S_TermW, 8, 35}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 51}, {S_TermW, 6, 15}, {S_TermW, 8, 63}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1472}, {S_TermW, 4, 5}, {S_TermW, 8, 43}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1216}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 29}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 33}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 49}, {S_TermW, 6, 14}, {S_TermW, 8, 61}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 47}, {S_TermW, 4, 3}, {S_TermW, 8, 59}, {S_TermW, 4, 5}, {S_TermW, 8, 41}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 960}, {S_TermW, 4, 6}, {S_TermW, 8, 31}, {S_TermW, 5, 8}, {S_TermW, 8, 57}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 9, 704}, {S_TermW, 4, 6}, {S_TermW, 8, 37}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 320}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_MakeUp, 12, 2176}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 40}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 832}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 56}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 46}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 54}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 512}, {S_TermW, 4, 6}, {S_TermW, 8, 36}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 52}, {S_TermW, 6, 15}, {S_TermW, 8, 0}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1600}, {S_TermW, 4, 5}, {S_TermW, 8, 44}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1344}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 30}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 34}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 50}, {S_TermW, 6, 14}, {S_TermW, 8, 62}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 48}, {S_TermW, 4, 3}, {S_TermW, 8, 60}, {S_TermW, 4, 5}, {S_TermW, 8, 42}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1088}, {S_TermW, 4, 6}, {S_TermW, 8, 32}, {S_TermW, 5, 8}, {S_TermW, 8, 58}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 640}, {S_TermW, 4, 6}, {S_TermW, 8, 38}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 384}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_Null, 1, 0}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 39}, {S_TermW, 6, 16}, {S_MakeUpW, 8, 576}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 55}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 45}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 53}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 448}, {S_TermW, 4, 6}, {S_TermW, 8, 35}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 51}, {S_TermW, 6, 15}, {S_TermW, 8, 63}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1536}, {S_TermW, 4, 5}, {S_TermW, 8, 43}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1280}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 29}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 33}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 49}, {S_TermW, 6, 14}, {S_TermW, 8, 61}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 47}, {S_TermW, 4, 3}, {S_TermW, 8, 59}, {S_TermW, 4, 5}, {S_TermW, 8, 41}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1024}, {S_TermW, 4, 6}, {S_TermW, 8, 31}, {S_TermW, 5, 8}, {S_TermW, 8, 57}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 9, 768}, {S_TermW, 4, 6}, {S_TermW, 8, 37}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 320}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_MakeUp, 12, 2432}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 40}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 896}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 56}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 46}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 54}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 512}, {S_TermW, 4, 6}, {S_TermW, 8, 36}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 52}, {S_TermW, 6, 15}, {S_TermW, 8, 0}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1728}, {S_TermW, 4, 5}, {S_TermW, 8, 44}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1408}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 30}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 34}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 50}, {S_TermW, 6, 14}, {S_TermW, 8, 62}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 48}, {S_TermW, 4, 3}, {S_TermW, 8, 60}, {S_TermW, 4, 5}, {S_TermW, 8, 42}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1152}, {S_TermW, 4, 6}, {S_TermW, 8, 32}, {S_TermW, 5, 8}, {S_TermW, 8, 58}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 640}, {S_TermW, 4, 6}, {S_TermW, 8, 38}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 384}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_Null, 1, 0}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 39}, {S_TermW, 6, 16}, {S_MakeUpW, 8, 576}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 55}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 45}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 53}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 448}, {S_TermW, 4, 6}, {S_TermW, 8, 35}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 51}, {S_TermW, 6, 15}, {S_TermW, 8, 63}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1472}, {S_TermW, 4, 5}, {S_TermW, 8, 43}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1216}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 29}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 33}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 49}, {S_TermW, 6, 14}, {S_TermW, 8, 61}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 47}, {S_TermW, 4, 3}, {S_TermW, 8, 59}, {S_TermW, 4, 5}, {S_TermW, 8, 41}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 960}, {S_TermW, 4, 6}, {S_TermW, 8, 31}, {S_TermW, 5, 8}, {S_TermW, 8, 57}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 9, 704}, {S_TermW, 4, 6}, {S_TermW, 8, 37}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 320}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_MakeUp, 12, 2048}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 40}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 832}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 56}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 46}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 54}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 512}, {S_TermW, 4, 6}, {S_TermW, 8, 36}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 52}, {S_TermW, 6, 15}, {S_TermW, 8, 0}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1600}, {S_TermW, 4, 5}, {S_TermW, 8, 44}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1344}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 30}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 34}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 50}, {S_TermW, 6, 14}, {S_TermW, 8, 62}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 48}, {S_TermW, 4, 3}, {S_TermW, 8, 60}, {S_TermW, 4, 5}, {S_TermW, 8, 42}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1088}, {S_TermW, 4, 6}, {S_TermW, 8, 32}, {S_TermW, 5, 8}, {S_TermW, 8, 58}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 640}, {S_TermW, 4, 6}, {S_TermW, 8, 38}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 384}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_Null, 1, 0}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 39}, {S_TermW, 6, 16}, {S_MakeUpW, 8, 576}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 55}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 45}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 53}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 448}, {S_TermW, 4, 6}, {S_TermW, 8, 35}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 51}, {S_TermW, 6, 15}, {S_TermW, 8, 63}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1536}, {S_TermW, 4, 5}, {S_TermW, 8, 43}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1280}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 29}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 33}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 49}, {S_TermW, 6, 14}, {S_TermW, 8, 61}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 47}, {S_TermW, 4, 3}, {S_TermW, 8, 59}, {S_TermW, 4, 5}, {S_TermW, 8, 41}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1024}, {S_TermW, 4, 6}, {S_TermW, 8, 31}, {S_TermW, 5, 8}, {S_TermW, 8, 57}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 9, 768}, {S_TermW, 4, 6}, {S_TermW, 8, 37}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 320}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_MakeUp, 11, 1920}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 40}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 896}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 56}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 46}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 54}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 512}, {S_TermW, 4, 6}, {S_TermW, 8, 36}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 52}, {S_TermW, 6, 15}, {S_TermW, 8, 0}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1728}, {S_TermW, 4, 5}, {S_TermW, 8, 44}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1408}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 30}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 34}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 50}, {S_TermW, 6, 14}, {S_TermW, 8, 62}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 48}, {S_TermW, 4, 3}, {S_TermW, 8, 60}, {S_TermW, 4, 5}, {S_TermW, 8, 42}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1152}, {S_TermW, 4, 6}, {S_TermW, 8, 32}, {S_TermW, 5, 8}, {S_TermW, 8, 58}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 640}, {S_TermW, 4, 6}, {S_TermW, 8, 38}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 384}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_Null, 1, 0}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 39}, {S_TermW, 6, 16}, {S_MakeUpW, 8, 576}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 55}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 45}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 53}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 448}, {S_TermW, 4, 6}, {S_TermW, 8, 35}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 51}, {S_TermW, 6, 15}, {S_TermW, 8, 63}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1472}, {S_TermW, 4, 5}, {S_TermW, 8, 43}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1216}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 29}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 33}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 49}, {S_TermW, 6, 14}, {S_TermW, 8, 61}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 47}, {S_TermW, 4, 3}, {S_TermW, 8, 59}, {S_TermW, 4, 5}, {S_TermW, 8, 41}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 960}, {S_TermW, 4, 6}, {S_TermW, 8, 31}, {S_TermW, 5, 8}, {S_TermW, 8, 57}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 9, 704}, {S_TermW, 4, 6}, {S_TermW, 8, 37}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 320}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_MakeUp, 12, 2304}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 40}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 832}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 56}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 46}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 54}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 512}, {S_TermW, 4, 6}, {S_TermW, 8, 36}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 52}, {S_TermW, 6, 15}, {S_TermW, 8, 0}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1600}, {S_TermW, 4, 5}, {S_TermW, 8, 44}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1344}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 30}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 34}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 50}, {S_TermW, 6, 14}, {S_TermW, 8, 62}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 48}, {S_TermW, 4, 3}, {S_TermW, 8, 60}, {S_TermW, 4, 5}, {S_TermW, 8, 42}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1088}, {S_TermW, 4, 6}, {S_TermW, 8, 32}, {S_TermW, 5, 8}, {S_TermW, 8, 58}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 640}, {S_TermW, 4, 6}, {S_TermW, 8, 38}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 384}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_Null, 1, 0}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 39}, {S_TermW, 6, 16}, {S_MakeUpW, 8, 576}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 55}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 45}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 53}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 448}, {S_TermW, 4, 6}, {S_TermW, 8, 35}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 51}, {S_TermW, 6, 15}, {S_TermW, 8, 63}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1536}, {S_TermW, 4, 5}, {S_TermW, 8, 43}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1280}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 29}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 33}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 49}, {S_TermW, 6, 14}, {S_TermW, 8, 61}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 47}, {S_TermW, 4, 3}, {S_TermW, 8, 59}, {S_TermW, 4, 5}, {S_TermW, 8, 41}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1024}, {S_TermW, 4, 6}, {S_TermW, 8, 31}, {S_TermW, 5, 8}, {S_TermW, 8, 57}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 9, 768}, {S_TermW, 4, 6}, {S_TermW, 8, 37}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 320}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_MakeUp, 12, 2560}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 7, 20}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 24}, {S_TermW, 6, 14}, {S_TermW, 7, 28}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 23}, {S_TermW, 4, 3}, {S_TermW, 7, 27}, {S_TermW, 4, 5}, {S_TermW, 8, 40}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 896}, {S_TermW, 4, 6}, {S_TermW, 7, 19}, {S_TermW, 5, 8}, {S_TermW, 8, 56}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 46}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 8, 54}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 512}, {S_TermW, 4, 6}, {S_TermW, 8, 36}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 52}, {S_TermW, 6, 15}, {S_TermW, 8, 0}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_MakeUpW, 9, 1728}, {S_TermW, 4, 5}, {S_TermW, 8, 44}, {S_TermW, 6, 17}, {S_MakeUpW, 9, 1408}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 30}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 6, 12}, {S_TermW, 5, 9}, {S_MakeUpW, 6, 1664}, {S_TermW, 4, 6}, {S_TermW, 8, 34}, {S_MakeUpW, 5, 128}, {S_TermW, 8, 50}, {S_TermW, 6, 14}, {S_TermW, 8, 62}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 8, 48}, {S_TermW, 4, 3}, {S_TermW, 8, 60}, {S_TermW, 4, 5}, {S_TermW, 8, 42}, {S_TermW, 6, 16}, {S_MakeUpW, 9, 1152}, {S_TermW, 4, 6}, {S_TermW, 8, 32}, {S_TermW, 5, 8}, {S_TermW, 8, 58}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 7, 22}, {S_TermW, 4, 3}, {S_TermW, 5, 11}, {S_TermW, 4, 5}, {S_TermW, 7, 26}, {S_TermW, 5, 9}, {S_MakeUpW, 8, 640}, {S_TermW, 4, 6}, {S_TermW, 8, 38}, {S_MakeUpW, 5, 128}, {S_TermW, 7, 25}, {S_TermW, 6, 15}, {S_MakeUpW, 8, 384}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7}, {S_TermW, 6, 13}, {S_TermW, 4, 3}, {S_TermW, 7, 18}, {S_TermW, 4, 5}, {S_TermW, 7, 21}, {S_TermW, 6, 17}, {S_MakeUpW, 7, 256}, {S_TermW, 4, 6}, {S_TermW, 6, 1}, {S_TermW, 5, 8}, {S_MakeUpW, 6, 192}, {S_MakeUpW, 5, 64}, {S_TermW, 5, 10}, {S_TermW, 4, 4}, {S_TermW, 4, 2}, {S_TermW, 4, 7} }; static const t4_table_entry_t t4_1d_black_table[8192] = { {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 9, 15}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 18}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 17}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 11, 1792}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 23}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 20}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 25}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 12, 128}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 56}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 30}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 11, 1856}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 57}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 21}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 54}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 9, 15}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 52}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 48}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 2112}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 44}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 36}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 12, 384}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 28}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 60}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 40}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 2368}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 16}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 10, 64}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 9, 15}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 18}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 17}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 1984}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 50}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 34}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 1664}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 26}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 1408}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 32}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 11, 1920}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 61}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 42}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 1024}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 9, 15}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 768}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 62}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 2240}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 46}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 38}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 512}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 19}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 24}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 22}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 2496}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 16}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 10, 64}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_EOL, 12, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 9, 15}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 18}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 17}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 11, 1792}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 23}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 20}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 25}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 12, 192}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 1280}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 31}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 11, 1856}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 58}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 21}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 896}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 9, 15}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 640}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 49}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 2176}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 45}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 37}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 12, 448}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 29}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 1536}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 41}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 2432}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 16}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 10, 64}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 9, 15}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 18}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 17}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 2048}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 51}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 35}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 12, 320}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 27}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 59}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 33}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 11, 1920}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 12, 256}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 43}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 1152}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 9, 15}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 55}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 63}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 2304}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 47}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 39}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 53}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 19}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 24}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 22}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 2560}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 16}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 10, 64}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 9, 15}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 18}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 17}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 11, 1792}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 23}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 20}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 25}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 12, 128}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 56}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 30}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 11, 1856}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 57}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 21}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 54}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 9, 15}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 52}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 48}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 2112}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 44}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 36}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 12, 384}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 28}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 60}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 40}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 2368}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 16}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 10, 64}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 9, 15}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 18}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 17}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 1984}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 50}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 34}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 1728}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 26}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 1472}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 32}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 11, 1920}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 61}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 42}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 1088}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 9, 15}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 832}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 62}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 2240}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 46}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 38}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 576}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 19}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 24}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 22}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 2496}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 16}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 10, 64}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_EOL, 12, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 9, 15}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 18}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 17}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 11, 1792}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 23}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 20}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 25}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 12, 192}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 1344}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 31}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 11, 1856}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 58}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 21}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 960}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 9, 15}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 704}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 49}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 2176}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 45}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 37}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 12, 448}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 29}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 1600}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 41}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 2432}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 16}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 10, 64}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 9, 15}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 18}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 17}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 2048}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 51}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 35}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 12, 320}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 27}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 59}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 33}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 11, 1920}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 12, 256}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 43}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 13, 1216}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 9, 15}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 55}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 63}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 2304}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 47}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 39}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 12, 53}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_Null, 1, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 13}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 19}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 24}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 11, 22}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUp, 12, 2560}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 10}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 16}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 10, 0}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_MakeUpB, 10, 64}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 9}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 11}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 8, 14}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 6, 8}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 7, 12}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 6}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2}, {S_TermB, 5, 7}, {S_TermB, 2, 3}, {S_TermB, 3, 1}, {S_TermB, 2, 2}, {S_TermB, 4, 5}, {S_TermB, 2, 3}, {S_TermB, 3, 4}, {S_TermB, 2, 2} }; /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/src/math_fixed.c0000644000175000017500000001436312101003017013141 00000000000000/* * SpanDSP - a series of DSP components for telephony * * math_fixed.c * * Written by Steve Underwood * * Copyright (C) 2010 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include "math_fixed_tables.h" #include "spandsp/telephony.h" #include "spandsp/bit_operations.h" #include "spandsp/math_fixed.h" #if defined(SPANDSP_USE_FIXED_POINT) SPAN_DECLARE(uint16_t) sqrtu32_u16(uint32_t x) { uint16_t zz; uint16_t z; uint16_t i; z = 0; for (i = 0x8000; i; i >>= 1) { zz = z | i; if (((int32_t) zz*zz) <= x) z = zz; } return z; } /*- End of function --------------------------------------------------------*/ #endif SPAN_DECLARE(uint16_t) fixed_reciprocal16(uint16_t x, int *shift) { if (x == 0) { *shift = 0; return 0xFFFF; } *shift = 15 - top_bit(x); x <<= *shift; return fixed_reciprocal_table[((x + 0x80) >> 8) - 128]; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(uint16_t) fixed_divide16(uint16_t y, uint16_t x) { int shift; uint32_t z; uint16_t recip; if (x == 0) return 0xFFFF; recip = fixed_reciprocal16(x, &shift); z = (((uint32_t) y*recip) >> 15) << shift; return z; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(uint16_t) fixed_divide32(uint32_t y, uint16_t x) { int shift; uint32_t z; uint16_t recip; if (x == 0) return 0xFFFF; recip = fixed_reciprocal16(x, &shift); z = (((uint32_t) y*recip) >> 15) << shift; return z; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int16_t) fixed_log10_16(uint16_t x) { int shift; if (x == 0) return 0; shift = 14 - top_bit(x); x <<= shift; return (fixed_log10_table[((x + 0x40) >> 7) - 128] >> 3) - shift*1233; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int32_t) fixed_log10_32(uint32_t x) { int shift; if (x == 0) return 0; shift = 30 - top_bit(x); x <<= shift; return (fixed_log10_table[((x + 0x400000) >> 23) - 128] >> 3) - shift*1233; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(uint16_t) fixed_sqrt16(uint16_t x) { int shift; if (x == 0) return 0; shift = 14 - (top_bit(x) & ~1); x <<= shift; //return fixed_sqrt_table[(((x + 0x80) >> 8) & 0xFF) - 64] >> (shift >> 1); return fixed_sqrt_table[((x >> 8) & 0xFF) - 64] >> (shift >> 1); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(uint16_t) fixed_sqrt32(uint32_t x) { int shift; if (x == 0) return 0; shift = 30 - (top_bit(x) & ~1); x <<= shift; //return fixed_sqrt_table[(((x + 0x800000) >> 24) & 0xFF) - 64] >> (shift >> 1); return fixed_sqrt_table[((x >> 24) & 0xFF) - 64] >> (shift >> 1); } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int16_t) fixed_sin(uint16_t x) { int step; int step_after; int16_t frac; int16_t z; step = (x & 0x3FFF) >> 6; frac = x & 0x3F; if ((x & 0x4000)) { step = 256 - step; step_after = step - 1; } else { step_after = step + 1; } z = fixed_sine_table[step] + ((frac*(fixed_sine_table[step_after] - fixed_sine_table[step])) >> 6); if ((x & 0x8000)) z = -z; return z; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(int16_t) fixed_cos(uint16_t x) { int step; int step_after; int16_t frac; int16_t z; x += 0x4000; step = (x & 0x3FFF) >> 6; frac = x & 0x3F; if ((x & 0x4000)) { step = 256 - step; step_after = step - 1; } else { step_after = step + 1; } z = fixed_sine_table[step] + ((frac*(fixed_sine_table[step_after] - fixed_sine_table[step])) >> 6); if ((x & 0x8000)) z = -z; return z; } /*- End of function --------------------------------------------------------*/ SPAN_DECLARE(uint16_t) fixed_atan2(int16_t y, int16_t x) { int16_t abs_x; int16_t abs_y; uint16_t angle; uint16_t recip; uint32_t z; int step; int shift; if (y == 0) return (x & 0x8000); if (x == 0) return ((y & 0x8000) | 0x4000); abs_x = abs(x); abs_y = abs(y); if (abs_y < abs_x) { recip = fixed_reciprocal16(abs_x, &shift); z = (((uint32_t) recip*abs_y) >> 15) << shift; step = z >> 7; angle = fixed_arctan_table[step]; } else { recip = fixed_reciprocal16(abs_y, &shift); z = (((uint32_t) recip*abs_x) >> 15) << shift; step = z >> 7; angle = 0x4000 - fixed_arctan_table[step]; } /* If we are in quadrant II or III, flip things around */ if (x < 0) angle = 0x8000 - angle; /* If we are in quadrant III or IV, negate to return an answer in the full circle range. */ if (y < 0) angle = -angle; return (uint16_t) angle; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/DueDiligence0000664000175000017500000000561010511204350012345 00000000000000Intellectual Property Due Diligence ----------------------------------- Modems and voice coding are heavily patented areas. Implementing these without serious consideration of IP issues would be foolish. This document describes the basis on which the software has been implemented. A check of the intellectual property information at the ITU web site shows a number of patent claims against the current standards implemented by spandsp. It is important to realise, however, that some of these patents have long since expired (group III fax dates back to the 1970s). Also, many are related to recent additions to the FAX standard, such as colour FAX handling, which few people ever use. The V.14 rate adaption standard seems free of patent encumberance. One patent is listed as relevant to the V.17 standard. It is a patent from IBM, but the ITU database does not specify its nature. I believe it is related to the trellis coding used, and I think it has expired. I do not know for sure. The techniques used in the implementation should be free of patent encumberance. Most of the implementation is similar to the V.29 modem. The key addition the trellis code processing. The trellis encoding is trivial. The decoding uses Viterbi techniques, which are quite old. The V.21 standard dates from the 1950s. The V.23 standard is also very old. There is no possibility that any patents related to it are still in force. However, the implementation also needs to be free of patented techniques. The implementation only uses very mature numerical oscillator and quadrature correlation techniques, so there should be no patent issues. Only one patent is listed as relevant to the V.29 standard. This dates from the 1970s, and must have expired. The modem has been implemented using only very mature techniques, none of which can be less than 20 years old. There seem no possibility, therefore, that any patents are still in force related to the techniques used. Some aspect of the V.8 standard seems to have patents associated with it, according to the ITU patent database. I am unclear what these are. V.8 is a very simple standard. There seems to be nothing innovative about it. Many patents are listed as relevant to the T.30 standard. However, they all appear to relate to newer features, such as colour FAX, added in recent years. The current implementation only covers the original features from the late 1970s, where there appear to be patent issues. The T.4 standard defines the image compression and decompression techniques used for group 3 FAXes. The spandsp implementation is based on code derived from freely available implementations of T.4. These have existed for a number of years without IP issues. The standard is old enough for any patents to have expired, anyway. V.42bis compression uses the LZW algorithm. This is the same algorithm used in GIF files. Unisys patented this algorithm. However, the Unisys patent has now expired. spandsp-0.0.6/COPYING0000664000175000017500000012706311004627052011151 00000000000000The spandsp library is licenced under LGPL 2.1. The test suite, and some of the supporting code, are licenced under GPL 2. The full text of both licences may be found below. GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. spandsp-0.0.6/test-data/0000775000175000017500000000000012357123347012065 500000000000000spandsp-0.0.6/test-data/Makefile.in0000664000175000017500000004542012343626375014063 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = test-data DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_check_real_file.m4 \ $(top_srcdir)/m4/ax_fixed_point_machine.m4 \ $(top_srcdir)/m4/ax_misaligned_access_fails.m4 \ $(top_srcdir)/m4/ax_c99_features.m4 \ $(top_srcdir)/m4/ax_check_export_capability.m4 \ $(top_srcdir)/m4/ax_check_arm_neon.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ COMP_VENDOR_CFLAGS = @COMP_VENDOR_CFLAGS@ COMP_VENDOR_LDFLAGS = @COMP_VENDOR_LDFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_FAX2TIFF = @HAVE_FAX2TIFF@ HAVE_PBMTOG3 = @HAVE_PBMTOG3@ HAVE_SOX = @HAVE_SOX@ INSERT_INTTYPES_HEADER = @INSERT_INTTYPES_HEADER@ INSERT_MATH_HEADER = @INSERT_MATH_HEADER@ INSERT_STDBOOL_HEADER = @INSERT_STDBOOL_HEADER@ INSERT_STDINT_HEADER = @INSERT_STDINT_HEADER@ INSERT_TGMATH_HEADER = @INSERT_TGMATH_HEADER@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIMLIBS = @SIMLIBS@ SPANDSP_LT_AGE = @SPANDSP_LT_AGE@ SPANDSP_LT_CURRENT = @SPANDSP_LT_CURRENT@ SPANDSP_LT_REVISION = @SPANDSP_LT_REVISION@ SPANDSP_MISALIGNED_ACCESS_FAILS = @SPANDSP_MISALIGNED_ACCESS_FAILS@ SPANDSP_SUPPORT_T85 = @SPANDSP_SUPPORT_T85@ SPANDSP_SUPPORT_V34 = @SPANDSP_SUPPORT_V34@ SPANDSP_USE_EXPORT_CAPABILITY = @SPANDSP_USE_EXPORT_CAPABILITY@ SPANDSP_USE_FIXED_POINT = @SPANDSP_USE_FIXED_POINT@ STRIP = @STRIP@ TESTLIBS = @TESTLIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = itu etsi DIST_SUBDIRS = itu etsi local all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test-data/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test-data/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am all: clean: # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: spandsp-0.0.6/test-data/local/0000775000175000017500000000000012357123347013157 500000000000000spandsp-0.0.6/test-data/local/Makefile.in0000664000175000017500000004564512343626375015166 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = test-data/local DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_check_real_file.m4 \ $(top_srcdir)/m4/ax_fixed_point_machine.m4 \ $(top_srcdir)/m4/ax_misaligned_access_fails.m4 \ $(top_srcdir)/m4/ax_c99_features.m4 \ $(top_srcdir)/m4/ax_check_export_capability.m4 \ $(top_srcdir)/m4/ax_check_arm_neon.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ COMP_VENDOR_CFLAGS = @COMP_VENDOR_CFLAGS@ COMP_VENDOR_LDFLAGS = @COMP_VENDOR_LDFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_FAX2TIFF = @HAVE_FAX2TIFF@ HAVE_PBMTOG3 = @HAVE_PBMTOG3@ HAVE_SOX = @HAVE_SOX@ INSERT_INTTYPES_HEADER = @INSERT_INTTYPES_HEADER@ INSERT_MATH_HEADER = @INSERT_MATH_HEADER@ INSERT_STDBOOL_HEADER = @INSERT_STDBOOL_HEADER@ INSERT_STDINT_HEADER = @INSERT_STDINT_HEADER@ INSERT_TGMATH_HEADER = @INSERT_TGMATH_HEADER@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIMLIBS = @SIMLIBS@ SPANDSP_LT_AGE = @SPANDSP_LT_AGE@ SPANDSP_LT_CURRENT = @SPANDSP_LT_CURRENT@ SPANDSP_LT_REVISION = @SPANDSP_LT_REVISION@ SPANDSP_MISALIGNED_ACCESS_FAILS = @SPANDSP_MISALIGNED_ACCESS_FAILS@ SPANDSP_SUPPORT_T85 = @SPANDSP_SUPPORT_T85@ SPANDSP_SUPPORT_V34 = @SPANDSP_SUPPORT_V34@ SPANDSP_USE_EXPORT_CAPABILITY = @SPANDSP_USE_EXPORT_CAPABILITY@ SPANDSP_USE_FIXED_POINT = @SPANDSP_USE_FIXED_POINT@ STRIP = @STRIP@ TESTLIBS = @TESTLIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = DIST_SUBDIRS = EXTRA_DIST = dam9_lpc55.wav \ dam9.wav \ lenna-colour.tif \ short_nb_voice.wav \ short_wb_voice.wav all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test-data/local/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test-data/local/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am all: clean: # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: spandsp-0.0.6/test-data/local/lenna-colour.tif0000664000175000017500000301573411422613736016214 00000000000000II* oJtOqLoKtPsPqNtQpKqLoJjGjGkHhGdCe@c>`=_=[3r4)r6,s7-u9/z>4x<2r6,r6,r6,vB4v:/A8A6v@4vE7v=2y90{G<{C6|A1@.?+@,G5O?;1>/A1E0G2I9M>OEJ>SDN@O@N=L9Q>P:P:RN7Q:P7P8SU>W@ST>U?R=M8S=S=RU?WASU>U?U?S=PT?S>K4SP9S=U@P;R=U@O;R8VU>V?RUX@V?V?XAW@U?WAV=U=P8Q7[AZ@S7Q6V>\DQ9O7TVP:P:L:LfBfGcEeBiDmFЁVߑaemlvx~{rlޖdІWyL`9P2s@+g9)g9*f5&n9)l=+m<+p=,}E6|C2{@0J8I7C;H=D4~D0K5C.z=*E3I7F4H4K7L6O9N8J4NK7H4N:J7P=Oc>`=`>\=X:Q5L2G2J7>.z;,p6+g2*e4/[+'^.*g82h93f71e4-^-&_.'l<2u:4u:2s80r7/q7,q7,p6+q7+z?7o4,w;1s5*x8,{9+@0A1x<2p4*{?5z>4{?5~B8o3)t8.q<,t6)>5~@5u?3tD6r<2u6/i7,q<.~C3G2B,~@+D2MKO9M8S>PS?S?SAO8SV?T=R;R;N3X=X=T9U:T9T9[@R9T;T;R:V>ZBX@S;I4P;VAVAR=O:R=U@M7XBWAL6P:WAS=T>Q7U>W@T=T>V@T>O;M8QP9XAP7T;U2y>0|A1~A/G4M8SW>]DfMjOhKdGlJlKnMpLnKnIoJpKoGuMoHrKvOqKrMqLqLqLoJmHoJqLpKkFwPnGmFiBqJlEoHnGi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0,T1-W2,Y4.Y0,R+$Z3,X2)X0&\0'Y'a,$K9`GjMzWԍc۔foqmjՉW΀OrDhAU8C+i4&_-"S'K$F$"C$"C$"D%#=!?#< @" A#!@ ~!B"#? C$"D%#E&$F'%F'%E&$D%#B#!>"?# C%#H)'O,*V0/Z22]53e<:c:8\42\63\63P-)T3.Q0+F'%B#!B$"C'$>$#=#"=%#=%%?%&;!"<"#C'&E)(C'$G)'L.,  g g@ D<Zx4p$`.LjP@ |>\z0l \0NlL<"x@^|-iY2Pn I:$uB`~)cT4Rp E7&sDb&b S6 T r  D 5( qF d ) e  U8 V t F <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<=<<<<<<<<<<<=<<;<<<:<<=<<<=<<=<=<;<<<<<<==<<<<<=<<>><<=<<;;<==<>< spandsp-0.0.6/test-data/local/dam9_lpc55.wav0000664000175000017500000123744411007012213015453 00000000000000RIFF?WAVEfmt @>data>                                                                              "                       "                                                       $         >  ) 8##=    8 3    ( ,,   )"  ' #5\MTgg @9      )Lx?a$s96)W%,[GB3-,.9-?1 '/  7*8:Ph=/tPB~ 2}ovvya#5B-  H?Pii f}.*NJ-]*-}"4MLd^DA/  t N m_c!. 6 n  *ZFnD8U[$ K8rIA"  3|}_(+  G ,M9+g XDk{!fj  6O \-LOr3*Av |&# % 19Do}WHtj`W$M Tst`uyyC!/ &0|o G U~'8i(J+$TaA`oˀʇO 0 RnmB|!3b,,AoAWd QtP8!%46$M PNbݱJ׉q 2%+" b} a t"mk*@ = o1 Q ! Sr 2=_8gB fɮƏ8'B)X/ *~n  *@|l 4U\ $@5>6p`A5O=sBN,# )0!o uRrD  :|P E g33JM iF^ oD ۪Dy;4:R,8$ĨE'X!B A7A&'A&O@ؖ ;S!C Y >*~d'JN `*}"3< =#n5D%&@ ;5++䧟̯G#?>5:k3Pޣ!A_T"Hk B  & I6ASO _N PQOC*,C722*/Rݟt93d :h80B>`n ?Ocq 8 c-}#~ A#[9TJ &Ts  '6,l;5. $,%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"iBKT6?Z3y>$Tn\UF>n d,nhv&(e؀ۀ 3y W o !y5qjosSdw,)NpHJvn~5`7q3 W[*UQ  yFuWQ?X{9| ChaX5e&2d`{+FzI ; J[gN5rvO;V9P5W xO;c0\2;9|fJ y*<(uWt$irH $,Oj6+) GfXreArbUAtv#pTqiXq+ymHZ&{EGfQ7$qRS+Y.\ 7cas;vD}id.,-n5{.4AV=P|sWQJY'R37\  XwN8| gRH>gMJ6  *Z\Hx/ ]yo cY7 Yz."~{fUNft(V(nbJ|nbB(e:R]"*d=gnt0&?( 04#mSO9@tzy1(3z5}e 7'dWgWn8<z<kc~WvcM d\]c~uazn!]( 4s,p5vVM$e5 TN|" 4;,V,V?#5<zWt.^Fr .A:Gty02236@N~'QmB"C^6.) $; 7/&9M ;=DF:#2,$;7 ;5+  .!)#5) 5,  .% $ !.7$   4  ++  = %+4<AUA%( O"e\M @& L*)# 5'7/+ ",    "               ( " &    '                                                    $$   '$      !! #%#  $%                                                                                                                                                 "                                                                            !         .+/ &$#%$3   ( &  )   $    %  !# #%  !!+%-! $#  %% ' # -+ %), * !-     )& ! ' $  & '  *, % ( (   .  #&                                                 " , #) ? 1 #0'' =Y9131 C 'O6a$A9] 3 SOvN/9 y",Im rjOrh9y|E%xit1;[3 Q"6m4lE? #IV{B?n _ 2$;L2s L\-;$# M Ffg8yj X O~Xn " q]\&t  %*1Z KLsFZ3- q m ' nqf}! 6:~eNjFR[\Zxv  )"i"J ?0OwV:  Bo kkD <  )wnR wi] ~0 m 6o\ J $H >_ /$C%ueR DTZOAD ~& mxT[Qr ~}wI%8 h% 5uE.Wd D*V  HBs D 3 |  \ac 8&>W"51S.?t="xA4  GZ3s '@ = Zm'@  _R:/2@E ~ 0Em[:Q ( n 5~%^ [K; V _ 3TT|  :{ ilQ-![Eq-34$R#WDyc 8`&hT~4pbo^k{."yV51AI2ow+K ?GC;y- 'FVN*;) tEiS~ I;G}&v{E[&K<)YWYNT7U*/C7@Q21M LDf2jP+_^H}Jv^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5* >ʹ &[N^9ax\f$d/68h9Ӂe"k p oYxZ'F!UN19R џhߧ#WY_9e% ԣ{")#,%ʅb j*^]Pf)W'cva]KM7*"leg٬Q]]D' ! \Ҋv4:/f27!?ڛ{@X7 Uܙ]RMPxp1D^K- Q>Gw@&_P#+EԞHz h+)xLիM UY7u Iz:$4S|+*]1&[W>%T!iO*^DA̴@ &')%)׍ҠIIj`4 :IyI|5(%ODMo:'+@BE K?N=k%ޯ`a', { L@t<~ =c`%%KG3) @мˌ::B?3.TvZY$ ovJ  k%NS[@'89//;+hT̰`]5z<' uKm 5gP W  aW sDI  w Pa4-}mJ|Q [T hxD": OIKc^]Tu2/Ganp@4EP3|=5V1H5oB\}C4&35LTE'At[I?uY^o s%c9mf+e)"_ai mC:G=%-6F"JNM^FU|kzT*$=_<i4s@ F1LD]:4  "  1                                   , %)*,5 5 /b)_+E"(2O*C,4K%  ]Dc>A1t$(VC8B#{l\p ] ZkBgMgYP/fu/ D@fvnI (R:@_>yE(F{A[ @^A)#,8%2 !                =F&zo@Xh^Hi1= */]y~ $>KNcW+g68N1M4 a{=@cd wh/;L:>vqfHw)L8Ye2qR/Q]s>: Q?1Y 2C?mIeh{f!Tvd-']WKK3z- JO!d,Ur y{%H 3- KcpKH tu #=h[+5 & ~ v/x)PM9v 1 /0< h ^Rx$ 3#\ k_2'&0  =8p ] ZC FBHs@@"k(~  9dY32 t#4ktU Q ./qNG Q8caӥ! <m2 0 < { F*{;*% rs @kfLPӝmVHT !Y_f*B ( 6 l nECR-) 8O  5Y^" $kH -v=_ v l3`%J9)qsB f# S3=X goRooU~hrz`R m',qD A 3Z4 [  ( v/ X X # x=S. v115JX|]D"W b yPo. oe^ 9 {s2Cz`uHT{PQ`]&0v|`? *(fHn Z.BZ-'=Z51U)!;Wg}F5pmW[Xk 426@5C58*6(                   #   A $'/ &: +$!-. :#y! >WP =2)3-2Zo$,h 7. H 7 Pb/A-`FQMrY# +H'L7I _ E_U?6_ !q)D,\d?4aZys%I+B6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W;$*"QT%GLq[ #g&B'D2XYXVƐ0=j $H4fAV4 5ԕB1'8'' P$U:8; Z|>f8J--F܍Fw30q֋&ds 8SW4%) m,K0]ㆺ+΁ 9?A,hK~)hk*:)>E2%|pjm  ) .R^V!ʎrQ y'4!mJӣ'- 9 ט+GPlm[  GL  ks J *KK}Kխ_N%-5 Uѡل^MI}֊  "ut"& ݦLF  t$P0wXz 9YhaoZC#D1_ I4tZR Zp` "kIRFPK KC~*  s4.YhwHqLAN{9Y_ Jj!zQyw* %R j.>^hE01j1$*!Pzs% (8kYm7eM`I&N 02%HX fW2C9J9+5!@%,!O-HLf poWg s7]j|zD'25H!  ' %2 <F}S5t)Bq?*#2(2M;8k:Gap/8-K 3 (  TSsiN 6IKqO/ 4.+UR}9$T.C1>h~sB<<+7n.,+ 9kNly +H n!y|i3c X \2-oe@RZ/?.#GDUWI+1fo-qbehNcO jD0|3|0F U|7t95%} oidEfu=\%Asi'@1I,>Sm!{>7+T_7b[A) psB[%qF u)N?iw= e ul^p6W}Gb|21(/uGswe|$Hcmvtoe]}I-uOc')L b1wf1@g4QK#W@ 89X\jAQv?=BPmBb:Bm6tTb-g'kQy&wt W:yg[9'QOY\,c<0_%\~56Re*s+zd9Q)X)OoPYT}Qd67 / &r)Apb[\ZmD?*$runFU|$@+CcABY@t k<a(ST33-h!9oz~UB IDD<xiL;N0mT*yz}zP!kVj Rr.`sChp/2Ywq"9va ;=Cl?CMeVu6MNWCQFq_7;tdpySsCF!Z2_-Gd8 ?Hk=oi!g80f0#?"f1c~1~j#V*G"G!  ^@ 5C G$,54BDm , 7gK(1'G> 6>+  + 3  /2    $(                                                        #('"   "#     "                                                                                                                                                                                                                                                                                                                                  $ ," 81 (G (5!$ K)5*4<M/O2]h9*5<SS X>$k@Gb@F T(J4vYyTQeK/-ncZB^H-O,tb4rc-YVx=NprQFK/CN(Rz'xJ"rI#7*ng+i#kahc>6!$AdFZKC'F9:ILE!( L].BNV| = V 71~'R~ln   i)>Fghhk <(O1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ٕ̉&#m clndX\!@}vǶ|;U\eJh+W)a0J7$(zޥ T%;\0tؿ7 ro-y%=FI4\cME1\_(52 Sߖ(r%Y  ]}e^ E`4g-hG/\ݒꀙ@m)<;[.]o,0# = ߶n> jv5lB|& cئ'Za.UGǢ+4<4'j^Χ =#,l'.}cTuG++:+ 6 $ "-(0# '%  %%   # &! ( "  * %  )!  $                                           &0+     Dq )i_HOty!eTl$FHb4-_R]8Zl>wB%YHd0}`"WEKUS<"=f,jOX mnpcZ]k}~i;cde+RQ&!&/ TN ~5L< .Aq}qz|4 nVYhsj5^1m=Q5(7 hTao`e MS~A$dn[%:fNi.i P u k:LvI8{<  Xu-<  I{P) W1 m{)T3${zDʸǺ-!?-F?~@>. lf +e1/-!;uM%+#NKڽ>RR.,:>#k +עŬ߉uH7U3;2,_}$ZܛY .[9)8!G eeiˁы3 M'b-  "}+I h"#n=(z8شA0A" aH*G1 ELP' =:Ğ,m f$r/=31$xBk@ "mIM%]IK6ve ![T WsϾv6s8] 1ڭLTB!/I\To.` «ߞ}^22L>}{ۨczUN/2d!$P +%݇0x> )J"w0qB@e%xfxxx#7wPF,d.ϓ8'i!'l$04 M'q#WUDގz n: =uS  $|%BG5^ɼ#Z)&D1+];8 $$#w5 }3ߋ21CP8(5+30 h zg\id q M+8*.: b52 KͦV;k1P$`?/frY`+# 5G['$v  WUkOE M MS%\+V eGBE] Vp Zh46-_*&n$a#B>F'( Z)Hl/tIٛfl )+ <- @[LfJo~ I S%O?B   TnڷC 7A{ɴƮ'Z@&Q5&!bڳTYN*WC4\ % "g(|^  CK:1 al  ߝIH"P މW-# !.^#ܫP1/( .e6NdV' pZi  TM[ULP 4M7MLbT$al5F\3&''+$NGޭd$j"9h't o PIZ7ep31ݒ!LUD)O9804 ; [ Av  \9q  +fT+B qE>8]p\ <<[op|  ߗ#?pT4LԿ֡@5W&27&lgY Ѥ  #6[=4q M h g n }$&4@7 1< W:?a ̷ƕh@<%7:Y1 RKL839 s9A  m ! cl$Cbi@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NrRq=/#gT9"k*8oh  XIJR)LeN>\eO-C%P,E5Z(r!IPwng^ P1 Dp =zn-|)xgO{<vR i,.e uoxX L8DiT!tuWp)XiiF+xi& >Gt;O$c\^^}|e`8B'!1M3)FQC=?):qN<Ug~P#Ce BFdH}rm!Bfx4Mmc.%07NZkfyMyp]4jimk"*E [Vjl6NpE 0tWFS*xauwWOy$$o/Zl%dEWPDVKt{cBI;JR/w1 Y*Y{FzGZXXe5rjZPYV 7ZN9zlQ+Z4hZ }x n ?s{ sXW< dE\6d   f D"">N  k){A/;~^i%(;1lzl ]w #  C8S$?e jA>Dzkb 2 ceM y $8Qp3 ]b0Kt< -] H?STppLF<GW 3\ oO AY;Ym %@C';J W, L93Z|  <c S y9 E2  KW GFnhEe-vic 1 d .pA<? w/jTS- E/L{ hu2)ua &# %T n0*s1 !< f jL T|7WAxB F [ "1 E IK C 9EYF  w F9 %I@ :f P})  |r5M0=D^I2k5R d| k 9RX4 A gVZv jI/o{L$S)_K&I Q @i,  fA%h ! LH n 4 9apA,? Yi m = MRx {'bT U { U@~ . :CL`Yb_EYOc|5 95F=A b|  wa<=0Nq2NPIYLtqbyn ,N<R_4SnIXO"'By\EJb^+p1(1hsA3zn __$sJgA0",rmBRP:*!cfM@e\f(A&\o"_?Ebc{)i CtAJ0>> $\BxN#  i4vza 3<Gxz` l@wBEYS}RY~nQoI y\9>fI <OPU=r4dom5c qWTlYwu# T0Ws@v05Cs^H"B%quB}nx%&!.e.70"',]rX?6M,YH$8 0<5 !!  &     #'                                                                                                           "  "                                                                                                                                                                                                                                                                                        %   )      -  !                                                          !                                                           %"- 6 + BC O/' ]F)M90T0je42+}hW`M7te*OI!*u6ev~t\YlYWZt%8=mkc<ui} GNu#6iWwo`#O{H7cDDo.628I?;yOy%gK -"2GF-0i~wDc"o9^8r4#E~%i[P(B {h,. Nfjr.$ ?WVyI99OId1R>Y~VQ_+Nq-jUQ+D*lq-cxGH`xb!9E{>xTCV I  Eb8A\h}VIB{8Ktwa7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.f  +AVj=# (  ^ta$t~ ;Xb`:]o2bJ~$>|8~LICRBQtKJ>y/MO+TD C% mj|zzE/OS=XIZ:QY*,CiUC7>U,^,uuOizaX$ 2-yQ%LwNUfi7&qvIxZ")DDI\VkQ'H;9UbPcZS?y 'PGL? ,>7'9C%02 %6 $ #2 %%2% 0  +  &"$/ !6 )!  " " - ,  ( '   '"  , %        !$ )3  !)  *  &-  !, ((B>,0 3*!!'(Ou$K'?O:XA@g 3N u_YC5W8}8C#rBrX1`B5|?37H)U6ZdGaT/iu dIp)kHa<L3La!FU6mGQ8>OR>3{Y*wt"8$aE2Vs3 l^c67(!I c_(D ulv4,#9Rj`%)1mhI${}&d]3/_Rj'amBTep` M]=-2N6fHdOVYL2$' 6MD # /* I!& <'#"(<;" PXU;:\*!" 2%'M(?p+HQ0/61d>    ( '/   !                                                                                                                      "     "   &       $                                                                                                                                                                                                                                                                                           #  '     ("  +    % "    !+4 )!)  .   2  / $* !        !      '  $ "            KGcqm\1Iut~r8oT/bWFi|;MO Yny.2cJ SCcL#j.LTsa$^j&V IU k!toM\J7V12YVV!-r(u ptr U`"Amvg wTvhY1 2O bb;oy$ IgTLZ!#& n-2,;z z; 3Y-ݒo@V> 'uSy?   %g9* 1;{d `a wG^ 4c z~)7(F #c>sfv.XG ^l?-H { R c 9 vg 2 j t|hvr](G 8 G  p0kTJj @ D9[FCC\K6 j ! %(9 r "LWB&YR2:x9S7~Su  i  KzF1 VC%  > E <Ko:#C}qv!j7%Y 1  e u`y\LJs9 2  G iy!N$l,*H*= pvrK p !gMXsL ~K,,y  - x|B3Y9S:w:9Qy5 ,)MA++k8  T )[8$ !eQJCF}Y7;&W V=9! _yOZYiC;@'By:~m(O|WkugiB?!O$er{F~?4' 6q|3VP.</OKpd0|'*-$ 4=ͬ)շXSe # 8$$N^u$C*g_Z<)b2/7&(.d9M Lp6 7 U$tP _p:,oB{iU2&%nP;=蟳H\!/l63wG+#?#ZTk*L l9 1mO|,M 5q.dFX<*Jǿܚ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)Dg #h` ) 6$ ]H_[Զu!!w @@Y<\xh  TjK*i(^ Mrgٽ֓ټ=RjF`~. ;wf,j @ 3 4vI>+{.l ySޭަ: .~l MLaF zK91H1WvL\[  G3}|l @:R  |a<~}r1Tp"X 6=14F|6_ t ZmvLKkRPe=]IwHlBAKW;>cSB4FcH_zE~=~W5vS"5+`3>E:1ZC??\luIlHg !qwkTV 36/rdTD C  Ic`L~ j >& R: 0(]#sk$1  $^, . W Iui8SROpX 3Xo Jx )EM$ L  Me(,&5!D#0L B(5@#PI X D+ ?t Qx 2'nI =RQK{l7D%=s Vm:@_!W[A E }{ A:{wF ^ Q/4dC TP.X >2p V-hJtV tBf oX &N{ ?J6/M+ L  -YTR Z ( V/KY[+~[qg<" | / ` ~b;]W^'a^*+`eyj;)V|HG!"BW_dQ4^ ^; '1e! F?tJv?`D90}jhww[[L|Uh (@G$H9v[yUXf/i\+% 7`stsE 0#"HCA=rL0 =-9($&J0[!'2  5#"% #    $       '  * 7 %  3+   "                       - /"6 @?e#<i;F.>jHG!g mB#I%+<pl>_^z?"7CmC{3 PTJ]mJX,VBDthuP{M5!iBh#PB AO{f~o_l>cfKpyh**5qn+S#AG'XQhL;x<,;*w~X[N+<sdkPC4h8Et%uLAiU5|S90WNl/xF(b%!9""{>m:39'idBv[>VL>} Hx):OBp $"Sl_(li+>AK*?in *PMEb<ZBm>x2+~/p|FCw',Hn%IB+L*%*9DNL>zb(~'1v  /jl Z<u  hgkHIuyd_M#< ?&s%.T[WB &|9S1?72$P5  N_Tcr gc !  oIdZ, )r m^LZmj A ,_J&_)}Xc{IQa4$&$QأO\f8"9%h ^5H}F 6,yPKbeu  T0E I/<5#K"ھT3<j>2V"WLkL k e9ny v~LW0noYE)B!38>-QLb~ -<#s]bNE !d &u@!13jT G -p1|) ~ʹZ,0E,#~eOr. |l9 K8p <v:N.%ga @ T 1/" 3.#$.>5,_"=2\rxmAGPl  H+|Iw  J (0!; 0tٿPBK%?)4*'RLD7  EQ k8X=Dy}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5W N$cgmv>Q=k<~ YOMBo7@as}~sDA/ka~[(yf<'  INaztT,uE1r< B:4NXlV9Cj5#f^T*){.u^e/~p:D[[(fIoBC|O`'yPl{O5#%il `Jlhao%G& y8nj;"/$yORQQl@ G)`hNF5 q[&F>0-&CcKM=zRX[-6L#+ g Z.}eA]^Vc$y4}cwhcF&`Z6}0'Z>6gW$lM l=;N:MMZ. Dl9`5mZ /TD.w0{F!7I0MnCFcE0[Sy4ii(Hkb=F|qxF  '*PZvI8YY&0PN"(X H7 $"Hg4z|`lcV.|@dT.|I1\Zt"XU%{U'![[u!]-J}. 9kV@B OL\%cw*$Y&7xw qY_s<SC:$}mT$x. pft)H#.W':G VX{yy?zjn 5Cc4 :;<H;/0"wyE(" GXV^2 Ndk>E *J8O5%EH+ 4V3  >S, 4&@()=- 7+ D 8 9B! #'I7 *& ) !S4=!0&& A. (%!+/-  )MG0.0!#-*6 ?+ (  4!*$ ( 5 *     $    ' #! ## & ' #! $  !"& 14 .     $" . )  !  3*    ! . / "3&! "   ' !!    $&/ !   +  #                                     #!     ##    073"                                                                                      "                                                                                                                                                                                                                   -      )+$ $!  #*2 ' '' ) # ) !0 !8 2%"-;, +9(  ,=O -@-8t+N&.R[> g\?j0_w1 NhT.L%/2'/"vl )L7Xx&qH;k}F>cn3Gs{sEzA#l]![DD {Kw Cay]-yZbj6sA;%B=:LiAHo>oB{WB%pq8oft %e+jmr=j`h2~uaC_}]DIzB.J0*9J PE"hMhiXaeM2q0y@.f<3T, K>,^x9$<Q& ]$=UjKK/upi}l{HD'A1Jp A {kB#LR ok8GUQDstF ,' t{\bC (i.0 ]\8K P  8 0 *f\ /+3GssojyLq\S8~;p*@JV6s" 6d*Q HVCi uo ; E W&p~N- ~`Dxg5kPzT = b, G.< h(Hvy7f=:<`JAJYwhW"~_$4Xh! &D  9sf=y"\{[Y'FxQU~TjJPV9i!nUD?H'N7 b8y+"d.A&G1 YpF<$Otk @B%`:t 3Ox0.6JDFޏ͙L,nD &(/#"#o% G0"Gc J}ou 8#<*` <ه4D,J~a{<18>! 'N370=D-r q 7^~"|g'!7 6 2sg/=339:5] -^652{Mn8 (,$,= K=U8Z^ ::+ #=T-(U613' AD8݋CTP ktYkjg3 W r=,f)}10Ʈɫ؎.#/)2*R4( L q XB(H[a &FL =]7 oCա8#VMp(N ʼ|@/Lf,%-60,Fa>E Yue f&Xs o' -*f%5S,),tCкKS(&H1B+xRJw y/WR'`Nz/s k]'8'#F,3 ,ǁ0F1#-&r-~U k ?d?[%$ q֞8a4r#~0<=ȯN160ah >6t c w  OSt~ %Q+._/ -fG D\Lk r)  q!# 1, yYL(gY lW y@ //G!m ZpwދG~+ 8yoVfv-ijpzC%:($ H{3lݓLl !*^xshZ93W `7y~q .#$?$irk>N}TJmy |F$;y6/4`.O}==nEsUi%Gr_  b(qx>*n?F? B T>bn20~  A" _ZLj(y0';H+ h!]nmS5 i V D & kA J8b_Sz6Jx {|\|BB h , 1 K U h&`kETB4M7N[?7W79Rzrnio 7 <  b { + j=S >$d]- kZ+1[{E Tq w 1 ,0":4@yl xz? O yCRUU L    ;Z,hg]q?7 2  DHxFK{  w  l 7: >c3^+i} bo7z+&; ( f*(Z&* J\HXJrO-o2j/ /rOvU B n|mA'KQE[A\q2Dy+Z-Q1eCGlB\[dm2~JPTp/~h=-E0H1'^`8\^PNS*a!Q=5J<ZV15si V i6  ppRYeqC  !}M|#7V.jeBeIVi^{ l ?-XjsjG 4   nBIYN:QRWbx kf ; | +a cjD I$W;9 u K w@ CH>OM| b i?UEPܘ} `Ka:1`|wQ  `p2oz xO  + kj}<^?  xSx  )}Db.oHN  ik " U G~ 5P t >  >S e z Y$5y^6{QTZW ^K^! ae׭ނ:"!HPH"( * )@ M:Db)7h J#7j*  > Vxۄr H  F$L'N 9(sr~ c4DIH~1nG)5F>`zuD a a{{Ds_DNM}|;brM@_)Hu6O t5!fylVpMI6 $ F }_2G_r HV3R(M.t.< 9C^ikoK%'{K pMFv10SM/-&~0"dP -j9tAc z;.*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ˡKہ&(69d-`bʛez(*$Z׈ҕJ\"#Gn 2[x #2(E2 dB])0\{7Xyd-nؔYm0wnnZ  W uF1h ?RGM,NQY&PM;Q<:@ Uu  $#-V{%/&]- <i^r.;p03[h/R#]o"W8&SΎZ8IcK($iC39D:$՝"R,)+"Kc$ 'tR `M  t3 & w#K?.GIO ܼ%vF:rLg#ZN y F l_,E[G[Er^ Ua_Mt -yߓj!#*5 (403[=ޗ)1 4pQJ^YXz d~ Q -C m 0 'uCD $OX}LahH /ީt#y*&X/,).AGj> * X[T{ A1 *[ o ] WWY 7 }D! {! =kI6ȗFK@=`Lx%J{U !"̓a_/;4G$>2(+4: Yr.Avm`TrPf {+ G(% Z 8|U q .KF"={H!;jz,ZP H'*~WՆA!(M"mWZ';+; n|hzSc oZv: P;q '$| uUY! '64_Hؖ(@y4yTo!+!%IK;3/ dyp r0g!  % TJ$ ! O6E r :K(+J,ۓoK#]D]j ( Ahs sY  +l, 1 z%ksY=HXsW0>:G ޽ߩ$ b#h. Q HjdM2;.zZyu0} SiL>RwRwe_ olKy iZr D  Ra 4o(r%o=/ y\H1| .PtAsL|}Jx*G]V6sfI NmIsLo  }0mNb8 l ?Ty<h=z'3'yyz] }\m3/\:|tqwbq:8.3Z8WinI)G :5vW59Z?]+R\dNK\] S!  l!zr+<.OT hu[/;/ *~n 5gm rbC=ELxfOLU|<h 4m3HK^W`_]EO4/##&3 # /D1C/ & 1 . '- -$6                                                         = #' *- RWigGq;~S."\=5JA %XoS(Hg^AZ8tyC#wXp.U^OU+:3^'X2z&l\:Xpm_<+Ck ^ =w7;]>` Y__}VLBF! BNav.)@C ;Oj@_q${ ?&Ne&J  %)%*$. #_=(9 S C + $$( C#3$ &77 0 /$"#0 ,!( /&  $   +    4( *!   * 4 #(   #  %! ) (!& #0!)7 $3$ 0 )                                                                                                     "%&&#   #                              !                                                                                                                                                                                                                                                                  # !   %   %     *!+0)  &%'!' #  7   %"/S` d-#|:DTDYx]CRND UE@q-f`5 pknk{ d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LO%ْԍMg-~ 7&&&mE;6(?+ZX!e \!]gޒz~m+W% FJ\J u6  <\Edr@A X  s -/+$>j e . <|K q2l@`I8|*$L :R ZxBpf"X.'zi4@%yxbIAonssDB["2#        #  #& " !# 1$5*%$-7&  +J,V.G)X7( >W X8s0U$9X%W$%K JB2a} z)#_Mr<3.gL_b?Wteq9MUIg2wftxN]}SSF\F7yr)d{k<LZ@+wj-KllzJ8D$by&Q an5 <{(jRs`0Zv6h*aH9dYXhb6 C-j0*7/ ",9` IW6"@225&&:7^5 e[jLF[+S#Uu rBkD&K)ZQ.lU]<On\e'k}hQ dQf6*%IqnJW/h0$jHH3!dF _V3>?K6,}jRZ#0 YHW Hu%I ^eP;xA>0oS e^)TP ]`5Kn$\5 l SJ(:Y^z3 I<`aC]&r<D0[l|I6Nt rd'&YeMeLs]>(hEfD?v%V=i#)DUphr;G?;_Dr)wtbaE`Rdq2mW $\Dan ?4 xd% *`b * /!l\ yaVCA3RaOjarT * f7qX]  J2{N{~f,~{sVMMSTl1LJ8:ryw$Ctqkv2AbzvNf.X<h2dgrZe6)4vs{cuZ[):?7,C@":CC*:                                _@`iH"SO,h9(@K)B#}1N =AF V' i TK!XKi ?e+SV .  COs tEtB/k<53(j WMYEm N )1M  O1]7 .i q |b5 8(es2.q d EJ `n 1#QjirtO 5 ^Bv A0ym#\U4g` Pds ^P Zy) )MD!{4 KN Q>71b@M;|/?][hV_CY:7A >EtO^fch(HNA/oWlmw 1f=QS(t15fTi%* 29uXVR$-q%%t,CwL)2ZP}mX>m)Jkav{3|N&ab+RM]n;v-~)I0x9~aJ5jO<(\O[($zyjr{d, j,s#0:@8!h}qIYtEune,xU  }DgghF8?BNjM\p&i` S5fE=tGfE}I %a& l bw%s ={,fLQn)j U= $o`|tb.#RNk\+CUun 9bA LRV5} y3;!6%} ԞWVĠݑz(03/@&} בi= J 2 :=8 *>5qƥœx=Y '81374N, ,U?pO7\1.;?;v.b D$ʣ˨*ۺ&18:810oنF^<\Hs0=>2b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Ie~NsGgbR@-@<eemh@|(f_Tj`c|6Dd/k'Ido].E4Ah@f^DbqX[)&`ORiNO K2A"V6LxPLT`SJ2O }u5)R^k0>2;r(mHgkb&.vkK+|$1.43@%-NF@@V$ynL5K\bb{YW9H*5kAmd2_QN'(xKP("8!9(- Y< /' ,!- /.  2  (                                                                                        !#    !  !(#"                                                                                                                                                                                                                                                                                   #  - ,  %&                 $ ()& -B ? 9!# A$*D# : !(NVJ-Qe-J}"\u=}\#WM9(f*v5~:OEgR6hg: B|eH84pd#*6_#T+V[ gt  Nm)nf ]Ch\jT  RxI#Aq =oD@TX|B8!  K 5C'P^ Jr =~3ށzrf| LS> (_G > n8! {ݾKCB~_9,5 n- #8~h#krj  l a:B0 \@z J!jLc@ W  JcT{  6 ݚm*7l~ Lr-+ F+[ml) `p <,wS~zX4 NZ#c !D= >kxNzgJy 0 -F,SUV   PDtE@p , s 6iuh_{? C @ DNVw4 z;a ObQc Zu U ^[;K$X mx75| s X {s%gxoy|Ly -na~a 4  z y{;NvP>&T J%  h (wec: !8#>,  N ) VU uRQaG(  tS 4 < rz;' {X C! B : V X6hRk~t0>? 4 `C.ErC@ c  |MZixskw O zi.`- Q  0{'}b,b$M " wcr7 # ] z8TT4VC'@i g. 9z7O!V 0[{ BK Bg KUTk *1 c+ Ev{5 -q7zzdMwkO %fO  SH&e:  dpkMd(=(!%Z)Z+250n L#;*=& z%.H%Z'ߌ:qݞ}6v&% @OW f3 %%6-Ґ'_4^ )*+'%m1]C $ r3fH?tev4W5&-K,c &_2 P I  Lj T0 KAq1Ņ=eI;K%MޞW o74E(IjR'7cWg[ ;>_E sh:8o,'HS9@P/3#v#5 C }~ !' , f-O$S5T9e$+(:Sٱ ~-m(R h=LM#Z-LQ5n %ـ+$<1<.'D v۟jC +%t'(u ; YVt4ò2ZF491" 8DGdӧ.3%I~Ia(C]U)s>S%v=/=- g}bֶF*5._߸A~pMgTΩj= 5}Ds9&h kj8 9;'G+WNd %TkOkq?E:7a"~FLؒ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J ЯH#^+, (GT U hf %{;"K p'ҐΛf'/'HvST ") 'HFUD4j& $1/L$J\7w Ft_ݫf:$/,i{ҽ( 419( kC ^fz~1?q5U$Q1-/DDs:$4X3, bkQۥ,H!##)cJ& ^/1A (L^i1,7,q#49^!#w+#  n\ -1 Ȝ@QE/61*j&ذPZ T*0"b?UϹN,Y27ǍC$_/y2C.0 "} YՕ1$."Yp+mC.@0Y>DĮW!681(HMG>ڀ]m3!"cU JGnv(360#t"аu~-B>I:+r9'2b #072Q2)01)v dнǠwa+49-c*ٻ>%& &y߶tN+6*3# 7%291! :0+=,K$`t_֯)y8=0kCjb 0!35](LC*ӼG+3,q6'!%rI PW4l5 e+D/!O` { "^: ia8Qd "] 'I>C!U 2 30tx>&A11To`'/o{Nɛv 6-v0k"{ WΟ{߀1&84(j ,KP:'] 0+.aHH!Ɇ]ڤa/66(HINq0 !d{ iybD+HRQo&}=';\6Y#t۰ %")$_=c,uܧ%GRT(J՜Zͻ\}}%" ;>)r(>,X!/%]+#}lVQC v E߭CQ-*nUNyu79% :"3ݲ7#_$ DRm-CP ,/ͥZ3$3"7% .X|S;]"!&U`*_K y@P/=l>Kk.A2# aV#zWiIS65  5_*aG5C+Enȉ?'N#'X C+:( gF17Kj 6 m; j )2p "dBR525 f f xq0C !"u4u<J4\:dKZis@f \ g&%\qvM%F=I7>$M44g/.cbj:,=jLV(e#ruc$ u?3["tPgKn}WW[`q>Xj( r~z% =tz2s=Q7wU;U2I|kwFi!b3=fy='aDG2Np k}l!I *aARZI.cr&%c I'Q@PrH>[ F&"J=vi~p~?aBiE(&'RaI =3_# x$`e* ^XG36)$ %x,,e 6W(;832A\c! B :#* &3(*  * 3, ,*!#!  "$*$ <  9    0 *  2 !   # -  %(&%   "  ) ( ) !#   "(  " *      $) + !  )) ,   + 0 , # /!.   '!&  ((. ' )   .#!                                           '.33,       " "&#                                                                                                                                                                                                                                       $     $   # )"" 6% .#    &  )!    )             ' %%    "      +%    "( ## %%                                        2  6 "X&T ,6E < 3I?GTaqRJg2/"4' 3Yh'd]` DVTtn1zZmF,dUgLPHah3n<886w$"2K]=T-)*q+,eO.#4bO<=zya[?` nQ% C/N0j B{ d&@x j_pG k N E8aJ|= EL T|^9o  KU'm;  .#J^ j{ M)5B| 3-ORG L a 9 RaVd w % S Cj<& VT oz \ !n<n J vrpK  ck#oY}c#E7sA j" T JQwݓ=R :v J a}a E`i[iqݶ5= dG b~>  ~ݍzI$? (*P s,Iu)'7*{Io܁=JbC+l8v* /$./ nMd u#' v9q$O+sDb* 4>Vx -0U (~Jn L0\\ EE 4U+y <#b ja e?{Wj q BxNBn SaL , %q'|6 nbu3 6Ds!7 wW  %{!gLWE"\bD! *@$Dkq,ETM`iQx$6 :s^,r?F75qYe}}y!Cz.Ozysyb\<8  "                   27F?!}:j\ArEt 2ߵx g xW6 RS:N\=T/CHhgo?oq \N/e 38e8k#i{X z|Tcf.T|'b <ܻ]HIV } 7 < ' `1# 8i| ; w`8F]+$LCM3!tU@Jl"PMw`t_bJx9S`0  NLV71;E5hj<4Z -^h{\xaxXmq * B 3O LM &FBY& c ~U1= JC4;p rt$ 1;*g%Z7*/}s2X}$\'-7HWQxҤؿ'#&:%jYfM+ A."1#Ovǫΐڨ|Q'x*)3%SX{p u-.L'a9 J$[!("*&B -ߜz)80)L>}.߄A"()"B;9ݡ'd!+x+#N 3Zr=u! l?%(c&c,a`JY%)!'!XQMԦ'\ݕ6$t(D&9 O {#&' N! Aq׮Gy!^# D~tTAmm1+bI0J b3  3I}.  Ffz B-`Bw(\A-pG:M3$$I&92k9*-M!9I19h 486H  _dy&g %axzScb1 gZZIo7I3e"8$*; *5~8F+,HE5A2V!,=0'K&ZJ G"*  .:%$#$   (   !   %)-     '    hkV3i13[ zAl P WN%z?Ei#P,W$ *%\ =k0 ZX olL o1)%EW R"]t4 Ybs$n%z;m g nLi() Qg'xcH?. u 3 /y[h . h,@X 36 LI wEf**Z\(:,Dkҍ Z!bbqd F J[\;G^  "t |-M!a ݮ&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@8FgL3%:, =j"w Y| n$3>k"b  > &V+3h Km0BE(N$b%iN~'pPe D%XB 6x 3y(VI#klx3 5* N1`) [+/~L?Igf ~ `1*6"7lHo( apd0D8ND:d mQhM D {(&$ n?%h`P+Xq#)Qt / ?#:#< GDlk O @Al!SX xSYu8Q`P C&E_N :R3& G[blM-4RD  9oN^r@n=y4&s skx 8 ^ xo (D^ TeuNv.U w1 }]9 K N1PM]f+,<'oQ 7NW= <} <sea+ @BFCL bs V 2%j.E 7n [:+VQ4DG yt5S F+(b& lL)yB CA&J E8Z,zqk ' O'&q3BH7K AN z'1'nkm*B)uG# #?Y!{v ]YAW lF#Z7!"l %D)H1EEPa#90ECg+TD s N(!y8Rm(j6lmo 7YbU-o^MbQ" ^/ 4HH .1(R7=;,MH>qYg7 | P  D o`,9\Oo|FbB G^~[ w-@IJK#+^2 9X4X04@ o>5\>{A g| .y`&0*xyXCb)eT>jy3T,VIv~!_XS$<7< /HA#A)*F!/* M#M193 A                   !     #          r$C;EAz<1c_XQS, D o~&`~7wN S7Y3g:=,C gNg6 rOOHD@W|fn)~ |~Ou$ r,? e,B^3[ !6l@)rJP `%uf` ;##4} 8 'o!U@ `}0 #dVrG>`G/  VM"`}(:' D `~W9YeQ  ]  7[FvewU I{bUu z 3 hI#Q  R gf_c[ v &C}Hu#w (eTU? U " # f}yAPm ]: Xlw7 G CJaH_ ` Eo \ C %: 3J@e" bV 6  J ^ki)*x"B %PGv u<< E97 I yE6Au &6x0or3j  Ba{Hxn"'B WV2 =  q| Y<t 6 _=9q +fu)s } *  3&  t1WRp[  pa l\K|o <9C(ol &\ TW :MT$:8k+t+ *  6J`+ r3RQ` I< 'E~yLA i =lGv06[4 \SA@!1 5Z,0{j j?? Cb$^w" P# B5K Z5P^XR jc&1s? 4wpQ .O:+tdm. |blMNb HGv  ;EY^ pn- &{ M$'N}'S~![ aY8;_FKs"y?]*Ad  -ZNsBI#=L LE=g޴yu 4Lq!X ={UHJEpv GF/&`* .%;  +fGoI  0Pv PV;5(4g3t\l !n cL/'Is ^ j=b,Wj g0fDBL  b H' h*_VZ Kz SPT[%`i e^KRzl 8\pLq&,=xyl Pl17 Jc!v/ P:HxA #4^ M 6q:w  z>^)x 0 rl,y/  g+V f^ur8u K GMcelTm  rt W;A] t. LdSP J 5 5c 3:\9b  URoR  P""FPv) u(m kQ[+Q <Fm$X 7 6 -:2yi A B,; rc1C V`. 8(_^1$~|Z  b~l ;Te/Yu ^6s 7Brn[/6PV  Hb&DZ 3/L$58:f% h$W0X}Xo: N?Y3/  >*oLfL8k0NK P-}%((>TxW 7  8E9joj]u@\Va= %  |{UU~frN 6??Zcd Ob YdouUfseYs1DzW > ? OCSmlzI}q lxk r<!9 y U 5<n  K9)i0} 4 CEAF"FwtF\X 0Z:zHn d9B-iG6JadU5G9qu)|{_!C q[qn70~l$.D3_LeM  2Mn)k*+RIUTIzoRBV9C |1Ke+S*-~H PJ wZ4-,xsA 5 dY2@+5T1\7Ks) Oe\<oy}t)-shY$"9 ?0TVE~D1g^djwDgdWt}3 S.FsRa#JGg_1GDRzNn)xPz)8x8Opr:(?= y<+0  #SRFz'^ %&:.]as'VKLt;:digQQP<5?/[\!Y8'm ap-=l<%',a3B @CpK>v >,bO|xj5jThT3sAOR  u-1&`^32^&oTk 4',}]>9x3{y`9h@5k=m)a G'6N\Lk=9aXV++OfYot5`Z:@nN^bmvN. 9R;_9F5q?^$5)`UVM/ :8+25&!+$1 . !, "/-$U+  ;5""/ (%$*L_DS47>K&! ">Y@g1 <,-~enCS-C ~i+#aydxk38JlOn|mm,"{- 5! ^7.>1)P2bw]J N ^{p3=:Me7O") ,Y$   %$  !                           (   "                                                                                                                            '#       "                                                                                                                                              spandsp-0.0.6/test-data/local/short_nb_voice.wav0000644000175000017500000056705410413505623016630 00000000000000RIFF$WAVEfmt @>data        !"  !*+                      (* (,/9<9232(sf[RNT^hz (/8'*3n!]&!$/;N.f!SxyjeW&oh \Z]$+;m5z%Gs$BYaB ]^5ld;2n$G# E?!eWuqeV0p1D @u8H.+3mbiJw.e!9I@72n@TMi _o.Y&JzI(FII;8c^lvWl.D9Wi 9f n,t^jXe;sW,i0  0C^}"_[!w'JQ@2waTA@MRWTcwhGMUh[%XC,77)2i͗f =((' }:@,tQ 6;#4 "Miȇ5}#&)7'r?P =CF}.,s|G)Ƶo4G$$)&'] m=%[9 1):cE &o# E: $9oZ ݩz\"{ $usX3  .+u% qPܯ@G[ j,b/ o + \f %)3:4`] ##V{e^y K# / b&EߩtJm  CWV ;#m'|b`ZCf\ Mh-4"<VSBRtxOH M; wsD\dVDf B q O fuw=E q^Uzi9 # ? 4 Y"S=YF !#!48Fw<_ cp&a]Q  :Zc w9cO)g&, Ny !  IQ\W w ]Ap#Y8$y C<`  , 3Pk y n krwD; /]~ D j eU'GI!L av+ - {( V`_ `-Qt L  $b]3># #|/o r` o ="I~}9M8=#o2 p 4+U7 _ w{-D w4 w{ pz+^We/s*h G E$  guE{(}MJ O)- |K E 9 V|B(>te] &r ~*R VoFGO&pZ(L? U 1 . ||9LB" ]  |;v ws)D}v?WS D~ . mlG JfeF>@L I 'x  Y+DIS1   5 M?|2MC   C x f * _9 k d *"UHBoB%M   N v 3 DGh:d.&  $ X;vp(Po =  ju{uN8i;xw.ajbR;'+]@}90\k;A:/M96wr&?74N0 V(ii ]-w)E%,Gj ~Se67~) bCq ;i+sRLWZ]Ao,`>-H0WB74{FY%,DkbS|5b^9k*h!)6jDY Knn8Fn[,?FLD}I#yQDR,[ e(HbM'9D$YoT|Pm>v1pIuJ *#O",4/-0#RZ (`\o{fs.??Bm_@fc9oaWS.P'G%w8} BoM%3SaNu2(Jw('9 !;1+"         ''  Wz""dP sus#MrX"iz5H6t*Hnqn&u0a1[D=_zVr 6!T(SHTm~qUAZLv:&-}nRK=lR)}b{TV:( ,UR |m9{ . ey%.n l x V:bInK( 0%& 0PI g b,#P5!$!hd3q= Yr #>  *NS[B^ %*K(&c82ء48 7t ;(t \) .U0(PH +">1% bxRֻoecc  v3r cysy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u_3]n LIwt ' co1 DF  Y E f pay,KOk 5: U* x; \  f t;pBo! 2MG; sFS   m {V*@kg-N  6 e e I9D5T*o@ ZS W 1  ](>>$C>[ {  LKC_5: ] w`Bgx+N'[Pj_6|yshU=_X^7-PU5?dRypX\c>NhmHzq0`dI3Puz' Z'.X_.R"dP}FxJFlR}h@$l=T~x7bw18nz ;ki2m_rM_j@[#4(c1e{0fKhxv Qep>-?& !WS}/[Q{HsF>*7>OGQq?qy |+}D90L LaJ.9 H1OA7yW\yw9.VZa#H)u{tY \ ?6my-K/]v^c|EmglTEBs-3M8UB](1+a$Sbn1b<hE2I9C~g<  Hvhz:#n9$o~$ X `o3ul4ZON@G,"~*9<s  ap! "i/ CD&C63 A p  ZmLE6Qs!Z) 2~ Lv %   _N_ysD1 oE~3 `${epmeK~ ft_>3 yG *I , [o E6:` H8 sC8fO ]ݪ7q; -P$~#'Z ; ;_P )c. &g"ܿoeP R HF )pw WFi r2>sg`  zN*&9  3 [K C]y c2zA g a K 1I4h G !&=E1 OB; 4 = SyL YQJ^#\DV*L!N 4 P R-f:OwE Tq&t  Ji&u   a cz3=(6#R 5b ^Q ! 7f|RJy6; G} ] $& b9 jji,  (]l%|  PT e XOG  #Y  H  (pcF4  { k V( $9BiKRX QHX<= ) m Gt7[y K!Z  enXI['( k -rM_/'o)>NkX\N  &  . ]vDd/FN  1d2AA ;H(JhCnL iX L) gF|J / NN'1I X@ [Fo  :w`cWqO~d; | Wn;G. + oWqlV5  kOu*=  ZmTP2 u#J _ w #p$ F?@ >,, &Bx 3AOs'cd g2 UleFoX 8 h"=7B"}{S  `fiO[t'" R/67xg  oUe  OaW/hE B? Kz l @ZjI0>W tY |t BI[V'*d } y 9?0iR8  N~W R6S(k p?XS +8 O1+Wxf^ q c Rx*^QUsH e,^Wwmn! ` s  MWD,j"RR/6 zb,&n#k8f u   ;)sSLcQ \\kR*O   sr~pTxh  Nb%%u{FFox%{ )M$i<URXf63NCX>kuJB!)H%(2`vx^a yei?TPu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$u 2~9B Z6=h5_i=W>2p7WS(w9;{> 3mh}}}>;0=dKwG7\ aBMjE{ko#UIFZ/;* $( nx: W Wba l v]X]C.t)YFc^^ v38Ag )hl]c cu H Ub3 ~nv ~ ` 41 =X/~r~:Lcu>Hww4twQJ mJ9Z&*s 1|! 6 | Dj#%1@u  D !U5 Gv;)H 9 P^9 23r?  w-  h 6y 9_HF@|8fX%1P+| e i MWgzn GpsIl Z ,c{}(")@$aIJTS +~i_U]rr d; TNj19rLD=cU Z$ }Hd@ wjf]W*OnoppaI1l"SM]q3G} _j.D}(L@ B)oa^} "{ 2;!N(@o~;<-B{0|}qV{Vu5:-t7]MwBn*'FKpD;uIq}oa&+;d;(.f-x# YNh@^x59{??m J|!0vP).W0[a=QH"CHQkkuw[s5R_:9s6z|v[=jlL.(NJZ[So,@P2j/5P J( M!f9(  +*XXJ"/  +/  L / ."=21("%~!* We,@!IN(5' *=@2F6I( , M5+"/M*Cd.;+ ." % 6+<B5 z"  *'(5 %.'I69J/8UL  !"82 ,B6  $ (<2~DZe]66M?    '. <Zh9~y T[@WZh %,_.61   @T=5          ","   //    $   $%+",1% !*9L<y{ ?*1kb$LU1$byCw~ 3!v~%$ ?N=DT@BI9 ,1$5+ +3/*2%   (. "   .,+ +/"                              ! (*                   !++*"       "   ! @`Sf/+'L<D1   !"!?*" +(3' 1" !fw|Za.Z2f Ws(y : S P7j 1Y3  s $ N&[@94L(  + ?{K6l,A g } P eL?S 8 jl C_^' ]jhA2vFN ';'Bj CET!c! pn1K !L!.S w"[B=PLtkK F!i }!MF7wc AM1' nFI 8 EE8'#Uv  xjV{2<D$D+OOhZl4xwZbJx\>=D0:[[Id]~ 3jO?un[U@v9?CMF;8%z 7zQB&5' l"_*@ .98pT]:/*;g=+h}BM^;&X/*M=iH>Hg0a=-]{u^*e$hA 0l. "sA!=T_2wbXm[foF( $<\ B|!_U6).PD|w<e5( )9Up*Mr|hW; m^J@DHPY}@N_n|_C( %BPS^_b__UQD;+ 3^F!11'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2-S ;G<z    $MZ,wt65H Xʱޑ)DR2W8K$߀Qȵ"pB !(?ZFt]d be) s.b0GKc!v2%;.)_pdVՐد =#D(49u3orD7HdJ2IBa $6~ P[ 0;[6r7(L"" 8w״Q [(j"@\?1Z$`T@ c%3 |r)wl  |#</ky "y2)8 'ӫS!VJ~XnI }j $!V %\H>  W%p3# '!] FK{Da .t7c! _ GP2d4L!*K)Y,A#wd oI5D#ZO4  &lU% & GF,X&/,X!qaR3PMUnfG7FCSY7i?$5r  2fSa/\n!,GHYCET([z/PGeNw. 7 7ESsUC7Mp /bk<iTT\v'=MM5(8JT[= jF[ T^ZG.6@1,"{YMYsW[hGAPv5Fin_F  '2,3..@?;;!('+!  6 }.'Z. G:.Mfak^BS' 8G!!(    ,.$   (      zN >6}!8$PYF;f xmbJnnSc9qAhdOB[u9%P3M ,,{G |S!CHV%TbYHA<>,z # vSQ.]=XZl5(8PB!]JhxX&TLKpRa[=FEY;xv"s'z=a~`;^"qs9a(w p6iM++ ( =X*I'(    %             "  $ yP[_k8GpW@:K};=QkiIP9/5 + p@U@6T.*~szISM9M &0 f}'[M$'*LqI; $3t ;45d G-pe~PxF V y IdhGD45g.b./y8:/Tv Xw:5M  ! v>jR4xx= xi 4w*Y T .%xLYWT $C!WZ,'X10m')s~|NK ~&(N&z,_ ] ? "9 tWA l q  TBNn 6",0VI "P@)Nku 5  _~.SJ N h F `>'bHIB\3wjFM 0 G n  w]#HL  Zth  fJv<Pr}A  kq_C'[*(fV&6x EQlNEJ0}3   8V s `!hR]azV~ + u![\dl+qd~'CSoY;g   @}jHe"T4Ej foOM#Dp a={ GM(F H& r7X6e#-Ji4?o=+q\Af xp|xc1Hd{8*'e\Ns[ACl@N3wEj/$*9"A^#_Y:N5B15EimY:!.i@%}*=[<,1 l? "Ri!CC?L'}C"[U88(iP!'bsZvvysQGniIUfMoR6 :^z 'FrvpZQF1vTfQS[/@! DD3eZw<;k*}XC"5PmPse<vmM8M%96M "kF2+ee^UYzhchq$1N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_ mHN.w*7UA*D:%D$$J [F. .u'"-Zzcm-J0Fn ojiI)<[m,^,s*G#C*>bT6 2:jLdEEsC=+s|:`{NZIYN[jeLR|gIp%$grv0 Dql@W"; k("b5 {3 X<^'wUQuW M4sD7 ]Z*FD>RBboa[ 20[P .%V/6GC2C6/T}'  W9)>i"WU[, 15  _fqzMf+!0 dI<B/}<B'ao vB[ fM2 *J "Z?6!' !                                                                     ! %       !"        "     ! tN[lM/\Yl. Q C0rj.$A-eecIv6fm},5$<o?}C$$ @ fB>z!KP -  e 8u_n@O!P@h*bPA>f>oBD #05_rG 01bx%  QjO 4$ 9LH! r  \T?>!yp,.k7]8 )I [  ,d sG Ic+aQU j R`:GY]] 1>bKh,h; XGI\;'+ w ׷kA6Z ,w<[ > } 6 gh_1-_P\i,9i5/ ;( cA DQwZsW 8t UW a%EU1lF^XF?IE% yjF"jjLG(Ww(c wNI 3y>P4R)X 8V:qQ`K 7% yV&B!D2}~jyT3@66=-s Xwa-0S$xaZd.+,o,@P>6\x}c'WIlH^ /F uwjz2*SW@q bfHr*r.ZFSC 5 n_j'!?R2t^Aqf,FwXVF& S0$(zVB  L+o B1OKOeN h>PB\"Mhr {fW_`=-Vx<:q"Dor} t!Zi > cR(8JAiq()k}E~ (tH v-:vpMAD2"8Ho:}7QR*w3 Lmy #;p: 0B(WR ,[+ID3Ml4`0#6 @8n}# C & MCq #N E .!PJf:'s=pH* {'[zP 6Ejz0RKm& YiIE( o sw$zjyGq u<HAW cWm{ E,jhwjs : g (TL?.Ske8 :n6%%o% no +%M2TzDBS^<L*"7@P@B\|I tCj $ 5TJH S  y&<י;*+& .(%5X$H QKv +,/ Gqb8*dZ 0  ! )=2!c}iOS 5  r#17 VR#$?!?*߈/2Ey&')` D JSONVA lX kY%m4< @ !k K+0;W& buR~" MU {   `DB;BE k EF ^.$a#*l>7߮u=FGq ~w {P!A+*!nsGU2  "'f. $ o `Aכ "CH>9=w(tH\ WL'R'V%q cu\ 7_EC4A #`v H L  <K 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w  DJ sJTpj!/\6,9Ql_+.^l2/i"yB7Yj^|/' p^.=?<v ^8(lXU%VU@ D6@es7YqjQ.U$H6=]i9{! !*+///'$ z s U3,+m,1L 5;+ifDbXf lK$ ")f JnoS zieXXiWPiN^yz $<BMZeU_Z<<* "  ].{ $  , =   6*    (%SdUT!Zv[C]M!z' F(?* !.  5C"+3+$FUJ.'!  %                  '"%""                                                          spandsp-0.0.6/test-data/local/Makefile.am0000664000175000017500000000173211422612266015131 00000000000000## ## SpanDSP - a series of DSP components for telephony ## ## Makefile.am - Process this file with automake to produce Makefile.in ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU Lesser General Public License version 2.1, ## as published by the Free Software Foundation. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU Lesser General Public License for more details. ## ## You should have received a copy of the GNU Lesser General Public ## License along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. SUBDIRS = DIST_SUBDIRS = EXTRA_DIST = dam9_lpc55.wav \ dam9.wav \ lenna-colour.tif \ short_nb_voice.wav \ short_wb_voice.wav all: clean: spandsp-0.0.6/test-data/local/dam9.wav0000664000175000017500000123745411007012213014444 00000000000000RIFF$?WAVEfmt @>data?pppp`p`P``p`@`@P @ppppPppP`p`pPP0@ `PPPPp@`@@P`P0p0@Pp0PpppppP  @ @0P0``0 0p @0pPpP`0p``@0p`@ P@`P0@@`P P` `PpP@ P0p`  0P @pPPP`` ` 0   `0P@ P  0 @0@@ `@0P  P p PP@P0  P `  P@`PP`p߰``Pp ` Pp pPpP P``P @  P  P0@ `ې֠ ۰p0P0 @ P  @  @0P@PpP 0 p   P `00ӀPp@ P`P@P pP`p`  p@P P `0 P 0 P   `ڐ @ `P0`PP0p `` Pp@ `@` p0 pPPppP!3%`м@0p@`0` @   ` 0@pPp `0  `Ppp@@ 49`Э @p`0@P@%@(!P `pp P@   PP D% @`P @`@РѰ`0%# p` Pp @ P`P`00 0 Pp`@pP?8P ЀྐPP 0  Ͱ ؀0"`@PP   00 PP@0 @@ #O%`Pн`pPp Ppp %P!@P`   @@0@0  `@@@ ?B `ˀP@ P @P@ـ0 ))`P pp ` pPpp 0 @@`  `P`0@p!EC PАP`%0`P0!*p%` P`  ` `@`@ P0P `  +]/`Б0Ȁp`0) 0@ p֐ "#`((`  P p  @p00@@'V:PP`ʐ@"PP 0P P!0.@$p0@ P 0 P```` @0"P0'O>@pPpݐ@p Ѱ@3@. &`@0@ P 0PP p  P"! P & OEPp0Pp@0 !0P0 @pPP1#P$!00 P P @`PP @pP@"'@#$`2@aP=P  ࠔ0`0P 0(P0@@pΠ@P(p(' `PppP`P0 @ 0  ""`$.]N@ ЩͰ 0p# P`00` (P" `00PPP P`$ 80b8@ pP` Pݠ`0  `!0`0 @pp @*SE @P@ȠPPP `P0 @ @pp@P P p``p`P8@A!0 0ΰPӰЀ `P P@ @@ @ @p  @p   P @ 0  ``p ߐ֐ِ@ `P   ` @ P  0@ P   p  @@ ```@@ @   P@P@p p` ` P  @ P@``@`p0PpP@P  0 p P  P  P@ pP0@0``@ P@ 0 0@0pp@p00p@P @P`p`@P P`P` P` P @@`p 00pPPP@@P0`00 P  p ` PP@@0 @ ```P ` 0 PPpp` ` P @  p;@JB/P ĐPް@+;80)P@ ``'00&`  @p@  00 @P  `4\P^P@0@P`рP@PP& @@KpCP+ @`P@@#0MH/ @Ű@pP6F H:@p`@``0$-+@ 0PP` @p'S@e@`pI@PP0 '`AKDP(`Ð@ 4 C F 90 ܠ` ``P 0PP @"G W0WPI!퐴@@&40=2 ÀP@` p@%270`ӐȀP@p`P` ` @$@EP PA`@`P $0/P& pppp `Pp$@'!0@0 p` 0 p  7DF;@ʐp`PpP`%' 0pϰ`` P @P` pP P P  $`1075#Ъ`pڐ  @` P``P0 P p``    p  0 P P p `'./% `Юк 0@ 0` @@P`@ PP p @ @ p 0 `&+)0`PPP` ``ppP`߰ @0P pP0P@@ p p  0`P `!p&p' `@ PPp PPP` P0 `0 P@P0@   p @  p p 0P `@#@&@!@ Pp0PP  P` @ @  @p  ` P `֠ppp`0 P  PP ` 0` `   @ 0 p `   ``P 00@ ѐ p @ 0 000 0 P  @ `P` `PP` p  @p@`@`` Ppp`@P@`00PpPp@@p P0 PP0@0@@0P`@P @`@P P 00 P`Pp`PP  ` PP`@p0`@P0@0 0`p``PpP pP` 0@ 0Pp0PP 0P 00P0@p  000  `@ 0`0Pp @Pp PP`@@ @  00P`P P 0 @` P`0@@pP P@PP@``pP@``P@@PPp@0PP@PPPPpP  P@P`  ``@@pP @PPpP`p P  pP`P0P@PP Pp@@`@Ppp` @0 0 ` 0PP0`  0 P P @@p@0@0Pp P`P``  p @PP@ppP`pp PP @ 0p@p@` 0@p0@`PPppP0pPp0` @`` P@ PP``@ `@ PP PP0PP0``P P ``P 0P@PPp@p@``@`PPp```Ppp`PPPP@PpP@`ppP`0p `0 p P`@@@`p@@PpPP00p`0PP@ @ `  P 0P0`0P@` pPp`p``0`P@@PPppP pPPp0@PPP@p ` 0P Հ @ P0`P0@ p``  @P 0p$A0a. ܐКπ*6'P&  P Π  0!p'420*PP@ΰ@@$-'0 ` P@ @pP &5c\' @̐`P 0`7P<))%@PҰ ` ` #()590P%0 @ːр"(P*%`pP@ 0%6dPi02PPpPp @@8`B0+(PPp @0 /1586% אpӐ  %*P)p' 0p@@ `0%*ؐP0p0`ߐ@ 58 $PP` P0 ˠ֐ؠ@ p'@*+`,@-*PPPp` "#0#`"0!`  @p 2PE )@ڀ٠@ Pp#  @PpP0!` pPP `P0`P  p PP 0    @pݐP@@pPp @p0  `  P @P`  p P ```@PP`  @0PՐ0@0p0 P P @p P@ P `P P P  0 0 P P0p 0  PPP0P ĠpP`@PP P!p`P` 0@p`0 P01 3 @  Ъ`P,+ PP`@!)0@30* Pp P%`'!pP 0p @@p@  @< 2@@ 𢐲ҰP#`P@ @ P@ /72#``߰`p  P 0 p ` P `P  P5`A`頴`P`ˠ`%`4#p ڠڠp0 ̐ՠ ")P)`% p0 p@@ p `p pP `  @  pP @7P7 0М`Ӑ "&0Pp P&0`,@ P@ P@p P P@P0 @P0p `  =4 ГPpp` 0 ѐ`p@-.@`P`  p@ P @  `   `P@ P p  9p=@琦pP@ɠ@ P @P  $ "`P` # `` `P   & D@4@@ @pPpǐ p p@`$ @pP``  P p 0 !p@ ` @ P074P0 0@0@ɰԐp0 p`0#$p`pP`` `P 0P pP 0` P@  %0 `Ѐ`נ#P)p ٠0@  P PP  @`P P  `` 0P@  P6@< %P P&&@`Ԡ` `PP  ` @!  `` 0 0 @ P`P@ @0*?07@ߠ@@ `$@P0@@    p `@@@   p PP 0@@p005P<`'0Ő ` P`@֐0 p @ pP P PP 0`  p`p `pp ` +p3#0𗰶0 `ؐ@p P@`P0 0  pp0PP0  @ @` p P ` `P @ P``@ȰP@0`p``@  ` Pp  `PP@`pP` `00p   P PpP`Pp P0P߰Pp p`  P` `P@@ PPP @P  PP@0P`00ܰۀ0Pp0P0 ` @```0P@     P 0 `  P ހΐϠ ѐP  P ` P`  ` @0p ` `  p0 P 0 `@`PpӠנڰ`Ӑ@`@ ` ` P 0P``@`@p p  0P@0 p  0 p`@ pp`Րѐ@@  0  ` P`!P `0  P0 ` 0 0p @`P P@`P Ҡ`԰pPP@ `  PP@  `p  p ` @@` p  P  @` @ΠԐp֐`@P`p `p Pp@00 @P   ` 0P   P PpPp `ՠ@ޠPؠހ  p ` @ ` 0PP  P `` @ `$0+@``@@0ۀ0$(#PP  p p0p 0`  @ P 0`  P`% 5!`@`֐p` pڠԀ`P P+P) PP p @P @ @ 0 @ ` 0 `  pp 4/pP@P   PѰАP `)-#Pp p`  ` @P@ @0 `  0%3! pP @P @ҀP`P@p)+!`   `P  ` @0 0  PP P P @'3 0 `݀Pp@ PӰ@@%-@) PpP@ p  0 Pp p p`  0 ` ` P ` @ #+PPpеېP P`p@@p ` `#+'p @ p  pPPP0 0 @  @ P @ P` 0'0% `␸P`p `ޠܐP P0P"!PP PP@p p P P @0 @0  @ @ p    $ pߐP` @ P `p P0``` P PP0 `p @    @ @ `Pp   @p$ϐP`ܰP    pP00 ``@ p `0 0  0 0 '# @𘐰pP рԐP # ` `0@pP0`p@ P 0P @  p P p``  #*`P P0` P0 ְ%!@@p `pP0 `@@p0` p0 ` PP #.( ԰p` ppP `  Ր0#`` @#`" @ @Pp Ppp0 @@ `  p p`   &3)0PЎp@  P@@Ԡ̐p@P@ p#.,ppPPpP0 `P p`   P0 pp  0 3>,0Ы@ː@p *, ΰ`@ @ 0.;7ppP`@`P  @  @ ` ` @`   @ P 0 0 0pA6@P`P `p`'3& ΐ@ @  0@0mf#0 @RhO- @ 0S@q\'pѠΠP@P+@<@< '0`@ `  P   0   @ 0 ` 0 p@5 e^&пIPfT2``0@ RPp\0*ؐ000$P5P7@$P 0 PP0`0 P  P P @ pP7h ^pPJcQ 1P@ ^opR``P ` (`5@2p@ 0P @@  P0P00p  ` @ `p NpaB0+X^B@P `@H@iP_0΀@`@ /@3 $ؐ@ @P@ `      PP  P p @#O`> 0. W@Z =P``@ NdS! ̠ɐ@ `P#0 0@ `  P@PP p `   @ @P @p pR_p;Ѝ0@ 4 XUP5 p ِ׀QdOP 0&200Pנ@ pP@P `   0P P  P0 `'YV`'=U F&``0Ԡ.XZ 8 pP0@*1& `ܠP@ P PP` @@ `@Pp P` P pP   )PQHpʀ0@D8P p @. OM-p԰P`  (`+ ߰  ` 0p` `P P  @P ` P (73P ЅP0P(@<7 "P 00 İ`P(ApA(PP0  P#`"Ppp@p`  P `P@P0@0  `&( 0ݰP1`. PƐ !P66P!`߰` 0 p0@   `   P`  PP `` p PP ` p p ` `*`P+*@ `װ`02p5"p p @ ``0   P 0@ p PP P0   ` ` pP@` p!P pPPڠP@$p(@`@@ ` P  P 0    p p @!`@ЦP !$`0 @0`)+`@@p` @p@ @ @ P@ p@P p`0@ P `p  P ` @ذ٠ PP0  @ ` p @  P 0 @ P`p 0  PpP@@@ @ ` PΠːـ PP`` p @  PP `00 0@  P`PP 0`p @PpP @P@PpP P @P0P@PP@0@0` ` @  @`P00  p @P`0Pp p@ p p@ p`PP@@ P@0P@0@` @P` P00`P`` 0P 0``0@0PPPP`PP0`P  P@ 0@0 @`p`p@  0@0`0`0 P@@@@0`pP0P@`0P`p`@P`PPPP``p`@  00 0P0ppp@PPPP PPppppppppp`pppppp0ppp`pppp` @@ p`P`0pp @ p`0pP @@pPp00`P@`p``PP@PP@``P `p @@p0` PP PP`0p``@0 P@Pp``P@``p`P``p`p`p `P`ppp` Pp p0`P@`@P0 0p P0``PP0p`p ` p0pPpPPP P`PPPpp  PP0`@@00@`pp` p``pP P`@p p `PP0`0P pP  P PPPpPP`` ` p@Pp@ pPp00ppPp`@@`pPP@`@p`PPppp```P`` P@```pppp`ppPp@``0@   `0 0p0 `@P `PPp`p``P`p`pPpp@ppp0PpppPppppppPpp`ppppPPPppppppp`pp`pppppp`ppp@Ppppp`pp`pppP@pp```ppp@PPppppp0@p@ `P  0 @@`Pp PP@ 0@0pp`pPPP` P` P`pP`@PPpPP`ppppp`ppppppp`PPPppppp`@p``@0`0Ppp pP`pp`ppP`pP@@`@pP@PPPPppppp`P`PpPP`ppp`@@``pp@P@P`pp p00`p@``@ @pp@ P P0`pp`p P P P @ P @@P@ P P @  `@pP٠p@` P P Pp 0P @P  @ `0 0 @ @ݐP  @ pp `PPp@` ` p0PP @P'/ ڰސɐp ` @Pp0 PPP 0` 0$-) p0ހˠ@@00P`0P@`PPp`@@ P $*&PPPpҐԐٰP0P@0P`P  P  `P0  @#$P `PP0ՀڐPp0  ``@  p @   ``pްp@@0  @p@ P Ppp  @ P@`` @@0@0p`p `0@P   0 P0P `@P0PPPP0 PpP ppP PPpP@p`PP0P@`p  P000P0 0   ` P`0 PP P 0@PP p`0`P@PP0@Pp0 0` P0@ `@ @P Pp pP00p P0 0`@P`PP`   0P@P@0 ``0P` @ppP@p@P`PP`P@P P` 0p0`P@ 0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ppp @````pppp`pp`p`ppppp`p``P @@P  pP@P `@@P`@ @` PPPPPPp@pP`PP0P` p P  00P`p@ ` `  p " @P`@`@ P ` ` @ 0 p@  @@@% ``0`P `0 @ 0 0 0 pP p@p*Pא А؀@` @PP pPP0 ``P@P0 `P`'P`ՠpܰ` P@0@ `  ` P `@` PP % P00``߀` `P P` pP@pP  @P`@0` 0` PP"  @@ @`pP`@P`P  @ @ 0 P@0  @P$@@P@  @``PP@ @P 0`P` P 0 p @ P $P` 0Ԁ``  P` 000@ P p  p  P Pp 0 @ppP@@PP` p0P@ P`0 P0` P `0 PPP@@@Pp`@ P0P `@0Pp   0Pp@PP@0PPPPppP ``@0PpP`P `0@ @ ` ` @ ```p00PpPPP `PP0@0PPppp`ppppppppPPppp``p``pppppppp`pppp`Ppp`PpPpPpppppP0`` @`Ppp`@PP`@ @P0P`PP@p 0`PPP@@0pP`P`PP@`0p@p `Pp 00PP@0 P` P@ `0PP`PPP@`0  @@PPP  @P `00PP`0P@ @Pp0` P`pp@@`0P 0` PP`P`@ PP000p` ``PpP0p`@P0PPP` @ Pp0``P`0` P@P@ @pp p@``0PP``PPp    p0P @P` 0 PP  `0PPPpPppPp0` 0` `0PPp @0`   PPPp`@`P`P@PP@0P`@`P@@@`p0@`@`0 ``0 P@pP`pP@` PPPP ` P@0@`  `PPP@ @P `P` @  `P0P p`0p`p`P@`0p0p@pP@p0P@PP@pp P P` `p@0P@ ` P@0@`0`pPPpPP@ pP``pp`p0p@p`PP0 p ` @@ @ 0`0@ @ p P p .0`P @ P 0@P@P@@0 P0@ P)60>`@0`p (*p 0`pp0p0pP@p"/`:Jp4P@p`@$5P8&0p݀ˠP@ݠ`!!0P  P @ @"P&.`Ep;0 0&13 @`ҠǐȰ0 @ p"`0 0`  P @5M0ـ ͐0Pp `&P.#0ՠРPpP$0# 0PPp `,R4ݠ`Ƞp@@ @P $+%@Pp`,-#`@ @ @ ` 0  P P  0  P2TCP0p  &! "& ,P"ppp8 :p)0@0 P P 0` 0 p0`"`8NHP0@1.%*(Š@@0P#? A,ߠ@ &*! `pP0=K0Pп0P"p90($  @@3@;!@ʐ ŀ`/p2+PP@ `P'2`>DP  :<@+@"PP@pؠ@ .@;p$ pаPŐ0&/0p(0p`Р̐΀`!`20PPP@``@  '`3PT0&ِڠ@9J/0PP@ ݠ'p,*0%` Րǰ@`  *0!@@ppP P 0p(@;U 0ЮpCK, p @`@@,1P,  0P$% @`  @ pP'@CZ`pD`O0@pĀ6;-P˰P !` P   @` @ `+CP_"pP` 9Qp@@P4=p. 0``ǐ`*P5p0 PЀ !PpP0P @ 0 0@  P*W6PP p'#*p$p@ p(' PP`@'P*PP PPpp  `0  *PT3ﰬ`ʐP/$P`P@怳p@67@"0 `p%5`, `  P  @ P`  p P5EڀP1+P  P`7;P& `P ..P`P  @ `p P 0 0P`0p4@* @`p + ) 0 .6'@p ` 00"``P `  @  0@P (!ހ@`P(*P00@ڐP@($@P`P0@P @0 @  p p P0߰Ҡ  ``p@` @ P   `@`  PP  0` Pp0`"``P@p 0 PpP0P`p` P@ P@@` pp @` ` `0  ր`P0pPp 0  P0 P P P` 0 ` P`` p @P@P 0 @ ذ00P 0PP0P @ PP@p `0` 0@p @``@ppP`00PPPP p` P@ 0@ p0`` pPP p@PP`@`PPp``@`` `p@````Pp0 pP@0P` p@PP0 ` P0`@p` P pp ``P@p00 0 @@@``pp @ `P  ` `PpPp0`@P  @`@@P@0` `@ PppPP0P0@PP` pPp`@0@```p@0@@0 P ``p ` `0``PP@pPP@@Ppp@0P@p p`0P@0 `@0@p @ P pp0`pp ppppP` pP0P`pp``` p`PP`P00pP   0P `@pP`0@pp 0P @`pP`pPPP@P`pP``0@ p  `P``P pPpPp p pp@p PPPP PpP`pPpp`@pp``p PpPp@  `p00`p`0 @pp@```p` pPPPP 0``@P0`0PP0@ @P@`P `@0PppP@ p`p`@ @0 @@P `@ Pp`ppP`P`p@p @`` p`p``@P`p`pPP`pp pp0`p`pppP`Ppppppp`pppppppppppp`ppppp`ppp`pp`pp`ppppppppp`P`P`p`pppp0p@ppp`P`p` P p@P0`0`Pp`@`P0` p`00@ P `0pPppPp  `0@`p`ppp@@P ppP 0pp 0@P0P@p P P @ P  P ` @ P    `00pP00@ `  P  `0p 0 `P٠pPp  0`@ `` P` 0`P@ ` pP ` #0'pנӐpP`@P  ` 0`0P `p  P.1P00`PPp`P@P @&@P 0P``P` `5.@0ppٰ̠ Pp ڐ  %PPPP@ 0 0 @p` `P@`:P1"@ @0ϐPƠ`ڰp`p'@#P0Ppp P P p  0 `1p@P@Pවݰ ɀܠ` 0 $@!@P`P Pp p`   @ P@p '` p<0p`ȠP܀Pߐ`P PP P @PPP  P   - @3 ` ` Ͱ ՐހP@ `PP p0@P@0P PP@p P$`pppٰ АP`  @  p@0` P P@@p p   @P`pP`P@PPpP@@ P  P`@PP``0 0`PPp@p PPP@P`P0PpPPpP PP`P00    @`P0  @P0P``` `ppp`0@P`ppppp`0P @PP@0p0P00p0@`@P0`P0Pp  p@P`p`ppppppppppppp`ppppppPpP`@` 0@PPPPp@PPP0p`PpP ``p@ 0@ 0 P P@  `@ @0p `@` ``P``PPPP@ 0 PP 0@PP p P`@PP`pPPPp @0`PPPp`@pPPPPP@P`P@ P`0p@@P@@ P pp0` 0Pp P`p `@0P`@@ p`0 ` @ PP@0``P0`` p Pp@P@  `p `@ P00pP@p ` P p ` @0 @@ `߀ܰ߰  ` ``  p@@P `P P12P( P` @@`` 00 `!``p p 0P@ P`PBJP= @pP'PP``Pڠ` @0 @0@0  ``=JFP / :P&  Pp`  `0@  P!@ ` p  `P - KG6P(C>PpӐP P`0 "0p pP0 @ p0!LKp:жp/TM 0 PP @ P`&P(`pp@'' P`0@000J`J0 P`p`[YpE0p`ǠPP 0 ހPԐ ))p@ `` $!p  P Jg@S5@̀`PddK0` `׀` 'P@ p P` P+hgJUuPZ.p@ `@#@@`$"P 0@ p` @ p 0 &PNi`V3p@Ԑ60nd0?簨@`$Ґ``" @`P0    @ !*@hmpLО``xQ$ Pא0p!+`#` P " 0 @0p ` P $*DmpY.Ϡp` 2pm^-령 .p(@ p@ pP p $.Im0Y&ЗP@0iQ"0p` 0ѐ +@40#pР @PP0 @p@`@$-dgA PP pV^4000 31Ppր̠ 000@@ P  P0!8epY`'@p%`G?`P`ɠ pp'`)0߰@ @ @pP p  &TePG PP@Ȱ*7-Pܰྰ܀!  0` @ 0 @  FUA `@πp`PԠ 0   pP` `0 P p7D8 P0@0ߠ0P pP   p p @@00 0@ `pp``000@`@`PP P @@PpP`p@ @ 0 ppp`pppp0@@ P`P`pPpp`ppp`ppp`0`    0p`Pp`@ pP PPP PPPp`P@P@0``ppP@`P0PP0`ppppp```ppp``p@pp`ppp`pp`ppppppPp P0PP0P PP@ppp` P`P pP`@0``p0` @@0p0P@`P@p` p``p Pp0@@@  ` P0@P0`@000PPې` Pp@@` pP  P`    @ p !@@p 0Pp @(& +P 0`@۰Pƀ  86& ``PրݰP@P@ `  p p`@ P@P!$B à@`  @`Pܐ`P10# p`pPP'05, @pp0  *`,pPpP P` @ 0pE ΰи P#pP @ @$:01Ґڐ@ 0$7/@@ @#0&0@0"P` p  @ @"`= `PƐѐ  P p@ &+0% p@@ %`PPp%`PP pp@p PpP0@ @ D0@PPཀ ` 0`@ (p)P PP ߰P `P` p0   p`@ ` 000   I`ΐʀ`PP P0@@ڐ@0-P)`@` `` @@ P p P` `  0 0 0PC `P ڠp`ܠPƀP+ p PpP0 `P P  @P   ` P  `p P ` 5@<0ːٰʀ! PPP@` @&`&P ` PPP  p   0 p ` ppP ` PI`@`ĀА` Ȑ 0 P `&P `P PP ` p @ `@   p  P P PP0 D#`ڀ͠P !@`P@p@ 0 `@  ` PP`p @ `  @   @ @  A0Ӑ@۰`@P@ ppP pP   @  ` ` P PD&p`ϰրѐ 0Pܐ`0#@ P P` PPp  PP@ @@`P@ p 0 p ` P @5E P``pװ͠@*@` p@ p0P0@ @ ``P p P  00  ` p P   p)>٠pP`АpP@('P P` P` p pPp `0  @  @ @ p  0 30 0P@ܠP`$0@0P  P` p@ P pPP@ p`p   p&@ހ`ܐ0P PPpP0   0@PpP`@pP@ `  `  P0` P`߀ 0@0 @ p @@ PPP@   @``0 P@@ pPp߰`ې@ 0PP @ PP@P @P P P ` @@ ` 0  @ `PP``p` 0  ``0@ ppP @ `  @@ Pp `ِP@Pp   `  ` 0p@P` 00 Pp @P @ P@ 0ܰ P@p0@ P @pP`  ` @P00P @@` PPP` P p `P `@ ܰހp0P ` p  PPP  PP`P0@0 P P P P@ `PP P p `0@0@P@ @ ` p`` p  @0PPPݐ p`0 @ 0 p` 0 @0 `@0` P p0 @` ``P 0@PP`P p p   0 Ppp@ @`@ 0P00P`0 `  p pP0  @0`0P PP0@P0P` @ @ p p  pp@@`@P0 @pPp p ` 0p`P p P@P` 0` `@P @P`@@ P P  P `PP0@` p p ` @@  P@p@p@P0P P P  @0pp@P @ P p P P00 `@   p @PP@Pp@@0 @P0P@@0`@`PPP@PpPPpPP0``0 @PP`P p`@PPP0 `` PP`p0`@` @`p@PP@ 0pPp0` PP`@Pp`@P P @``0 @PpP @@ `0  P P` @ `   ``@ P@P  pp0@@P0P p 0@p`P0``P0P  `` P@ @P`P P``p@0`PP0Pp`P@ ` @0Pp0`PPP  `# -@P`P "`pސ PP@@` `00  p` p0P`PPp`@ P@'P=`pP°p0/$0`0PڐP )P$0ޠpP @0P  P`  0p ` p`P@ @N P3P7@@P` /p5Pp P%'@`   Ppp PP P00P PPP% 7MPЪ@0AP-pP@̠Pp`61 0Pp@)& 0PΠ  @`@ PP  p 0  (00R0P@ڀ 8>`ȠȐ0 @-`;`" ޠ)$#```@` 'P`P#0 P@P@ )M@%PЬ``0*>p@P050)` P` `!,'`` P+!0 @`!)0 @ @ p` 0`=0Sp`Πɰp<>00@.@"0`@0Ѡ@0 22@ٰP, % `("pp@0 @ 0P P-0J ΐ ̀%@/ @ܐ #P &` @ `@ P P@ )V#ޠŀ`Ԡ + P*"p0@   P P Pp `` 0  p @`  P P5@: P`P` @@PpP߰P 0`@`P  P 0   ``@P`@PP0 p0p P0`P0`@` p0P@p    @0P  ` `P 0p @`@ 0p@`@0@p@pP0``PPp@`@0p`````pPp P``PPPP0 pPp``@`PP`p ppPppppppp 0p0 p0p @@  pP` @`Pp`P`@0 p`@`p@p    @@ P`  0P0`@   `@@``PPPP`PP`P p@0P`0@ P`0 @P`PPP@   p`P @0`p@P PPPp p 0@P`p@P`Pp`P@P`@@`@pPpPpP` ` P@P0 p 0  p@0p P`pP PP0`P0 PP`P@@ P`@@P  p P @0@0`pP p@`@``@0`` `  P ` P@ @ Pp `PPPאP@  ` @ P0P 0`P00@ P P 0@` @հ P P P`0P`@p0P @ @0 %@  p`@ƀհp`P``` P@PPP`P@0 P !4 pېؐذϐ @p P#%#@0ېp@  @"P"P%p! P  @(@E?P  P ``P 0PP+-," `Арװސ`PP#@&'p)%@p@ #( 1OWP3@݀ ːӀِp#21p*PPр`0`0%P&'0%``P` @"*P0 20`?P6PТҀ@0)0*P@P߀@ذӀְ `pp@`p`%') *`()@>< ! @@̠" p 0`p @` @ @@ P``  !`%0%!P0: )PP` PpP@P#`0 `P@0  P  @p`  @@@ 0$$ p@7@>0P0ppP#)#@ @ܠ     PpP`P P2? 3 PP  `  @`ՐP@0 `0  @p@PP 90AP3РPP`  00P` @ 00@  p PP0`9`H<$@PPP P @ `@ `` P@PP`P` `>pNA$@PаP P  `Ppɀ @ P P0 PP `@P` DP=p`@0  0PÐp@P  Pp`p@ @ ` pP"pGP;`ޠP pPpPр ÀP  `0PpP  P1OH*Ш P   P 0ŀ`0 P P  `pPP ` 0 p@2 VN(뀶Вޠ @PP@P @ Π @ @`  P0 P @ P PppP!P_0B@К`()0ɐ0P`0PPP 0 0  P  ` P `'JX?0 0߰0),`@@&P!`` P@ p`@0` @```5YS ̰0`!p/`"`` 0P () 000P0p@ ``PP0$`GU< Э``PP$P`P!"0` `p0Pp0P P5PE` 0@p0`P p@@ٰPPP Pp`PP @  0 `P?O0@` !  @P`pp  Pp P pP`0pP` @ @  @> Ā`@@ pp @@p @     p ` .P`Ȁ0` p@P`p@0P0@@@ P P   ` @  0 0P` P0߰`@@0p`p`00 pP ` 0 @ P 0 0P@ p P@ `P@PP P0PPP P@`0 p `P0 ` ` p P p 0  PP  P `P`P0P@` @P@`p@0@`@P   @  P @ P  P @ pP@`00p @0@ 0 P 0   P @ @ PP p Pp @0  @p`0P`pP@ ``P`P@ 0P`P p` P 0 @ `p   `0`Pp @PPp@`p`@@@` P`@p`p p 0`     P @P`P0@` `@@P@`@@p@P@P P   ` `P 0@`PP`` p@ 00@ 0p  p@ ` p  @p  `@P00@00 0P @ @PppPp `@ p  P p p@  ` P @ ` 00@P`@P@ 0pp@P`p```  @ @ `` P  @0P@ ̀0 ߰@@0P@ @P`  P P `@ `@pP p` @` ;P1@  Pp  p0`@ 0 @00 p`p 0 ` @p@ BV@P@ Pܠ  P@@ P  @0Pp` 0` P0 @ p  RPNPp6P+``PP @607 @ p$(@`pP`0 0 `    ` $A8@!P>`,Ppޠ 0;P>0"'PPݐP0 PP@@P& PP@00 p @ Pp` 6P0PP؀ ?.P0P`2>$0 PPpp@0 ```P !@$p  P@P@ `P@.;` Ơ 98ppPP`@006 00Ӱ׀@p`@`p p `0P@ @ PP` `0  0 !@;0@'6!p` ڐ ڐ׀#/p! ` 0 P @ P00p   P   `p @ P0`- Ь0P!2 ހ# ! PPPPP0``@P `p PpP   P  @ `'@+נ@/0`P  #` PP Pp 0 @pp@P@  0P0 @ `  p P0 !(@ ‱ -#pπ`  P PP `   p@0 00p @ @ 0 @ P0  0`Pp&0pଐ p ,`p`P` 0 `@ ` P pP0 p` p`@ P P  0 p `p   €Ð @P @   p ` `0``P ` p ` `0@ p0`0Pp@@p p0Ӏ@P P0ݠP@ @ @` p @ 0P @0    ` 0 `P P P  ʰ P` p0P`` @ PPP   `0` 0@P`@@@p``00P 0Ґ P0@0p   00 @` 0p  000`p`@@ P@  `ߐݠP` @ `0P pPP@0 p`PP@P```p `P 0 p@@P`p@`p@p0 ppp@ `@@0 ```P@ 0@P`P000 P `@`@@0PPP0P`p`0pPpP` PP0pP PP@0P`p0 P0@@ ``0 `P00 `` 0``P@@P`P pPpP P`P`0@0 `0 @ `P`p PpP`P 0p`P0`P  P p P`pP`0P @P@` PPPpPp``  p@  PP 0`  `@ `PpP`pP@0 0`0`@ P @p@00@P@@   @0p `  PPpP0 @P@ P  P@ `0 ppP@0`0 p@p P`  P0 ppP` `@ ` `Pp` ``0  PPp PpP@ @`P`p0P@P0 ` P 0  @P0@`p  P`pP@@P ``P@`p P@0 ` @0@0 P `P P@PP @@ p`@P@PP  p 0`@ @pPP ` ` P @0P p@`00 0@pP @``P0 PPP @P@@P@p ` ` @0`0 P`P@p  @P@ @P ` `` `PP PP    0P`   0` 0    `0 P` 0 P@ P ` P P  P0 P P` @0@P@`0  `@P@p@ P   `P`0`  @Pp p P@P@Pp` PPPPp@@`p @@P@Pp`p 0PPP`  @@ pP 0@ `0P p P P0 P@P 0`P pP @``0` p@@p ` ` @0@ @@ @ ppp`P p @P` P0  0pPP  @ @p `@0 P 0 @ p0`0@0 P@ @` @0PP PPP@ P @ p @`@pP0PP `` p PPPPP 0 P @ `p0p0 @`` P`p@ 0 @  P@ P P`p0P@00@@``PPpP` @ 0@0 @00 @0p 0@ `P0P0@ 0  @P` `P0P @p`P p `00```@ p@` @` p`` `P @P@@ `@ @@@`pP0`0 P  `@PPP @p@`PpPP@P 0p@ P @ P PP`p P0 `  ` @PP@`0P `0`` ` 0` PP0p@p0P@P0@` PP  P0P`P@`` P0@ ``Pp@p`` P@p 00@PP0@P`p@@000P@@`0@`` pPpP@0 @ @`P0 P`000pP@`P `p @PP````@ Pppp Pp0`ppp`p`p@0 ppppppppppp`ppppppp`ppppppppppppppppppp`pp`pp``pppppppppp`ppppppppppp`p`p`pp`ppp@pp`ppppppppppppppPP0P``P`PpppPPpp``Ppp`pP0@Pp `p``ppp`p`Ppppppppp@P`@`@`ppp`ppp`ppPp`P```P`@0@pp`Pppppp`pppp`P`Pp`@pppp@`p0Pppppppp``pppp`pp `Pp00PpP` @0 P0pp@p@ pP`p P0 0p@P@@Pp0 P0`p``@@pP`P`pPP PP  p0PpP@P@P0 P`0Pp@pPpPP@``00pp`PP @`0p`P`@P   PPp`p0@pPpP0`0p  p`pPp0     PPP` P`pP`PPpP` `p@`P@P @` @0  pP 0ݐp@`P 0 P@@P` P p @PPP pP` 3 6p PPpP0 @Ӏ` `"P  @ P `p P :PB`&`0p͐PÐ͐Ӑ@&0%` P@`@P @   p@ &@E:'P`@`Pנ0 0p`*&PP @ 0@0pp@ `0@@  @  $;@@`@Pп̀`! & @ ppPP @0PP 0@0P 0P`%@`*`ˠ0Р@@p @p p@   @028@`p `@  00@p`P@P P0  `` 0  @  `.8 `p@@ ``00`@P P P 0  p  PP0p >`P  ϐŐP@  pP  0 P0pp0P0 P  P `p P `2"@ @ @0P0ݠ @  @0@ PP `  `  P ) ` @pΠ0@p`0@P @  pPPpP PP @ pp  P`( @@ ׀0 `P @ ` @ Pp0P`0 @ 0 `  ` `P P@  P P`0 p   PP 0 @ P `  0` @ @P  `  0 א @p @ PP0p00` `  @P pp 00@ p 0@` `P`p`pP p  P  ` pP@0P@P0 0P0P ` PpP`@P@  00p  `P    @0 PP0@``0` PP@P PP@``   0`  @P`  ``   P0  `P`  P0 @`@pp@` P` PP0PpP `@@P 0 ` @`pp`0P@`P``0@pp@  0`P``` `P` P`pP @p`@@P  P p@ `pPP@PP0P `0 @Ppp P`@p@@`Pp`p`0@pp@@0@`@pPp@@@@ pp0p`ppP` ``P@` `PPpp0@@@ @ pP pPP``00`pp  p@  p@ 0 pP @@`ppP `` p P Pp `p @@p`@`p P0 ``  @`P`@@ppp0P @  `  @  & 2P"`$0`ـpۀ P@(p @ ``   PP*\k)-0ЭPг @HO1*p@ PP` A@C3 %0%00@`,75P1.`& CNP'p 0p鰟`Pɐ+*2 .p1`"`p؀PPƠ@p%C8Pp! Pѐ߰P@ !*p5- @ pP^h`2 `PМ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  0P `"P @P@P   0   P `  `!60O3𧐵   p`ܐ0 Pp `` 0p @ @ 0  $>PSp @``P`p ` PP @PpP@ Pp0 `@ ` Pp@*@@L0 @0`000  ``P P`00`0 p ``0@  P@`P/POO P`P"0ΰ`PP @P@@  P P  @&P;W 1pԐ`@` @ @```PP `0` P 0@ @ p P 0 P 0 $APMPPమp0P`pߐpP `P @P@P`P  P PP ,EK0 `ЦP`P p! ͰԐP p @ P@pPp pp P0`  0  (NPR ׀P@`0 %p0ڐѐ` p0`P 0pP  P@@ P @ `P 3`^p6P@p@@`@`&$p @@ `` PPP `Pp @ `  `@#0CW `@ #' `ߐ@Pp `PP `` `  0 P  @  @ ?V  `PP&`# ppܐ@` P 0PP0 P P`00   `   @%-̐`p@` P`0p P` P`0P0 p` ` 0 00p` ```P 0``` 0p``PPp `  0@ @   @&5P@ـPP pP0 pP  pP`PP PP@p0 0 p@0  p P` @p 02`5 `Ɛΐ   `@@ p P @ ` P  @p0p` P p P 6GP@0` p` PP@נِ` 0P`p `@0   p@   5@p PPـP@   0 0  `P` @  ` `` @p p6U 0π`@!`@0րP``0 `p `@  PPP `  `0 @'PAP30PP @`  `P @P00p0 p P@ p 0 0PppP p   0 6NѠp P @@pPp@00 ` `  @@  3/@ 0нP ``  P@pP@P pP P  p P P@`   p&p `΀ppP00Pp P@P 00 @ @ @  P@p @ p 0P``@P P 0@@@ p`@@ @`pp@P0P`@ @ `@` PPPp0P p``0p0` P`pPpp`P@ 0 ` Pp`0``ppPpppPP`Pp``pp0`@PPpp`P@p0 P`PpP0p``@ ``PP0@p0  P@ `@PpP0`P`PPP`0`p`PPPP@P@P`@p` `p`p@PPp0P P`p00@Ppp`P```P Pp0`p` pP P 0@P @PP` `P`0pPP@0` 0`p @`0pP0`P@p@`@` P@P Pp` 0`P `pP0p `000Pp ` p`@ pP@ @P0p`PPPp@@@P0PP 0`P0Pp `p0`p0@`p`P`PP0 ` `pP`PPp@``P`PPP` P``p 0@P @P PP00 P@ @ `` 0@```p0`@`@P`P@`P`P  ppPP@Pp@@ @pP0`@`@ `ppPP0``P`0@`p`@`@@`@P``` p  P`  `@00@P ̠א p @ `p@P`@ P0P`0@ p  p @ 0   @,@P0еPp@ `$51& `p``P p %*'pPp00  @@ 0 P" ,P>PJ(P`ԀpӰހ$ 3Pp@P@ +@5P4P) `@P0p"'' " p 0`P /m\Pϐ〻p@` "22@@0 pPՀ0P P#!!` PP` (.+P`P p'Nf0`pнpୀ,TF`* PÐP #`5p?7`"P0؀@@`' ' P@@P` #`''0pdpt9 PP0SfF P`p`5P70 @0 PPpΠ@`P p#P`P!$ 3m^З0PPJJ`100@pې@p"45" PPp @P``P P p 0`00  Zh<0PпPp(;3p0pʐ@P"@.% 0`@P @`P p @"KZ:p@p PPP$` 0   0p `PPPP p@0 ` Pp @0@"*`=J07`@@ـ  @Ѡ`0  pP0    p  p` @ p!8P>"琯ɐ p 0` ڠ `@ 0` @ P@ @0@ 0 @ @ @P 0@ P p"@A@>@АP` @ ` 0נP @ Pp  `0P 0`p0@P0 ` @ @P  @>@B۠Щ  p P0֠܀ ```@  ``@``  `p@P `  ` PP `7AP p P0`P PP P0 p0PP@` @PP 0  @@0 p;PDP P00 `ۀܐP0 0P@@0` p@ 0Pp P   @ @@&>: `к@@ P@  p @@`@P0p0p````P  0P @@ `  `@ PPP!0PиΠ0PPp@@P  0@P`0@@ 0@@ p @ ``Ppp P ```P`P@@@@ p p0@ @ pP` p0Pp p p ` `p0ސ@`  P@  P `p0`0PPp0p `` `   `00`0p`@``Pp 0`P0PP@@Pp`@0PPPpP@` 0PPP0 @0 @` #@pPp 0` P@P`0`P0 P@P@`0 @0p@P0 PP pP`Pp P@pp` pP @p @P ` P pP@p p`PPP0`@`pPP@p`PPPP@0p P` 0P@`0pPP P0ppp@P0pPp`@ p```0 ` P0P``0Pp0``p``p PpPpp `pppp```pp`pPpp p `pp`` `PPP `p0P P@` 0 p p0p`@P @Ppppp```ppp`p`ppppp`pppPp`pppP` PP`P@00``0PpP`p @@@@@P@`0 pp `@` PP0PP `P0@0`p@p@```P @p0@@ 00P@ `@0@Pp0@000 PP`@PP 00P@ 0 @ `0@ 00 @` @p@@pP@ PPPP@PP   0@0P`PP``P@@00 @pP @`@`pP@`PPPPpp0P0Pp P@ 0@P0P` `PPP`P pPP`0p@P 00000@0PP@@@`P0`@`P`0@pPp0` pP 0`@PPP0p`P@@ 0 p`ppp`pppPp`ppppppppppppppppp0@``ppp`ppppppp``pppppppp`ppppppppppppppp`pppp``pppp`ppppp`ppp`pppppp`p`pppp`p`pp`ppp`ppp`ppppp`ppPp``p``pp`ppppPppp`pp``pp`pppppppp`pp``Pppppp0P`pP`0`0Pppp`p@ P`pp@p`ppP 0`@ 0`pPPPp@pp0Pp``@`P   p pp0@@ @PppP @`P P` 0 0`p @0   @@ `P  P  @p` ` @0` ` P0@@P```p@0@@  p 00 0p  P0`P@`P   `   0``p P@P 0``Pp  P  PP 0` P@@`p ` ` P0P` P`@ P p p  pP  P0@P ` p @ @  @PP``@ P@0p p 0`@ P@ `0  `  PpPP0P0@ @  p@pP P 0``p@``PP P 0 P`Pp0P@Pp P   `PP pP `ڀ 0`0P` P pp`0`P` @p P P 0`P`@ ` 0P`ڰ P  0 p P @ 0P`P`0 P P@ PP pՐ P  `  @@Pp`@`@ ` @`@@P0  ppڠ` p`0  P @@@@ @ ` P P P@ @  PpԀްP   `P`P@  @ Pp P0ްP0@0@@P@` 00 p@ 0  Pp  `@` P(+-@+$`@@ 00ߐ`0 0 @P0 0 0@ @`P pP PP &+P,*p$P`нP@p$P p@p0!p!`P`   P  @ Pp#p',P/+ p &0װА0 %"@P Pp  0`P@Pp 0@`@ !P'201`$  !P 0Ӡ̐P&` @@ PP`P p p 0p  $-8@7"p@`P 0$@'P `@PŰ֐,*@Pp`0`" 0ӐްP P  P!"`"1=P=瀳ЗPP@ P0 p@ Š`('@P ` 'p0 @PP@"0'2= #@ǐp  PސP0+0$ P@%`+P`  @ p ` +=7PP0P pP PP#pP`00PP#!P  ` P P""`'7pF@& Pڐp @pл``P 00ؐ@ !` ۀP0@ `@@pp`p#%<@ @@PPP "P"p PĐ`  @Pހ`p ` pPP PP @`4TW0@@"=2 `@Pp/0p P+`1(٠Ӡ@@p & p `0pP@&P## )D`Y`*ٰ0PP#<.ppҐрP.* 0p0 @0#p P@٠P 0 ` P *p,`(1PUPP͠Ӑ@# P0`@̰ܰ `` @P0p @ @0P@P  P P @0``P**`;/0P0@ P P0 P @Pp``0  P PpP` '+,`> @@`@``pp    p@ p  P` &(-=@@ @PP@ 00P  0 @  PP @P0   pP@`&,'p<@0мΐ Pp  `p0p P @00P 0 p@` "+#`5 5`0PPP ` P`@ `0PP@p P P 0 @ ``,),0> P00@@  P` 0 @ P p `@  P-)P)`9А`@ 0@0@p  Pp ``P@ P `PP " #),P ߀̠ːƐРPppPp 0P0P@ P p PP P`P @p0  pߠڀ P@ p Pp@P @pP`0` p @P @%  p ؠ@ 0`0P ` P `@ PPpP0 PP p0 @PP۠@   P P P  PPp@0Ppp`Pp ` `  0p`@0@` ڠ0ڰ `P P@pP 0  PP@p P۰۠۠@ P 0 0  0`` P@@` ` `  `  0 @ @ @ 0  P@P P pPP0  0 PP@ @P@  0 @ PP@@0@ p ` p0@ @`P0  `P@0PP `@P`Pp0@p`@P` @p p  PP0 pP`0@@P  p  `   Pp p`P@pp `@0P@p00@ P `p0 P`0Pp0@ P@pP`@p@PP``@@@`PP`PP@@ p@`@P @P@``@000 `@  @0PP0PPPpPP@  @` P`` p @p `Pp0@P`0P@@@ pP 00pP`@p @` @p`pppPp``0P@0P`P0p`P ` @`@0` `0`P@0@ 0`` `@ 00P `P `ppp`00@0`p@p`@   ``P@`0`Pp0@`00 `p0P@pPP P@p@ `P``  `0`p @ pP@``0P@@@`P`pP@ p`@  @P0pP @@pp0P@ @Pp@`@@`p @pp`pP0  `0pP`PppPp` @p p pP`0p`Pp0pP `p@ @PP0P`P0@` PpPP`P``PP``P0`Pp`P@ `@ 0PPP0P ` @p`@PPP@ `0 P`@@@pp@P PP@@` 0P p@@0P@P`PP```00`P0`P`PP0  ` P0P0`@0`0` @@@p P0` `0P `@`@@0PPP@@p`P` p@ 0pP@00@p@@@P`PP  pp @P`pp@PP0p@0@`p P`@``@P pP @P  PP P`P0 PppP`P@P0`00 PP p   @`P0pPP``P P `@P`@p p ppP 00 P@0@"0PPΰʀ@p   P0`PP0 P 0 ` P ` P$+'  ܐѠɀ@ @ p@@@@ `"p @pPppP0 @ @0 p#304`($PPP0pPP@"P0p0ذ۰PpP%P&(  pP̐`P0 P `3=`7.)pP@@0 "') pP00 `&)P*-P$PېǠ `"" @0 0  p P.`A0CP;09 P@ৠ0@@+66@*P0`PˠʀP p+1-)&#@PPP,p0*`P 0P `*(P@`Pݠ P5p6P$` P@ ',$ 0`@@$L @Pp `Pp) ?1pàװ@0#;P:`@@P@PP87- Pp΀Ϡ,8/P`"p&`%  @@  EDߐp P9F``̀03C4 `PpP`29P<P̐ɰ% 96% P'p)`0`P pp,Uِ  +B.pܐP`P @$@=9P ̐@P @43'P @`ɐ`P-1p)`P!$@ PM"` @``@:1P`€ؠp36, ʰ`؀`  +/-ǀ0)0+'0p0 0#`P p @0 #`JPP` 0P@`+7)P␹๠Ȱ݀Pp"00P4'@`P` %,) @` `$  PP0 @E+ ␗`@P04.0)p```$P1p7 !`Р 0)'P٠@@ PP PP  ` ;`!P P  P-`*%Ԡ`π0P.3@$00"0p @ @ 0p @0 p@ P7`PP@P&@*0P P/P3`@@P  @@ p @P 0 p ) 0 Pp`"'0 װ0(p+0@``p@@p@0PP` `@P  " İՠ !p@ `@@ @ @@ 0@`    P0@ @p` 0 pP@`00pP0 `@   p`@@p Pנݐ݀߀pp  @P@ P@@pp   0   P  Pp pP P0@0@P`P  `0P@  P@p0P PP0 pP @`P P PP`0@@p`` ` @ 0P` p0`0` `  pPP@p@@P@0`  P P    Pp ܐ`  P ` @ `@P P@ p`p00 `@P@  ! 0Pp`ܐ 0@P0@@`&P @߀`p   p` 0p%@` АͰ`@P @`  @` P  P   pp@%p@ҐՀ ϐp `p pP0p0 0@ p@0P`  P  Pp p@@ @PP` ` p @pP` `p`P`Pܠ`PP0 @`@`p`@@@PP P P @  ``p @P А ِϐ @PP 0 PPp  @PP0PpPp p  P  PP P P@PPP@  @0` @@`p@`P @@ `pP @p 0PP  @p@0 аp ҠڠP PP `P PPp   @ P@@ P P  @PPѐ ؠ @`0  `P@@  `PP ``p 0p`0` P P P0@0@   0@` p000P@`@  0@ P P 0 PPp@Pp @PP 0`@PP` pP@p@P  `P P`p` p 0 p @`0@`0P@ @0 0p@0Pp P`pPpp p ` 0 P ֠@@@p@Pp0 0@  @@ P 0 `0P Pp0@ P P P `  P Pא@   0`@ @  @p0` @  `P   ` 0`Pp 0P p` p  Ppp 0   P  @ 0ڠ PP` @P@@p @ P P p ` p 0 ` 0@ @@ ߀ @@ 0Pp0@P ` ` @P  P  0 @  P @@ P  Ԁp`pP  P@0`P0P p @ 0`0`@ ` pp0@ P p P@0PҠ۰@0PPp`0  p p@ pP 0 P0 @  @` @Ͱ P0@P@PP @ P pP p  `p p pP0 `PP ̀`PPP@@P@   pP@ P  p0 `ݰݰ`p#P ` P0P 0 p  @@&`Ԡ@PP0&*P$0P@0p!"!  P0 !  `0 @pP  `p P #p`̀ԠP00) *@  0 P`   P P  P`` "" pж0`@0P  P @Pp@ p%`%p @ !)`' 0@!'$   (@( P@"$0װPp )1 .` ۠ۀ" 21'ð@@,>=p3 ڠ$)(P@`p @@=P- ``P$DH/ P@pP>L@`рϠ 14,Pˀ@p" P@ P@p &&>0!0@ PP$CP?$Ҁ˰)0>pB(0ɀPp '%@ 0 ܐ ` P `@ P@ @0/8`` 0A@ZEp@@0P"`;D@5` ېP̠@`&.P,P! PנpP;08+p `ð 8@.ܠҐPP@(0)P`p &E ` ʀJa@ ـܠ0p:B 200Ր0$/-!p@@ސ00@54P 0P .@IUP5` ΐ #3.P@P` (P+ A$ŀ`? O8@`@Аؠp@p14@&PpP  & +"0 `0 `( # ɐ:`C+p @!0`0 0 ` : `+GZP-PP@ `P*+"ؠP@p+8.`PP#   `   @ 0@   @03@`@7SO@Pߐ@`PP'@(@@ @35`$ P `P@ 00 @0 @P 0 0PP`  p 0 2㐽 +?J,`ʠP  !#p` Ϡ&4+PPPP@ @,`` 0@$``p@ P   @#@.ޠ`@40GPFP0` р@P p! @ ̰װ`-2!` @0 @P!)PՐ.-P`0  pp0 @ P p ppp@.@@ !?>p!@`Ȑ@ P @p !@,# `0p@  p@p pP@0@@p.`+0 00 Pp  0p`&@0p.@1P @p 0Pp` $@P @p  ``p @P`@` "p@P   ` P@P  @000̀000*@@@Pp P``  P 0p p@ PP@  @ 0 P P@ @p@@PPpp @  p0 $@@P P `0P `P ` ```@@P P` pP P  p `@ P0p0@0P0 `P P 0PP@ P P00PP`0p@`0`@@@P `` @P@` @@ ` @`@ p  pP  p0@`@P@P p0  P`p   `00 ` ```p`0p`@00@`PP@p```P0P@P0`PP@p@  P@``     @P@p0p@p0` @``P``ppp`p P`p` Pp@@ @p`PPp0@p@``PP@PpPpP`ppp`p`pppppp``p`ppppppppppppppp`ppppppp@``@PP PpP pp``  p` `P pPP0P`ppp`@0PppppP`@`PP`pP`ppp0` p@`p`p`ppPpppPP`Pp```pp@Pp``P`ppp`0P pp`PPpp`p@p`@Ppp`pPP`ppppppp@P0pPp`pPp0``ppppp``p`pppppppp`ppppppppppp`pppp`pppp`ppppppppppppp`pp`pppp`ppppppppppppppppppppp`ppp`pp`pp`ppppppppppppp`p``ppPpP``ppppPpppp`p`@ppp`P`PP `Pppp`ppppppppp @@0  P@ @``P 0`p P0P P@``@`    ` @P@ P`` 0 @P@P `00P0PPP0 @ 0P``Pp @`pp ` P  @p`P0 @0 PP ` P 0 PpP`@ P P0@P    P pp@` p@  ` p`@PP `@` p @   0p@0 `PPP P @ 00P`@  0P`  `@`0 `0p`` @ P0` p@@0 `0`@@   p P@@ p0` @P2 pPP @ @ 0ppp p`/P@p```p` p7 8 p`Pp`   `  P0P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@PP` P ;H)P0ְp( P 0` p !O8$@ @ɠ0`PPP!!``Pp`@PP@ p !:Q+0 0ِҠP $ PP!P*X@5' `кp@Ԡ0P  %(  ݀ @"p'pPF2!0Pˠ0P@.0#@`00p%P>V`82% @ɠ` Pp)(` #`@`P` 7`TP<=2`ڐ!%'  `@`/H9;8P! `0`PՀ`  `& &`P3)@150/0 ݰ  !0 p &&P/` 0ܠ0؀`    PP &pP  `P ۀP P P @p ``PP 0 `  P `PP`P `    @@  P``0@PP  p P @P@0@00 @`  ``P0`@```@`@@P@ 0  P@PpP0  `  p`@P@` 0P`pP  P0P`  @`0@pPP Pp`P0P pp@ PP P pPP P @p p0`PpP @@P00@  p` P0` ` PP0@0Ppp 0  p @ ```@P@`P` 0PP` ``P0@ 0@P`P0`P0@`P@0` P`0@pPp P`  pP0@ 0 0`pp@`P`  @ P0@@ P P @PpP P`P`P`0 PP`@@0@P ``pPp  P0`` P` @ PP P` 00 0 @ `  `P0@`Pppp0```pp```ppP   0@    @ppp``Pp``p``pp0` 0@@@ P`P @``p@pP0`0p @ PPP P0P0p0@ PPP ```Pp0 0P  `p p@@P0`PPPp`pp@P0`0p0``0@@`p0@P0pP   `p0@p@ @@@0P @ P@`pp@P0`0 P@Pp@@P`P`@ 0 PPP 0 0P@P`` `@0P``@   @`PP pP @!`*`@P߀ P ``` 0(0@pP  0 `pP`  `@(`PP`P 0 `@`0P " $@@Pp`P` p ` P`@  `@ PpPPpP `PpP @ PP@ @ ` @0` P p0PP`P p @ PP  `  `p@@` `@`p@`` @ p 0@ pPPP`P`p ` 00``P P PP p ` p `  0`P@P 0 @p0 `   pP`PP@ P0P @` p P000 P@p@p`PPp  P 0 0`0@P @ pP @  `@P 0 ``p0p0P ```P@P@0`P`@PPP `ppp0P0 ```P``0 p00P`@ `@@`ppP p`pp`p`Pp`pP`pp`p`pppppppppppppppppppp`pppPp`@@p` `@0 pP`P` 0 0@0 P0` `pP@`00@Pp 0P p `P`@`` @ P0p@`0 p@@0@p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` p@@)& `PP0pP P0 Ppp `$&p0`0 PP0@p`p  @  P$ @p0` ` @ P  0@0P# 0 P @    @ p`0`0P `   @0 p p@@ `0 0 @  @P@0p0 p@ p   p0 P P`P` `P`0P@` pP@ PP` @ P@ @PP``P` pP @PP@Ppp@0pP P@`P``pPPp`@ @`P 0P0p`0 @  @@`p `P  ` ``PPpPpPPP0P00ppP@0@@ P`P P p0p` P@@  @`@`P`0@0P@  p  `P0pP  Pp pp@@P @p`P@P p  p@`` ``0``@  @pp pPP0`00 0@P0@`P `P 0P @p`P@ 00`pp P0 ` 0@@``0  @P PPp@ p 0@ @  @ @ `@@p  @PPp@ P 0  @` 0 `@@  `` P P@``Pp0``  @``P 0P@P0P`p@`PP@ `P@P```  P` ` p p000 PP @  @pPp@@ PP p  @@   P@0``P0`0@ 0pp0@`0pp@`@P`` `p Pp@ppp`Pp  P``000 p@`0PP0@ pPp   PP@Ppp  P P`PPpPP```@0@P@0@PpP`pP  `0P@p p@ P pppP@  000P00@ @0@P`0P  ``PP p0P@`@P@PPpP@  0pP 0Pp`p`@0@@P@`p@ `p @p0@@ ` ppp`P`p`0P@`P`P0`@PPPP PP@p0P```p``P@pPPpp0 ```p``p`pp`pppppp`ppPp```pppppPpPP`pppppppppppp``pppppppp`ppp@ppp`PppP`ppppppppppppp`pppp`pppPppppp``PpppppPPppPP@ 0`p`0ppPpp`ppp`ppppppp ppPpp`P`P0P0`PP@P`PP` ``0@P0pP @`P@ `P@`p@ )P&p`p@00P`` P  P  @@ 0PPPP pp@P  #` P0  P0`  p ` 0$` @`P`p P@`  P ` P$&0P0` P  `p0P P@0 @`@  @ )$pPP@P 0PP@0P  P @PP P  "P)`P 0Pp @Pp @ p 0 0  Pp'0@pP p@ p p@p p @  p!P,"p@pP  PPPPP@  p 0* &p`Pߐ`0 PPP @`P0p @#&0p0@ 00p @0` 0 P P  @ pP` P P`ppp `" `@@ `Pp  @p`P @`P 0@PP@p@`@P P  @`P@`0 @`P  0  p0 P @ @pP`@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 ઠP .X@Pp` `$P p P@'S\@p0 ! EP> ܐPPː`$0#`P@pհހ  P+lB@P@ #P*pE" PװԀ @P * P`ܠ  PdR0 p" >(@ 0`P!% P 0@Ӏ P`0 00l= 䠴Ґ 0`.;%P@͐p ` p@`.r`G `@@7 P*70@@ ߰P /!P@΀@@ 0 p .PnDPp`9p*#-@ ͠@*@PP @P@``d @͐ .?`%0PP )(pP PP 0@_0=ذ 9 2@0@Ґ 0"PP@Ӡ `p,[HPÀÐذ 570000P@@P@0@0 @#MN ̀pـ.<# `00 0ހ0 ` 0 PpP@ 7M/ P ֠53`p``pPp@P Pp0@ @  +C30`@ -p2 @ `P0 @P  0% 4)P@ #.P P`P0 @P` P `  P " PP@ @P ` P@ P @ 6p)`ޠPۀP+@`Pp P   0   p 0 pP `@`P`@@0  0 0PPP@0``  `P 0pp @0  0 00@` P PP@@   @ `  0`P` PP@`P`PPp Pp P P` P@P P p 0 P  0`P@@P  ` P ` P@0PP ``P``   p@`P P ` `p@p@  `@``PP`P00pp p p@p`  @@` 0@ @  P@```p@ 0` ` p @p Pp `P0p P @ p````P0P  @ p P p`@0pP PP PP0p p 0p P0P@P@@`pp P P 0@p00`@ P  pPp`p@@p  `0p   000 PpP P ` P @ P PP  P`pP P@@```0PP`` p  @@ @ @ PP00 ` @`@`p0pP      00P@ p@ @`  p@P@P @ `0@pPpܠPP 0 p P@Pp    Pߠ@ݐ@Pp `0pPP0 P  @ pP`0ҐPې` `` P `0 @0#`' @PӠΠP p` 0  @`PP  @ `"-1`(@ǠҠ @ ` PՀ݀P0 @ (/,p`ۀЀP P0PP *p/'0 Ϡ݀0!P$ppPP`@p  4 8`, @ՠѐ۠ P&*PP`ސ0@p p&/P, ܠް` `@p p 0 P@p@,3+P@pP`ߐ 0Pp0 @`PP`0P  )`6.p@ PԐPP P 00`P` @ 14'P `@@P` @ pp`P P p `(9*pPЀ` Pp `PP 0 / 3 Pـ֠`P P0pPP@p P @6`1p@ pр```PP`Pۀܠ0 p @3,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P0 P   @0`p0` @ 0P`P pp `pPPp`p@`@`p`ppp`PpP```ppPPPpp`pp`pp@p`ppP pPpp`pppppppp``ppPpp`p@``P`P``PP`0` p0P P0Ppppp`ppppp`P`pppp`pppppp`pp ```@pP@P P0@Pp@`@`0`` `pppp`ppP`pp `ppppp`pppp`pP`pppp``pPP 0`ppppppppPPpp`p`pp`Pp```0``@ ppppPpPppp`ppPpPpppp`p`p```ppppppP`pp`pp``p`pPpppp`ppppppp`pp```ppppppp`pp`ppppppppPppppppppP@`p @0  `pPpp@p pPP ````` P0 p@PP`@@P 0@@ P p`@` 0 @ PP0`PP 0P 0P@ 0P @@P` p@ PpPP@ PP ` 0Pp @` P PP P` 0 PP``0@P ` 0 0Pp  PPp` # 0P@ P  ``@`@Pp0Pp`    `  `p ` 0 p0` P` ! @ 0@`0 PpP `p @ 0p P PP0`Pp p P#PPp Pp @0@ P#` 0P 0 p0P@  p`P``p``#@#p0`0  pP`@P`% $ @0  p@`p '#"# p0p p ``@"'&&  P`P0  ` PPP`)&)0*@P P@ P p @  "(`+!p` P0Pp P 0  P0` &P+`"PP0@`  0`@!p)#p0 0 P @  @ " P`@@` PP0 0@P@@p`Pp00`` @  0 `@p@@@@ @@`@@P`p` p``  `p p`0``@P PP@0@P0 p0`pP `@PP00P`P`@P0pP P@0 p``PPpPPp`ppp`ppppp`pppppppPpp@   ` `  @@  0 `0`` P` 0  p@P@@` @ P ` P`p@ `0P@ P  `p PP @ 0 P ` PP 0 P @ppP P pp`p0@ PP   p 00@P P``0P`P`@P@PpP @`PPpP`p@P0 p PP00pPPp `P@ Pp@P`@0P```@@P 0 @P0PP0P @ P pp@` @P@0@P`!..@( '0@P `0 P`@ .;40'`Ԑ` ` @  1$pـ` p `@@`@ p,`50" ذP  ` `p@''p`0 `p@` p@ p` @`p @@Pp@`@ 0P P`pp0P`@0PP0``p @@PP`pP@0P PPpppp0 p``Ppp0@`Pp`p@pp@pPpppp`ppppppp`pppp`pp`Ppp`@)@P@ `0`  ߰`  P` PpP p`P`Pp`p`0p0P@`p`@PPPP p@@` 00P P@@  `P00 @@P`` pP' !P  0 ``p@,0)*P#ސ܀`P@  P Pp` `-,/`* P  ppPP`p(0P.1$PPP߀ܠؐpPP P0,1`//!`۠@0PP  `@P` ,p.1)݀PP``0   p@PP(P()% 00P ` p0pP p `@p PP`p`0p@`0p@ P0 P 0 p00P00pP P PP P@ @@P`Pp``pPP0@@0PP`p``PP`0  P P0ppppppp`pp Pp@PP@`PPP`p`ppp@` `0P@PP@PPP@ P` PPP```  pp`pPP @`@00 ` @ `@  P  @PP@`Pp`@ P  0@p`P0@0` p pP@@@ 0 `p 0PP00`P` pp@ @0`0` @ 0 p`@P0  0 `P pP  P`@P PP`pp@`P0@ 0P`@p0 pPPP`P@``@@pPp` `p` 00`p`0 p  P0``` p @`0PP P`  `P`  P0`p`0@`p0`P P``P0@`0`P0@pP` 0@`pP@`pP@pp@`P @ P`@P0P ` @Ppppp@  0@0 p`@@Pp`P P @0`p@` PP  @ ` ` P`pP p  ``@ @ 0`@ 0`p@ PP  `@`Pp``@0@@`@` 0 @`@ Pp!@P``0  @` p#P PPސP`  ``P@0# P@  P0  p !"`P 0 ` P0p `#P  p ` `p  !p 0 P @@0@p @P @ 0`0 0 P0 @` Ppp p0P P@p@ 00` P `Pp P0@@P@00 p` ` PPPppPP p Pp p`p0``P``pP 00p`P `@ PP@` PPpP p P ` @``P@0`@``@0 p` @@P0 PPPPPp@@0@ @PP@ p``0` `Pppp`@`0PP P0 P@pPP@`@@ ` P p@P@@P@ @0 PPPP0p 0`0 `0`P P@P @P0@`00`@`ppPP P@0P@0@@@P @@@  `p` p` `P @@ pP@0 0 0P0 P Pp@P@ @@@P  pp`@ pP pP @pP@`@P @`` p0 P@`@ ``P@ @0`p@p  `0p    PP P@` P@@PP0`p0@pP`@@PpP`ppp``p`pppppP`PPpPpp p` p` @P@pP0 00P Ppp@P@@``p``ppP````ppp`ppp`pP`pPpP@`P P ` @  Pp0`@PP`0`pP 00 @@@000 ``P@`P@`P0PPp0p0`pPP`P`p`p0P`pppP@p`p` @p@p@0 P@@`@`p`P p`0PP0P0@0@ @``  `@p ppP@@P0@PP@P0@`@ `@` PPP0 Pppp `P0`PP`0P0P``PP` P00 0`P`pP``p`p P0 @pp`P`@p  p`@P `0`@ `p0p`PP`P`P`0@pppp pP`0`Ppp pP  ``@ P`P `PP`p`Pp `@ `P@@PP`P00@PP 0p`@0@p@0P`P`P`Pp0@PPPp@`PP 0`p`@ `@  `Ppp@`0`@0`Pp0PP@0`pPPpPp p`pP@ ppP`P` p 0ppP@0p0@`P`` P` @ P @P` `0@ 00p00@ `P0  P0@Pp0 ` @p 0 @0@0`0P0P `  @p @0`P@`@ `@ 0 @P@@P`@ppp P` @p@ p`00P0@`@P ` P`0`P` @P`@@pp`p P `pP@ `p@PP`P` PP`P`P p@PpP0pp @@P `@0@P@@ @0` P@@@P@ @``@PpP@ P` `@ @ PP P P@P p`0pP @pPP @`pPP  @0 ` `  `P `@PP0 `P0 ` @ @0`@ `   0``P@ P``PP `P`   @` 00`@` 0P @ P@ @  @P0 @ pP`P@0`p`0P@P@` `p@@  `0@` P`Pp00  `P@P`@ p0 ` @ 0@0` P`p@P P  p `PP@ p 0p`P0 `@ ` p@@00`Ppp0P@00P` ppPP  0 0@@ 0 @ @ Pp`0 P P0P`p``0pPP PP` @ `@@ 0@p `P@@@ pP00 PPP P0 `P@pppppP`p`ppPPPP``P`Ppp```ppppp````pP`pp`pppp` `0 `` `pP P `` p` `p@ P 0 PP@ppp``@`p`pPp@ @P``pppPppPPPp@` P`pPPp@` P`0@``P``  ppPp@0@ PP` @ 0P`p`0P Pp`p P `pp PPP  0p0`0`P P@` @ PpP PppP P ``@`p P @  0PP 0P @@  ` P PP ``0 0 0`p`  0pP p  P @  0@P ` @@0` `p`@ ` p Ppp@ @ @P@@P 0 pP`0@0P`!@p pPP@ P@p ` ``P! PP @ P pP@@p # @ 0@ 0@p ` P0p 0!!@0p@pp0 0 @@`P$p#p0P@ P  Pp0@%" 0`@ 0 @0@@%#P  P0`p@ 0 ` `&$` ` pPP0p @ 0P0 p'( pP`P pP  ` p  P"(&` pp  P p0p ( *"` `   p PpP P)( `@p@  @ 0 `@ @ ` *)!0pP p @ @ pP`@ @ )*"@PP  0 PPP`@ '*%P0@pP   @p`  @ P!)) P P P`   P`@`0`P 0p#*p&`P@@ p 0 @`@ ` $ $0`0P`p`0@0 0 P !#0``0@@ @@0`  0 P` `0`P@ P @P0 0 0PpP@ @p `P``  @Pp`P`P  Pp PP  P P`p`  P0P0  @ Pp@ P0P @ p @P 0 pPpP pP  P 0 @`P0P PP@`0 @ P  P0P @P ` @ `pp`  p```p@`@@@@ P @@` @p @ P@ P``@ 00 ` @@@ 0p`   @PP `p @ P`P@`pPP@P 0@P @`p  0@ppP@@0pPp P @` 0P@ppPPPp@@0`0 P` PPPp  PP0`0@ `0p0 P``P@`p 0P 0@  P @ @@`pPpPPPPp`P`@pPPPPPP0@p P p P 0`P P0p@ 00  PP`p@ppP@  ` P  @P0@@PPP00pPPP@```@P``P p  pPP``0``p pp`0P0 `@PP@@pP``@0@`@@ pP```P 0`  0` `@P`P0PP`Pp` 000`0P0p0pPPPPPP`  Pp PP PP@PPPP0P0P`P``P@0PPP`0P PPp` `@PP@ `Pp0PP `P@P@ 00PP `00@0P`` 0@ P P P`0@0@P P@ppP`` 0``@P@ p PP PP`0@0 `0P@P`p`p`@@@p`P00P`@@ P PP P@ pP0P@00p@ ``P@Pp @``P0@ pp P@0@P`P`pP`P`P0P`PpPPP0`p` PP `Pp``P`pPP P@@pPp@p`0p p`@ `0pp`ppp`00pppP ``p`pppp@ppppp P`ppppppp`pp``pPp ``pp`ppp`pppppppp`pppp`pppP`pppppppppppp`ppppppppppppp``ppp`pppppppPpppppp`ppppppp`ppppp````p```pppppppppppp`ppp`ppp`ppppppppppppppp`ppspandsp-0.0.6/test-data/local/short_wb_voice.wav0000664000175000017500000030102610306510325016620 00000000000000RIFFWAVEfmt >}data}|wuttleefghikkkmmjjkigddgjkihgebabefjnje`deefee_^\^_^aaadhgfefc_`b_^]^__a`babbabhihnpqprrttvyroovywwywqsvpihkmloplmpliigiooqoty{|}xwxzyuqljgca^^[VVYYVRSWVTRSTNMMJKF@ACJUY\`gjfgd^`ehjloqqngbbec\Z\_aab`^_ZXVSRQRV\_a^Z_a^_acccdfefrvqqqrstwxwrpruy||}~|}{{{~yz}|{}}{~|xuuz~xwzyvx{{zzxyzxqrv{zwyyvpnqvurlnpoppuuurmkhd^^a^_]^edb``ebaegedbbcjrpppsojhfiekmlmkg`ba_ZUVUY\^_aa]a`cegjfhmppouyz~~}~zuqoljhghgedggcfijfba^\ZX]aaa][Zadbbcosqkejkllkeadhklnqomsuuqijllljghimpqspjgge_[Z\[WX`bb_bfikhhcadjpqpqu{zrposuz|z{}~~|wvnoofc^]]adjiddgjdcbccbaefcdeggdb^\\[[WTVZZYYZY[\YY[Z[^__YY_`\[]`aafgjjijmkdcgebbbfgfefiknljmnnoquppsstojfjllhccenpmlnruvwz{~|zyyxtpsutlkmmjea^\\VUUTRLLQWYWX^cbab^\]cfcbfjmlfc`^__`fe`]`dabceejjikkjhb^^_]]abcehjklnokjikkhijmmotw{wstx||}~|~zwurpptvrsutrtuxwxxsuonhhhcb_^^_]\YWTOMHMPPU]bbbdfigghdfiifffedcgfacgjkhllgffec``fgjlnliqsmjkjikorqrtyzxywpkmkhhiiipopty~~}~~|yxzxvuvutx~yvvspnlgknonhefbbcb_\^ab`XSRTVSPU]][\[^__bgonoqqkdb_]__Z[[ab^Z]b][YZYZ[\^__^^^]]]abghgijkiijlmiknnoprqrppqqqkjgfimmlorwzzyz~|~|y|wsqsuoijmmlllmomknlkkhhgffgjd```_^bcacec__cdfefgecbaab`^`b_ZYUV[^`_`cghfc`__```a`^cgbddcc_^]afgegggcehimkmlmmt{}~|~y}~}~|{{}}~~}~~~~|zsprsqonjijnnlidabdd`_`acbfgeijkmquutpprrohecfjjec`]YTVZ\ZZ`ddffhhdabfhegssnhddff`befgnoklkqusrwyyxxz|}|}~{xy~zx|{wwvx}~z{~{vtrprutstsy|~{xyyz|{xuxyyzz|{ukfehha``cedcbacb`_\[Zb`^][]`bc`YWZ[[\\_bbchhjhefklijmledfikigfilptsrsvvrppqpklhhfbbcbadfjkkihhkmoptvuutvux|}~}~~|y|}~|zwxuxyvqnzvtpmlhb]YNHEDABABJOPOOPQQMFCGNNKPX^`afhdhghllqvzz{}}xpnnjdbefca^\WXZ[][]]`baaccaecbabgijkouvv{~}|{wvrsstxxvxwtqmqsuz{|}||~~xwtqqmjgigfhjmotwurlgfkmhefjiffffdda`]]]\\aggfgjlnllmib`accaafiijkjkpuvvxxyz~~xuppooojkookmjhehgeegmruoouvstrlnrrv}}uwxvtrpopqnmjb]Y[YYWUZ[WX\ZZZY\`bdfdehgcbc^^^^ZWYYZWTVYWPQTWWX\_`addddaaca^\\^[WWZ\\_bfgdelponrxyy{ytux{z}~{{}}~zrqtsqptqlilopomllnty}|zyzwsnliefknmnmjghieec^_bdcabefb^^`_`_[[WVYZ[^^^^\YWVW[YW[^`ehbbcabaaflpwy{{zytokmkigggjqsomomjhjlolkkiheeb]\^__bfkqsuy|||}~}~zz}}xxvmgghiecdhjiggjmnmjifdcb`]][XXVTTTRV[][^chgfhdbadd``^ajnoprurpsvrrsrwutsplefeda^bcfilqsrpruwuplpxz{zyxxy|~{yw~z{}}|{z{{{|}zywsvvvttvtwtrtutroklllc]_`]YXVUYZYUTVSTY\^]afed`^^[XW[b_[cknppnopqqmmkqvvtrkegnosxstrnprqqkjmnnmnllkljgfhjd\\_`ccgjmrorw}z|~{}}}{}}{yqpnpokimmjhf`]^^ZTPOTVSPNQPPRSUTU\\YYabba`acdjuniegeddadaac`_aeiefhghjifgecfcaa`b`\\_baa^\Z\]]\]`glmmlloqoqqqoqtxwruwxuvxvxxusu{yuwxyz~}}{yvsngd][[\[VSUURQOPPRWXZ\YUWW[]\`aedfgiopnlnnknrtttsvuwvuvuvtpmljhkouxspomihgdfdcabginpqmmqrqlnrswwtssw}}{uopnnpxywyxyxz{{uohdfghgecb_`_aedbdbaa``cccfdbadiklklrtqhbfhe]XWWWWVRSRRRSOKLPW]\^behikjkpsuzxvyztotw|~~}xwy{wrnloqropoqusustroouwx||wyyz|wplnpqpnlqy{{z|~{wy{vrrpoqttpnjjnjdadfceeefec^YVXVTRQTUXW[\\`fdegihdhhfghfcba_]ZYWW[````^^`cd^addfecaba`^_ab`\cededdegnutpqrsvyvoptxyywy{uy{xpmovy{}vroooqsvz~zvtrqomkgedfdaaehfdehhcbefddedfhcZYZY^cb`baba`egihdabc`\]a`^Z\`]]_ceefllgcedbebecfknrsxyyxusrqqqqy~xvxtmjicceehkmppqw~~}}|}~~~|xtuvzxyy|zzzwyxwnjiklihgebb_^_`fhdcfca`ciga]]abbdedgigggffjjjijjilnsstvsrruyx{yy}zvtwtonmlonmnnppmkiffedgejoppssoruvvsruty{~|}{z}||}}xsuxvvttsrrtsppmlnlkknmptrmjkea`bfb_aeecab_bedb^XXZ[\YZadea]cijb]_ZVUZ^]^]]`^\[[^fhjkmssvxwutttvt~~xrmnmlcb`]\^`fjiilnnqqniffhiklmoootx{xtsuwx{~|}zuw}~}}yvz~{rsvsruxvstwxwtpjikmigiiehkhfgmpnkiigjmje]]^[SPTVVSQVZZWY`gfdgjhalrnjflliillgea_`bdhiikklnllkhiikpuywssvvsqtuuvy{xtttrrrnijkggkmqstx~|y||xtuwvvtvy}zvtsuy|~~~{|}}zy}~|ytqrvoebdhjkhgghklokcbbcb\^^[\YZ__``aghgeddhmrwzzy}xsuqrqrrrtw||}||zxvwwtsuvrquzuohliqjj~kzsm}|y|wz~xztp_Q`||LUlwxl^Dd)13c-#%Eo4-af n-jeLsXL) (.[F$BB;L2Rj\)?!*8M{mv? ($'6?"|]R}co& &4B.2E-->8. &>Pk{7RgUU^+XN(ghs*xbms~]_! _3E4])C~ B B^y$ZJw 0?y-b7VOKH[1 3?R0u^.>)Gu#N> #a,f`(9D7  7Z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d+~P.M@YhkM?~Bk s#jpl(:9 Hl;X$sd \jEU&b c;Mm'|,'5'?&4-4L/3 U,/b+2Anm~)`x l8Pezykcw0_(.Wtcy;QX| >Fn6X{(&n=;lBa YVXA"Tv]7?b ?b% #-CA=A+!**:j&-L5#+]@5: Eg7Ljk&Qyks(dsYGgVfrq\{pn~hvtp{elyo~xuskillidkprszw}}trknsuroggmmhglnpmkkklqspjghknpvww{|{vtwz|zvsuyxtqlgdfjjghuwoliijhkmmkklkhd^X[[]]^_^`a`_dhikilrwvomookikopmopqqoknrssuwqnrxyzzxvwwwtnlltxuttsw}}}~~{{~}tmnnljmtuxyuropmpqtxzz|~~|xty~|xyytrrungghmljkjligd\\^bdfd_`]ZYXYWUWTSV[ZXZ\_b`]]`a`^_^`dcihgknjdc_^_]YXYZYY\^``cjmmjgjqvtqqmoqqstrrvw{}yvxzxw{zxwuvxvy~}xz{x}xtssptvuqossswyz{ywvwzwqppnmnkdchknppnoqngdefgedddeggc`a`chljhlkjhec^[ZWTRTTQTVWVTTTWXVTTSQPOS\^[^`edfga\Ycggccjnkfcbda`bglkquz|xurrjfhmmiikpsooqsssrrtqrtz{}}y{}|~}xyz{||{yxutspjgeglonkmpwwsrvwpooqnqtvvsqnokghiljegkhc`cgfa_eijghmpstttvtspptxzxvuxywokjhjnpqpnnnnnppompqprpqnhddefhec]\ZVW[^dmlmpqnmtuttvy~|z3/RU:+MN{`y|gZndVT@;;-9+938%{PUDKoporhvfh`W^_up\[hfZ@FTS>*/D7,4AI&&.0")I=(GVDIk]J[~nVgcjkxYHOk~hPM\ObQFHSXETX]iNY]SajWbyqu|o}whyzouxpbht`W[XL?ORIENGHJPG6;)+# &(& $2672;Lkxpup 7Qs ,FO^rtjygJ Wg)yW(ZKBk8O[jmeh *Tz<JO[x3s!>u TAdbht74ny;RO _`xgZ%!Z [*g=> b# :s}l]\^fyJ7[El$a8Cnr2|tkcrmEMiiV[k-K G8iYXXN5nK,i8kPPuqDJP{}xbVN*lLTyJr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2D+}Q&ij){(m,~o;dx2NC<\o^CkGLeX V9r9pg$r2>A6aGqs)]%+&h`h/}3^d=hx=d~`SFr%K$jj?I .gC2FxWUvkhtucG7i}xr7c{h[9mbKnWz0ntLAs1Y =)ZxPwJw|>mvy^LOnXEX|lZ[f9"uh2yPJ'.<72@\cdgv~xzs{}zz}q~z{p}wyxnldfebakphfloneqyuz~{~~}}}}~vxxryyvvsqnllliiehnolkxyvpecaehiha\\_aehceedefgjighiibba]^ahlc]^\[SOSSVWY`gkquwvqorsv{yzyx~~|{z~~}yuuu{~x{|xx}{zz~}|}{sjhjhgc`bbcblohbahkhfiqqrwuwxvusrqokihotrptvuvutroje_`^XUSSQLJJIJMNLMLLMPSSUQONMMNPORSQV\[[XV\agjmrwzvutqnmlmnkihflqrrutoqqsoqvvsw~|z|~~~~}~~{zzx||~}zy}}~~}|xrprqruwpnomkmnkkpvvvy~{w{~ylcflsolmnmigd`ZWW\cb_dedhihiknqx{vsswy{|yy{}}|yspnnmljf`YQMRSOTWZ^`cc_^a_bdadkqru~|{yz|{}~}}zyz}|}yz~|ussrsrrnprpjfhhd^]^\[X[^XSQSRRQMLKGCEMQX[Y][RQVSIGKOSOKHMROLGEFHKMNPVZ\]XW[]]ZX`dbdgjmnnnmmjhkmopquxy{}|wsrtz   !!!%*-.).5651013774.56651/*)'$ {wwutw~~|zwpifgmoifikmomjiib]\XQIGLNNLLPVVTRTUQOMKHHIKNPORNHGIFD@4011/*!    !"#*-*(! %# !!"$"$%#%"'+)()/432378577668;<>C@BEEGJJD@?@@?@@DDEC?=:9776645;<;63/,+)(" !!!").257646669:>=>CFLOQU[]djks{#)&(+.4;DIHFJIG>9<>?;<FA=82,&')(! }|zxxuz~}}z{|xtw||z~}z|}zwx{{{xrhdfb]UOME?<<:8664/*#      !)*/6>AAEHLOSRV\bdimptwz|   }umg`]]RGB@;3*#  "*19;=?AEKPRSX_adegimqqru~|x||}~}   }vmkh`]]__a_][Y]^]]ZXVU[YSRPOPMNMMRS\`[WW\_^^][Y]_]aflnkrxz~{xwvwywuusojmonkluuvy{{zwvtvvpqrtrpswtoprqoopsuz}}}~~}ywxzzqljjheecdfddd_\XTMLKMJNOR^ZOGEA==>A?>BEJJFHD?=<<=<<==>>=<=:>AEIHMLMNMQWXZ_ghegrtrruyx{z}}{}}zw|}zuprsttsrstsqnlia`ddc^[``fjeb]_hikpnpu}~~~z{|z}~zyz{z|~zx{{yyvsuvsqqj^ZZ][WY]`][YXTPQPTURNLKKJDEE?>:8646656;>=;753223//./31/,.3651+)-0*,0032543689677<>>ADFHGEILMQWZ_bghhhjmnrrpquwwv{{{voh^YVTOG@:;=<65::77-(%"  )(*.240.1789:9?CAA@DKJHBFNV^aemsv{}ywvvuwxvvyzyzz||{{}|z|~|}}~|||zyy|{wvuurmllijnsx{~|xxyyupnkjhkf]USY[VQRWXY]]YZ^^YTPOOLLLJKPX[Z]`bacjotx~wnrwxqigjprnijd]Z\XYYTTSRUTQQLFEGNQKKMMJD>72/../-/033.,%"" '***.12,2=70("!#$%%!#$!(...37?EEFMTRMLLNPSZYW]ehhiijlnvwy|{y}ytwxxuonooolmqsvttpqqjfde^^ehfcc_\UQJKMLKMPPQQVWQPTTV[ZV\a_`cggglidacggegeebdhea^]agkijquw{vvy||}|ywyyvyyywvuutstrpmqrsvywutttlgfe_ZYYWUSSRRSUW[\\addb_ZXUSQMLLMLMLMMLLICA@;:98757:9AEHGKMNORUVZ\`_^bkkkppqljkpqonjlkmonqrqosrqpssuwtssuuwxy{~|xxy{zxvusqpsususuttuxwrpuxyx}|zwutqd`aZUSVVMMVSOOLEEGGA<=;:740.)%     !!%*($%+479==9:DGKNPRZdhkpvz~~zy|}}}{v||~}}}zupqtsojjhhgffijihhjmljljljkj`[ZY[YSRU\spandsp-0.0.6/test-data/etsi/0000775000175000017500000000000012357123347013031 500000000000000spandsp-0.0.6/test-data/etsi/Makefile.in0000664000175000017500000004541712343626375015035 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = test-data/etsi DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_check_real_file.m4 \ $(top_srcdir)/m4/ax_fixed_point_machine.m4 \ $(top_srcdir)/m4/ax_misaligned_access_fails.m4 \ $(top_srcdir)/m4/ax_c99_features.m4 \ $(top_srcdir)/m4/ax_check_export_capability.m4 \ $(top_srcdir)/m4/ax_check_arm_neon.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ COMP_VENDOR_CFLAGS = @COMP_VENDOR_CFLAGS@ COMP_VENDOR_LDFLAGS = @COMP_VENDOR_LDFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_FAX2TIFF = @HAVE_FAX2TIFF@ HAVE_PBMTOG3 = @HAVE_PBMTOG3@ HAVE_SOX = @HAVE_SOX@ INSERT_INTTYPES_HEADER = @INSERT_INTTYPES_HEADER@ INSERT_MATH_HEADER = @INSERT_MATH_HEADER@ INSERT_STDBOOL_HEADER = @INSERT_STDBOOL_HEADER@ INSERT_STDINT_HEADER = @INSERT_STDINT_HEADER@ INSERT_TGMATH_HEADER = @INSERT_TGMATH_HEADER@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIMLIBS = @SIMLIBS@ SPANDSP_LT_AGE = @SPANDSP_LT_AGE@ SPANDSP_LT_CURRENT = @SPANDSP_LT_CURRENT@ SPANDSP_LT_REVISION = @SPANDSP_LT_REVISION@ SPANDSP_MISALIGNED_ACCESS_FAILS = @SPANDSP_MISALIGNED_ACCESS_FAILS@ SPANDSP_SUPPORT_T85 = @SPANDSP_SUPPORT_T85@ SPANDSP_SUPPORT_V34 = @SPANDSP_SUPPORT_V34@ SPANDSP_USE_EXPORT_CAPABILITY = @SPANDSP_USE_EXPORT_CAPABILITY@ SPANDSP_USE_FIXED_POINT = @SPANDSP_USE_FIXED_POINT@ STRIP = @STRIP@ TESTLIBS = @TESTLIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = fax DIST_SUBDIRS = fax all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test-data/etsi/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test-data/etsi/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am all: clean: # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: spandsp-0.0.6/test-data/etsi/Makefile.am0000664000175000017500000000151311422612266015000 00000000000000## ## SpanDSP - a series of DSP components for telephony ## ## Makefile.am -- Process this file with automake to produce Makefile.in ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU Lesser General Public License version 2.1, ## as published by the Free Software Foundation. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU Lesser General Public License for more details. ## ## You should have received a copy of the GNU Lesser General Public ## License along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. SUBDIRS = fax DIST_SUBDIRS = fax all: clean: spandsp-0.0.6/test-data/etsi/fax/0000775000175000017500000000000012357123347013607 500000000000000spandsp-0.0.6/test-data/etsi/fax/Makefile.in0000664000175000017500000005326012343626375015606 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = generate_etsi_300_242_pages$(EXEEXT) subdir = test-data/etsi/fax DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/config/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_check_real_file.m4 \ $(top_srcdir)/m4/ax_fixed_point_machine.m4 \ $(top_srcdir)/m4/ax_misaligned_access_fails.m4 \ $(top_srcdir)/m4/ax_c99_features.m4 \ $(top_srcdir)/m4/ax_check_export_capability.m4 \ $(top_srcdir)/m4/ax_check_arm_neon.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_generate_etsi_300_242_pages_OBJECTS = \ generate_etsi_300_242_pages.$(OBJEXT) generate_etsi_300_242_pages_OBJECTS = \ $(am_generate_etsi_300_242_pages_OBJECTS) am__DEPENDENCIES_1 = generate_etsi_300_242_pages_DEPENDENCIES = $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(generate_etsi_300_242_pages_SOURCES) DIST_SOURCES = $(generate_etsi_300_242_pages_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(datadir)" DATA = $(nobase_data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ COMP_VENDOR_CFLAGS = @COMP_VENDOR_CFLAGS@ COMP_VENDOR_LDFLAGS = @COMP_VENDOR_LDFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_FAX2TIFF = @HAVE_FAX2TIFF@ HAVE_PBMTOG3 = @HAVE_PBMTOG3@ HAVE_SOX = @HAVE_SOX@ INSERT_INTTYPES_HEADER = @INSERT_INTTYPES_HEADER@ INSERT_MATH_HEADER = @INSERT_MATH_HEADER@ INSERT_STDBOOL_HEADER = @INSERT_STDBOOL_HEADER@ INSERT_STDINT_HEADER = @INSERT_STDINT_HEADER@ INSERT_TGMATH_HEADER = @INSERT_TGMATH_HEADER@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIMLIBS = @SIMLIBS@ SPANDSP_LT_AGE = @SPANDSP_LT_AGE@ SPANDSP_LT_CURRENT = @SPANDSP_LT_CURRENT@ SPANDSP_LT_REVISION = @SPANDSP_LT_REVISION@ SPANDSP_MISALIGNED_ACCESS_FAILS = @SPANDSP_MISALIGNED_ACCESS_FAILS@ SPANDSP_SUPPORT_T85 = @SPANDSP_SUPPORT_T85@ SPANDSP_SUPPORT_V34 = @SPANDSP_SUPPORT_V34@ SPANDSP_USE_EXPORT_CAPABILITY = @SPANDSP_USE_EXPORT_CAPABILITY@ SPANDSP_USE_FIXED_POINT = @SPANDSP_USE_FIXED_POINT@ STRIP = @STRIP@ TESTLIBS = @TESTLIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = $(COMP_VENDOR_CFLAGS) PBM2G3 = pbmtog3 FAX2TIFF = fax2tiff TIFFCP = tiffcp ETSI_TEST_PAGES = etsi_300_242_a4_diago1.tif \ etsi_300_242_a4_diago2.tif \ etsi_300_242_a4_duration1.tif \ etsi_300_242_a4_duration2.tif \ etsi_300_242_a4_error.tif \ etsi_300_242_a4_impress.tif \ etsi_300_242_a4_impress_white.tif \ etsi_300_242_a4_stairstep.tif \ etsi_300_242_a4_white.tif \ etsi_300_242_a4_white_2p.tif EXTRA_DIST = MAINTAINERCLEANFILES = Makefile.in LIBDIR = -L$(top_builddir)/src nobase_data_DATA = ${ETSI_TEST_PAGES} generate_etsi_300_242_pages_SOURCES = generate_etsi_300_242_pages.c generate_etsi_300_242_pages_LDADD = $(LIBDIR) -lspandsp -ltiff all: all-am .SUFFIXES: .SUFFIXES: .c .g3 .lo .o .obj .pbm .tif $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test-data/etsi/fax/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test-data/etsi/fax/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list generate_etsi_300_242_pages$(EXEEXT): $(generate_etsi_300_242_pages_OBJECTS) $(generate_etsi_300_242_pages_DEPENDENCIES) $(EXTRA_generate_etsi_300_242_pages_DEPENDENCIES) @rm -f generate_etsi_300_242_pages$(EXEEXT) $(AM_V_CCLD)$(LINK) $(generate_etsi_300_242_pages_OBJECTS) $(generate_etsi_300_242_pages_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_etsi_300_242_pages.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nobase_dataDATA: $(nobase_data_DATA) @$(NORMAL_INSTALL) @list='$(nobase_data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)/$$dir"; }; \ echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(datadir)/$$dir'"; \ $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(datadir)/$$dir" || exit $$?; }; \ done uninstall-nobase_dataDATA: @$(NORMAL_UNINSTALL) @list='$(nobase_data_DATA)'; test -n "$(datadir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-nobase_dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-nobase_dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-nobase_dataDATA \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-nobase_dataDATA clean: rm -f *.tif *.g3 .g3.tif: ${FAX2TIFF} -M -o $*.tif $*.g3 .pbm.g3: ${PBM2G3} $*.pbm >$*.g3 ${ETSI_TEST_PAGES}: generate_etsi_300_242_pages$(EXEEXT) ./generate_etsi_300_242_pages$(EXEEXT) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: spandsp-0.0.6/test-data/etsi/fax/Makefile.am0000664000175000017500000000351111422612266015556 00000000000000## ## SpanDSP - a series of DSP components for telephony ## ## Makefile.am -- Process this file with automake to produce Makefile.in ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License version 2, as ## published by the Free Software Foundation. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. AM_CFLAGS = $(COMP_VENDOR_CFLAGS) PBM2G3 = pbmtog3 FAX2TIFF = fax2tiff TIFFCP = tiffcp ETSI_TEST_PAGES = etsi_300_242_a4_diago1.tif \ etsi_300_242_a4_diago2.tif \ etsi_300_242_a4_duration1.tif \ etsi_300_242_a4_duration2.tif \ etsi_300_242_a4_error.tif \ etsi_300_242_a4_impress.tif \ etsi_300_242_a4_impress_white.tif \ etsi_300_242_a4_stairstep.tif \ etsi_300_242_a4_white.tif \ etsi_300_242_a4_white_2p.tif EXTRA_DIST = MAINTAINERCLEANFILES = Makefile.in LIBDIR = -L$(top_builddir)/src nobase_data_DATA = ${ETSI_TEST_PAGES} noinst_PROGRAMS = generate_etsi_300_242_pages generate_etsi_300_242_pages_SOURCES = generate_etsi_300_242_pages.c generate_etsi_300_242_pages_LDADD = $(LIBDIR) -lspandsp -ltiff clean: rm -f *.tif *.g3 .g3.tif: ${FAX2TIFF} -M -o $*.tif $*.g3 .pbm.g3: ${PBM2G3} $*.pbm >$*.g3 ${ETSI_TEST_PAGES}: generate_etsi_300_242_pages$(EXEEXT) ./generate_etsi_300_242_pages$(EXEEXT) spandsp-0.0.6/test-data/etsi/fax/generate_etsi_300_242_pages.c0000664000175000017500000004537412100564556020653 00000000000000/* * SpanDSP - a series of DSP components for telephony * * generate_etsi_300_242_pages.c - Create the test pages defined in ETSI ETS 300 242. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "spandsp.h" struct { const char *name; int x_res; int y_res; int width; int length; int compression; int type; } sequence[] = { { "etsi_300_242_a4_diago1.tif", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_STANDARD, T4_WIDTH_R8_A4, 1100, COMPRESSION_CCITT_T4, 0 }, { "etsi_300_242_a4_diago2.tif", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_STANDARD, T4_WIDTH_R8_A4, 1100, COMPRESSION_CCITT_T4, 1 }, { "etsi_300_242_a4_duration1.tif", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_STANDARD, T4_WIDTH_R8_A4, 1100, COMPRESSION_CCITT_T4, 2 }, { "etsi_300_242_a4_duration2.tif", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_STANDARD, T4_WIDTH_R8_A4, 1100, COMPRESSION_CCITT_T4, 3 }, { "etsi_300_242_a4_error.tif", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_STANDARD, T4_WIDTH_R8_A4, 1100, COMPRESSION_CCITT_T4, 4 }, { "etsi_300_242_a4_impress.tif", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_STANDARD, T4_WIDTH_R8_A4, 1100, COMPRESSION_CCITT_T4, 5 }, { "etsi_300_242_a4_stairstep.tif", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_STANDARD, T4_WIDTH_R8_A4, 1100, COMPRESSION_CCITT_T4, 6 }, { "etsi_300_242_a4_white.tif", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_STANDARD, T4_WIDTH_R8_A4, 1100, COMPRESSION_CCITT_T4, 7 }, { "etsi_300_242_a4_white_2p.tif", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_STANDARD, T4_WIDTH_R8_A4, 1100, COMPRESSION_CCITT_T4, 7 }, { /* Second page of the above file */ "", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_STANDARD, T4_WIDTH_R8_A4, 1100, COMPRESSION_CCITT_T4, 7 }, { "etsi_300_242_a4_impress_white.tif", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_STANDARD, T4_WIDTH_R8_A4, 1100, COMPRESSION_CCITT_T4, 5 }, { /* Second page of the above file */ "", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_STANDARD, T4_WIDTH_R8_A4, 1100, COMPRESSION_CCITT_T4, 7 }, { NULL, 0, 0, 0, 0 }, }; int photo_metric = PHOTOMETRIC_MINISWHITE; int fill_order = FILLORDER_LSB2MSB; static void clear_row(uint8_t buf[], int width) { memset(buf, 0, width/8 + 1); } /*- End of function --------------------------------------------------------*/ static void set_pixel(uint8_t buf[], int row, int pixel) { row--; buf[row*1728/8 + pixel/8] |= (0x80 >> (pixel & 0x07)); } /*- End of function --------------------------------------------------------*/ static void clear_pixel(uint8_t buf[], int row, int pixel) { row--; buf[row*1728/8 + pixel/8] &= ~(0x80 >> (pixel & 0x07)); } /*- End of function --------------------------------------------------------*/ static void set_pixel_range(uint8_t buf[], int row, int start, int end) { int i; for (i = start; i <= end; i++) set_pixel(buf, row, i); } /*- End of function --------------------------------------------------------*/ static void clear_pixel_range(uint8_t buf[], int row, int start, int end) { int i; for (i = start; i <= end; i++) clear_pixel(buf, row, i); } /*- End of function --------------------------------------------------------*/ static int create_white_page(TIFF *tiff_file) { uint8_t image_buffer[8192]; int row; /* TSB-85 WHITE page. */ for (row = 0; row < 1100; row++) { clear_row(image_buffer, 1728); if (TIFFWriteScanline(tiff_file, image_buffer, row, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } } return 1100; } /*- End of function --------------------------------------------------------*/ static int create_stairstep_page(TIFF *tiff_file) { uint8_t image_buffer[8192]; int row; int start_pixel; int i; /* TSB-85 STAIRSTEP page. */ start_pixel = 0; for (row = 0; row < 1728; row++) { clear_row(image_buffer, 1728); set_pixel_range(image_buffer, 1, start_pixel, start_pixel + 63); if (photo_metric != PHOTOMETRIC_MINISWHITE) { for (i = 0; i < 1728/8; i++) image_buffer[i] = ~image_buffer[i]; } #if 0 if (fill_order != FILLORDER_LSB2MSB) bit_reverse(image_buffer, image_buffer, 1728/8); #endif if (TIFFWriteScanline(tiff_file, image_buffer, row, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } start_pixel += 64; if (start_pixel >= 1728) start_pixel = 0; } return 1728; } /*- End of function --------------------------------------------------------*/ static int create_diago1_page(TIFF *tiff_file) { uint8_t image_buffer[1728/8 + 1]; int row; /* ETSI ETS 300 242 B.5.1 One dimensional coding test chart - the DIAGO1 page. */ for (row = 0; row < 1001; row++) { clear_row(image_buffer, 1728); set_pixel_range(image_buffer, 1, row, 1727); if (TIFFWriteScanline(tiff_file, image_buffer, row, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } } clear_row(image_buffer, 1728); set_pixel_range(image_buffer, 1, 0, 1727); if (TIFFWriteScanline(tiff_file, image_buffer, row, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } return 1002; } /*- End of function --------------------------------------------------------*/ static int create_diago2_page(TIFF *tiff_file) { uint8_t image_buffer[1728/8 + 1]; int row; /* ETSI ETS 300 242 B.5.1 One dimensional coding test chart - the DIAGO2 page. */ for (row = 0; row < 1001; row++) { clear_row(image_buffer, 1728); set_pixel_range(image_buffer, 1, row + 728, 1727); if (TIFFWriteScanline(tiff_file, image_buffer, row, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } } clear_row(image_buffer, 1728); set_pixel_range(image_buffer, 1, 0, 1727); if (TIFFWriteScanline(tiff_file, image_buffer, row, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } return 1002; } /*- End of function --------------------------------------------------------*/ static int create_impress_page(TIFF *tiff_file) { int j; int row; uint8_t *page; /* ETSI ETS 300 242 B.5.2 Printing resolution - the IMPRESS page */ if ((page = malloc(1079*1728/8)) == NULL) return 0; memset(page, 0, 1079*1728/8); set_pixel_range(page, 1, 0, 1727); for (row = 2; row <= 78; row++) { set_pixel_range(page, row, 850, 850 + 27); set_pixel_range(page, row, 850 + 27 + 745, 850 + 27 + 745 + 26); } for (row = 80; row <= 117; row++) { for (j = 0; j < 1728; j += 2) set_pixel(page, row, j); } for (row = 118; row <= 155; row++) { for (j = 1; j < 1728; j += 2) set_pixel(page, row, j); } for (row = 194; row <= 231; row += 2) set_pixel_range(page, row, 0, 1727); for (row = 270; row <= 276; row++) set_pixel_range(page, row, 60, 60 + 1607); for (j = 0; j < 1728; j += 27) set_pixel(page, 315, j); for (row = 354; row <= 480; row++) set_pixel_range(page, row, 209, 768); for (row = 358; row <= 476; row++) clear_pixel_range(page, row, 488, 489); clear_pixel_range(page, 417, 217, 760); for (row = 354; row <= 357; row++) set_pixel_range(page, row, 962, 1521); for (row = 477; row <= 480; row++) set_pixel_range(page, row, 962, 1521); for (row = 358; row <= 476; row++) set_pixel_range(page, row, 962, 969); for (row = 358; row <= 476; row++) set_pixel_range(page, row, 1514, 1521); for (row = 358; row <= 476; row++) set_pixel(page, row, 1241); set_pixel_range(page, 417, 970, 1513); for (row = 354; row <= 1079; row++) set_pixel(page, row, 864); for (row = 157; row <= 926; row++) set_pixel_range(page, row, 884, 899); for (row = 0; row < 1079; row++) { if (TIFFWriteScanline(tiff_file, page + row*1728/8, row, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } } free(page); return 1079; } /*- End of function --------------------------------------------------------*/ static int create_duration1_page(TIFF *tiff_file) { uint8_t image_buffer[1728/8 + 1]; int row; int i; /* ETSI ETS 300 242 B.5.3 Acceptance of total coded scan line duration - the DURATION1 page */ row = 0; clear_row(image_buffer, 1728); set_pixel_range(image_buffer, 1, 0, 1727); if (TIFFWriteScanline(tiff_file, image_buffer, row++, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } for ( ; row < 117; row++) { clear_row(image_buffer, 1728); if (TIFFWriteScanline(tiff_file, image_buffer, row, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } } clear_row(image_buffer, 1728); set_pixel_range(image_buffer, 1, 0, 1727); if (TIFFWriteScanline(tiff_file, image_buffer, row++, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } clear_row(image_buffer, 1728); for (i = 1; i < 1728; i += 2) set_pixel(image_buffer, 1, i); if (TIFFWriteScanline(tiff_file, image_buffer, row++, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } clear_row(image_buffer, 1728); set_pixel_range(image_buffer, 1, 0, 1727); if (TIFFWriteScanline(tiff_file, image_buffer, row++, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } for ( ; row < 236; row++) { clear_row(image_buffer, 1728); if (TIFFWriteScanline(tiff_file, image_buffer, row, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } } clear_row(image_buffer, 1728); set_pixel_range(image_buffer, 1, 0, 1727); if (TIFFWriteScanline(tiff_file, image_buffer, row, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } return 237; } /*- End of function --------------------------------------------------------*/ static int create_duration2_page(TIFF *tiff_file) { return create_duration1_page(tiff_file); } /*- End of function --------------------------------------------------------*/ static int create_error_page(TIFF *tiff_file) { uint8_t image_buffer[1728/8 + 1]; int row; int start_pixel; int i; /* ETSI ETS 300 242 B.5.4 Copy quality criteria - the ERROR page. */ for (row = 0; row < 68; row++) { clear_row(image_buffer, 1728); if (TIFFWriteScanline(tiff_file, image_buffer, row, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } } clear_row(image_buffer, 1728); set_pixel_range(image_buffer, 1, 0, 1727); if (TIFFWriteScanline(tiff_file, image_buffer, row++, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } clear_row(image_buffer, 1728); if (TIFFWriteScanline(tiff_file, image_buffer, row++, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } for (i = 0; i < 10; i++) { for (start_pixel = 16; start_pixel <= 1616; start_pixel += 64) { clear_row(image_buffer, 1728); set_pixel_range(image_buffer, 1, start_pixel, start_pixel + 63); if (TIFFWriteScanline(tiff_file, image_buffer, row, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } row++; } } clear_row(image_buffer, 1728); if (TIFFWriteScanline(tiff_file, image_buffer, row++, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } clear_row(image_buffer, 1728); set_pixel_range(image_buffer, 1, 0, 1727); if (TIFFWriteScanline(tiff_file, image_buffer, row++, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } for (row = 332; row < 400; row++) { clear_row(image_buffer, 1728); if (TIFFWriteScanline(tiff_file, image_buffer, row, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } } return 400; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { TIFF *tiff_file; struct tm *tm; time_t now; char buf[133]; float x_resolution; float y_resolution; int i; int image_length; int opt; photo_metric = PHOTOMETRIC_MINISWHITE; fill_order = FILLORDER_LSB2MSB; while ((opt = getopt(argc, argv, "ir")) != -1) { switch (opt) { case 'i': photo_metric = PHOTOMETRIC_MINISBLACK; break; case 'r': fill_order = FILLORDER_MSB2LSB; break; default: //usage(); exit(2); break; } } tiff_file = NULL; for (i = 0; sequence[i].name; i++) { if (sequence[i].name[0]) { if (tiff_file) TIFFClose(tiff_file); if ((tiff_file = TIFFOpen(sequence[i].name, "w")) == NULL) exit(2); } /* Prepare the directory entry fully before writing the image, or libtiff complains */ TIFFSetField(tiff_file, TIFFTAG_COMPRESSION, sequence[i].compression); if (sequence[i].compression == COMPRESSION_CCITT_T4) { TIFFSetField(tiff_file, TIFFTAG_T4OPTIONS, GROUP3OPT_FILLBITS); // | GROUP3OPT_2DENCODING); TIFFSetField(tiff_file, TIFFTAG_FAXMODE, FAXMODE_CLASSF); } TIFFSetField(tiff_file, TIFFTAG_IMAGEWIDTH, sequence[i].width); TIFFSetField(tiff_file, TIFFTAG_BITSPERSAMPLE, 1); TIFFSetField(tiff_file, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); TIFFSetField(tiff_file, TIFFTAG_SAMPLESPERPIXEL, 1); TIFFSetField(tiff_file, TIFFTAG_ROWSPERSTRIP, -1L); TIFFSetField(tiff_file, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, photo_metric); TIFFSetField(tiff_file, TIFFTAG_FILLORDER, fill_order); x_resolution = sequence[i].x_res/100.0f; y_resolution = sequence[i].y_res/100.0f; TIFFSetField(tiff_file, TIFFTAG_XRESOLUTION, floorf(x_resolution*2.54f + 0.5f)); TIFFSetField(tiff_file, TIFFTAG_YRESOLUTION, floorf(y_resolution*2.54f + 0.5f)); TIFFSetField(tiff_file, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH); TIFFSetField(tiff_file, TIFFTAG_SOFTWARE, "spandsp"); if (gethostname(buf, sizeof(buf)) == 0) TIFFSetField(tiff_file, TIFFTAG_HOSTCOMPUTER, buf); TIFFSetField(tiff_file, TIFFTAG_IMAGEDESCRIPTION, "Blank test image"); TIFFSetField(tiff_file, TIFFTAG_MAKE, "soft-switch.org"); TIFFSetField(tiff_file, TIFFTAG_MODEL, "test data"); time(&now); tm = localtime(&now); sprintf(buf, "%4d/%02d/%02d %02d:%02d:%02d", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); TIFFSetField(tiff_file, TIFFTAG_DATETIME, buf); image_length = sequence[i].length; /* Write the image first.... */ switch (sequence[i].type) { case 0: /* The DIAGO1 page */ image_length = create_diago1_page(tiff_file); break; case 1: /* The DIAGO2 page */ image_length = create_diago2_page(tiff_file); break; case 2: /* The DURATION1 page */ image_length = create_duration1_page(tiff_file); break; case 3: /* The DURATION2 page */ image_length = create_duration2_page(tiff_file); break; case 4: /* The ERROR page */ image_length = create_error_page(tiff_file); break; case 5: /* The IMPRESS page */ image_length = create_impress_page(tiff_file); break; case 6: /* A stairstep of 64 pixel dashes */ image_length = create_stairstep_page(tiff_file); break; case 7: /* A white A4 page */ image_length = create_white_page(tiff_file); break; } /* ....then the directory entry, and libtiff is happy. */ TIFFSetField(tiff_file, TIFFTAG_IMAGELENGTH, image_length); TIFFSetField(tiff_file, TIFFTAG_PAGENUMBER, 0, 1); TIFFSetField(tiff_file, TIFFTAG_CLEANFAXDATA, CLEANFAXDATA_CLEAN); TIFFWriteDirectory(tiff_file); } if (tiff_file) TIFFClose(tiff_file); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/test-data/Makefile.am0000664000175000017500000000153211422612266014035 00000000000000## ## SpanDSP - a series of DSP components for telephony ## ## Makefile.am - Process this file with automake to produce Makefile.in ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU Lesser General Public License version 2.1, ## as published by the Free Software Foundation. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU Lesser General Public License for more details. ## ## You should have received a copy of the GNU Lesser General Public ## License along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. SUBDIRS = itu etsi DIST_SUBDIRS = itu etsi local all: clean: spandsp-0.0.6/test-data/itu/0000775000175000017500000000000012357123347012666 500000000000000spandsp-0.0.6/test-data/itu/Makefile.in0000664000175000017500000004541412343626375014667 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = test-data/itu DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_check_real_file.m4 \ $(top_srcdir)/m4/ax_fixed_point_machine.m4 \ $(top_srcdir)/m4/ax_misaligned_access_fails.m4 \ $(top_srcdir)/m4/ax_c99_features.m4 \ $(top_srcdir)/m4/ax_check_export_capability.m4 \ $(top_srcdir)/m4/ax_check_arm_neon.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ COMP_VENDOR_CFLAGS = @COMP_VENDOR_CFLAGS@ COMP_VENDOR_LDFLAGS = @COMP_VENDOR_LDFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_FAX2TIFF = @HAVE_FAX2TIFF@ HAVE_PBMTOG3 = @HAVE_PBMTOG3@ HAVE_SOX = @HAVE_SOX@ INSERT_INTTYPES_HEADER = @INSERT_INTTYPES_HEADER@ INSERT_MATH_HEADER = @INSERT_MATH_HEADER@ INSERT_STDBOOL_HEADER = @INSERT_STDBOOL_HEADER@ INSERT_STDINT_HEADER = @INSERT_STDINT_HEADER@ INSERT_TGMATH_HEADER = @INSERT_TGMATH_HEADER@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIMLIBS = @SIMLIBS@ SPANDSP_LT_AGE = @SPANDSP_LT_AGE@ SPANDSP_LT_CURRENT = @SPANDSP_LT_CURRENT@ SPANDSP_LT_REVISION = @SPANDSP_LT_REVISION@ SPANDSP_MISALIGNED_ACCESS_FAILS = @SPANDSP_MISALIGNED_ACCESS_FAILS@ SPANDSP_SUPPORT_T85 = @SPANDSP_SUPPORT_T85@ SPANDSP_SUPPORT_V34 = @SPANDSP_SUPPORT_V34@ SPANDSP_USE_EXPORT_CAPABILITY = @SPANDSP_USE_EXPORT_CAPABILITY@ SPANDSP_USE_FIXED_POINT = @SPANDSP_USE_FIXED_POINT@ STRIP = @STRIP@ TESTLIBS = @TESTLIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = fax DIST_SUBDIRS = fax all: all-recursive .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test-data/itu/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test-data/itu/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-recursive -rm -f Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic clean-libtool cscopelist-am ctags \ ctags-am distclean distclean-generic distclean-libtool \ distclean-tags distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ ps ps-am tags tags-am uninstall uninstall-am all: clean: # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: spandsp-0.0.6/test-data/itu/Makefile.am0000664000175000017500000000151211422612266014634 00000000000000## ## SpanDSP - a series of DSP components for telephony ## ## Makefile.am - Process this file with automake to produce Makefile.in ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU Lesser General Public License version 2.1, ## as published by the Free Software Foundation. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU Lesser General Public License for more details. ## ## You should have received a copy of the GNU Lesser General Public ## License along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. SUBDIRS = fax DIST_SUBDIRS = fax all: clean: spandsp-0.0.6/test-data/itu/fax/0000775000175000017500000000000012357123347013444 500000000000000spandsp-0.0.6/test-data/itu/fax/itu8.pbm0000664000175000017500000175231511007012212014746 00000000000000P4 1728 2376 ??????~?x??|>x<||?>>x?|||>x??x|x>? 0|0?|??8?>???~??>??~?>?~??<?|>?~?>?~??>?>~????>~???>~>?>~~>~>~>>>>???>>>?>>????>>???>>???>>???>??>>>|~?>?~>>??~>>?|8|~??~>>??~|~?|??>~|x|~~~?~>?~||~?~~>>?>>~|?~~?~~?>?~?|~>~|~?>>|???~~<?~?|>~|?>??|?>>>?>??@~>~?x?~>x>?ǀ~>p~???>>?>>~>?>~?>?>>>?x>?>?>??>????>??>?>???>>>|~~>?|?~~?>?|~~?~|>?8??~~>>?|~~|???|?~>??>~?~|?>?~|>~`>~|?>?||`0~|~~|~`?>??||?~~xx??|?~|8?>~||?~~>~>|~?~~?~||~<~?||~~<|8~~|x~?|~~?||~??|?~|~|~|~~>|~>|~?x?~~??>~~?~~ ~~~|~~||~~|?~~~~?~~~?~~??>~~>~~|?>~~<>~~<??>~?x~~?8>~???~~??~>~~>~~?>~||~|?>~|||~<~>~??8~||~??>~~~~>~????~~??>~??~~??>~?~~~>~?~~~ >~?~~~ ?>|~~~>~~~>~??~~?~~~~?~?~<~~?~~~~??~~??|?~~~~~x>?~x??>~|??>~|~|~~~>?~>>|<~?|>~|?~~????|>~?~~??|?>?~|~~>?~?~><|??>~~><|>?~~??>||?~?~?~|???~|?<~~?|~~~~?À|??~~p?|?~~|>~|~~?>~?~~>??|<?~~?|`~?~?~?~??`|?~?~?>~~???>~?0?>~~?|~~~?|?x~~~x>~~??>??>?~?>??>~|>~<?|??>?|~||||p?|>?~>||>|?|||??|?~>|~>|~>|@??|~>~?~||9~>~p|~@||?|?|???|??x?||??|???||??||? πx||?|?||?>|?p?|~||x||~|?x||>|?||>??||???|??|8??|??|??|?8|<|?||?|~|<~||??~>|?>??|~???|??~~??o||~N?|||8||~|?|>?||~<<|| ??||~?|?|???||~x||??||?~||?>|?~~x?>|~?8>|???~~?>|~?>|?~??>|| |~?|?|??|~?|>??|~>|?>|~||~?|?~|~|?||??|~?|<||>~|~?|~???|?~??|~?p|~ |~?>|?~???|???~3??|?|?~|????<|~?|~|~||??|~|??? ~?`|~8??π|~???|~??|~>???|~@??x?~?|~|{?>|~~~?|~?~??|?p|?~>|~??>|~?|`<|~?|<?|~??~>|~??>|~0|~|~?|>~?|?~?#|~|?~?~s|~>|~|~??|~~|~`>|>~>K|?<? ?0|~?|<8???~?>|~????~??|~?|??|?||~?8|?|?~??|?|????8?x???~0x?pp|~x~?~`?~x???<0?>??>?>`???~||??|?????|?`~??????~?????p?????8~?????????|???~?|?x|??<||?~<?|?>>||| |>|~??>|~~@?p?|~??x??|~p~?~x?|~??|x?>|~Àp?>`?||??x?|~|0?>||?|?>|<~>>?>??x>?~?|??x|x?><<<?>|?|>?>?<??|????|>|???>?p??>?|~~~|?|~|?|x?x<?߀x~??x>??||~<>>~<<>?>?|?>>?|~??~|~?|@|~|8?||~8||8||~|||~||~?x??||?x|~?x<~||>||?||??p?p?8~ |~<?x|?0?|>??|~?|~?|~|||??`?||~?>|??p|~?>>>|>pp?|p??>~88q0~~|||??~>8||?>>~x|>~0?|~>q?~?}~??g?|~~?|x0>>>~p~8~8~????|~8??<>>p?~?|~<>>~|~???|~`?||~>??|~??|~???|??χ|~??|??|~?|>?~?|???||???>??|~ @>?~??|8?????~?<??~???????????|?~?>??????|~?|?~|?~~??????88?~~?>?`?>?~??>?||>|>?||>8>?>???~~>?~|}|?`@x|?8?x??0?q?????????x???|~|??~~?<~??|??~?p??0~???????~?~?p|`>~|>?~>?߿~>??}?~?x|?@???@?~<?????>????>~?|?|~???>?? ???x????????@?~?p??~???????~ ><~?|~<??|????x?>?>?~>|~??|~<~?|??<~?|?x???~?~??>~|?~??>~??>~~?~~>~??~?>?>|8~~?|?~?8~|?0~|?|~>~???~?|~???p?x>~~>?~?~>?~?~?~?x?~???|??~|~?<?>??~|>>~?~~>~??~|?~~~?|?~~x~???~~~??~|0~~08~~????~~`|?<?x? ~~~?8~???~x??~???~?~~~?~8>?~?>?~>?~?~ ?>~>|~?8??????|??>|?~>??? ? |?||?||??>|<???||?a?|~?~??`????~?|~??>p?>??~??~<?|?<|~>>>?>?>?? ????~???8??>????>????????~~?x~p|??>~??x???????>??>?|||?~~~|??>|?p?~?????~~??~?????~?|?> <>?~8>>?<>8<?>?ǃ>p? π>?~?~x|?߀?|?~?????@?|?~?8??~??||~??~|~???~~||>|??|???>|>?|?|??<||?>||<||>>~<>|???|???>>?>?| ?>?||x||~?|~?>???>>??~x??~~|??|>?|>???|~?<~~>~~>< ?~?<????~?p???x|??0|||??>?<>>????x?????|~>?x~ ~??8 π??x0~????~???8??>?????<|>0??|~?>?|??|?`||~>?9|<|?|? ~>>?>> |~?~<????????x~???????|????|???~| ??|?>?~>x?<???<?? ?~???????|??<???~?~?|~?|>?|<|~~?|>~>~?>~??~??p??>??>>  ?????????>??|????x?xx?|?~|<??~<?| 8x~~x|0?>?ϟx<? ?<<?<~<?>??????~>~???>????~?xx??x|x<>?8~p??? ?????` |~2?<>>??~????~|?~|>??~?~??|?x?8???x?~|~~??x@~?~p~?~0?|~?|<~~ ~????>??~>?8>>|||~<>~?<>|<<<?>>>~>~À~<<`?88??????@?~> ><><<8>pg_=0g  ???????????????????????????????????????????????????????????????????????????????????????????????????????8?8?8?8?8?<?<?|?|?|?|?|?~???????p?`??p`?@???????????????????????????????????????????????????????????????????????????????????????????????????????????????????߹#??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????8????<????<??>??~????>???~???~??~??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????ku6?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????spandsp-0.0.6/test-data/itu/fax/itu3.pbm0000664000175000017500000175231511007012212014741 00000000000000P4 1728 2376 ~|<<?<?> 0?|?>?~?|????p ?>><>8 ?<>|ۀ}|><<0|<?~>???>~~~>|~>>>|~?~>>>>?>>>>?>?>`?>??>>? ??>>>>` >>>>>?ǿ>>??>>>???}p>??>>???=??~>??~?=??|>?~>~>?~~?=?>?~ >ϼ>?>w=?}???x>|><={>x>??????>?>?=}?}?>?<Ͽ=<?~???>>?>?Ï?0~}~??~>}< >~??>?>?>`}??>>x?<|??}|>`>}}?>>><|?|???|??>|?}?>>?<<|>߾>? ?>||>?=??>p>?|<<x|?> >?   |>>|<????>>?@>>?>ߏ߿>>>>>߿?>>߾~ǃ1>>??>>?>???>߿??0>>?????ߟ?>>?~??>>|??><??>?>?>??>p???>??~>~>>`>>>p> <|>8?8?>x >=>>>>> >>x<?x>>|p@ >>?8x|<y?>>~>}߁??>>>}>};?>Ͼ}><π?Ͽ}~>}>>~π?}?π?>><π?>}><?y>><>|~?|? x|>x?><pp8~?8p<>||~?|x<@?xx~?>>>|<}???@8x>p|?~>~<}?<<>>}?<ϼ<<><`x|???>p?>x}???`>??x{<?????p>@>?qy=?????x>0~?yxy<Ǟ<<π><<xxxǟ<<?π?>xx|ǟ<<=?>O?x|Ǐ????x01?y>?~>>?>?>~?|?>|>?x??|><>?`?>x|~??`|8><ǀ >?x>1?><ǀp8?><Ç>?<8>><y>À|C>>xy<|<xy<<>x>><8>>y<x8>>?<? |<>p<?=?r?<|>`>x?>??>?8?>Ͽ>?>|???<?x ||?~>?>x<|?>~x}?>>|>|?>>>?x}~?|>p~?0{??>89????p?>?>x~px? x>?0 0x?8>p??x????????|?>??>??>~?>?~~x|=>>x|y~|x?|9>~?<88π||?<<< Àx|><<<|0<?>p8<8?|>><x<|||p|<><<<<x?~|<<x8xϟ?|<<x||Ͽ?8|??|?ǿ<>|y???<x>}|/y=?Ǿ|{|x<?<x<?~{ϼ<??y<xxπy?|px8?x>?8{߀ <p?p| ߁???p@Apx|a 8x ?<||`????8?`A0@|??x><?|??<s||{?<|x>|>>}|x|8>x|>x<<<=y||{>>>|<<>=?x<?x<>x~<?>>||8 8x? ?D?LpC@ g88? ?70~ ?@??????&0|~?~ |?|>Ͼ|????|<x??|?||>Ͼ|?|x<>?x~~|~??|}x|>?~~=~~~x=||||?~π|}x|??~π|<||x|?|||x|?~~?ǿ||||>~||ϟ~x|>>~|ǟ?||>>|||~Ϗ??x~|~?8|????????|<?~?<>~.???>????????<|||>><|><|x<<<`~?<|>>??x8<?|??p~~<?????x~??<??>>x<}><p><>?y|?x>~?>>>|?>>>>?~>>?|>p?~||>?|~?|~>!~?p~0???|???????|?~??|~߁~~>|?>o>|~>>|>~|??<||??||{??|?|y??p ??~>|???~>|?>>|~?>?>?~ ?>?~???>~>???<~???????????|||0x' x8=/ 0@;1q0<Á<`?`??~>|>|???~>?`??>x<??>>>߇߿>߇?~>>ߟ~|8pq ?>>|~}|?{?>?w >>>|???>>>|>|???>>>Ϗ}߇||??>>>|>Ϗ?|<>|>?>>߇??>>?}ߟ??>}<||><>|}>>?π???ߏ||>|?||{><??{?ߟ|ߏ?}?>y>}>?x?}?||~??|?<<?xLJ??>}>=>?||{~?|~?|x<@<x|??>||<<>|}>|><x}??xqp>|<x?~>>|?|`xq<x?<x0`pp88???x<q?|?~@ }??8~??~8@???@???|p??~??>??~?{߰~?χ??|?|~>?~?ϟ?߇??~?~~?~??|?||>? >Ǟ>?~?~?~~?||>?x~?>|>?|~~|>?>}x||??߀~~?||<<p|?~???|!<?|?~?~|0p8?~???σ<?<?χ>?}??|>?| ?<}>=?x?x|~>Ϗ>?x|>|08?A`?<< >x|p~?????~??>~~~>~>~>>>~>>p>?x|0>>?>??=?pp00@x>????xx<xp8>??>{??<x??>~>߿{x?x>?|>~?>>x~s?>?<ß?|??>|>xx>>>~?>?x>x<}??>?|xx<<??~?> ?><}??>|?x<=x>~?>>?x>?~<=?~?>~?ߏ|>?x<=x>>?~x<}?<??|<?p??>|?>??x????xp?p>10`p?À??  @À>?~?x|?>???<?Ϗ~?<?~????|?@ߟ??~??>??߿???>>>???߾???~>>?߾??<~>?y߿}?=?}>??{ߟ|??|>?ߏ|????ß|>???<8???????{?=x?xx??|x??? ?? ?8?p|;x???|x|<?~x|??π?~{x??|π|~<{ ?>|x|>?=>|||>=??x|>??7?|>???|>?y=?|>?x?=??>{|>?x=?>{|>>{x=w>{<>?x=x0>y<x<y珀{yx<x<珀?>?90x8x< p?><?p?p<>~?>~??>???????>??| |??|??????||>?~|À?|>?|}0|}?|?||?||???|?|?|?80?||?&  h08??'<@ p??x!@|???>? ?<p8?>|~~|x???~?p|@0???<x??>~?|x>??>>}|~}}||ρ?~xx>>>}|>}~|σ?~|π>x}|||>?>|?;??x{>x<}||~>>>|????|1xx<<?>>|????xx<<?}>}>|????>xyǀq<}>|>}|>???9~?xǀ ??|>|>}|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|@8x8x8x8|8xx< |8?xx?|8?xx|D 8?0 x?x|8xx|~8xh<x|?~x<x>x|8xp<xx?x@xp?|<8xx?|?8}xxx|xxp|xx>x|8x>p|8xx|x>|x`?|x?Ǐ|x|>x8|>?x<8{|>x|8{Ǟ|>x}|xǟ|x|8x?ǟ|xpßÏ|8|ǟ?ǃx|Ï8|x|8|x|x|x|x|x|x|xxx?|x?x>s3x?|0 x??>p |xx>p|z's|xxp|xx>p|8>p|xx>px|xx<>p|>8|~p|8xpp}Ͽ|?9~?8x{>pyϿ|?x|{p}ϼ|}xy?|{xyϼ?>|}xy?|{xy?|}|xy??|{xx<|{x|q?x|s?px|x|x|x|x|x|x| x|x|xxx|ӿxxx|xx|xx@<@xx|xxp|x?|x<x>@|`x<<x<0`>>|>xxx0<qx8c|x~p~><{|?|?x><?|x?@ 8?>?|??y~>p}<x??ǀx|>}?{>|??{<ǀ ||p?=?{<x?< |xx>>?{Ͼ|?yπy|<{<|xx<={Ǽ<x?yyx<|?x~?=}ϼ|=yyx<{<?||xx?y?|=qy?x<<|||p??}|}Ͼ<<<||p? 8~|<x<|p<<|<|x|?p|0`p0<<||?p|<||<|p|<8?|p|~p|>|||||||x@g|`A?oxPLz?|?||C P`y|`x|x||qxpy|xy|x y~|?x<7y|??xyy|yyx||x?x~|??>~x<p}??~?|x~?|Ͽ~~|}??x?~?|ǀ>~???|~~?>~~?x?| |ǀ|?|~~?|?~?~>|?|~~?x?|~<ǀ||~~|??>||~~?~x?~?~<|>|x~?|?>~??><|x~??x>?|?> ~||~}|??|><~x~}|???|<>|>||~~<|?~y>><<?p<<|?|>|<xx><x|8><?xx|~x|>x|>x|>|<8xx|x|x;?!/Ǐ ` spandsp-0.0.6/test-data/itu/fax/generate_dithered_tif.c0000664000175000017500000001256011422612266020033 00000000000000/* * SpanDSP - a series of DSP components for telephony * * generate_dithered_tif.c - Create a fine checkerboard TIFF file for test purposes. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /* This program generates an A4 sized FAX image of a fine checkerboard. This doesn't compress well, so it results in a rather large file for a single page. This is good for testing the handling of extreme pages. Note that due to a bug in FAX image handling, versions of libtiff up to 3.8.2 fail to handle this complex image properly, if 2-D compression is used. The bug should be fixed in CVS at the time of writing, and so should be fixed in released versions after 3.8.2. This code uses 1-D compression to avoid the issue. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include #include "spandsp.h" int main(int argc, char *argv[]) { int image_width; int row; int resunit; int output_compression; int output_t4_options; uint8_t image_buffer[1024]; TIFF *tiff_file; struct tm *tm; time_t now; char buf[133]; float x_resolution; float y_resolution; int x_res; int y_res; int image_length; if ((tiff_file = TIFFOpen("dithered.tif", "w")) == NULL) exit(2); output_compression = COMPRESSION_CCITT_T4; /* Use 1-D compression until a fixed libtiff is the norm. */ //output_t4_options = GROUP3OPT_FILLBITS | GROUP3OPT_2DENCODING; output_t4_options = GROUP3OPT_FILLBITS; x_res = T4_X_RESOLUTION_R8; y_res = T4_Y_RESOLUTION_FINE; image_width = 1728; image_length = 2200; /* Prepare the directory entry fully before writing the image, or libtiff complains */ TIFFSetField(tiff_file, TIFFTAG_COMPRESSION, output_compression); if (output_compression == COMPRESSION_CCITT_T4) { TIFFSetField(tiff_file, TIFFTAG_T4OPTIONS, output_t4_options); TIFFSetField(tiff_file, TIFFTAG_FAXMODE, FAXMODE_CLASSF); } TIFFSetField(tiff_file, TIFFTAG_IMAGEWIDTH, image_width); TIFFSetField(tiff_file, TIFFTAG_BITSPERSAMPLE, 1); TIFFSetField(tiff_file, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); TIFFSetField(tiff_file, TIFFTAG_SAMPLESPERPIXEL, 1); TIFFSetField(tiff_file, TIFFTAG_ROWSPERSTRIP, -1L); TIFFSetField(tiff_file, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE); TIFFSetField(tiff_file, TIFFTAG_FILLORDER, FILLORDER_LSB2MSB); x_resolution = x_res/100.0f; y_resolution = y_res/100.0f; TIFFSetField(tiff_file, TIFFTAG_XRESOLUTION, floorf(x_resolution*2.54f + 0.5f)); TIFFSetField(tiff_file, TIFFTAG_YRESOLUTION, floorf(y_resolution*2.54f + 0.5f)); resunit = RESUNIT_INCH; TIFFSetField(tiff_file, TIFFTAG_RESOLUTIONUNIT, resunit); TIFFSetField(tiff_file, TIFFTAG_SOFTWARE, "spandsp"); if (gethostname(buf, sizeof(buf)) == 0) TIFFSetField(tiff_file, TIFFTAG_HOSTCOMPUTER, buf); TIFFSetField(tiff_file, TIFFTAG_IMAGEDESCRIPTION, "Checkerboard or dithered ones"); TIFFSetField(tiff_file, TIFFTAG_MAKE, "soft-switch.org"); TIFFSetField(tiff_file, TIFFTAG_MODEL, "test data"); time(&now); tm = localtime(&now); sprintf(buf, "%4d/%02d/%02d %02d:%02d:%02d", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); TIFFSetField(tiff_file, TIFFTAG_DATETIME, buf); TIFFSetField(tiff_file, TIFFTAG_IMAGELENGTH, image_length); TIFFSetField(tiff_file, TIFFTAG_PAGENUMBER, 0, 1); TIFFSetField(tiff_file, TIFFTAG_CLEANFAXDATA, CLEANFAXDATA_CLEAN); TIFFSetField(tiff_file, TIFFTAG_IMAGEWIDTH, image_width); /* Write the image first.... */ for (row = 0; row < image_length; row++) { if ((row & 1) == 0) memset(image_buffer, 0xAA, image_width/8 + 1); else memset(image_buffer, 0x55, image_width/8 + 1); if (TIFFWriteScanline(tiff_file, image_buffer, row, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } } /* ....then the directory entry, and libtiff is happy. */ TIFFWriteDirectory(tiff_file); TIFFClose(tiff_file); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/test-data/itu/fax/test3.pbm0000664000175000017500000104125511007012213015112 00000000000000P4 1275 1745 @@p``@@@x8ppp @` @`` 0  0 `   A  `@  @"p  @"L  @A108@C10F@g` oN`l(`` ` O78|10Cpbx8p x    >0?;???`00 >?00> "00@ `80`??00?x p?8?|???8 x80x<??>0 p80`8`0p80`| 8p` 0p80 ` pa|` 8p80s` pa|a>p8 ` s 0ca<<ap00??a<x0c8?| 0?? a??00/?@???89~8p?8@1??8p/qt ?0qsj0?#ǀ{0?aǀx 0t~@@<|??~>p <>x<cހpx00p`<p00<p880?8<8x80?|0?00?08 ` 00`x ` 0`` 0` 0` 0` 0 0g 0c< 0c<`  0` 00`  `  `  9`  q 0  8      `  `  p8  08  08  8 x  000  0yp  0    `?  8       ` @  `|  `?π<  `0p  `~  `  `       `  `  `0  `8  `} `x  `  `  `|  `?  `` ` `  `  ```0`0@0 @0 `0 @0 @0 @0 A??0 /00@@0=0.@0 O@0?00870 A؇0 0a? ?  000000 00000p0p0p0pp00p00`00`00`0 0`08 00 0 0`  0`0 8`0 0`~00`00`00p00p~0 8`0 8`0 0 >00 ~00` 00 0 0 `~00`?||00`? < 0`0 p`0x` 8`08`0 8`0cx0`00`0 0p0  0p 0 0`00`p8pa08px` 8< 88` <0` <0?p` >pp` ? p`7 p0? 0p8spp?0`<`pp@0` p0` p`0` p`0` xp<<` <pp`pp`  p|``<0x`|08` 0p`` 0p```?0p`@p`~p`|p`` xp`< p`>>``p`~<`pc[@8` pnx` p~`p>`p8`p>`p>`p`0p `0p`0p`p`p?``{``?`?@?q``8```~`0`~`0`0`00@ `0000000000q0000!?0`0`ǀ `0 @08 0@0`0p~0x` pǀ 0À 0p0 p0 Ax0 x0|0xp08B00  0<0  0   0 0 0 08< x    `?0V0 8?0`{0 0  0 `0p0 0#003  03< 03 03 0s|@ 0a   0          <      x  |?<   ?~   <8   8       |   9|   8                  ? ? x@  ` ` ,@  @@  @c    /?     8  p         x5ǁ      >       ? `` p        ` ` `   `  ` ` ` `` p` p@ `@ ` ` ` X@ 88 @     @  @ `   @   0 @x08 q< Gx `   9  }     ?߀ π ߀ @ @ y q      @  `  @    @ @ @ 8@ 8 @ 8 @ @ 8>@ 8? @ 8`? @ ;K3 @ `1À  @ 0Gq @  @ xcp @ ?sw0 3@?; p? 0@  @8@?l?<? p88C{@0@0 ﹽ0@0`/-@0@0A?~8?O8?^pC0@0@? 0@ 0@  @  @ 00 80 00 0 0 @ 0 @0 @ 0 @ 0 0 @ 0 @0 @0@0@0@ 0 0 0  0 0` 0<`00`0` 0` @0` @0` @0 ?gg 0 ܣ? 0 > 0 0?0 0? @0  0 @ 0 ?300 0?0p ! p?p? p? 0  0 g1 0 c0@0a0 @0a0 p0 p80@pp  @0`  @00`0 @00`0@p`0 p `8  `<0 0 0 00@0 0p``pp @0 `s0 `?`0@ `?# `~' p|?x ` x?o0 ` 0?0 `?0 `?0p#` `a` `g` `8#|` `` ` ` ` `` ` `;0 `{`` `8q`0 `8q `c@ `c@ `g0 `` `@0 `@ `0 ` `8@ `8` `8  `8 `8@ `80@0 `800 `80 `8 8 #8` 80 p 80 8@ `80@0 ` ` `p0 ` ]8 `?x0 ``8ox8 ox0 `yT0?0@0`7'0` `~~0  )?7{00 ??|0 ` ? ?0P^v(@  0  ` `0@ 0  0@ 0@ @ @  @ 0@0@ 0@0  @00@0  @  @  @  @ 0@ 0@  @      @0 0@0 0@0  0@ 0@0@  D`0@ 8 @ ` @?@ `0 ?``0  `0 ` @0 ``` @ `0@  ?> @ 00` @ 0` @ p @0 0  @0 0 @0 0ǀ`@ À`@c @ 0c @ 8a @0 a`0  `  `  `    0     0 0`080@ 08< @0?`@ 0? `@0 0?`@ 09`@ 0`0 0`0 0C@0`0~@0 0?|@0 ?h|@0`0P@0`0?` `0C~`0` @0`0@0`0@@0p@0 p `0 ` `0 `8 @0`` | @ `` @0`` @0`` @0 `@0`0@0@0@0 @0 p@0 @0`p @0``@8``@8@p@0`@0 @0 @0`@0@`@0@`@`0``?p@0@`8@0@``@0@`8h`4^@0@` @0@`@E"p@`@yEp@`@`A8@`„@@`Y0@p@` @`@ `@0/}@@0Q8gL@@097~8@p?Àpx`@02l ?`@``<`@`@``` @`` @`@` @`@` @`` @`` @`@@`@@ p @p@@``@````@``@``@````@``@``@``@`@ ` `# @@ @A3`@@ @@`@``#`@!`#``#D ``@0``0@@@@ `@=7`@`@?`@}@@`p@@@@@xp@ @`8``8` p;sx` p??`|p?`@xp?`@``s `@`` ```p |``08`@?`8R``8`@``@? x8``?0` 8`?0p `700 ` p00  @` !@ ` @?+a`  $c@ c  @@ c?  @ xÎ  ? C `  0` c 0` @ ` > @ @  ` ?@8` a@8`  8` ` 8@ @ ` <@  ` @ `` 88@ 8 @8@ @ `  0`  0@  8@ 8@ 8` ` `  ` ` ` 8`  `  `  ` `  ` 0 p@?_8}@ 7 A8`p80x0 |0<00`80xcw@D0bGÿÜ _  /A0$|@0`0`0` 0?` 0?`0``` `` 0` 0`0 `0 0 `0 @00 @` 01@ ``00p@`00@`00 `00`0x`0`0 `0 `?0 0< >080<l`08fL`0  @p0  @ 80@ ~0` 0`/`8 ` 8N ~0a 00xa00`0;`0`0͗:O?` 0?`0 0?`0 0`0` 0`0?@ 00{@ 0@p`! 0`  0`0` 0p<`0 0@0 0c`0 0@0 0@0 0`0 0`0 0`0@ `0@ `0 0000 00 00 00 0`0 0`0@ 0@0 00 00@ 00D@8 p 0@8 p 0?8p 0?D8?p`? 0D`?` 00F`?``??0>`????x0p0w83@>083083081080p080`080 80080ß080?p  880?p 0880?q0880;c?0880so?0080a 880> 80080080 80 @800`00000 00080`?080 80  80` 808 80p?? @80` c`80`8N 8p 80?<>`80 |?`0 ~?`0?! |00?# 0? 0 0 0 `0 `0 `0 `0  0  0 00 `0  0  p8 p8 08`08`08008p08  080p8  08 `08`08 `08 ` 00` 00`0`0 `0 ` 00` 08` 08` 08`08 `08 `08`p`0`08`08`p8`p8 `p0`p0` p0` p0`p8`08`08 `p8 28`p8 `p8 ` p8 `p0 ` p0 ` p0 p8p0p0 p00 p0Dp0 `08/|` p08` p88` p88``08``00` `08 ` `08` `08` `0|0` `00@` `08` `8|80` `00pxH` p00`H` `0x00H` `0?0@`H` `00@p `8w@>p0@h `pc  `pLd ` 0d ` 0` ` 0` `| 0` `  0``  0` ` x?` ` x8p@ ` vߏp ` ` `8a@?`  @a@` 8<@ 0p` ` x<xa 8` ` `08 ` ` @~0 @|  80?` 8p<`  0`q  0`  0  0 ` 0?  csId  g@cÇ`  g<|`  p`  ?~x 8@@  |  @`   8^> q0f`  ><<8 !@   xp x   x9   8  ` 8` `  8@   @  c @   c@ ` C8 ` 8O0 `  ?? ` {?} Cd ` 1}j`  ?a  ?  ac  >?| @2  ~ p @?  g~;p   ǀ<83   a  xs @    9c7 @ ǃ < όc3` x&^ CÀ c1` ?  A1`  8pp`?cP3  8```@  ?8``@  8?``@  q`  a  s@x       8  ?9LJqÇ  9qÇ  8qÇ  8  8   0 8@    ?  <  ~  |  <| ~ 8| > ;  ;?A8 8@0<8A<@ 0~x A&@ >@ @b > `>0A@B $@ 8 0A@ 6@ 8 @0A`3 @  A0`,'p   A`#8 `p A@`8  `8 8  8   ~ ~n?>>|> >||x~  ? < p @         0 08 0 08 08 08 08 0 8  08  0 8 ? 0 8 | 08 p 0 8 0 8 0 0 0 8À 0 8 À 0 x 0 p  p  p@  0? 0 p  p  p p` p0 p p` p ` p  p ` p `  ?`  8` p 8`  ?9`9`0;`~>9|` ?o1x` 1|`<|=0x|`80|`80<@8080 88 0>G0~?| 80>?x>18~w?|38a`3p8 os 8 s 80  p 800  p 808  px800p800 p000 p000 `000  `8000  `x8000  `8000  a000  ?c000` |g8000` gp80pp xf80pp~`` ny80pp?~!xg80p`103gxp0pp`1q7000pp`?q008```?<`30``` 0pp`?"| p`p|`0```0``@?|p``?p```tp```>| `` `| `` ` g`` ` p@` 0 p`` `p p@ |pp ``@` 8` `@` ` ǁ`@ 0 `p 0` 0 0 ` 0 ` 0 ` 0` 0`0`08` 8` 8`p00` q8`?1`988`!~88 80 0  ``0``00?`0D``\;0Ao`00`00@?00 @00`` 0``>`0|`<p0`000?`0px`0xppϿ`  8 `Ǐ`  x` 8 x`}  ??`^````@````@K``?``o|``n@ > `  w0x ?  Y@ ~  ?@  A ?C~  @?C  ~|  |S    @~  ~|  x @ ?p ? >@   @ xw8 8#   ?  0    8@ 8@ 8  8  8?<  8?  8  81  8{8  8g  8  8|s~>  8a  0a 0 0 0> 0 0/p>80 0 p 8`x<8 p 8 ` 8 8`  88`  88`  80`88` 880`0 800`x 800`pp`  800`<8ppp  0800`0p  08000  0<000  0800p0 0800 `p@?p8008@p` `80 @0ax0 p8008p0 000080p?` 00008p`` p0008À` p8p08@C` `80 8ps8x `80 8pc8x `xp`08/p8 `ppp0?0 `pp`0< `p0`08pp0`08`p `p 88`pp`p 88`pp`p 88`pp`p 8`p``p `p``p `p``p `p``p ````p <```p8>```p8>@8`@p8`aǸ`@p 8~c?@88`` 8#x`88?`8Îx??\?`@`8;Î8?8; `@`8{q@`8;0p`83 83>c8< 8388 `88 00 0  80`8}0`@70`80`p`~8p``8`p00p0a8>0|0p?8p>`>8 p 8p`@0p@ p0`@ps~`00~`0p<`|0p0<000000 ?0800 0000<00p`|0p`?````````` ``  `` `    8<`8x ``8```8`{`8``<8 @8>888$80 @88  > 88   88  880  880 @88 A88 `BA80pA`80`@8p`@8p` 8p``x`@@x`D8`pb@ 0`D`0?`@`0`!0`!`0`18`8=0@??8 ?0%@8??0@?08p?>8p<?|808<~p 8~>xpp op3Î<< ?p{Î<<ps?0 p3? | ?p 7 Hp7? @` #? ` 3c ?x<`3 9p~ ! x 0 8 8  8 `@ 8  8  8 8 8 > 8 0?p 87|` 0s`??0c`??0ap#Ü pqp' 8p109? p1p8>080p<|<p 88x|p 000 0 p ``x`;x`0`9~|``888888808qq0p0``888`88888808<8800>00|00<800p`;x 800`?x ?00p?p pppp8?pp p``pp8 x ?x |8 `>?p`` ``?'?,_??Z` @p"@8B;\{~I<yaP/ƀ 8q@@?@g>? (>Sv spandsp-0.0.6/test-data/itu/fax/Makefile.in0000664000175000017500000006272712343626375015453 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = generate_dithered_tif$(EXEEXT) \ generate_sized_pages$(EXEEXT) generate_striped_pages$(EXEEXT) subdir = test-data/itu/fax DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/config/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_check_real_file.m4 \ $(top_srcdir)/m4/ax_fixed_point_machine.m4 \ $(top_srcdir)/m4/ax_misaligned_access_fails.m4 \ $(top_srcdir)/m4/ax_c99_features.m4 \ $(top_srcdir)/m4/ax_check_export_capability.m4 \ $(top_srcdir)/m4/ax_check_arm_neon.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_generate_dithered_tif_OBJECTS = generate_dithered_tif.$(OBJEXT) generate_dithered_tif_OBJECTS = $(am_generate_dithered_tif_OBJECTS) generate_dithered_tif_DEPENDENCIES = AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_generate_sized_pages_OBJECTS = generate_sized_pages.$(OBJEXT) generate_sized_pages_OBJECTS = $(am_generate_sized_pages_OBJECTS) generate_sized_pages_DEPENDENCIES = am_generate_striped_pages_OBJECTS = generate_striped_pages.$(OBJEXT) generate_striped_pages_OBJECTS = $(am_generate_striped_pages_OBJECTS) generate_striped_pages_DEPENDENCIES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(generate_dithered_tif_SOURCES) \ $(generate_sized_pages_SOURCES) \ $(generate_striped_pages_SOURCES) DIST_SOURCES = $(generate_dithered_tif_SOURCES) \ $(generate_sized_pages_SOURCES) \ $(generate_striped_pages_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(datadir)" DATA = $(nobase_data_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ COMP_VENDOR_CFLAGS = @COMP_VENDOR_CFLAGS@ COMP_VENDOR_LDFLAGS = @COMP_VENDOR_LDFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_FAX2TIFF = @HAVE_FAX2TIFF@ HAVE_PBMTOG3 = @HAVE_PBMTOG3@ HAVE_SOX = @HAVE_SOX@ INSERT_INTTYPES_HEADER = @INSERT_INTTYPES_HEADER@ INSERT_MATH_HEADER = @INSERT_MATH_HEADER@ INSERT_STDBOOL_HEADER = @INSERT_STDBOOL_HEADER@ INSERT_STDINT_HEADER = @INSERT_STDINT_HEADER@ INSERT_TGMATH_HEADER = @INSERT_TGMATH_HEADER@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIMLIBS = @SIMLIBS@ SPANDSP_LT_AGE = @SPANDSP_LT_AGE@ SPANDSP_LT_CURRENT = @SPANDSP_LT_CURRENT@ SPANDSP_LT_REVISION = @SPANDSP_LT_REVISION@ SPANDSP_MISALIGNED_ACCESS_FAILS = @SPANDSP_MISALIGNED_ACCESS_FAILS@ SPANDSP_SUPPORT_T85 = @SPANDSP_SUPPORT_T85@ SPANDSP_SUPPORT_V34 = @SPANDSP_SUPPORT_V34@ SPANDSP_USE_EXPORT_CAPABILITY = @SPANDSP_USE_EXPORT_CAPABILITY@ SPANDSP_USE_FIXED_POINT = @SPANDSP_USE_FIXED_POINT@ STRIP = @STRIP@ TESTLIBS = @TESTLIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = $(COMP_VENDOR_CFLAGS) AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS) PBM2G3 = pbmtog3 FAX2TIFF = fax2tiff TIFFCP = tiffcp ITU_TEST_PAGES_PBM = itu1.pbm \ itu2.pbm \ itu3.pbm \ itu4.pbm \ itu5.pbm \ itu6.pbm \ itu7.pbm \ itu8.pbm \ test1.pbm \ test2.pbm \ test3.pbm \ test4.pbm ITU_TEST_PAGES_G3 = itu1.g3 \ itu2.g3 \ itu3.g3 \ itu4.g3 \ itu5.g3 \ itu6.g3 \ itu7.g3 \ itu8.g3 \ test1.g3 \ test2.g3 \ test3.g3 \ test4.g3 ITU_TEST_PAGES = itu1.tif \ itu2.tif \ itu3.tif \ itu4.tif \ itu5.tif \ itu6.tif \ itu7.tif \ itu8.tif \ test1.tif \ test2.tif \ test3.tif \ test4.tif MIXED_SIZE_PAGES = R1200_1200_A4.tif \ R1200_1200_B4.tif \ R1200_1200_A3.tif \ R600_1200_A4.tif \ R600_1200_B4.tif \ R600_1200_A3.tif \ R600_600_A4.tif \ R600_600_B4.tif \ R600_600_A3.tif \ R16_800_A4.tif \ R16_800_B4.tif \ R16_800_A3.tif \ R16_154_A4.tif \ R16_154_B4.tif \ R16_154_A3.tif \ R300_600_A4.tif \ R300_600_B4.tif \ R300_600_A3.tif \ R300_300_A4.tif \ R300_300_B4.tif \ R300_300_A3.tif \ R8_154_A4.tif \ R8_154_B4.tif \ R8_154_A3.tif \ R8_77_A4.tif \ R8_77_B4.tif \ R8_77_A3.tif \ R8_385_A4.tif \ R8_385_B4.tif \ R8_385_A3.tif EXTRA_DIST = ${ITU_TEST_PAGES_PBM} MAINTAINERCLEANFILES = Makefile.in nobase_data_DATA = 100pages.tif \ dithered.tif \ itutests.tif \ ${ITU_TEST_PAGES} \ ${MIXED_SIZE_PAGES} \ mixed_size_pages.tif \ striped.tif generate_dithered_tif_SOURCES = generate_dithered_tif.c generate_dithered_tif_LDADD = -ltiff generate_sized_pages_SOURCES = generate_sized_pages.c generate_sized_pages_LDADD = -ltiff generate_striped_pages_SOURCES = generate_striped_pages.c generate_striped_pages_LDADD = -ltiff all: all-am .SUFFIXES: .SUFFIXES: .c .g3 .lo .o .obj .pbm .tif $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test-data/itu/fax/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu test-data/itu/fax/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list generate_dithered_tif$(EXEEXT): $(generate_dithered_tif_OBJECTS) $(generate_dithered_tif_DEPENDENCIES) $(EXTRA_generate_dithered_tif_DEPENDENCIES) @rm -f generate_dithered_tif$(EXEEXT) $(AM_V_CCLD)$(LINK) $(generate_dithered_tif_OBJECTS) $(generate_dithered_tif_LDADD) $(LIBS) generate_sized_pages$(EXEEXT): $(generate_sized_pages_OBJECTS) $(generate_sized_pages_DEPENDENCIES) $(EXTRA_generate_sized_pages_DEPENDENCIES) @rm -f generate_sized_pages$(EXEEXT) $(AM_V_CCLD)$(LINK) $(generate_sized_pages_OBJECTS) $(generate_sized_pages_LDADD) $(LIBS) generate_striped_pages$(EXEEXT): $(generate_striped_pages_OBJECTS) $(generate_striped_pages_DEPENDENCIES) $(EXTRA_generate_striped_pages_DEPENDENCIES) @rm -f generate_striped_pages$(EXEEXT) $(AM_V_CCLD)$(LINK) $(generate_striped_pages_OBJECTS) $(generate_striped_pages_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_dithered_tif.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_sized_pages.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generate_striped_pages.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs install-nobase_dataDATA: $(nobase_data_DATA) @$(NORMAL_INSTALL) @list='$(nobase_data_DATA)'; test -n "$(datadir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)" || exit 1; \ fi; \ $(am__nobase_list) | while read dir files; do \ xfiles=; for file in $$files; do \ if test -f "$$file"; then xfiles="$$xfiles $$file"; \ else xfiles="$$xfiles $(srcdir)/$$file"; fi; done; \ test -z "$$xfiles" || { \ test "x$$dir" = x. || { \ echo " $(MKDIR_P) '$(DESTDIR)$(datadir)/$$dir'"; \ $(MKDIR_P) "$(DESTDIR)$(datadir)/$$dir"; }; \ echo " $(INSTALL_DATA) $$xfiles '$(DESTDIR)$(datadir)/$$dir'"; \ $(INSTALL_DATA) $$xfiles "$(DESTDIR)$(datadir)/$$dir" || exit $$?; }; \ done uninstall-nobase_dataDATA: @$(NORMAL_UNINSTALL) @list='$(nobase_data_DATA)'; test -n "$(datadir)" || list=; \ $(am__nobase_strip_setup); files=`$(am__nobase_strip)`; \ dir='$(DESTDIR)$(datadir)'; $(am__uninstall_files_from_dir) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) installdirs: for dir in "$(DESTDIR)$(datadir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-nobase_dataDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-nobase_dataDATA .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-nobase_dataDATA \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ uninstall-nobase_dataDATA clean: rm -f *.tif *.g3 itutests.tif: ${ITU_TEST_PAGES_G3} $(FAX2TIFF) -M -o $@ ${ITU_TEST_PAGES_G3} 100pages.tif: ${ITU_TEST_PAGES_G3} $(FAX2TIFF) -M -o $@ \ ${ITU_TEST_PAGES_G3} \ ${ITU_TEST_PAGES_G3} \ ${ITU_TEST_PAGES_G3} \ ${ITU_TEST_PAGES_G3} \ ${ITU_TEST_PAGES_G3} \ ${ITU_TEST_PAGES_G3} \ ${ITU_TEST_PAGES_G3} \ ${ITU_TEST_PAGES_G3} \ itu1.g3 itu2.g3 itu3.g3 itu4.g3 .g3.tif: ${FAX2TIFF} -M -o $*.tif $*.g3 .pbm.g3: ${PBM2G3} $*.pbm >$*.g3 dithered.tif: generate_dithered_tif$(EXEEXT) ./generate_dithered_tif$(EXEEXT) ${MIXED_SIZE_PAGES}: generate_sized_pages$(EXEEXT) ./generate_sized_pages$(EXEEXT) mixed_size_pages.tif: ${MIXED_SIZE_PAGES} $(TIFFCP) ${MIXED_SIZE_PAGES} $@ striped.tif: generate_striped_pages$(EXEEXT) ./generate_striped_pages$(EXEEXT) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: spandsp-0.0.6/test-data/itu/fax/itu2.pbm0000664000175000017500000175231511007012211014737 00000000000000P4 1728 2376 ????~?????>`????O???????p???????~~???x????p??<@op <?p߀|?~~?????@?????????x?0?|????p8?|????????????????????????????????????????~?8?@???????????????????????????????????????????>????????????? ??????>??>?????0??????????`?????????????>@G>???????0????~??x????????}????????<??????????z6??????x??????p????x??>????????????@??????????`?`?p?x????<?????????`? ???8?????0?????????????????????????x???x??? ???????~?~? ?????????????????@?????? ???????????????`???????????|??????????????????<?????~?????~?????????}??????????8?~??????????????~< >??3`?????8? ?x0????????A????????????????????????>???????????????????????????????????x??????????????????>@?????? ?????(? ???????????????|?~??????????????>????????????????????<_?9 ?????????? ??>p@7_??(??????p?????????p??`???????????????????????????????????????~>?8?/??@>8~??>??????????????????????????????????????????????~? ?????@8??`????? ?@|?????0??? ????????????????????????<??~π?????????À0????????????????π?~??????????????????????????????????????????????????????????????????????????????????????????????@p?/|?????????88?????????? ?????????????????????????????p?????????<???????????????????????????????????????????????????????????? ?8?????????????? ???????~?0???`?00????0???????????????x?> ????????????????t????????????? ????????7????????|?0???????????? ?0??8?????????????????????????????????????????????????????????????????????????????x??????????3>???????`?????????{ ???????????????????????????????????????????`?>?? ??< x~??8~? ?? p<~?|????????????????????????<???p?? ????????>x? ???????<?? ?<?~?~?p?>??????p?~?<???0?x~~~x>>>>8~ ?x~|????x?||?~?|x<????~|????????????????~???????~߇?~??????????????????????????????????<????~???<??????????~?????????????>????????~>>????>~~? ?>?>~??8?|??@ |?><`??@??|? |??`??s????????????????????C???????????????????????>?@>|??~?~~3?v?`?0~`?`????π ???>????~0?~?????????????<@?|0 spandsp-0.0.6/test-data/itu/fax/itu6.pbm0000664000175000017500000175231511007012212014744 00000000000000P4 1728 2376 ???~??|}??|??x}|{~?|8>xp>||???|x?0?||ow~??o|8??}8||x|}||x>||~|q~~||??|wp>x?>~<|{|y><~~?߿x|???x?g???8 <p??s ??~~07??xaxpx~px~?@px>pxpx?xpx?pxxpxxpxpxp>x xpxp>xxpxp<~xpxp>Ϟxxp xpp pp pxpppppxp?xpppp  pppppppp|p xpp?xpxpxpxpxppx`?xp x`p x`p xppxpp xpp x pp xpxp xp?xp xpxpxpxp xpxppxp?xp ?xp xpp xpp{xpp xpp xpxpp ?xp??xppxp?xp ?xpxp xpxp?x8p>xp~xpxpxpp xppxp?px`p xpxp xpxp xpxpxpxpx`x0xpxpxpxp xpxpxpxpxpxpx>px>px~? x?x?0x>px>yq~>0>>@@?`? & x @? px`ppxpxp x?p1p xp?pxpxppxppxppxpxp?xppx`pxpxpxpxpxpxpxpxpxp|p<~p~p|pxpxpxpxpxp|xp xpxpxpxpxpxp?xpxpxppx`xp|`xp?|`xpx`p?x`xp|ppxpp|pxp|pxp|px p?|? pxpxpx pxp xpxp|p|p?|pxpx?p|pxpxpxpxp?xp?xp?x?ppx?xpx?opx`xpx`xpx`p?x?`xp|`xpxpxpx xx`xpxpxp?xp<pxpx>p|p<x>px?pp?x?p?p?xp<px?ppx 8pxp>xp~p|ppxppC>@pp?xpxp~xp>x>p<p>pǀp?>p?~?p??>p?p?>pp>7pp >pp >?pp ?8>p?`<<p x<>p<p >p??p p?p?>p?p??p?q???w|?0>?|???|?>x><?>~?<|?x?x|x<??p|<~??=?}?>p<??>p ?>?p L??p> q>??pxp8>p< p<>p?pxp >`x`?<p?><p@8p<?>p~<p>>?~?p>~~p>~?<?~pc<>p??p?p`ppp?ppppxxpx|>xpxxp8p8p?<?p??p>p?p??>~p?>~ p?~p_>p<p>pp>p?p>pp>>p?>pp>`p?>`p>`8p?>`?p>`px>?p<8?p<<?pxp?xppp??p?p??p?p?<p?8pxpxpxppp?p?0??p?pp> p?p??>p?p>p~??p>?p? ~p>p p?>>p<<px?>ǀ|pÀxp~ >?>? ~?>?~f29"?`?(?À?p??@0>?8<>?x ~?x?> ~?>>?p<?> <<>~?p>?p???p>?<p>><p>~<p>|<p<p<p<?p?><p<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|y?}?>w?y?>?y}?><?>Ͽ}}<?<??3xq~>?xz????g??~~? ~|?||?|??~x?>?x?>>Ͼ>>x|~?>|><||>~>~|??????|????? ?`> ? 00x8>????????????>{9y?><{<}=7Ϟ<{<<=Ǟ|y><|p<>Ǟ{<{ p? x@p||x|~~?ϟ?? ??y?|??3<|x=y?ǿۃ???y ?={ϟ???|>px>?? ??????????????x??8?<<?x~||x?||>>??>|߿ >|߿>Ͽ>Ͽ||ϟ||߾?ϟox> ?߾<??x??px?><?<??<>8>>?>>?y|?g|?{>> {x>>yx~~????~x????<??>???=?~?<??x<|?||??>?x??`>x????????????????8???x???x~??????????~q?|??0>?>spandsp-0.0.6/test-data/itu/fax/generate_sized_pages.c0000664000175000017500000002251211422612266017674 00000000000000/* * SpanDSP - a series of DSP components for telephony * * generate_sized_pages.c - Create a series of TIFF files in the various page sizes * and resolutions. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "spandsp.h" struct { const char *name; int x_res; int y_res; int width; int length; } sequence[] = { { "R8_385_A4.tif", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_STANDARD, T4_WIDTH_R8_A4, 1100 }, { "R8_385_B4.tif", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_STANDARD, T4_WIDTH_R8_B4, 1200 }, { "R8_385_A3.tif", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_STANDARD, T4_WIDTH_R8_A3, 1556 }, { "R8_77_A4.tif", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_FINE, T4_WIDTH_R8_A4, 2200 }, { "R8_77_B4.tif", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_FINE, T4_WIDTH_R8_B4, 2400 }, { "R8_77_A3.tif", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_FINE, T4_WIDTH_R8_A3, 3111 }, { "R8_154_A4.tif", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_SUPERFINE, T4_WIDTH_R8_A4, 4400 }, { "R8_154_B4.tif", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_SUPERFINE, T4_WIDTH_R8_B4, 4800 }, { "R8_154_A3.tif", T4_X_RESOLUTION_R8, T4_Y_RESOLUTION_SUPERFINE, T4_WIDTH_R8_A3, 6222 }, { "R300_300_A4.tif", T4_X_RESOLUTION_300, T4_Y_RESOLUTION_300, T4_WIDTH_300_A4, 4400 }, { "R300_300_B4.tif", T4_X_RESOLUTION_300, T4_Y_RESOLUTION_300, T4_WIDTH_300_B4, 4800 }, { "R300_300_A3.tif", T4_X_RESOLUTION_300, T4_Y_RESOLUTION_300, T4_WIDTH_300_A3, 6222 }, { "R300_600_A4.tif", T4_X_RESOLUTION_300, T4_Y_RESOLUTION_600, T4_WIDTH_300_A4, 4400 }, { "R300_600_B4.tif", T4_X_RESOLUTION_300, T4_Y_RESOLUTION_600, T4_WIDTH_300_B4, 4800 }, { "R300_600_A3.tif", T4_X_RESOLUTION_300, T4_Y_RESOLUTION_600, T4_WIDTH_300_A3, 6222 }, { "R16_154_A4.tif", T4_X_RESOLUTION_R16, T4_Y_RESOLUTION_SUPERFINE, T4_WIDTH_R16_A4, 4400 }, { "R16_154_B4.tif", T4_X_RESOLUTION_R16, T4_Y_RESOLUTION_SUPERFINE, T4_WIDTH_R16_B4, 4800 }, { "R16_154_A3.tif", T4_X_RESOLUTION_R16, T4_Y_RESOLUTION_SUPERFINE, T4_WIDTH_R16_A3, 6222 }, { "R16_800_A4.tif", T4_X_RESOLUTION_R16, T4_Y_RESOLUTION_800, T4_WIDTH_R16_A4, 4400 }, { "R16_800_B4.tif", T4_X_RESOLUTION_R16, T4_Y_RESOLUTION_800, T4_WIDTH_R16_B4, 4800 }, { "R16_800_A3.tif", T4_X_RESOLUTION_R16, T4_Y_RESOLUTION_800, T4_WIDTH_R16_A3, 6222 }, { "R600_600_A4.tif", T4_X_RESOLUTION_600, T4_Y_RESOLUTION_600, T4_WIDTH_600_A4, 4400 }, { "R600_600_B4.tif", T4_X_RESOLUTION_600, T4_Y_RESOLUTION_600, T4_WIDTH_600_B4, 4800 }, { "R600_600_A3.tif", T4_X_RESOLUTION_600, T4_Y_RESOLUTION_600, T4_WIDTH_600_A3, 6222 }, { "R600_1200_A4.tif", T4_X_RESOLUTION_600, T4_Y_RESOLUTION_1200, T4_WIDTH_600_A4, 4400 }, { "R600_1200_B4.tif", T4_X_RESOLUTION_600, T4_Y_RESOLUTION_1200, T4_WIDTH_600_B4, 4800 }, { "R600_1200_A3.tif", T4_X_RESOLUTION_600, T4_Y_RESOLUTION_1200, T4_WIDTH_600_A3, 6222 }, { "R1200_1200_A4.tif", T4_X_RESOLUTION_1200, T4_Y_RESOLUTION_1200, T4_WIDTH_1200_A4, 4400 }, { "R1200_1200_B4.tif", T4_X_RESOLUTION_1200, T4_Y_RESOLUTION_1200, T4_WIDTH_1200_B4, 4800 }, { "R1200_1200_A3.tif", T4_X_RESOLUTION_1200, T4_Y_RESOLUTION_1200, T4_WIDTH_1200_A3, 6222 }, { NULL, 0, 0, 0, 0 }, }; int main(int argc, char *argv[]) { int row; uint8_t image_buffer[8192]; TIFF *tiff_file; struct tm *tm; time_t now; char buf[133]; float x_resolution; float y_resolution; int i; int opt; int compression; int photo_metric; int fill_order; compression = T4_COMPRESSION_ITU_T6; photo_metric = PHOTOMETRIC_MINISWHITE; fill_order = FILLORDER_LSB2MSB; while ((opt = getopt(argc, argv, "126ir")) != -1) { switch (opt) { case '1': compression = T4_COMPRESSION_ITU_T4_1D; break; case '2': compression = T4_COMPRESSION_ITU_T4_2D; break; case '6': compression = T4_COMPRESSION_ITU_T6; break; case 'i': photo_metric = PHOTOMETRIC_MINISBLACK; break; case 'r': fill_order = FILLORDER_MSB2LSB; break; default: //usage(); exit(2); break; } } for (i = 0; sequence[i].name; i++) { if ((tiff_file = TIFFOpen(sequence[i].name, "w")) == NULL) exit(2); /* Prepare the directory entry fully before writing the image, or libtiff complains */ TIFFSetField(tiff_file, TIFFTAG_COMPRESSION, compression); TIFFSetField(tiff_file, TIFFTAG_IMAGEWIDTH, sequence[i].width); TIFFSetField(tiff_file, TIFFTAG_BITSPERSAMPLE, 1); TIFFSetField(tiff_file, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); TIFFSetField(tiff_file, TIFFTAG_SAMPLESPERPIXEL, 1); TIFFSetField(tiff_file, TIFFTAG_ROWSPERSTRIP, -1L); TIFFSetField(tiff_file, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, photo_metric); TIFFSetField(tiff_file, TIFFTAG_FILLORDER, fill_order); x_resolution = sequence[i].x_res/100.0f; y_resolution = sequence[i].y_res/100.0f; TIFFSetField(tiff_file, TIFFTAG_XRESOLUTION, floorf(x_resolution*2.54f + 0.5f)); TIFFSetField(tiff_file, TIFFTAG_YRESOLUTION, floorf(y_resolution*2.54f + 0.5f)); TIFFSetField(tiff_file, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH); TIFFSetField(tiff_file, TIFFTAG_SOFTWARE, "spandsp"); if (gethostname(buf, sizeof(buf)) == 0) TIFFSetField(tiff_file, TIFFTAG_HOSTCOMPUTER, buf); TIFFSetField(tiff_file, TIFFTAG_IMAGEDESCRIPTION, "Blank test image"); TIFFSetField(tiff_file, TIFFTAG_MAKE, "soft-switch.org"); TIFFSetField(tiff_file, TIFFTAG_MODEL, "test data"); time(&now); tm = localtime(&now); sprintf(buf, "%4d/%02d/%02d %02d:%02d:%02d", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); TIFFSetField(tiff_file, TIFFTAG_DATETIME, buf); TIFFSetField(tiff_file, TIFFTAG_IMAGELENGTH, sequence[i].length); TIFFSetField(tiff_file, TIFFTAG_PAGENUMBER, 0, 1); TIFFSetField(tiff_file, TIFFTAG_CLEANFAXDATA, CLEANFAXDATA_CLEAN); TIFFSetField(tiff_file, TIFFTAG_IMAGEWIDTH, sequence[i].width); /* Write the image first.... */ for (row = 0; row < sequence[i].length; row++) { memset(image_buffer, 0, sequence[i].width/8 + 1); if (TIFFWriteScanline(tiff_file, image_buffer, row, 0) < 0) { printf("Write error at row %d.\n", row); exit(2); } } /* ....then the directory entry, and libtiff is happy. */ TIFFWriteDirectory(tiff_file); TIFFClose(tiff_file); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/test-data/itu/fax/itu4.pbm0000664000175000017500000175231511007012212014742 00000000000000P4 1728 2376 pp<?8p?pppp' C@ ?@!@p<x?>x|?8>0<|~?xx8<|>xpxxpx8><<p xgxa`0x<<pgxx?πq>>?8??x>|?<>>q?>>?x~?~???<?>|>x<<<??x>Ϗ?~??<?Ϗ?><߃LJ><~x<pxx<>>?x|x|<|xxxxx<>?>LJ<<<LJ`xxx8> px?|y~?<?x|yxxx>|||xx8ǁx>>χ||>χxxx8?xppx??xy<>xxxxxx|?px9<>xxxxxxx?x<xxxxxxxy>xp<<x|xxx81xpx8<<?xx~<xxx>xx`>>x<> xxxxx>x8x8<<?>|>>x0x<> <{3xϞ?x||xx>`|xxxp<<ǃ<<><ǃ>||?|??x|8|>>??>?>???~?????0?????~||?>~x~>x`9ǀ3@<@>8=??p@?x`<`???|p?<?><x|<???ǀ~>?|p>x<||>>x?A8><|<|À?y>><x?||?`x>??~~|x>x|~???|??>?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?<?8ǁ灇px?燁x{<<<<|?x<?<ǁqpx燁{{G88<<|?<?8ǁpx?烁yxy{<<<<>x<><x<|<>x|㏁qwǀ0x>燁xy{<<<<<>??||s???p{g珁pyc<>>~?>??????>??>?|<>???~??`@>` 08????~> ~a?!8`>`><<x?|<<88|<xx<<x||x 0<<xx|x|<<088>x~?|88?xx<<x>@?<x88>x?y?s8<88px8<8<x>y ???p9< 88x~<?@x|???~?8<xx<<8ǃ00q>???x|?>???<|>|??x>~<<8???~>?~ppy`<x<>|??8??|~~???LJ|~pp|<><>xaa8qpxppxx<<@<<p8pxx<>xx<<<<<yxxxpx?xxx8<x <<<?<<yx?x?px>ǀxpx|<|x8<<<<??xx<>8?<><<<y88<x8x|x?~?<|>>>?>??x?>x|<><<>|x>>>xxpx|????߀;8 |>>~??>xx|???|???yoO??~?O<<0x|p8?~~??}<@<<`?8<<~< 8>>8?|? x>~??@>>8>~<?`?<?<8?`<< 80>8~?<8<8}x>p~|x 8x?| ???|<<Ϗǀ?|>>>?>|||>???|?~~?~?>??LJ>><xxx8<χ|p|~ߏ~<|>>|<>8x<>>x <8<xxLJ燃p<|<x_x<8?<|?38<<p?<<x?p8<<?@<p8xLJx`p<8cx<9x ?À8> sq<<x|x>xx>>>>>px灁`xp<xx9<???<?{~Çǃq>p8@ `0<<?xo||?|| `<0x8> ?<<~~px?`8x~x>8xx<80 xx ?a0pp>899<|x>???<`8xa x????߀?À>~~}????~x>||??xx|<σ??<<>>?>><pxppq|x>x<< Á@?|??<<><>x<> x<<<<x|88x|0~1|pp8<ǃLJǏǀx<|x<?x<<<<?x8xx98<xÁg燏xxx8x>ǀ? 8<<xx<<3x8xw`x?8<xÁg燏xxxxx<ǀ><<<|8x<8x880pxy`x8>|<wπ燏xxxx|<ǀ><<<>><8> <<|xxx{p|8??~?ϟLJǐx<x8< x<>>?>~>~?????|?????ǃLJÇx>|x|> |>xx~` p>|~<|pp><8<<p8p|<|<p<8pxx<<<8~ pÀ8?xp~|8`<|<LJ?߇>????>>8?~π|?>}?~=?~?=??<pÀ????>>>p<>p8?>???><?x`<<?<px<px x>>> ?x<8 <<<p<Ï?x>>?x<pp>xϟx>xx<~x????p~?xx~?????~?p>~p~?????<?x>>?|<|0x ?????>`|<<@?0|<|?x|?>x<x<<xp<<xx<c|<???x `xx?????????x| >??????`8xpx???|?`8<x<<8>~?|??~~xxoppp<|?|<xxp>ǃ~???|<x9`98<8<|||>|?xx<|p `9<>;}<x>p`x<<>Ç8x?<xy~8|`1|<>s>x><<<?ppx98p8<9>?xx`G<<8xxCxax 7<p{`p<<>q<? x<<<1?x<pw`x?<8>?>`<<x8;808xc 3<x?8<<>p<?>8<|?;xp8qx8<<8>?xxpp<><8 0<xx<8<<>p?>p>0<<?9x>08p<0xx<<>8}xx?>xx<888x {0{???~<<<xpxp <<<08xp@pp???>|{xx>xp0|8ǃ8`x  ?8???~~σ|<ǁ><<8xpp><0????<|<px >8?>?||x||?><>p?x?@|?8~??? x??0??|?|?p`?88?8}|??p@0xp?x>`8|xxp?<xx<pxp<x|x<?@>xp<px?|??<????qx<<x<?<|@xx??~??<??????~>??x?>>?x||?z~<ǟ><||xx<<||x|<>x<xx<<|x|x>π>y?Ǐǀ0x><<x8?|x<|ǃxx<<0xx<pxÃǃpx0xx?xxxy<x<x~0x<8p{?p<ǃqpx>?xx?>?xx |xx0<x`xx<|xx<xx|8p{7< q??~?>|~|x>>?|x~x||a||88χ1px<<=0????ߏ??x|>yǀ|<<|x9Çx?????????????ߏ????~???x`Àx a<|?~7>x?~~xp|<00 0<|<<~ ?@>>px??8 ??|>?>x<0<>|>p~8|x|x<8<8x<||<x}?<px|x|`p8p 8<8|x<????????8s~|8|x<??????|?|||?<<?|<|x?>||x?<<?|~|xx>?|>|>?||8x<><|xx<yxxx||>x<>><>ǃx<|><?LJ<>xxx<<0xp<>><xx?<8<<<>xx>><xxx<LJÃx<8<p0x<<xxy> G8<?<ǁ?8x>x8x<@8px<<<<?<xx8<?<<?p8<p<<8|<<~?>|8<?<pÃ/<?px8pÃx<|x<|x>?|xx8><8<xpx<<9<p8<p<8|>|> px>>Ǐ~<<0>=pÃ|x< |xpx8xÃx8<?px??~??<<???>?>|8|?<><>xx>>>x8x<ǃr<G8> p8???????????x|<|?<|x????~???????>x?g<>x'???<0@ |<<> >0g<???`<` <K<8>?`|x?>@@<8~>|??xp <<<<|>x|px???ǀ| y? p~?<Ã<<<<<<p8x<|}<8x<<<<xp 8~?<<|p<xxx0>~<< <<<????<8axx8ǃx<>?<|~??8?x<xxw8xxaxx3<xx>?ǃÏ~<>?<<ǁx<w<Àxx?x?<ppLJ||?>?8<<x<x烁x<<<><<<q?x8a8<pp> 燀LJpx<8><<8<<<<|LJ<qg|808~χ|~?><||||<<|88xx>x?????8?pp0|@x0~>?π?x8???pp0x?x O p?A?#>>??>?<<?<???<?>??~<>xx8<?<ϟ><~>ppx<Ǐ?<>?~||>>ppx~?ǎ~ 8<>?|?pxpx??w ?>?<?>>>?|><x?|x<<>>><<x|>x8>|<<sx<<?<yxxx8<sp?<>yxxxx?<q p?q?q?><<|>x<<x>xxx<<q|px<>?q?>>?>||>|x<>|<>|8~8?px|x;ǃ~ǀ`xq`x??~~?}?<χ|ÃÁ`p x????????~?<??σLJ|~0??????????8ߏ`c8@q@?p~x?8??x?`p`8?pO p<?p?p`?~8@|||>?<|||8xx|8<<<8|8| <8x<>8x8|?~~<|??<  x<<~0|8|??>~??<?`<>>x|??????????ߟ???<>||>>>=?><<<>x|>x~|??|??<>>x|<<>||<<x<8>xx<x|x|xxx?|x>ǃǃx<||>|<<|?|<8<8xLJaxxxxx<>ǃÃq8><>pp<<x|x<|@?8<18<yxx8<<?qx<<0<< |<x8<8yxx<?1x<<|<|<|?~ 7|8<x8<y?xx<<?x<?<<|<><?a#|x<|8><x8<xx<<>?ǀx< |>>||>?>>?|<<|<|{><|8p8<xxx<<ǀx?<`??||>>?||>~<<<<`?????????x?`?p|>x?<?|?8???<~ 0|< G8???p |`><80~ ~x?>?88`x~p?<xx|x>`x~=?ǀp~x|x<8px????x~>?~π|x|q`x ???~<|~}?8 xy>>>>=|<?χ|?x???~x|x|>?|xx|<<<~|~>>><?8?xpxx|>?=x<xxxxx<>?p<??xx<<<ǏA??88ppxx}x|<??? ǁxpx<<8<x?<xpxx?<<>xxx<<<x??<88xx<<<;xpxx<~<xxx|<>>>0|<>x0xx<>|<<<x>><88_~??p||~| |`{<>~><<<<|8>><pxapp?x???>?~>?>?ǀ><Á8p?x???|x0>? p|~?????~?~~xp`8p<  <>x ~?|?<?><> ?<>?<~<??0x~|????x~?~yx||><x<xxxyx|<<xxy=|xq|x<>x<xxy{yxxx<<<xǁxy}xx|x<x<qxxxyxx<<<xǁxyxyx<Ϗx=qxxx8ϟ~~?>߇pÏ???~??????>10|??><0<x~~xp?<<`?~<|8`> |>~<> xx><|<`?0px<|`>~?x| ~>px|??|`ǀp8@<x`x?????p~??~??~<>|p~???>????8xxpxx|x|<|xyx8xx|<p>||88xx?ǀ>xxx8x>?<xpx?pyp<?yxppx>x?<{xxx?y<?<<?/8?Cyx>p?<p>?xxx{>?~p<?yxppx<?>?axxx~x>><<xwg8<yx>p7<?xxxxxpxpx LJxxp0pxx|x<>`x???????p????????~x8|?>'o? ????@~xx?|yxǀ??<>?p0 ~p |?p>x|>0x||>x <yxx8<p<98x?π8x88p???<?????~~>?Ϗ~||<?88?<?~|ߟ~?~~?~??????~?|>xx>|~>|>>???ϏLJxx<<p<ǃpx|y<LJ|x <ǁx|3xLJxcx8pxG<ǃpxxp<x`|xxxxpxpy8<x<?~x>~><|>>燇x|<< x|xpxxxy8< x8????<????|>?<~x|?>x??>?>?????????0`|?~~?p????x ~8 0 yx?x|xp ~x?0>8`||??? px>?w <p> x0ps?|~??8 ~xp`??~?ߏ??8ߏ߁~? 00~߀??x?>??pp>>>LJxx><||xxx8p><<<x<xgx8xxx<8燃xp|>8<pLJ|x><xpxpxxxxx<pC<px`<xp@x<x8xxpp0x<p<p p<8@p||xx|?<xÏπp~x<|<xǃpx<`pp??|???GO3p?|????<pw?8|>>'?|???pp?m?pÀ`<x8| <x<x|`x8<xx<>|<` x=x8xp88x<`p|?߀x~?}xϏ8<8<pxx????|~?x??|8><<8<p!~x~???8?????|~>?8?>?|>>xx|x|xx><x<<?|x|<|?||>xx>|?>||~>px||<?<||<?<>8y>y<>0xp<x~xxx0x|x<<<8<p?ǃ8ax π8|xx<x8?8<|8x88< <x<c<xx|<q<<<x|xx0|cx|x|8<xpxp8<>ǀ1x~<<p~x>x||8<<<8xx<0Àx8 18|<|<|x88>8>|<x888??~<<8x>|||8~xxx>x><<|8< pxx8<>x?????<?????>??>|'<??'~??|~<< |<>x p? >8>0?<8>8x<<><||<|<x<<x|?߃߀?π> <<0x8?xx?~p|=?x~?C>ߏ????x>??<>|?Ϗ|?}?x>yp>>|>|<ǃ<xxp|>>>Àxχxy8|?ǃLJ<yy0<<<<À0xxxp8?{y| xx<<<?ǃ<qy<<<<`x8pp8|xx<<<?<y8<|8px8{ |xx<<<?ǃy?<<<p8?8|x>x|<<><?yo88>8px8 ~|>x<=LJǃxx8<?<<p8x8?||??߇<18<><<<<px{?~?<~??ߏ|????8?x ?o?3?p?x῁' ?>8< 088À0|x8|x8`xx8xx |<8x8pp8`x???|??8 0xx?????>|>|{89>߀|p<<>?0y?x0p~x~?????????||????xxx|>~<|><<<???<<|?px>>?Ǐx?x|x<yxxx>|xx<<<x><>8x8><>xqǁxx<yx8xx>8xx8?? ?|><<<< ||<8<|p88p88xσx<<xx<x<><|<8 > ><8<<8<|px888<<<ǃ~??~|x?>?<<8<||>>?<|x>Ãx|8<<<<ÇcLJ???????~~~~???~>????~?????`  ?~>|~x~|?p@~pp<p??h00~0??????pxp<x?8p<??????xxx>x~x<<x>?>|x|x||x|xpp>x>~?xx<<|<|<|<|<px 0<00<p??8x|x|xxx|xx`8xxx18p8ox???|<|>xx>xx>xǀx<<8<pp8>x_8<pp8x8px||<<><<<|<||x|||xx<88Àpx38x><<<<x0xxx0ǰx<|<<xpxxCØ x`x<<<|px8<8xÁpp8????????~x~x|<>x?|x?||x<<xx<>px|<????????????xo>?~??~?x<0~x`@<?`@~p3?>x8``|@|p`>`0xp8<x80x8=`p888|??>|?ǀ?>xxxx<xxx8?x<=0~<>|s`<xx??<<qxsxp{<  88x8xx8x?<098?xxx?><<|@x?p8px8Áx?88x<s|<<<yp??pxpxp<xxxx>x`xx?|>xp8xxx8x>8x8||8|>?>><>qq!x8xx#pxx8p{r> ǃx`x???~?|p<|??x|xx?|?||8?????8`x>'~?????~??|??0o >??8`?<|?|`<>`<>>x8pp?><>>?<?@ <<88x9??~~?~~?||>|||ǀxx<y??~~~~?x??p|>?q>?~>>x~>πx~ǃxx8< <<|<8x0ppqp|p8xp< xp8ǁx88p|0<xx8<<<8Ãppqx0xp?xap8x<8x888<8Á?pqxxppp8Á?<>x??<<8xx88<|8<xxx~ppp8|xc<8x8<8axx<<<xxxx<8<|xpxxx|p8p8ǀp8??<>xx<<<>8χ{|xxppx<<>p<0pp9Áx8?????||?Ǐx|??|p?|???~?~?8??>}<??~~?0o??<>8a<x<8p?@<><>p?8| ?0<x<x8<g@ppp<~?π?g>0 <p< ?>`|<?߀w?>~8>|x>q<>x?<|?xxxǃχÇyϟ??<|x~||8x|xx8p<<><<8xx>?㇃x8><<88x8<x<8<x8xp<<8xp<8Ã??LJx<<=>8~~χ??<>??????????~~?x8xpO?O??;?~~ ||Ç>~?ǀ88888|~~~~<|?0x >8?|px xx`px8pxp8 ~8p< p?χ~ǀ0xxa`38|?@8~~?~}||pp?~<χ??|>?~ǃ>>~x?x?~>?|?xp<Àx><<>|<ǃpxxLJ燇LJ<8xx<xpxxxpxxx|px888Ãǃ?8<`>ppxǃp9pダpp8>|<<>p<?xxpxǃǀxx0q}|燃????~??|x??>p~???? 0?|?>|}???x|?8<0?8`@ ? `0>>s<8p8p88p|||08p8 <x8<|x8p8<`?π 8<><p 8??xx<8 08`?À ???~||~?>~|~~<|??~|>x>?<||}??x~~?~x<>??{xxxx<<|x~x}xx>xx~?|pxxxxx?ÃÀ?yxpp8<88888<?8?xpxǀp|<y`<pÀ|xy?xxpp8?<x1xx<<<|88<9x q`88qx0pp?~??|| <~|8x0x???~~?????p<?p??< 8?|<??>?ρ??8???`|8  8? ``ppp8>888x``<8|~0 `|>xp??||?xx?0?><x<0x?>xpxϏp>|x<8pxx<?|?ǁx  >??x?߁x?<??Àǁx<>|<Ǐx<<|?ǀxϏ0x<><燀<<?xpxppÃxx<|ppp<x0<<ßǃC8< <9ppppǁxx<< Áxpx0<x<<x?<pppxpp<x8<<Àx?8pxpp?8xxx8<<ǀx>8pxx?pp燁8<|Ϗx8<<Àx8p?xxppc8<<><|8<<x8px8Ãpp8??|p<px0vx>8<ppxx~?p??|~??|8<?~|~x???~??<?@;08>y~?|>8@8`p`0p>8| `xx`p@xxx0??s8pp?σq<p <xp????>???>|yy>xǃ}>|~?p?xxxq~|<xxx|x<xx88Ã>? x|~<<|<`<yx?xy8< yyx8|yyp8<x8p?x<<p<|xp{y`x?8>|p8|xx8>p8<|x8<px8x<`<x`b??~?~???>?>>?~xy|?o?~~???~?~??~`p h8x8`?>0 ><>?<@@|p|>0>> <x `<x<>0|pxxpw w8x>??< 8p>ppx???x~A@8@8<8 ?>?|=?<<<p88 pxx????~??>>??~~?~8<߀1xǁ>px<>xx>~|?>>y>?p<<xqy08px<><x<<@0xx<Àpxpx| xxx<<xx x>p|8<xxp88ppxpx8>p<<>px8p|8@p8?x???~??}x}σ88<x>x<<`p<ǃ@` O?~???????????8|>߀xLJ~???p?9>8<88<?~~<x<<|`p<|x?`<<<8??<<p|8?? `p0` pp@8?>?~??}=>>< p?y008pp ppx~>{????}p~~x8|><<p???<<xxcx<À8px<<>>>yp<<<88p}|xx~88a8<Çp>8?><<|q|><x88<ǎx<p0p<<?p<À<px<?8?`sx88p0ppp8888<p<?8?x<x88p`px<xpp<Àpx8<8<?x8<px|8|8`x<LJ<0<<À8<x<<xx8??pダ?x0|||8x<88  88<pxpp8x~|x|<8øx<<<18<8p<p8pÃ~?>x?????|>?|??p|x{ @8߀??x????~>?~~????~pp`@8``8`?/?|p>8~>~> ``?p?x <x <?x<p<<`wxx~8<xp<ppÃx pxx8<<<p8??0 xx8pp8?~<|>x{8p `0??x?|??xqq?|?|>`~ p?|??x?|??|?|?=?>|>?~<>x<<||>xxpx|xǀppxx>x<p8xxpx<<|x?||pxx xx<80p>xp88?88p<8p?xxpp8pp<pǃxppx>x<x>8x<Àp`x<xpxxpǀxxp|88pp<>?x<<||xx|0pp88p0p8<pp8xpp8xpx8p?~??~xxx?????~x><8<x<<{Á?o~???????99~?@?<9;?8`???{xp ?~x?p88pp?xp`|p8(8x>``@xp0<8pp>xx<p8<?ǁ?>8<?LJ8<<<<x?8xxϏ|?>>χy?x>y88 8A~yp0燃p<<|<|Ç|?>>ρ??σ|??||???|>?x燁?<?p<px8<ǃy<8<<8p8888p㇃?xp<8?`>?xx?ppx<9<8<p<8<88>8xǃx燁????px??p8<y8x88p8888?Á<08a燁oo?Ãp8?pp<9888p<8<<x px燁xp8<8px>px89?8x8p888 8|xpxx߁xx<`>8@p8ppx<9<88p8<>x8?|><px>pp<<x ǃǁ<88p888x88  烁???x?p<<xxLJ<8x<<| x8p<|~?~?~??||>?xc<|p~g<<>`?|??`x~???~??@0|<?000 0x~ x?x80>x8~>?x??x<~<<<xx<8?8<>88x8<<<x8?8<<8Á8xp8x8><<x|~?x<<|?~~p~>~?@?p>p@x?px?px?8<`8<8x`<<x<`~8<0 <?>|?8<`x~????8||>|>|>??Á~A~~<>Ϗxx8x?x?<|<??π<ǀ>@x<<?|xx8xxpxp{8<<<<>Ϗ|Ã~?ߏ?x<χ>8x8xpxp<px<LJ`Áǀp|pxLJyp8<?<yp`8<pp<@ǁÀppÁÃxǁxx<<8<px?cqapppxpÁ>xpp8<8y?8<<pppp8?χϏ>|x||xx|px8<<pppÀpppxp~8~ߟ|w?acp`88~>?~??????pxp8 8?|><~'>??矟ǁ<xp0 ?8x>?=?? Á??0<?` 0 |xp`>0<x>~<xx~<xp;<π??`x0 890|}?|~~?ǀ??ǀ`~x<80?~~~~?y;8p<0À||<<>?p<>>??|?π>~~ǀÀpÀx<<<xxxxx~|?<x<<?À<xxx?x?xxx><<<8?pp8x8ǁ`pダ `x<>8<xxxx<<8pp8p8pダx|<<<x0>xxx8sp8p8pダϟ?? ?~xxxx8À`pp8x8pダ???<8|x8p8|88ǁpダ|?????~?>||cÃpÃ<>??>???|<ǃsÃ@<>?`8<?>~8~8 |><x<>|><>x>wp|>x@< |888x00?߀@<xp88??|8>|8?!~<pp >|????~??8??<0`x<x<>x8><?8<<<|x8Á?y>>8{ xxpx<<ǃ>y|8<p8xpxpy~???xpxpx<88?pp8p0<8xx8pxxpp~x0<{p<xpx>8x8p<}pp?808p8`p8xxpp {xxpx<88<pxߞppp?88ppp<88 pLJyx<x>p|<ǃx?8<pp<8 8>px<|xpp<88ppp<8p??<<<燀p<|?xx0pp 88ppp<8xp ???>??<|pps8xp<pp<88p<>`?>~??~?|xxxpx8ppxs8< À~x<`|~???~|px<|<0w???~?pq>>?pppp?pp<?8~8`x~x<p~0x|><|~8px>>8 x~8p@8p<80~wp>{@88p80x?|8?p<x?80xp߀???=>;>?|px|?|>????{?~ǁ|@<8ǀ>|<<À><?><|>8px88x<ϟpp8ßÀ>p0<<`p88Ã<Ï<8À<<?À8< x8x8Áx<ǃp8p<?q8<8??Ã08Ã8<<>8<?x88?瀃p||ÏσÇp<p q8<8>p?<p80<<><<<px888!<?p~><pp8<<px8<8p<??><<><<>???7߀?~8?p x?<p` @߀<pp|~???<0`|pp 8pp<|p8x?gx 0?<xA>xp80><<00?~????x|>|8ǀ 08ppp p|00π??~|x||?߀?||<>=}?p0 {>????<p?8px8x<0p8?p8 Áy` 88Á88p88xpp<p8x8<x8<< ㇁Ãyx8ǃp8px<pqp8 ?px8|x<<?8?8Áy88p??qpp8pǏ??pxxx8xg8|<<ǁyp8??!ppÃpLJa<<`px8|x<<xp8p<`x8<yO88ǀp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>p88?`xx8|x?p>><?߃|><<08|x|x8qx<x<ǀ<<8=??8|x<p8qx?8<ǀq|pxx<?xx>x?<8x?||x8p8xp8xx8< Àx8pp8<LJ8x8<8xx8p8x~8?p9p<p0pp8?8xp8p88pp8p@x8p8x>8 <p9x<|ppp8?8xp88pp8x|~x~0pxpp> 8>qp?8<xppp<p8pp8pp8|>?>{<?q`p8<|ppp<xx8!xÀxp0>xx|xÃ|<s 8|? ?????Ϗ<|?x<8<xx|8ppx d@ ?????>??p} ??|`??8x8?8w??? 09C|x800>xp?8<>x8x>pp8x <>xp0?<?x>>~??x <>????x>?|pxxx?xx?>>|>?ǀ<x|<x|x?><x?<p<||xp<y|pp<ǀx<<|>x?|x><|x8@0<xx?x>|xp<<x<<xxx?|xx<xx>>x>|xxp<<x<<x>xx?><xxpx<x<x>px?>>x|pxx< x<<x>>xx0p <x|8<px<<x>>x{?xs|?<<<?x?????????p߁??????08||0???>???~~?x>>p>x>~`>~???>ǀ?x|????p>?~????x8>>?x~<?x|?>x?>pxx<x>x|>xx|<xp|8<x=p8><xx?<?|<p||x??????????;||?0`0~0>spandsp-0.0.6/test-data/itu/fax/itu1.pbm0000664000175000017500000175231511007012211014736 00000000000000P4 1728 2376 ??????????????x<?????~|???<?/~?<???8~??<~?|??|??|<?88??8x?|?|xx<?xx?p<?;88???3???s??s?a??~??|?>??<???<???p<??8?<?x?`?<?x?<|?x?||>???|<~?8??<??>x~~??<O??<??x><??8?Ç?a< <??|???>?????~~?8?x>~x?x<>x~|ǀx|<>xx>8<8<><|x|π|><0>08|>|0|x|?>x>?x <>|px|?|~`|>?||>>?<~ρߜ|||??p||>?|>0|y0>x|`=~|`~?πp@|<<|>~|p>8xx>x<~>~~xw|x~|<>a><|~>>~????~<><???????<#@@`~8|<x>|>?~> x>p<{f><ǃ??<>x|x?>~|<x@>ϟ}<<w|>||w|sϼ>LJ?<{>7<<? xx珼<?|<||Ͼ><><<?<ǀ??|<||<?{<><?<>xx<<󟏌?<=<<?||xw|s<>ǃ?<|><<> xwxw|<χ=<<|w<<Ǟ<>>?|~???>??8 8p`{><x?<p?|xǀ????<888???y888?|<x<88Pa<|>><<88<|x<>><8<|~||?<<>88?>x|><|>8x<?|?x<xp8<?<?<><xp8<y}x|<?|<8pp88y<<>||><<?>8pxp <<=<x||x~>||8pppp88?x>|<ߏ|>>|><<<<8ppxx8<||<|?>><<<<x?LJ?|x>|>π|<?>|~>?????<??>???>8>\| ><>>>>~x>|><|p|>>x|??|px?>>x|?|x?>>||>|||>>>|??>>?ߏ???x?>00`|? ?x>?x><||x?>~><>~????<|?x????~߿ǀx>?>??><|<???|<?x>|>><?<x<>|>?x>x<`|<?<<<>p>|>?x>|>>|x|?|>0~<>||~????????????|???`x?|??>~~?>>~8>>~߁?>>|??>~?|>???|~~?>???|>||><|?|>>>|>>>?~?~???>?>|>|>||???|8<>>><>>~????~~?|>|?|?|>?|<|??|>~?|~?>???><???>|>|??<|??????~ǀ??>?><>?~>? ~??~>p?|~>|>?|?|??|||||~?>|>|>|?>|>?>|~>>>????????9?` >xp>?~<sx `88xxxx|x8}??xp>>???xx??|>x??8xx???~?x<<<x|>|8<x8p qx~|ρ|<Ãx<<x8pp8x?{>x>||x<?px<<|8<xxxpqx?<>y<pxxx8py?8xy>x=x<xx<<8<xxpcqx>>yp<>p8x|<x8px8x}>x=x<px<<x8<x|ppqx>y>>yp<~x8>x<x<x |<<}{>|>x>>||~??}??<???~?<?<?x>~À>x x8~8???????????~|??>?>χ>χ>?|?y?~>>?<?|<x?@~<<x`9x`|<x~?????p??<<???>??|<??|xpxx8x<<>??<<8xx8p8x<>>>π|><<x0p<ǁ>q|8Ç<ǀ>>ǀxx<<~8<p8<?<<><<xx<<?p<<px?8<><x<>?8<<8<|x<<<<<<<p<ǀ<q8pp8x<<><x<7ǃ8<<x88px<x<~<?<|ǀxx<<p<p<x<1xxx8>~>>~x|<x<8x<?>xy?<>???Ϗ??}????????}8?????<x~@'xx??xppx<xp8> '  |x0>??q|`>g~>|<8>?<??xp8<<Çp8q8?x~<x<8?~<`8p8xxqx?||<<<<<>xp~x>||<< <?>|><<?8pxp?8<p8q|?|>?> x>|x?>x|<x?x8ppp`<8<<x8q<>|>?>x|~<8x<8<p<p<p8<pp|q?~>?><|<<<<p~~??|>??||~??~??????~~~?}x??????????>?x?? ???p??>0<|||?|?8?0p<?<xxx<~???<x<p????~x?=?xp?????}~p???x??x||?Ã8<xp~??????<~>>|x?x<ǃx<x`À?~>x>>>x<<<<x0pxp?~|>?|x~|<|>x<x~<<xǀ?|>||LJx||xx<<<<<<8p`>|x|x?x<<xp|?||LJx<|xx<pxx?|xxx||x<<>x>x!LJ?~>?|||x|~>x>< <|<???>~ x~~~???????ρ??????????x?< ?????????????????x`x8 x>|>??0`xx0 ?<|??p|?~@08<??xp8<p<<xppx<?x><xx <<x0?x?߀??<?????}|~<???~?xp|<?}pxp<<s?~<><xx|8p?8p8<8pxx|<??~><><xx~ ?8pxx8>p88pxx<?<>|>>πxy<8x|>x90x<<88ppx<>?<>>>><?|y><8x<=x<p<88ppp<~?||<>>|>??xy<<xx<}x8<8<8ppp8>?>>|?xy<<xx<}x8<p888ppx<~??>>>|>?xy<<xÀx<xx8<p8<88px|8>>?><9>xy><x<x<|x<`<8<><8?~>>>>>|>|>?y><x<x<| |<||~~?}?~???>???>>~y???~??x???~?>p~~9>????|???||???~x| `|??8>x||~x`|@x?~|>p pq0g??|?x???y???<xpǃ??<89xp8`?????x|<<Ǟs8x8px<>|>?<|<8`x<s8p8x<8?~??||>|<|><8 {<<|s8x8px|?~y||>?||~<>8<!>LJs8|~|???}>???~??~????????????>??????>?????~0?|` ?8?x<~ ?0<px8p<~x<x8p?<>x<<?9?>p 0|x<???????????x?x9x<???|x<|????x??p8x???x~<||LJx888x{?xxxy<<x><xpx<p<px?|>~>xxq8<8<8xp8?p|>?>xx<p<xpxp<?px|>?>x<xqx<8<xp?8>x|?<xy<pxp80p<px||>?>|<xqx<x<ppp88>|<|>><x|y<xpppx<pxa<߀??|>?|>`|xq><<|x<|~?>??}?????????????????|x0x??~?>|@@~|`x>8~|0~~~~<|~p<~<8~8<<??>xpǁ=??>`pxp??????~? ??`0?????x??????||<|x<8???????<<px<<<<xx8??|?~~~χ<8xxx<p<<88a8|xxx<xqx<<xx<p<<88<8>0<x<xqǃx?pp{<88<p8><xx p?<<<<<8|8><x|<?p|>|qσxx>p|x>??????>ߟ?~<߇???????????????<`>`??>????~88 x?y?8 8<?p?" <~????~?><>8x~x|>?~>8x?~?||8<?~>x8<?>>8<>~8|9~? <<8< |? 8|<?~????>?<??{????<ǀ<x><??>><8<<x8p<~8xp<<p<~~??~?><>~<<<x<xx~<8{xx<<x<|>>|>>><>x<<?p<x<?x{xp<<x<|>>|||>><>x<Cx<x<x?pxx<<x<|>>x>|><>x<p<xp ?<x<xx<<8|<|>>x?|><>?x<p<xp<x<<px| <?|>>x~><>x<|8<p<xp<<>>|??|~>x>><>|<> 8<p<?????x~??<||??>?€???~????<@??~???8?<?p?~0`|||??8>xxp?||?p??|x?pp?0`0|x<?xx~xx|x~π?n?>?????x?ǀ???<x<?xxp< xx??>|ǃ|||x<yxpx?>|x>`xx~8x?x??xyxxp<|qx8x|xx>x?x|yxx8x?p|qx|8x<x?x??~|x||9x>???a|~~q~y|?9???~8@??~p?????=<?<?} <<><<?>|~x>p>>?>  π???? ??????~??????????x~>xx?|???π>|x~?x8ppp<>~~|?π>>|>x<y|ǃx~|yx8<?ǁp8>><x?x|||yxx<ǁp8|>><xpǃx~~y|x<p|px>~?>>ǀ>x矇χx??????????????|}???~@ <!????8|>||8x>||???||??>x0??0x8<xp~??>~<xx`~??p<x|?|||?x?????|?> ?x???Ǐ<ǀ}?|>~??x?x<8??>??~??>xx8p>p8?<x~??>xx<8x8p<~~?>|x|>?x<x8x8pyp<?>>||<x<x8pyp<<?><}<x<x8p?<x8>>><?<x<x8?<p8~>>|?{<<xxx<x8<x<x~~>>?<<xxx<x8px~~~>>~>>||>><xxx>x??x??>?~?~??????p??>??????>??|?8p<|߀<x<<<<<??<>|?<p<8<pp8<<~x8<p8<?{?p8|<p8<<?<p<<<>|<px??<p88<|???????????????????x?>?? ?????????????????????>x???~~xxxx<<<<ppx<<8x8<<0py<xx<<<{|?<<<s>x<x<p8p<<8xx<<~<xpxxx<>?>?>?p 8|~~~?x? <x8|xx?x>>xǀpx?p?ǁx<xx<<p<??πxp|8xÁx<0x8<x ?<? <p8?x~<Áx?<?xx<<px8<<x<<p8xa>|xx8x<x????|<8~>|0????@ @x?0ppq8qÀ8=8p<9<<x|p<8q<<p?|p???998`?{|x}y8pÀ'y?pq9?8pÀ8;߇x<???À> g>x8pxqx>|; xs>>` |w <<xx?{=<???x~x?x<;x?yxy{<>8{xp8x?^Ç<8?||8qx<}{<<88x??9????>><{x?>>?{??~~xǿ{|~~~pxspandsp-0.0.6/test-data/itu/fax/itu5.pbm0000664000175000017500000175231511007012212014743 00000000000000P4 1728 2376 @@ <@xx| g |>x?p8<x?x?=|?~8??<??p??=>x?`?~xxx??9?p~xxx?߁?x~0 ?xπ?|>@`??x營x|<>|ߏߟx烿||?<ߟϟxǁ|;x?8|ϟϟx|x??ǀ~{??ߟ|Ϗ~πϟxxψO???}ߏ|Ͽπϟ|xcϏϏ??>~?Ϗ>?ϟxx燏s?>x`?~?Ͽ>?πϏ|xǀσ~??~?Ͼ|πχs|x߁?ߟ?~?`Ͽ|?ϟ???Ϗ~~>Ͽx?翀|`?~ߏ~~??||?~<@x?<x?ߟ????|p>@px@0|~<<8>?>??>>?>?>~~<?~8?><~?>|@|?|s p~??< ?~?|????|???~??~?>|~}|?~?߀|>~|>Ͽ??~|}~?~>|ߟ?>~|?>|Ϗ?|>|?>>~||}@>??~>|>>~~|>>|ߏ~|>}?>?O>>|~<π|?|}p|xxߏ ~>}?>8>~?߀|?~>|~|ߏ>χ>?~?}߃???~?π????~?????????| `?|?x|8`` y??x >x?~~8|?~>?x~?~>??>~ > `>|<|g>><<? >>??~>???>?~>~??>?>>??p~>?>>>?~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s8|?>~||??|>0>?ǀ`xǃ?LJǏ>?~||?>?>y>>>?9>???>??|?|>~||?~~?>?χ??@?~|?߆>~??>??>>?χ~"``0<?>~||?{ߟ???~ ~~|?χ?{???>~x|<`>?~~|߿<??x?~~??~8?`|?À||99|l>}??<><~><?|||~???~p<><>~@~||x~|2z?~~|?~x~?~?~?~?~??>?~8?~8?|8??~8??|p??~0?|?~?|?~?|~?|~?|>?|~?|x~?|?~??|?~??~??>??~??>??~??>???~??>???>??>??>??>???>??>???~???~???~??~???~??~???~??~???~??|???~??~>??~8?|?|<|>?@?>?>8>?<?||x<?> ??><|x?<??||x|?>ǀ??>~|?>~x?>?>x?>?~xx?>?>x|?>`~x|?>1π??><~?>?sπ?<~<~>?`>x?yǀ?~>>>?>?0?~<<?>?~<?>??~?>?>?>??~<?>?><????~<????~<????~<???><??><??><???><~???><???><???><???><?><?><??><??>???><??><???><???><??~<??>>??~<?><>?~<?><>~<À?>>~<À?>>~<?><?><?><>~<?><?~<?>?~<?>?><?>?><?>>?><?>?><?>?>?>?>>?>?>?>p?>p?>>p?>p?>>p?<>p?><p?>x?>xx<xx<xx<xx<x8<>x8<x8<x8<8<8<>< <?~><8<~><< <>so?߿s~?8<sx~<??~?>|~>0~@x>}pp|<>?<?><<x<<<?<?9<9<<??|><q0<@@><><<<<<p?pp<ypp?<?`> ?<<<<<<<<<<<<<?>|8<~||>>x ~|~?yx~|~??<~<8~<>~||?~~0`Gx~0~?~??>||???x?|?~?q~~?~???c||??>~~?>~~>>|???||ߟߏ>>~|~~߸>~~??|}@?>~|ϟ~~@>~|???@@??>~|~~w?~`>~~??|ߏ|p??~~~?|~?|?Ϟ}`Ç?~p~~???0?`|~}|>?p >?8>>xp`?x q??????<;?|c???~?χ??~???~???>?>~~|???>?>|?~|????~?>?||?߀???~>?||??>?>~ ?>?||>??>?~p>?||@??????|>>||?χ<????~~~|>χ???~|??>???>>??~???x~~|???{?߀??{??{??{?}{|{p|x{`{x<<~>p{x~?>x~<|>~ߏ{8x~~ ????><??? >~???χ?~~>??>~?????߿?~~~?????>>?>>~?π????>~~~|?>||?<x}??>>~~>?~}|?<??>~~~|?>>|?~|w}??>>~~?>?߀|}?<?>>~~|;?ǿ>w|} ><???~~~9?>~ߏ|}ߟ><??~~~}?>~|}߿?>??~?~~|?>????~>???~~|???~~?>? |||}?7<8` ?;????{???>>~~>|>|?>|~? ?>||?=>|ߏ?=<ߟ}><ϟ>a??0>>>>}Ͽ??=>??߿>=>`~ᅬ? ?>??@0}?p8???8|?xy |< ?>~?p?x>p~?p?>?p??p~p?}~<?@0<<??8A?a?>?xx{?yyyyyyCyyy{y{}{<=<<????~???π???||88À`~|08À??~|?@~>|>?>??>?????>?????? >??x??À~~~?~x߀~?>?~~|?~?߀~?>~>?~<?~?߀/<?~|~>~~~|@ 80?>| ?Ç?~|??߀<<~~~>|~ǀ0A8<8<<ǀ<π<<<x?y8y| >>????ߟ矟?>?ߟ~p??ߟp???ߟs??~p|??~<|??p8?>~pxx>xxppxp8xpxpxxxxxxxxxx8888888<<??=8<8<8<8<8<<<<<<<<<>>?> ? ?<~0d8(??>>>>?>><<>><<>><<>>8>>8>>x>>x>>?>>?>>>><>?>?>????aC????>?>?>?>>>>?>>||>>?|p>>`??>>>xy?>~>>>>?>?>>>>>?>?>?>>>>>>>>?>>?>>?>>?>>??>>?>?>?>?>?>? >??>>?>?>?`>?>>>>?>>>>>?>>>>?>>>>>>?>>>>?>>>?>>?>?>>>?>>>?>?>?>>>?>>>>?>>8>?>|xx>?x>>?8x`x>><>>>~p~?g`<8xg|x>??π|x>?????w><<?<㏟><>=x{>Ϗ|?<?<8x>Ϗ|?x<?<|>Ϗ?|x<xxx<x<|>?||>|xx<x<|>Ϗϟx? ||>||<|<|>ǟ?<?y??8>8>>> x>><??????x>???>???>?|?~????>>| 0|<>88`>?>`>>>?>?>?>>0 >>>@> 88p >>>x|<>|~~>>>x|>>|>?>>@@xx8<<|><` >??#8|`|@><<p>>xx???<x8<| x?>|χ>?x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>?>?<p<p8>?8x3<8p?x??``< xx>`??>?>>|??>߁><x|>><ߟ<?~||y>>><?<Ǐ>xxxy><|?LJxx|xx>|~?ǟxxxx><||<xLJx3|>xxx?>||>|Ǟxx>xxxϞ>><|x?> |LJx|x>><|x>?>LJx?>?|?LJxx|q~?>|?Ǐz>?<~???~><<?~?< <x@?>ǀ8 ~0??{y||~~<>||?>??>p>x>?>>| >><x<~|>?<?8><8><~<<`8|8>>>| x >xx~>~Ǐ??<<>~0<|??|||xy;|>~Ϗ?>||Y||w<><<<<|>x|x>s?||<χ||<><<<<<|xgx>|?||?<?||><<<|x<?||?x|><<<><|x>x|?~<||<<>x<<|x<?|||9gx~>><<|<<|xx>x><=πq|?>><<|?|<<<??{|?<?p|~??||ǃ?`|?~??~~??<~~珀> |~?8????{||>>>|<<>> @p?x80>~|x8?>`p|xx|~?pp8xxa`0x<{~||`??x8<|>x?πx{<>|~xw|||x?qǟx?<||x~ϟ?|ϟ0x9><||x|w?ǃyǏ><||x|?LJyLJ~?<>|||xxǁy@ǁ<>|||x|yLJ??||||σy`Ǐ8?||<~9`yǏ8?~8<~?> spandsp-0.0.6/test-data/itu/fax/test1.pbm0000664000175000017500000102301311007012212015077 00000000000000P4 1240 1754 <pAO` | 0>`pp`0`1  p0 À ` x 8 0 x?0 > |p ~ l`0  &? 0 &`#?~`a<p`8 ` p00<0<À0|À`xgxgv8|à p `8<<8pÐ <00 08 |    `'x`0 c`80 8000 0 `0p` | 0 00?x0 t0A0  `0A ?a c    '  @` @` `` `` `8  <` `p 0x` `@800`  000`  8 `1` 0 0 0 @1` 00 `p0` 00 x@0 ` 0?~  Ãx0` ` 0?xs `0aǀ`  ` 0   @1@@   `0 ? ~B 1a@`0`? 0&`Î ``@`0 ``,`<@2` <` < x,0`pp6\@ dp`<x 880@f8`00 f`` 8p 8xp n8`0 @?!o!x `0 !@! `# x`0`0 a@p~8@'`9h```0``|t@> L`08`x?0<'L`0~ `>0<l p0 `8p0` 8 ;00` 000 ` `00` ` ````?`?```0`0`~0`0``0` 08??8`  `p??p` 8`0 l`@x` p@@`8` @@`<` @` @ `  x` p ?8`  08x``  0 2Ѐ` pc? ` 0 `0 ` ` `||@`  `   ``   8` `8  8 ``p p0 `` A < `> |``p x``0 0 ``x p `` ?@`` x``9``````p`p@pp@p007<0p?00000@0000000000000000 0000000000000p0p8p8ppppppppppppp p p p p ` ` ` ` `    L  L @ @ @ ` @ ` @```@@@@@@@@@@@@ @ @@@  P #,8``?` 22 X@ `p`0`` < a8À0 Àp0`p`   `p `p`p8 0p00 pp00 p0 0 00 0080800Ǽ00008<p808~<x?0p8`p`8p08`8 0p00`` `08 `00 `p08```00` `00` ` 00` 8` ``0  0`p>```8 0`p?``p08c```0``8`p```@8?8~xxp```088`xvpp`0ppsaN `0`pNm 09 08 0À0 0 p `0w` @8~``8pp80p0~08<080p00p@@ 0  8 0 p  <8 80@0088 `000 `000`p:000p00p0p`0`p0 ǀ?p@0π`00p 0  0~ 80pp p`< x`p0<8x80 @p @p@ `` `` `````````p `08~@08@ 0x @x  ǀ l ^<p|xp0?8800p`@ 0x0 80`0000` p00`00 `00` 0 0x`8 `p`0 `s p ` p `x0` `00 000 00000800000 ~?  ` ``@`p` ?! p`` 0 ` 8  8p 0` 0@   `  0` ` @ p0 `` <0 p`?0  p`0|00x 8p`|06L 00@@0pw80B8f0L `0@8?ap~80b80| 08p p#ǁp`00c.00 p8> 0 `q3́`0pc80 0' 0 @q7ك`0`a8  0 p` x `a6y 0pc88` `0 ` H8``>a @0`c8 `  p `0@p @|>8@pc08  8`0`p@<``c08@`08`8000 p`G!0&0``0>Ap0@0`Cpp?0```0@``0``p 0><|000?0q`C8`0 ` @080@< @? @@0 @0  `0 !  `@0  `0@xppq `0>@0p'> `0~`pp? |@`0<f`p0 <8 ~@`0`?  0p<`c @`0` ? 0@ `xpÌ`` 0 p0@@ x|0 a<8 ?0 0`x8v a? p000xp@s0c0``p0?  x`ap `0s `>`@0@ea`က?`0? 0> ~8=? `0`   xx`<   ?}pp@o@ p<|  <pp0π??|π` ` 88` <8@0 p` ~``8`0080 ?0@p08`@ 0@@0 <a@<`<<ca@p$>0<`Ac 0|`8 @?` 0``p` @` ``` A` `  c`  8 >` 0c< 6007?8@ 40p  0p ` x`>  `8 `s `0< `0 p0@08> ` `0p0g` `8`|  8`8pp`q ?`08 `09p 1  gÀ8 8 Cxff6 @<<@<>@8~`0`@< 0`b?@ ~3~?  `??> ?8@`|~0g0x`Fl` h g8b`  70@`9= 0?p@`8s0 0``88p 0`?  0= `p8 07 `8`000 0g 8ppp ? pF 0``` ? C ` ` ?`? `?pÀ`?? p8?   g<`p0`8 L9`  p  x9 1 p49`1p? 0`>9pq8?8 >y0p@<?20pP0ǁ`0F0p`  >>0v 0 p7`8p 0   0@  00 0p0@0`pC<`0`?00`x `?P0?<```0_0` >80` ` 0 x 0 00?00pt8@??  {0 0 00>08060 a0 0q0? 0{80<x?`00>>_/`p08|+`?`0p  ``?`    `w ` `g``ǁ`00`p8`?`|p`x<``ǀ@x`<8 pp80p00?@`@@p<     0 0 p  `  0>>@0~ 1   @? `  8 < 0>f? 8 8   8 80 ?9cx 8 À   0 > <`?1 0  @  0@ f0<c `  008?f F8 @3 0 .``&~0G << ` s`<08 Op8?? 0f8'00><@| 1|p8 ?@` @?n0>@  0 `0 0p p0 0 30? @ 0`@` @8` ` ``{p0@@``0@p``008p8` 0008`` p8p0 p `8` 0 p0`` 00`` 00@  `00  `0p`0p@9`0p@9`0``1`0````1`0`088q`0`08`@`0`x@0`0`@8```{ `p 0`0 p8 8|8  ? `@` @p|@08p@ 0x~o0s a``pH80 8p<9`@x `@@pp > 0@@ O@`~?< 80~0@`0>x x@~ @>O h `   ; `p=7 `xp0062 lp<~6  pp@p??l6 x ` @p8c $ 0 6p0` `13p``0@<3p @80`? 0 aq @`? a  `Pp98ap `0>8p  `@00 x0Ã`  `@?x08 00À` `p@!001` p @|' 0 8p 1Á 80x`/` ` 80 qa8 @0!`|0= <` 08 @a`0 `X8`x0<8~ 0@sC`p p|@p``p0x`? `s` o<x``0``0?0@pn`1` `po `px8 0@<0o<`p`x `0@ ` ?<0?8 `0 ,@>p }0 `0 p0~`` ` 0~<=`03|@ f  `@`0?B|   0` @000  ` p0 `0 8@@ <`@ p`` ` `20` b0?p` s?  ` `@ >p `` 0 3` ` 0 3`0 ` <0 q``  f0ap` 0<`  0@`8 p  0@ x 8 `0`  c 0x 9Á  @ `  0@ pp@0 0 `0 @?08 |p8| `}0< 0?  0? 0 |`0cx00`0   ~0008@x @@? `@` `d@ `@ 0@` `8@G ??``"@`3``8@ `0   `0@@@00`@0  `@` 0G``00?`@8 ` `0p` Al ``G` 008` <Ax c``000` p1@8 tC` @o;` 9`` |`@pF` ``3`0`??  0o?<  `s`p`a3<~ c 8@@À@ 8`c``a<1`7>@À0pAC`2x`|`  ` GC@ `@~@ @@8@A  @p`t@@ @@F@F`k Df ؀ f ~ 0< < `> x`?pp03 ~ p ?Aÿ'?ÀCc<0p}0?@ p 8  8  00&0 ``0&00`0&00p`@f0 `08@L80``<@L0```< 0 <``<0<6p?`0 xb000 gxp 00p0  8`00@00p1/ `7?0@0?`08 @ǂp08s @>g0`pw808<70 0Ãp0 3 0@|c  pC;pp~~ p0 `p&0`pc `(?po| a0x`  ``008,8 @pg3@`>10x`  880 ;8~2f 8?q`m0|0  @>8v`8 u}pp>|0 0<0d`8 x8| 08` 0@0p~ `0@`0?0 p&80q<`8p0c0xe@ b `pP xx x<p80000p``0 0 p  `0p ``\p0< ~<@0`48 ÀG`0`28 c8 La`0"x3>|p0xc`0!38v0x3 `1 Lsp c06p2 `3 Oppcq0fp0`;`π p`A` 0n!p0`?` 80 000?``` 0 000```~` < @000`0`o`? p `000`8p``?  0 `` 8``6 @ 00`````   N00``<00  8``x0 0 8a`p   a@`0 8#0}À   p@ 0p>p<p|px`8??0|`p ``Ç?x p  0  `8pp 0p888`0000` ,p8`00|0  ?08 @ p00 `p8xp 80`p~ ``{ap  ap00 c00`0 8 `o 0 ~0   x0 p0| @pp `08 pppxp8x?<  x<x  |p@`  p@ `0`3 088<3  00<?<#  0`6p6pc  ```2 p a  @9``3p a l0``1`8 a|``1`8 0 l```0`q 0<```p`w  0``p`  `<  ``pF` ><``  ```np 0  ` `lp À@`  `1<0 Ap`0@@ @p0p p`?spandsp-0.0.6/test-data/itu/fax/Makefile.am0000664000175000017500000001111511422612266015412 00000000000000## ## SpanDSP - a series of DSP components for telephony ## ## Makefile.am - Process this file with automake to produce Makefile.in ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License version 2, as ## as published by the Free Software Foundation. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## License along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. AM_CFLAGS = $(COMP_VENDOR_CFLAGS) AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS) PBM2G3 = pbmtog3 FAX2TIFF = fax2tiff TIFFCP = tiffcp ITU_TEST_PAGES_PBM = itu1.pbm \ itu2.pbm \ itu3.pbm \ itu4.pbm \ itu5.pbm \ itu6.pbm \ itu7.pbm \ itu8.pbm \ test1.pbm \ test2.pbm \ test3.pbm \ test4.pbm ITU_TEST_PAGES_G3 = itu1.g3 \ itu2.g3 \ itu3.g3 \ itu4.g3 \ itu5.g3 \ itu6.g3 \ itu7.g3 \ itu8.g3 \ test1.g3 \ test2.g3 \ test3.g3 \ test4.g3 ITU_TEST_PAGES = itu1.tif \ itu2.tif \ itu3.tif \ itu4.tif \ itu5.tif \ itu6.tif \ itu7.tif \ itu8.tif \ test1.tif \ test2.tif \ test3.tif \ test4.tif MIXED_SIZE_PAGES = R1200_1200_A4.tif \ R1200_1200_B4.tif \ R1200_1200_A3.tif \ R600_1200_A4.tif \ R600_1200_B4.tif \ R600_1200_A3.tif \ R600_600_A4.tif \ R600_600_B4.tif \ R600_600_A3.tif \ R16_800_A4.tif \ R16_800_B4.tif \ R16_800_A3.tif \ R16_154_A4.tif \ R16_154_B4.tif \ R16_154_A3.tif \ R300_600_A4.tif \ R300_600_B4.tif \ R300_600_A3.tif \ R300_300_A4.tif \ R300_300_B4.tif \ R300_300_A3.tif \ R8_154_A4.tif \ R8_154_B4.tif \ R8_154_A3.tif \ R8_77_A4.tif \ R8_77_B4.tif \ R8_77_A3.tif \ R8_385_A4.tif \ R8_385_B4.tif \ R8_385_A3.tif EXTRA_DIST = ${ITU_TEST_PAGES_PBM} MAINTAINERCLEANFILES = Makefile.in nobase_data_DATA = 100pages.tif \ dithered.tif \ itutests.tif \ ${ITU_TEST_PAGES} \ ${MIXED_SIZE_PAGES} \ mixed_size_pages.tif \ striped.tif noinst_PROGRAMS = generate_dithered_tif \ generate_sized_pages \ generate_striped_pages generate_dithered_tif_SOURCES = generate_dithered_tif.c generate_dithered_tif_LDADD = -ltiff generate_sized_pages_SOURCES = generate_sized_pages.c generate_sized_pages_LDADD = -ltiff generate_striped_pages_SOURCES = generate_striped_pages.c generate_striped_pages_LDADD = -ltiff clean: rm -f *.tif *.g3 itutests.tif: ${ITU_TEST_PAGES_G3} $(FAX2TIFF) -M -o $@ ${ITU_TEST_PAGES_G3} 100pages.tif: ${ITU_TEST_PAGES_G3} $(FAX2TIFF) -M -o $@ \ ${ITU_TEST_PAGES_G3} \ ${ITU_TEST_PAGES_G3} \ ${ITU_TEST_PAGES_G3} \ ${ITU_TEST_PAGES_G3} \ ${ITU_TEST_PAGES_G3} \ ${ITU_TEST_PAGES_G3} \ ${ITU_TEST_PAGES_G3} \ ${ITU_TEST_PAGES_G3} \ itu1.g3 itu2.g3 itu3.g3 itu4.g3 .g3.tif: ${FAX2TIFF} -M -o $*.tif $*.g3 .pbm.g3: ${PBM2G3} $*.pbm >$*.g3 dithered.tif: generate_dithered_tif$(EXEEXT) ./generate_dithered_tif$(EXEEXT) ${MIXED_SIZE_PAGES}: generate_sized_pages$(EXEEXT) ./generate_sized_pages$(EXEEXT) mixed_size_pages.tif: ${MIXED_SIZE_PAGES} $(TIFFCP) ${MIXED_SIZE_PAGES} $@ striped.tif: generate_striped_pages$(EXEEXT) ./generate_striped_pages$(EXEEXT) spandsp-0.0.6/test-data/itu/fax/test4.pbm0000664000175000017500000104125511007012213015113 00000000000000P4 1275 1745 +co+?ُ _oݟ@? `?_ `` ?s"M\?w_ ?|8b""3f6!̆"! f's80b! fba1H FcDfA#D$"c0bc0b`8c@<f#0& AB b < 0c0 0 0#30$g0 pf@ & @c $f1 @l`" pb2 8b1 dݏ @@60`"28f1ňIbx@ cc308f1Af|f>` 1pb1AfLf31c@@b IcDf333Ifx,n `řI`ЈDf333LL`f(ɘd٘f#3# L B~ gf33x̄F  xxn333Ì̄`l3m>60@@@ 31 `|3 23230@@@ `L33336~801 $`D16333"22=1`ňF v@fF0a# #v## 11203@0F"l 0?A2I&32#r"6 3603@bHB&`D``0&H3>s2s0 " !c601DLfg1 HCF` `02d#06c"!01LX`b ȈHCF `13 0@ 0tc6q021LX@b1 f ȈA0@Č!, @@ 0#p61DFb1fL͌a@E`00@!Db fx 861dHDb f x@dؘd000Aa3 DB``lF3! 0@ɀ1 b&``311c 3 Db102lh`0@@>8b3p  @؟1&2c0 0 3#31c`# Db!0"DDLb&f1@1& LD؁1&2 Ɉc 6226( 031c 3Db302lDb,Ffb1@xL 3#&2 c "3bhBG0# `7 Db3<`Df ddb1 2 0&2 a2!c`df`300 b308DDf dlb! ͜c0 0 0rb1 Ya`!c0D&`c0f1>lLf dlb!1FfMB00818a"!cD&`c0@#8x,db!ňBD@ʼnB 0x `2&3b Df`c cnjf1 ɈBN L0`b2&Idf`c & ɈC La 0`0 `60͘@ Eb`#1"l`` 0 ͙&`"30@F`l{l@p xǀ'`&30@Ligc10&&3"@ afff30>||Bf,y @`@& &2@@lAfff32Fgc`Ȅbdif0`0fc`s3&@Lafff2`b"`Ȍcfaffb@6` alLcff2`b&`ȌcdAfff`fbf237``|fff3 b#`c@afcf`f&d3!#4c" fc302Ff# bdaf`ff&D#!cF`b#>c|Lcd$afdff&#!c@D`D!0&23<~cc`fgf@ffd##cF@Db!0##$flc `fb#373F@fD! >##b`ca@ `"dLdD#&##s3fbLc`3`0`@ ~gLcaEx ` p@0  p0#LLL` @` Pp3F8 ` yxd@@ @CG|` il0c A` aD&"f10:||B؀c @I` aDb&f3bc#gd C1 ? @<|L@b  aD"'f3`b2,3 v3 ȀC30I$l0f" ab&3`b2f3b1ؑx!@ 0B30DǴ@`bcfb&3`Ƅb3g"194lppB3 E `Ffs302b#b1! ffcg pɀc3$i8@|~3遲`b3! ff b shc1 1Adq &g3! df!b@31lx0ca`Fcb2|, q dfbb`& d !,f#b & 19f .81  96̙ɀx`p1"O8xXp0L1d0Y㇘`1` c3 牜0`1# 0`H c# `0%p`1|c23 |0 0` ̘  c3 !a09`!̈c"3 @p   e`10#ap9@!̀cB3@p @%Ə`<9311@!̀aC3&$x9 10L@ ! @ف# 8  @@bg,>>  3x1# 0D!L2#3lg!  @321f&f61`04xc3fff&0`pF  3f00"3s@ ``0!06lN63b@ ``13663&@ $d4p  3  63cLDb؀͇ ̑1B >>?6#!L`lLf>3`12bLy 33ǁbs Lf@XFl bc1!10b !݋Y 0?#9d d@ȀFL bb1bF,6 1211b! ` A>1 fdf bb1; F1XG01313"aL |0 11 6fDd1fb!a@@`8Dlٙ``d1&b6!1ϐB@ Dɉ<`1B>;0&Fb&!1 3̉,@30 20Ab&1@|#-ș1L0 30 0>31|x1p!180 000113c?I 0 p@ @p<93a`1`` P B43ayNj  `  dxc06fd301 9D 00 b(c1C"b@1?01M1DX 0{@ b c`Cb@q  @YD 0y 6aB a;bC bd00@@` 㙀 ,G 80`afbf1>xlf#3# f0pј f3 ȈCDllNDb2 333fLfc6# f ύA@DdlDb333s`F`  8   fDLb333`  803332fa3f (@a0s1dDA,xC&"8Dp 0fhCF"(0 c `C0",1<908l`CpbL10(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ff`0Fbc0 ǀ0ߜ36@1p|f`g #0&8  8@8?@`g >p0~Hd8`9a1&6@0n x @HF,{6< 0q~D L  L`πp`Li112  000dN`3   Ǹ1"`Lπ `3D A13168 q000Bp" G̀1`` `0DlA123>> 1?b0`aF Cǀ@@ p `faLA122? 03110@?|@L Aa  |<|s LC1F2c#031ac1 @0p@| c v618@ |00f&cFav03136   @   b b&1800&f@a03136 g8f  bf10 <@ᝲ 311r3& f̈  b`109;23123 D̘@ 0 b`10#3&` L |` p f"119& rldxÀ`f<30  cDfx `!0@ c,B`f{&ϟ`q0@clFÀ`Fc6`qgX0cDF`FC`!<!@$ƀ 0vlf`FC`!$ccp@0D `|4|xFC$`!?0b#1q@0<،F ́g331ǀ@C@=sǃL 38g &fb311c1@1ٍL3L6 &fb 31C3"ݟ|ɁL 3DLb>3;133"1B0b Xf66~oHLY 3D@31C3bfbBc3 `ƌ٘ 3D@81B2"b`Bc3 b3`c3Ϗǀb3bb`Bc3  C`g>sL DFb;`x`@  B#D DDb13Lj`@ >"ʼnG DDb13q L`<, "#9  |g DDb16a hD`3f1@"# C1> H Db3qxD`0bb#@`" B16b;~| @@ h|3xD`0B"#F,~>@0"# B16"13c=9 1@ @&3? hD`0B"#Ld`fbc# 6lĀٳ?9 a@# p;ffs1Ld`|bbL@fv< g36b3?c#31gls@> fsD`dbb1 @bbd{`3`b!1FD@fDc||p `nfb1|@Bbl@`3`~q񹹋$!1BLnFc0lDB>g?90L@BclA!`` mȁ1COocD0@0̘@Bb@Cg3`331C@;cD|ffDB``q31@;c3>~||` `1c0ƛb2`  38 | Bc#` 08c#  c" , b" L f6s  L #    " "    ` 3a00 0qp  0;>0@G010018 C̄g! 100@1@ 0̄i#"g1 Bb2bg1ǘi0FL& F b fl?aB0ayLH0v,@ 0s fl6"F38B0xs31Îp0fl801"g 1  &F"20D'bbf3 ?c1? 00@0 p"" G000 2 f230@D &"~3 0b1 0000`82g" L10 0"`#q7 &""`1@0b1 |<>矞#3@"bf3O3 1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@8ED c6b#""6`f~q3 D|``f"31bF3"<>1? |f8 LG C"#b&@`fc@l`3f"311`2c033? xlLFP B"#"&@@f#`?~fc3&1fZc 1? C&b"&@f#Fc>әfDc !? cs&&#`f  C9fb 0!?@sff`` Fc&a0# ? `؏1 0 5`10!1 129> 8?1C0`11 i0373c@` ? f3Ap``01>l03323 b?f1Ap @`8ٙ12g033:3 ɘǁb?9 F!A H  136A3>3gq`0? F!An< ?13<3xffxp? f!AffL&"f<|0 @3>3 b6|f8@#?0 f! DfL"bF3< ><ϟ0?qؘØb& 2f<c? >3 !DgbcB!0 "&X1ca#٘f b~ `f4fcgxc?3 Dd bcB!0 "f 1f$cg80#g b` 0`f0f&,c?@#@afdLbbF!0 "p Ȏ1f&301>ǀ fb``f0f& c10?fcf&f10 b` ȇ1f&201b316`bf0$ @c0?>0 ff X1f&201b31`2n0& c?f<Ϝ1f$&201b3>1Fflc?1sb010f38!ǀ|c1? !08f31mݏc`31? f31`&c"0 ? 0x񙙃b6{9p`? b7A1ٌ|p03?ߘ剈`Mfb3C1p?93 ? ،fbGaf  `yfb0C1̌`12=͏1? ،d F"&`6LLx`@>dcb1،`1033@|f#1`?p d f&@`Ͱba`?nj㙟00c1`1 #3f31@`?d"f&@`̀F`1p8w1`1 #3f331|80@ ?d&F&` Cd08`1!#1f#31L>8 ?fff"!`Čp`f  1`0&<90@ p?6q30`f30?3ɠ330|@`?fs&0`C "2`<~nQ3>6 0!Ϝw6f#1033!0Fffbx|y`A`6"&`p6L110& 03|~s033!ddf`?9I1`3&&``dL0331  0 3Ā03!0ddf`?N1x 36nf@`dx0;31 #903108Dg?p8`q~fbD010 q3;0F8Df?Nq132 |0@|0f@?p23 L رx`@@ c? 3"2 ͑I8@?fF?0>~&| 1c9|8`?$l&l" sbflf|q ?$d ` HFdL|| `?$g @|ɱbFtlDl~>`?&ƀx;q6b3FüDf&8? l1 Dȉ[b FøDbff`2l|c?`l1 L0gcǁbllȌ DƄb&d Fc3`?dL La0f6f̏|g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c1 lF#<a<@Ld~?Bg3D3<c8C0o~x0s>@c3b0LX`#c3 0}01c`? 0!8lx6  !Á8FL80` AL8  l@!0 eFxX@ A"ifx G0"9.͘ G>`#1LnFfɌ| "p#@D?~nFfD3``< @lx f1D#bG~>s`0 Lf1Dabb""c17g>  hf0Dab"vc0$b3c0Ɍ#bb"vc04b13@8x7fb"`c0,b13 g2c1,b1 fc36ff3 @3?8<@`38x,1@`@ÀH!@lly`@@ 2~j@g>631L@3`af& 0Lba 2b&233131@Acf"b90b##e389 r f9sb6##@cnj9@nj>3b&##@  1&f &##@ `0f >s3@ ` `  C!` @@ < @c33cg p@1@g8f7c24f"  `@133800B??b3$$"  ;c`@`22100f~b8!`3fpb3d$"  fx8``0`110 ffc#1p< & @ 0b3f"   1f DL``0`13 3210 df##18fc71f` Df2f{dc000 ?  eD` `qDf3`p238x F~?D̈f Df0fcc #00L!@4x@fDLD f3`p:3fL̑``A|}Ϝ̙0f Dftaa #001@@`񙝜dLDf36`pq3F ͛`Ǐ0 f@0f``a!001@@8|f3&bx3F<ɻ`0cfd`da#00 1D6vl3Fly`fp ' 1DfD&@d <<<ϟ @A ǀF1 8D@LA01Mff   1Dd&@d ` 0 , lfLA00d `ߐhFfD" `g `` 0Dٙ<Á a100dx@0 ^РFcs`d̜g@``D͍8f$f:0A0a 6Fx30 `C `|gbbb3 ɉ1Hf?$C0vx @`~~~#DL11Hf33&~ x` @1~h10f13gF08 @80123f1?F8p`01f30la|0`f32lAbg0 >3dOf@ 0  Ãof  0 o    `fE>`@`@ lF `3cc`cF0 lG`#26"fc3p? F0dL،1`"66&f#3033"Ã! 0  h`"&6&f#3 #321&f̘8F0 o fL`""6&#3`"3b1, Lly8 @o#3&b"21/1H LFFk209pq@#1c3#2&1d,H 62c1 2`C11" 2`C119#02`C1 11DDl|#cc1`2`C1 1!DFd2cs0 f"c111DDr#c1900 a 1DDt"c13s8` p 1 1ĄDbc131<  ;lDFbc1313611b0D8cc133 "33 666x0@!c1633 ##0"`0@1ρ3333 #~`0 0p0133c``2gÀ`@0?s10 ".`b$q0 #8>fff`L@b06l0t x8L@f0`Dd>18x l`& L@f0``F3318 @df`6~ @FD@f0`hF31d x@!cff`1b7#1)@|f0`8D11f;<=1 @gnf`0b"#Iy㘄`njc`208F31~1&=lq0@w`f`0B"#`k6gx0031@1!@!0[`f`0b"# pc6D33D1 @!31#P +df 1b"#CwF d1f @!3#3Lŀ :f06f33 cȌC8p3f!@!3#3 Lɍ\s3Ic$Ȍ@p>>p!36#XFDwd00 x332#GČ g0361# A Ą0 ـɁ10#  Df11c`xL?8| &10xc`xx@&130c<|@@`?@@!@&130c303ffcǁ` x s1fg#0c1<3`83# f11p>gs0fð1H F@3`?f11ـ?0`!9dɰ10Ld`0`033w@ `d@0``33`@Ϙ 1Ad@0` X1 ` 3`;dD@0@ 10 `1p` <1{110@ ` w ``3? 񘁙180@0 |80 Ff ɘ` @ 0xa񘍟21f@`da330 GGp 00F`q ٘|"fLy 0ϟ`1c @`(a30DL>0F` ٘d"$ a& 20 8cb8a30L 3( 0 fd" `'d a >800a6l8a30L833l 6f<`q`& a 213Ǐ`11 c񍍎|@3x|3 L#01  ?# c19{0D l #0 C!B0321 ́lc0 # B0 1 8a9 B0 h0 y cC0@ @P?@ @Ϝ|sp ><@ ?'@`8ؑ&4 c4F@` ػ01ff##Cpb0F``pH٘60ld"@D9> b0`b @Fxψ& 1ld&`D33ǎbp`pɟg f#321bf#303@0 f~Da&201`xc331`b`f!f#30cF#0"3`  F@ ٳ Fd&201`16p&1f#30C#3 2#l|` 0  Fdb"01`p>qf33"0b#2#DDa$!0 0@0<!08@fw193ffc1"3DL12f3x`!0`@``<>s3cs11 b `` @`@6D0c# `s?À02c @@0 l :(&f `cÏ8d߀3 0`8 ;m36f3 `ȌDca? @ Fπ0s9 0Ȍce3 @DI~00؈c91 A6~3C3Ld&gbg00nc91@A#323@@7cL dff&fb03;>y~393Aa!23fLY#9̀L dvf'f"011fi330a#3fD03@ǀId`&&">0!1`313c#2nD03@`1BfL"ff"60!1a@`332+s``c4fbfb6011`c3@b `>33`@!c?p36c3@b A1 3`~@>aٝ8،@` #` Llf0ppf0FFly 00FB`k6c1x0<~Ff8c6#1M6@0#@Fc#13&Gc!`@@phfLc#13gf& !p@`||fhc6c106?~&0C&lr s&0`F&0C6c33g@ay63bF& sc c4`6fqc`0LNps&c "8Ld@`Ànc36"Ld@w>3gd@dDnj?@?@`_@]?/_/?~@_@@ Հ?z /OH#g  @C/ߠG `q3`'? 0` ?p`??? p`89?{?~`889ǃ??? sǾ9 8?9>9xy<??a9N ?;9p98ǟ`oaϼ9<;sg90p98<>x88q 3sgs8p9>G<8=>Ï?`8<8qss>g18 `9?x8gß88yxs>q p9?8<8ys

}?8|08}88y<>9?        8  80`  q p0` 11`8 `08p0` `100`~|`<`10` 6|@@0@d`1 0`  s00` a1 0`F 7|?8p`? 110  0`Fcf88x @?9  `# 0`0c07 100cp`1 c 01cl8 p1LC|00f `091<>?pp96C00<f `01f?Ïs1800f ``1|1f?98f890f ``10c<901cf`1`t>8p1`8111`sr8`f|81b <~93 88?`0qp00p08@p`00Ü0@ `p00 c0`0p800g0ga0A80p0g0#a8 @`80p0f0a1Ns80p1f0`80qL1aqw80 0c81a1ca8Î|80 C80cs81 a3aaclq ?80<sqcg8p81 a3a`83 1 9080Ï8q\3 a3ac3 1 08f908ps?c ascc3 x1 00B0a00>x8b0pqcgc 1 00b0a00fp<0p sq8Øc 1 00F1p0b01f0`scÜ1 001cp0dx11f0`101cp0l<1!p0`y1c00 xa!|p`y10 xFaap`x0Fqap`0|0p`0pp`x~ p`0p`0p`Ca`0pcaa 1pd8cac  1`l0ca# 0p``x0bac pa'00`0@`8fac `a0 0` 3p08`0c `a0 p`8~?xx`c`a0 ! c880`qs0 !` c03?0`s0a`  C 01 1<xx`LC|00 afx|?Ü6C00< `0c? 80@800 `` 1a1{8<<0x8<8 8y00c a0!`10;s< 8 Dvq81`1003ø~? 9 ?f91a!00cs 9~|` |x0ca!100c~|?px?3a100` t?0sq00`w  `3 ;0>8x`3F`  `0 11`> 0x?gc  `> 1pfc;`>p Ǐ 0p<>8`0 !`a01`> 00 1c1`p0`?0`yvq` c`0a? 0`<s`qLc`1c?n?ø`xx0``;13`>f1q0x` ;3`>`a30~ q>`a # 0 g1  >`a c<0c8l1 Ì ??`c c0;0lca?q p`?q c0;0ls aa1>``>|?8cp0l13aa1'a8 p0> p381caa1 c pp0>pp1caac c cp00>p݌ca af C `p00> a0gf C fs0` 0~ 9 gc0C 0f3 p`x10|F9 gc0Ø ?1 | <xL0p1ø |q?~q?~!|`|a|?| | | \8|dža | B1 Acc 1 2#cǀA  1Afc 1<23@  @ 1Afc 1l0?31XFsϏ 8fc 1<"3;fc،c gf1b#0fclc`0`` 3|79c1cl3 1`  39cl3 1q`   cØLb  @x3`sÂcx< c g`13` f1cdž1f6  p 3131` &cac7 p33` &cac <3 x< C93`Lfg?c,Çac0`asb|~888???8?@8@88P88'8 0@0 00`00?ppp/pppp p(````?``????????????? ???~~}~~~~À ~a3@330`p3F3 p3331&g ``#3b1 Fs g``&b#b3! f0fb Fgf3c f< ffF3D D GF1c  30@CL a<p 88Ç 0??8?8?0?0a?33080?3\3 00?!c 0<?c1`0 "8?cq&# c?cd`fa c?cafal ##ρ?dx #c0̌L?p1a1M?aq p`s p@@PD`???@?M/"  lXs w T3ݗ{u vz >  g + o &P ?  spandsp-0.0.6/test-data/itu/fax/generate_striped_pages.c0000664000175000017500000000755711422612266020244 00000000000000/* * SpanDSP - a series of DSP components for telephony * * generate_striped_pages.c * * Written by Steve Underwood * * Copyright (C) 2010 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /* This program generates an TIFF image as a number of small image striped, rather than the usual all in one page FAX images usually consist of in TIFF files. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include #include "spandsp.h" #define IMAGE_WIDTH 1728 #define IMAGE_LENGTH 2600 #define ROWS_PER_STRIPE 37 int main(int argc, char *argv[]) { TIFF *tiff_file; uint8_t image_buffer[10000]; int image_size; time_t now; struct tm *tm; char buf[256 + 1]; int i; if ((tiff_file = TIFFOpen("striped.tif", "w")) == NULL) return -1; TIFFSetField(tiff_file, TIFFTAG_COMPRESSION, COMPRESSION_CCITT_T6); TIFFSetField(tiff_file, TIFFTAG_BITSPERSAMPLE, 1); TIFFSetField(tiff_file, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); TIFFSetField(tiff_file, TIFFTAG_SAMPLESPERPIXEL, 1); TIFFSetField(tiff_file, TIFFTAG_ROWSPERSTRIP, (int32_t) ROWS_PER_STRIPE); TIFFSetField(tiff_file, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); TIFFSetField(tiff_file, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE); TIFFSetField(tiff_file, TIFFTAG_FILLORDER, FILLORDER_LSB2MSB); TIFFSetField(tiff_file, TIFFTAG_XRESOLUTION, 204.0f); TIFFSetField(tiff_file, TIFFTAG_YRESOLUTION, 196.0f); TIFFSetField(tiff_file, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH); TIFFSetField(tiff_file, TIFFTAG_SOFTWARE, "Spandsp"); TIFFSetField(tiff_file, TIFFTAG_HOSTCOMPUTER, "host"); TIFFSetField(tiff_file, TIFFTAG_FAXSUBADDRESS, "1111"); TIFFSetField(tiff_file, TIFFTAG_IMAGEDESCRIPTION, "Image in stripes"); TIFFSetField(tiff_file, TIFFTAG_MAKE, "spandsp"); TIFFSetField(tiff_file, TIFFTAG_MODEL, "testy"); time(&now); tm = localtime(&now); sprintf(buf, "%4d/%02d/%02d %02d:%02d:%02d", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); TIFFSetField(tiff_file, TIFFTAG_DATETIME, buf); TIFFSetField(tiff_file, TIFFTAG_FAXRECVTIME, 10); TIFFSetField(tiff_file, TIFFTAG_IMAGEWIDTH, IMAGE_WIDTH); TIFFSetField(tiff_file, TIFFTAG_IMAGELENGTH, IMAGE_LENGTH); TIFFSetField(tiff_file, TIFFTAG_PAGENUMBER, 0, 1); image_size = IMAGE_WIDTH*ROWS_PER_STRIPE/8; memset(image_buffer, 0x18, image_size); for (i = 0; i < IMAGE_LENGTH/ROWS_PER_STRIPE; i++) { if (IMAGE_LENGTH > (i + 1)*ROWS_PER_STRIPE) image_size = IMAGE_WIDTH*ROWS_PER_STRIPE/8; else image_size = IMAGE_WIDTH*(IMAGE_LENGTH - i*ROWS_PER_STRIPE)/8; if (TIFFWriteEncodedStrip(tiff_file, i, image_buffer, image_size) < 0) return -1; } TIFFWriteDirectory(tiff_file); TIFFClose(tiff_file); return 0; } spandsp-0.0.6/test-data/itu/fax/itu7.pbm0000664000175000017500000175231511007012212014745 00000000000000P4 1728 2376  8`?? s0@`??`x??q ````>8?7`x?p880x<xὀ0qg`>8p`<x<0```?w<8 <|x6`a` ??<xv3o8 ?<  <xc07op y?8<x0?``` |w q88p<0x0~8 ``g9<0x0g`??<0xc0 8f`8?<`x08 pF `8?8<x00 F ` w?7<x c0p `?v <w~~ c0`x0a??080`?8|pp~?? c p?|  `ppx8G>8`??``?`p>x??0?0p8߀ ?8q88<xxp 900p0809@?ap000p`9`G`pp??ǀa?|@<  0 8@ `>0?!@? Ç0? !p8 ˜<8cv|<}?<0 3g~>=1p8ٜ?7 < 1 w93g?g< >p x?3~?>@~ 0 ca~>g~ @avx p8?0 c!|0p8~`0<0 p 013<08> `8p0a0?p88p 0?p0f 0a`<0 p?8<Øp`1 p?~0_p?p8ә80`; ?G??8a8??80`c??| ?8;pp<8>?p?883 ? 8 x`  p|>p800 0p9p830~?߀~f >888?089q??#<8<8?0<80`s0<{?8 8w`vv0 o  `t`0` `~<p8<  `0ep?0 ??><p|`0`x8s8? p>1x>0`0d0|? <Ï88Þ>0p``0f8 x8ß?x >3c` b_? hs9<|8p0Î>?`` s8 `8 s<9p0Ǟ><<`@`c8 `8 s<9p>8ppa0`h? ?s8;<xpp8<c0xn80 π0sx9<Np08Îap`xpc808p `0sp;p08<<c@x`f0p`? `npyx |p8x`q9`8pp> ~p|8?pqs`p a 0À0`?~<<qჀ?0q> 0?` Cq``  @0?p8pp??`x}0p>88 x<0y<x?<|0<8  x|C@<?p8x`<0?<pxs<{pyxp<3 p08p9688xx0ppx8`<<~1 <0><x88x<8<0@0 08p q8<8x `<8 <8 p<0 0<0p`px0 `<px0  8p q~8x0px0`<`x0  8p<xqǀqx0` `<1  80p<18Gqx `<0 <p0<388@ <qǎx`<1  8 8py<??88<qÆx`< 0 <0<p?p8;qÆx8`<01  8p0<p8x qx8<`<8 8`<00<p8 8x<qx`< 0  <01<p88x?qp8 ||p7<|p8qp0 8Cx<38p~8p8p| ?8pp>0|  @`0p0@88p8???8?~p=8???08w>p0?8pgxx`8O8x>8~p?p`8`08pxp78pp>p?< p ``3 g0wp`x0c?80p~?xx`qqÀ1qg0p?xa88pp? ppÀ|p8`0p`8?x?8pp>|8Á81p`'`0?x88sp8\0p0?p6 8```8wx888ppx81`0x88a8pppn`0pc8?x`88p?Àx< r.`1` 0xp g888g8?p p8`c8x838ppc8op?  1 0x 78pp>p? p<|c8?xǿ8x8<p?> <8<x0a xx8p?`00 c80 x;`8p08<8q0a 0xpx>pw3x`800<<8r<0<p0`x0>`1x@`  0 @ 8<p? `<08=p??~? <x8`>?<|? 008?p8x0 x<  x?~80`<`0 xpx08p80p`8``91 ? 80px80x8`;1 ??80x88pp`90 ?|p888pp?cq<0   x?88ypf<8  8 88pyp~<0 9@xp8? <ᇀ0`Cπx<0 8@8 x>Ç0 8gÀ<0 x88 p|Ã1p'p<0 xx 8x;8p>p`0 x|8w8p>`1 ?x8</ppp3@1 ?x` 8x<p>c `1  1 x` 8fp>0p pǀ0 |x1 x` 8n? <p p0 ?1 ~`~?0x8?>?x0|1`p0 ` @~p8a >x` ?0 `?80?|<| ?8>3<0p8 8@p< 08 `<80 p0`8`` N8|pp088.` 0808? ``? 00 008} f8 08c `9 =8psp08.X<`08`|? p?χ0}<`?000??8`??ϣp{<`?00`0???`=xϱ0A<`8a80``8`}p<` <00`8@?:|`}8x Îs<80c`` 8>8xp ݹh8<1`a0 @8>@8x]8͹x ``8`;#0`<`1Æc6pp>߀4<?@8x8xÎap >`p8c>`x<88xpсx9~ `01? `00?p088`| 8p`@0  0> `0 `  0 8@   xpxppx|?@8 p8<p;?~xp  ?qÆـ8p 8<``s?|o?>x>><x?p 8!?80f`?8|?~p p 8?88~s8 p8~0 pNp`g0 9p8 80088pyp sp8?0x8p8`0`cp8C??p888x p8808988?8p80<010<8~8`8p 8?N8?08p|8x `8p80|sÀy868 ~8 `80<p08pà `ǻx0<v`00<ǀ 0>p088`@a0O>|>?s0 x`  <a~p`0<p <p`p>p?80|`?8`p| ~7`ppyps`< xp8c  `x0 ?8xps< p`p0a8`8p3`< 0``9p3?{><sv< !p0πa`0x?886`< pp@`  `08 p?<pt< `p `0p|{`< `8} 08 |`>߀< `00?`b;xy`~8q`< `{3< ` q`< ` p08 ?p0 80@p`< `p`0 p; 88{8 p`< ?p 8pp3 8yx;8p`< ?p0<~ 0098qc`p<`< a0 p0 9 'pp0 `qa`x`p< ` x q sp08q?`p`w` wp?x|0~`wp|p0 0?0??pxx p p0<<`p` < 0 8?89p?x9p8?`9p88@?<1@F`?px8 x0?@< ?w??p<p8pv8x`v 3?#xpǀx8 ``80p0ǀx 33 8???xpx `80``0x 3x???wp80À< 2~pm?><>ǀ x~860<?>88> p8`8x84<8<`?p8~<p>xx?088p?p8x`<~ p8 ;πpx38 8la?8h `x0x03 x?x``0 p0<0>?p?À0?p?gp?~0 :??|?@8??|<>p8{x00`p?<<ppq0`?|x?p80`8{<<x?p p00 @a<|n0|?dx<0108w<<w<?p x0>0108 X <0|880 ? 10x8<?8 80  1 0x>8q<pxq `<0 `1 px8p?x <8x <0 `1 px<<80<0@0<`1 `xp<q@<x80`ph1`<pÀ<p`<|8pp0`x1`<<@x|<8pp8x@ x1`<p ?~?<`p@8`8p1 `pqqp0pxp1 `0?x`|p0 ?a0?p0<??80p?p?0x~` 0?`` ``?p>`8?p?p`x`~ ? ?0q?cG8p@@<|>??`w3p000@`?x>3<`003x<p ` ~mF0``?p xl&0 t?p?x 78<<8>8pw0>?p8<p@0  ???8`0`00 x80px ~x@ 0 8xp= 0 ?~p?x8p0 `88p? p?<80xp`9O<xxp 08x81@`nx<`pp8 <x80w>?80 x8<p88``X  ?00x8<|x80`0 `?`00<8<<xx`0p<0xc8<<8`0 p<q#<<?A088<| p<?op3<<`À0p ?08<?xG0`??>x1p08`?xn`08<89|p s00`p|p`8 888`98w00<88``0 ><8x98 w0?p8880@|<p90w0w8`???`?|?x0??p<9?@0 #` 0`?`?{tsh?À{|`@À?yq 8?À{8<8@~8π~#=xs?x`?Àp<8s?p?`08g8?pÀpx?0w?`8 `p x|8 ?8 83ppp|v7`0ap 8? ~q8?p88`88? 889 w0 xp`80{?88 0wxp`80p8??x|p8pw?x? 0`8?8p1s?p?`8p8? psp@??`81p?`00`88p<@< p1p8?8?80p9?8ǀx>=`?p ?x|wÀxpxpx0 vC<q~p~80`pxpp>8C8p<0xp`wCx0pxx;px`?p8ÀCx8<<?0}pg|`p809fxpp?;8p`p``0`Àfxpppp9px`f px`0`>xxp>p}90pp`x0  <x?<8xy pppopx300<?xpp~p ` pp{pp?<<x?>p0xpxp0 >x;pp`8>`{a x`31 ?8<x`?q 3`  xx?c g?<8p r<| ? w>8` `<<1<  ?88;Ì@0 0?s@8?p?a8;c` 8``? 8?x<?o #p8ppc8a|<p? sp `0p>80?8cx?|?p0p8`;xǀ 8`6`8p8f8108<p<À qp?`pp< 08a<pÃ?a` `00? x1 8``0x{ǁ qp q0``09x;~q 8q8p 0ap 08xqqp p0ax C08xxqπ>qp 0c8x?Gp88<qπ0>qp70xfp8<@?τ?x<pppc|8<?<<<qpxppc<8px?sqp`p?8;xx 8?p`??w8~ p8~|`?8?`88`?88`@0<p @8pp0`xx<pp x`<p<px?` ?0`rp8 x?p`;`<?;s<p?808<?xp~x8`p08xpp? p?xx<`088p?? x<`pp8x?? ??? 88<`3?888p?~1?80 08|0xpÀ8Àq 98? a 8<8p7À ?80q00t0Ǟx<p?G?84x p 8`780888?c 18<pp@  8w0x8|x; 8??8>x8<p8@  ?@?<8 {8~@o `< <{~<xpp?p??8<88pp?p9pq<?1`>pg`q8x`8<;p`p<8pA<c8p<???~0? 8a <ap1<8<xxp8?8p<??x<xp8pp8<?~>x<>x a8{>pp<><8<|xxa8p1<n?x <πxxc8<py<N8<xxw8?8pq?<͠x8<xxp߀ ?q??`<x> sǀ??8@? 8<?<q8| >p88<?9|? `v 8?>`<~x?`A8.8? 8x~?0? <~Àx888p8|nx 88 8 xp8`x888p p0xpp``0<xyppp`< C8`>x`p<xp?p<?pxv?8x?pxpx8p <`s>8`;?8?p?;xg80pp?@p<?p@<ۇ;<8888<p{<p<ppxc< g08x0xx<pxywp x>8x`#8?x>pp<~w  8888xx~p~ 88x8a08p|tp < xpx?`xxpp|ۇ~ <|?`xxp<8?0 >xp09p>ppax 0|0@0?p@?p8 Î80 pp8?Ì<pp<;8 8 >pp}=p xp0?r?88?>=8x`98?8p??0xx8p;>0``?<??08p8 |8p|@`q?p<8?ø8p<8p 8`Ãq8?<8p888p8<??8?p? 8p80<À80?À<p880`<߀À0`g0?~pn?Ӏ8p0<0À0`< o|?8pp|80 <`À0`p ?>?|Ïp80 01@8p?~|?|?Æ8`0o038?0 p><?xÀ80px=o0p?0`0`~<?À8?<p?p `>`0p<À8?p w08` ``0 89x?`p`c0ǀ0888x p ``0 1 <yp @?`0 `08` 08`@0p`p8?p0?@?Àx880À803 cqp09? xp>p80c cp> 8?ǀ0`80a?|888x8` `80a ?8|?<?8?>  8`88088`<@x8<8p08@?w;<08px?x<p8p80{x8<x8|\8 ap x`8p088?|p? <p8`8|p78`8x@8|?0px `0;`p?8`9`<`8<@;p x`c00yx~<x0x0?p>pp<A8p08ǟ>o888pxv0?x08p<~@p0`x8~ǎp008 p?p`8?n@`8x>x8@88 xp8 F`y<9`x080 p00pp Fa0|?sf8 80xp vc0x?<0pp080p >gpy8>Opp`88x |>`yxx8drp?0<88~`8x8~c8<80<? ? 8<?x8`008x`0`8p xxv0p ?`@y߀8?`.pppyx89` 0  8@q8x?|8x98p 0  `> `0 q0? ?80 `0`a3p C?0`qs?88 pݹ<8 0` ?q?8  x p0``1<8p?8x `0`10`10O?8p `?0`<0~w@`1??þ;8<~p?p8 `0````qÞ9~qp09 `0`p`1838808 `0` 0s 08?8809 `0`0s8??ppx?09<8 `0 v08<?pp98 <0t0x<p|90 `c~p>xxx<8` ~9p s0px<?8ǀ9|`>`p?{?x9~>? 3<`x0  ~ xx`08 <8x` pf8<0pfx3x080_0f xs89x888pCv 0x8?p18p8>9f ~?5? 0pp`8;8~ 8p8 xp<0x?8 |8?<`8? xـ; <? 0 038>`xp???x8h?8  {x0 ?xh{㇀ }8/8??0|y8` q8 p~p>xxÇ0 pp?< <x8? >3x 0?0x? k ~ p83p{ 7 <00?pp8sÜ3; ?p`80Ç0sÿp0 0p8 |s<p@0p`08 <p`8``<|v8@`x<8@0p ap x}8`qp s8?<883?@ ~<pp8w8030 p< p8?p`p7?Ǟ p<?a0~8s?@| `p<?p  <q0C0` 00p8p88p q0Æ`8 00`8 `0800p q0g<> 0`8>|?88`pp08p8 0q0> `~<~> xh`p00`8< ?73 `<~x`0`8  70aǁw<~8 y`0a 0a0?c88npy`pc8> paw g0px0c8 0a0< >`8<x p8wp< pp| 1<p< p0pg0 LJ8x?Ǐsqq?sc??8``sp>` 1pq`00x988@1y|g0<80  1@8?<`:080` ?1>|?p xGs< ?0n<?8`<p?c00; p<yxx?p<f x0x?a?0. p`yx<f0x8q7\?<?<01?<a<8q a< 08 <pp<À1 `ǀx8yxy< 8p08q 8py<9<`x8`181}ߜ<g p8?8<` <<yÜ<;?0>8y{?9~?881pv8@ 0yy>|;88py~ 78` 0`1x00p?n00`~ 0``0????>p? 0`08 3@0 1@0@8`> 1p8?x |pp@8|?0 s`09ǀp0 <>p<|x<p900`x ??~><|x<?008p`x  |03{9À|pp8cǀx8pssw?9p`w< |?8sg 0`pq`ǃ<|x8sc10x@w>|>g0<poLJ<<Ïy>x?89 1@`sxpw<|ǀ8g`8pp<8xxÇ 83@90 `?8w||;g`8 p8x?@ `8w``|g``pyx9A8s܀`9f @p|?8s g89À0gc~08c>q`f c8G<8~8 pfaÀ`g`c 9`@@<?8|>a?<` ?8~@0F ?8||<1xpp`p`0<|x>9p 000`s8xp?<`8080s??|8O?80s 8p`03ǀ7>>x?80 p8w8ppp@0}:<>?|?|8 `> 0 0`~80p?xxq|?|`x>8`0p0pc||x>?p?` o0s||x.? p60~~x>?>|. 08 06?0~~8>><|<8 0xÀ0t>8~|>9|>0? x< 0xx>||0_0?xc|?0?000?q|081ۀ`00xq|?x0?0s 00x?q??r8?8 01 x~??9pp0< 0<1y`9p{8 ~1s{?q? 3~  8s ~? 7<> 60pp08<>8~?@>p?w?8<x??Ì>?  |``A<|??|<|~?<~g`|~|?pxx|}pqx`|`0`߶<~p0c3`|x`0@>? >wp`00@?x`p?><` ?7` 9<w{qß``8xpx< ? 9?x0p~~|? `8?w? 9<8p??`Ç~p|`8xxx 0088 xp8 8`3`||p88 p>p887x|ppxx86}x<~w?ps0?gx088 c1smx 8888pp`0Oxp8p08`80`8``G88p|?`0`p`pCx8sp0p`0c8 8xs00@ 7x8ps`00 x 8s ap80x 8<s@c8`@px 8<@p70n``px 8x`pp>p|`b0x <p8p 8` 1x <p<<?8?p81x <<x??` 1 ||x|p ?@|8> p0` ?p8y~`xp8pp>0x0p>q?88?`~ `p 0y8px`x`x 8 p x8pp`s8ppp>0xp|  ppqp8p8p`8<x` xx pp?߀p80x<8p`pppxp`0x`p xp qc8@4p0p0ss8`x`4x0 8axpvwp8<p 1`ap ??p`x0<x8 ``x< @>08pp 0``pppp< `x0 p  0`  81pp00p<`0 `~8r8`808 8pp0`fxp8fp80`8p`8 @0?  0px8px8cpp`xx 0x<xp~`3` 0<~`x;?80 x 3?>s|x8p`80 ?@0@p@p? p9??@ 8`p?0818?>?8qr|p0888><<qxls<8?8?;>|?tps88w?00|??c8<?f߸ 2`><??<~>`8<8|0w`0a0|fp8?p<<0dpp>pp8x8p ?`3x<`@f``>x`x8p?l3<`gs@: >x9p0?><<`9??x=p0<<<<c93p@p<89pp8f<8v`0x <8`?<6<  `wY <<88y?98w< pc8px>8x?y`8 8x<3< p`p0p{?xÀ 8 <<n30<s?>8 8e<p 8ó\ c?8 <cx?0.>w0p>~f>?g?|>8f?8@c88``0<` ?|yxp8p|p0 ;|<<`pxx` 78p~<0ppp?8 p3|xx `?xp`  g8x<x?|p 8`Î@ c8p81Î`x ? g0pp  p0c8Ǟ~?=`p?|pÞ~x~?|p<x8`80@ p<8p `p`8p?3 xxp8<?x|cp!~ <p`88xp<a;xq8?'801ǀ x;8>8 ??8p? p<x||p8p0 `g8px~ǀÃp888pxp?p08??8px?p<?x`08 @8x?p~??<ü`0π8| 0Cn8;ǀp~ `488c ?vx{8 p408c`0xpp8~<!8c` 8?x`ppq8<8 cp? 3xpqpq0<`8 c00?xp>xp{08 8c80?p<p 88 8xc??x@?s8 c8` ?80pp ~` c`<@Bxwp @?<|?> `a ?8<88p?8qp<8??xp?` xxc `88?p p8pc? `xp  sx`0p{>8`o8 0`8p 8w={8p00G q`spxy.p8L8`` c|8s?8ǀp<|80` a`p|x?p0p p0p80 c l8|8w;8p8 a`7|8ww08  80 cf8|8;w8 80 `8 a`px?8 >r8p?8p 8p80p cs88p:p8  <808 p80 ao8x8px <8p8p 8`@<8y8p8p 0yx`8q98 @?c8080 `@`80?x{8`??0=x?;`?;   8pÇ`x|3` s ??pÃ<8s` p~aÀps??p0<c pooaÀ`?{8?p 0 <0???>x?xpۇ0@@Àq ?p 0À?8Cxx0x7`?x8À}0`v`xp9 Ç0pppG<xp9pÇ1p  8 8p|9pq`88 8 >0ypp 8 p >?̀p9p8x ? ;x><yÎ8 p 8? 9p|9p`q>` 00p8 pxq``|< p0`0?89 pp8x?0p 8Ìp?pq> >8?0`8ppx>?x ?888 p<?`0`p8x `>C0@88 `0 p? !0   |8080 > >|p8p'8pp ~ c|pc0?x ?ax p<8p <80||sa<8x| 0x0<x a|   0@00q`| 80`88 8 ?1 8 ``y8x` p9 p8``q<ダ88= a `x 0p8p|x㇀8p x  px 0pxÞ8ppx 0` `pp88x x `?` ?ppp 8p8p?p ?x p0`~?<Çx@x 9Àpp30@0x?8x9 ?00 xp?9?0À0|9p<80p? >wp06` `p1 0l 8;`< @8 x`x w8` p8 `88?8 `0`? ?`pp=8o`0 `|?999p0888`?0099 8<8`0{8pp``89p00x`x?8A00` `~p?p~  ` s8@0? 0 ap<??888?`98  cpmb09ǀp< 8?p8 <38C<a<pp <pp8<90  gaqgqx?< ?8`8|3~0p c<8Às <??~8 =x|xx|<x 8 `83p cǃ? 8xnNn`p888 <px8Gv`p8x8xp??qy8p~`<Ü80p8pxπpp??w?0p?`o8Ü808 |=?q;c19 `p@`~ |9?x?8C>9 q`>   ?p8x?<p?8p?  ` 8 <x?p x   gp`w8Ü` |p?0`@?p`00Û` xp??8?pf` ` ?8z9p,?0Apx~ p? `` ?x8p>8> pp0ap0 ~1px01`01 ~``0/q?010q Gpx``8`8x?x a {wp`9` '<À{p~ߎ?8 C8p`18>><?9pxx3 8?Gp`a~ÏqLppo9~s q ~p `88@9 gpxxw?08xppy=xp9xppx` `0ǀ9<xpqx8`08 ` yyp0`A980 0100|x0<8`0?  88À>@8<?`a À|pp?Ǹ` | p|8p8ps?p p`?>p|x~3xpǀp8`  >6s  sxs 8< `;0?=w?qÀ88 ? ? 00`` ??`80<㙀 a` ?0`0  xǀx80Á8  p8 0`?89À< ?a O` @0 `ǃ<qx8<8 9ߜ `80Àpx87?88<> g`81À0c`?x?89q8> 0 π8 0>`p`|8qs9y8<n`9<n` `0|`>`?<w<No 0x| 8`p?|w< dx ` 8p8=@p<?8y?088ax|pcs<88q0À<9@8y?3??88p8~q< p<|8838q?? 0~1Ü`87p ?8#9g30pq0?~ǀ0?p88/ < 0ga0` 08?pp8p8xp p`p qxxǀpx8`81 xp<<`pÇs`#3@8x<px88À;`8 88c0 x<x|?q89`q9@pq `81 8 |x?sposcsǀ c`q ǻ08~x=8?;`qq<À8cpxxy?w8p >~008~8 ?aa1À8^0<w08` >p@0p@wp`~8@p<0p<>??tx08p``?.08|8??=?0` ~pp?y< 8p>``0 p0x{<yypÀ8A08?`<?p0?!`1 88px?p0<8p38`010`<>øy088p78`0q`x8p>p`0q 8`8x ?qpp;|?w8  ?x8?qs;x?w90>x8`0q xs{8<3908y8<pp<>><<'?px0x@p?898?x<! >3sq00` ``x` ~~ ?8`@|8p??p<x?  p1 !`xp 0qp`0?p<?p`?xpp98  ~gp??`x?`q<>8?8988 px? 3p<8x>p9?? ~ 00sp?<8p98 ;l =0?xπ8<x<`9w8?>  0?ϼ`r88<8;<p9sq?Ï; 0n `0x8|<x8?~?0 9?1800`<`0?x8~?> 981p@p0p0`p> |x`p?8<<x@9pq`81oxf`<|x98@0080?x ??x8wp888 0??w< Fc?9n`?08p1p~08p|>f< p8<<9x~p?pg?8?w0{x?pph` a >`wsg y`8??0pppp>c?!cs@8;?``8p|f8 8p08|~~`88>8@? ??A@`? 8 q `Î x>818`` ? À?0{?8?18``. A?8p<p? 8 `88<? ?<p?8g`0 ``x8?.3{?<`0@8`` <xx86#s?<s݀>|8`0` <xx0>c>;p8ð88g`p` fx ?8`c|?~p?<881`p`  `þ8>?p?8r?||` ÀxÞ|p>?p<ppÀ8ß><p`xxxp8` p`x:ǀoxpp88` `Gx pǀxxGÎ8;` p` <p`>p8? 8<p`p`80<p0>À8F` cp<0?~<?08  `  8 ?0{~x~0À8  <|<> <`8~|p?`80pÀ ߾8>8`:<>`p~@x?p x|` C; N  ?0? ?  ` @0xp `q p8 Ϝ08p<<<qf@ 8 80;x<??a`8q0p<p< ?8`s0406`x<@ÀGg9?ppx8p1À~npx<?p??x8Cp p` 8`?x8 <0À???8?x yp`8<0??>0: 8`>~G0` a 08p > | `  <` A?>p wǁ0qL?0c @ ;p0 w|À0c 8 `m0?p>??À``s 8 pn8p< >`s`x8c  p 0~Xp>? #aa@n  0.p<8c>~ g pnp<  ?s<  p8`<`  ?`0 `?@|` <xp? <<0??<? rÇ|0 8`8;ÀsÇ88p80` s88;p@?s#?ǀ;p <`?ϼs Ç?<?À8`<`0?? ?0xpÇp?00 p<08?|p?0?<`6  00߀ppp8 <`04 0sO p8>x`>ü3~ <0`80?   x|x8800: <0f?? |`8@ <08<@>>0 \8~sxxp=À09 <8|@?8px0a0880`pp8xq7`nx =00~?p`?ppx0ǁ9?@8 ~>?``;`??>?8 8xÀ 0``#pp `p88`p@88`~p`80`?8`~?=<xp<c? 8p `pps8?8 axpxp`3?` `<!`p ax8<p ? ? `8gx<p``x?pp~x0q opp0 `t.`0p`pppx0|~0p`pppp ?80s89gp`0p?ppp8x`0|sy8cpp8pppp|ax< ppp8ppp8~? 8q8p0?xpp<~pp@!`?=p8>`?=gp?<G~0?@8<`0 < x808@͞pg8?0p088<` Àx0p`paǏ8?G8  x 0p<q?x?<8? À8px 8pap8?? 0p À 8x3x ?x``~?q88x88 80< 8ǀ8`p `x0 `0080 <8~|8~8~8?x08|x9x>8̆0p8??p?|x x88?|??8800@?8 0`0 0 8p888`080x8 p0? 0<?0 p`uc8p 0p78`8`8 0 s88@pp7@8pÂ8??xA0?s???xp?p3q!Ã``8xcs8xÀ0?p8၀8?c?sp>88pp`8Á8sp>8?p0|8`80A8sp8Á8|p8n8~?98sp?8p80p @o{88?;?<sp?08p0p xg `0;8?`<sp?x00`p8q~`8?8?<sp?<198>`pq8`890?<sp?38vpap`8000sp?<s80fpa`8?0xsp<??x p `8?p0Ǟpsp?xp0p`80 08x`8?ppx1y?xpp8~~@sp`qǀ|0 8"88`0 800` x8x0pp> À~<<8`<?s>x88@x9p  c>|8q80`8 ??`0<?1`< 7 0s?08|wp ?pc 0w N`Àqp@o xC`00/0?8p?s8 0߀ ?ǀ~<y`9 80 s0z9=;80<@<>< `h?|<8à=n8 8y08``wp8cq38  80q0| 8`8xpπ88o`s8` 0x~ ppxp0 10<@08À8Ç?>`8p0 0pp800? 8pp8? a 0<`80;08>xÀ888p 0xpp|pxp<px880<px 8`?8s? 8< 0`pπx<0<<>89qs~08~w8?y8`ps<q`@#? | 0 p`p0 pp `800p@8 p 0 p`{x`0080>pX <<` 0<x<?pxwp?|x` p̜<xp<x;30o89` `s<8;3`pp p~8aa<x3`0spp|`<px@3`0`pp@ ?;<p>?p<83pp>ppw?  }>x w3p0 p=pts ?|c|p??@8pyp 9~ >3p?xp}p  `<wp<8pv?xp;8 9<?`<p??800pp~<>p8xx8<x`p<c xq 8 8????808<8pp90q0|6_ px<=x{` 8<p< g8`ppa80?{b0p y8pa xpa00``x fwp87p0;sA??s? ;>~<pp??8pp߀a? 0?9>8 10 `pp>``q8<p`x?`@03Cp xs0sx?p90q`pp8|xx8p803=x`8?<8pxn0sqsh<88pqp88 x8x?<wpÀ 0`?/l 8x?0 3 x߀00?<<ypxpp?~p~ ``> @<<_pp <0>~ 00`6|?x>8?|0` `ÀpoN? ?p?'x?|x8opÀ0>>9< pǀw8p 80o8 8`p  <ps0 80g`?s0>pa |? p  ?x??8>paـ`| 008?xw8<``c8`0| 0 xwxwp8<cp` >p 8xx agp`p8`Àpaaf0 8 À8`8|~l0  <|à |0<`?|?8?>8??8 pA 8p0p80pg | xx<`x800`pnxs 8q@8??^pÀ0w?? ?x?pq00`x 8@pppppxp?q8 x`|p`0`~xp8`p8 0<s <<?xpq| pp8 ϳ<p<~0`߀8  ߀8xx?p  s?08x?<?pq?n0`0wp0?x>q?ppǀÛ8{<~q`0` 1<? ;c88<;pw0?<8@1?`0>8x ü?x88`??p88p<~>@x?<8?Ìxp ?0qq| ~`8<88<xp?8~  ?<<|8<8~ ?|<x 8|`@8p? ?0@?08`0? q p0xC80@8?88ǀ87xx;~pc88p <pq?{w;` 8``x8#p?p~0y??q8ǟ|``y?8~8`w0< x?>~8 > p`w<<<8`x|?88 ``7<>p`<88808|?`x78`8??p808p7pp08 p??pǸ0p0?x`@pc3 8ǀp8 pǿ4p?8`p` 08<?<?0`8`Cxpp<8<?<0|pp18pp8<0>`xp30 pp8<808`00À30 0`8>|` ?~?<8`>>0 08`0x8`xp`0 88 x<0p8`0p08w8xp 8xx0`>0`p c0cs`s8v g|0<`?`p!|8p<w88c`<8`0`Gp~p>p`8`xq00@0``ap?|>p0 0 `0 8`8|?{? ?L0``30` 0p88xw81?$ c0 1@`s `<0{0`<4#0 18|p8p0pp (v`0xs<8p80p<8>`x?~8w<p``8c< f? s: ~8p8?3>p83p`?8@c@ <ps8<p0q`0`x<80x8>```s<x0``pq  ?8@ 08p8ypA   p 0|<p|a 8s~>w8>x8a8s~pc?<o>>8xpccC?<8?pq@ c 8x`88 ?pc c?p8? f oc<<<|``c|x<p >@o` xgp?~?p w 8>p|p`8?3p<<08`0;p<<?wxp8f?`0 38oxx<<?ppp?<?\>0px? `g00|??0?psc?|8  aq|<cg?00`cax><rpwq~w0888pp08?xp~8qπ088pcas~p0 p?~`>9?8?3w0~?`8|?`p0?0 ? p0p0 x0 ?C8g0p0`<???q08w8<8p``?<?>8091p8`x>88`xÀ?p?wp???p?|}p>?o?0| p x88Àp?w|p ~0| 8}00À?8pp<`>c0088px?<`?06 >}``<?x??p?0 `0<88`vp 03a`888`p41ǀqpc8`x08p?88x <`0p ` x8>x?0x|<`0 pps 0<<?8?pxqx<``p00q=c 8<>8pxy88@<p80?s0<9?x8p?x1@80qc<9888p`@?x`<@x8 >< p8<??p ~?||?``x 00  0<80@8@0`90`08?0 ?08882<`089p8 0?8p7Àx`0q8980p`pwxg0#<?q89? <8?`?pxg0O8?p??@?dg088?80fg0x88|80q88xpg8<x8p~q0080p8a08x08x}p`< >cp00p80 88810<<|<<<70 px0x3s8pxp1px>q08x0q8?8~8x?qsÀ83À0`8880|g9?8p 8`88 p8|~;10` ~ p8ǀ>?<088 g8~>p8>8 x{88xp80880x#0LJ}<?`p`80`~ 0`` f0@p 8`pp8 8p8`<>88p8< p0@`?p<69x` ?pp``0`p89???0| a8p  p t>?pxapp`A0p ~gxx8|3c0? p`|x?x p878px` ?00?08~`0}a?7`p0?p8|8}0 ?n?p88   <px|`0?>` `p8~<`8p y& `1a8pn? 8`0> 8 8a@`;9c8pN? 8 `0?8 8w` pygxp x9` p`>x`9ygp8<x<` ap`q??x8p @ @8|xL~|?xpp ` 8`~??1n|<>8xqp p`a0<38?xpq`p?pA8?|38??p~09x09><<<p y0 0 8@?>8|@p~8`<0:p0>p8xp0?``ppÀ>>`88w<`~80<p<``?000|88m_c088 88?xa8?pxx ~<3x?| LJ>`@x ??1xx?` >8}?c@8~`<q `?p8Cp @p} Na`` p9ppp#8 1@x0p|ppx?><80|x<p0g x`|q x?<p px<?` 0<?8p8 `q   fqa~x<p x`8<8`8<`8pp8;xp0cpp<pp8pppxd8 s? p 0pp?pp8?`p`80g8` 8x 8`gpppp8?`p8`8`8Ãx'0?ppp8``8p`8`8  ?>~ppp8aÀ8``88 8  >s0pp8À8?s8  p0 ~~pp8`pc8 `88` ~?pp8wc c8`98< |?p`gc8``18  8p>pwc81p@ 8pp>`? 81s`8pxpp6 `>c8`1``p<p<ppf`>?8`1 <<8<p>8`9;v ~8p?88pp<|~c0{pw,8`x<Àx8ppxπ`C xxpǀ8x?px```?x`px? | ?@x  <a?p@??n0@`?<? ;8?<<;??ww?xǜ>;?18o>8Ac;8a8pp`<x>wp??p?0ppo `??<p?0p?0pccx`p?=? 8?<;? pg`8A?`>~ ?w<`8||~88a0  8p?00>x?=p8p>p0<8@ @?0 <?pp?w8p< qώp8?x80<8pp8a<=<ppx88s w>`0s<8<qÀx?8| 8px<9818p=ǜ?`8p8sp<p??888pp8q>`pp8 x~0` x>?p@#x?0<< `~@0x < `0~| `ss8800`0?sys<|80<q8ss808p8`?q``??0`0p8p``0s?>p`0? `8083`` 0q8x8 0 p 0Ǐ8|? 0` /p`980 8p0p0  <0p`00`{ǀ80 pp!`a`s<sx8p8 < pc0  < 9808  70a xp888s p`  8<>`cp098?ppp8`a p`psx< 89p?{~?`a p @?px` p0?  ap?pq[8  <?|=pg? 8<8xǀ 989?p??;`8 y   <ǀ;8>p8À  px?πl  ?f `<8p8<8|8n8|988x|l`<|@8? 8@ x>8p? @@?@  808?q8 `8e~~?q @߀xc` 8@<w`pwp?``1` 8sp?;|f `=Àpap||p`v`~  gp 8xmL<|` 0 p?xpup ` ?~ ` 0 <pphx>8>&`` 00 8 xxpvx 8p ; 0 p0 8<|x8>3 3p 9`??3~x8 ?p8ppp s?c? p0 p8a8??`8088?3><L< pw`88 0f@8aqpp |s>  vwp0 w808`?yp?7  7`?p8 3`?0?xpw v` 8 q0 p<x?803`p8p23ώθ8 8 18 0w380`pxpw8?8p8 8q0 pc8``<q80 p ` 0g18 1?>0`0?x q9 ?>3s>`p?qqÎ  >08300|a0?pq?8q 00x?08C0 p`@fp|<{p<À  ?px0 ?Àx0 ^086? p>? p0 8 @`~spxx`p8>m```x< `~? pp8 p\(< `p 0<`8q`>|߀q 8 `0`<. <~<|`<Î| <p<Ïcq0p | nÀ8wsǁ= ~c 8?x<0a ~<8<>?0`pp p ``|x8>q>;0`` ` `p||8>q70`p8 8``pp 88~q 8`p!pp`8<ap?8À ?p|0opπ?ǀ8?{90`<{0qg?0~0`~10?`3>< 1q>`880À p@ 8?0<?op?8pǀ0~8wp ~ p p~À ?p ?>=<px 8?x8 |>? ?8 0|8xx88x>|?2?~p8pp/8x0?|p<ppx?80<p<88p88x~`78Oppx 08p<~|`888p 0xa a`x@00?py~p1xa?30`?syp?0`?sÀ<?  0?@8sǜ|a?80@|8q?a ?;000p`x=<sy|x 00`? x8?qx8 0pp?ps?<>a 90p<98qv<?c 183`? s9b?? 100`c<<81o၀p?0<8p7|?`88?8> <#888~ 0pp?8?` ?0p?>p< ? x 8p1<<? 0< ``8@?p<|8sppm?߀x|À88 p8p ?a<p833~?888p>?q8p `0L݌8<88<?8pp8 m s?<0?s8`|8 @ 1;?<8!8??8 ?1{~?8q<;88㿀xpp x  0{?p {?<;88p |8s<8F<|~À< ?<<À9? ;n8d88<??p91s?|`p p?}0ps1`w8`c>xダ?pp3 y&?8>`w  F8?~p?  88x?8<0   y0x`ppa88 8`?`p8 0<`8p<81` `8888|08x?p0?8|x?09|p0 88xqq0`?8p?q?>08wxy?g` 8p !@0@ ` ``8880pp080??``08CÈ8?|>p0`oc``?<p8<p8o?0??x<`As31`8po`???8`~pl 3||x8`><p`l 3x8 `|1 0  `~?ppx`~3  a3p?>`yp x? p;p3`p ?3?p|0`8 ppf<>p`? 0 gp<?p``0ap cl8?` ý`s!880p a|p`|0|;` 9`s?p pL`qp|`q8p ;p `<p A<x0080p??p00`p 0@`80p `0 8  p80?` ? ?0`?n?0?8p8p c:Cx~8p8p8?>?<0?p wg0 p8O;8?8cÀ``??8?'x` `?~8~8p8 1 ?`<88=?`ǀ8 88p>x9<>À`0`?\0pp8?pÀ8 `0>|88?|``0`18`80  @`?p`pp`??8x{88n08881 px~?8<0y ?p; s 0>|?psp?|8p 8x8`08?spandsp-0.0.6/test-data/itu/fax/test2.pbm0000664000175000017500000104125511007012213015111 00000000000000P4 1275 1745 ``` 0000>80000p0P8 088`080 0&08x0?x< 0vx<0p000 | 000` ppc08`@0 p0ppw}08`@0 9`0gpp>?@@0p/0 `p 0p`<p#`?@0 p!`?0`p 00\`@0f`x 080` 80`@<0|f`p 0 0  08`0|0l`?p 8`0 80@x 0`v~>`p00< 8p@v 0aL<< 0 8@  0 0cp @0 8 0 @g 0  08p 0 8`8 `18 0 x` `3` 0# ?880> p>x8c`  08 p;<    0181@?9 8>?d?~/P   ~@ `@@0<0p 0 0pp0  0  x 0 p | x` 0@p ہp808`> @`0? p`{ ` ~8``x`  `~ 00``p q1 0|00@1p ;7@ 0<0@p 6``88 ?0p> p`8~8'>@0p80`8o8< p8p80 `8π p;p0?`8 3p0`8 ap @0 ?`@@ p 0 8@| p 8`0`p` 8@m800`|0?00 >?080<?0v800>8|x00xp08x 08x008<0d0x9`0 M< l?נ $= z `  0 X``0  8`8 @``<pxxpx @ <?`@p0~`0``0@a8 `xcp06` '` 6@p 8  <0~`@ |@  1x`|@ `0@ q@<<3   0`0`!`px#, @4p p``p!`>8C@$ `0 0`"` 0@d8 0`"0` @@ ```@0?`&?`@  @@0 `$@``@  @ !0`< ``A @030`  0@0`z<>8@ 0`0pp 0`p@p0` !`` @yp@ @8p ?p80@ `` ?0`;0 0`y @s``8``? 9 8`0<| `(< 0pp8`00`{ @p00p00P  0 1x`@; a< p?01@s70`0`?x1`c 8>0 `` 3` p< 0 ``82` `80?0` p"`0`@ `"`p`0@? b``  ? b` ~08c`@>pc a ` `|@@x@@ @<@x`@   0    @0@0 @ @ `?`A@&`0  f1`0 B 0   0@80000`0 @`@@@@@=@@@@@`@88@`@ @@@@@ @@@ c0  0 @8o,ߟH0 @p"``0@0`@?@0?@00 0c.p@0 0 08 8@@ $ px8 8|@ 0@0 08<x8xp@ p@  8<03@&  p|p 0<8@ 0p0pX8Á00@`0<p 000@@ 3p 0p??a`0{ p<a80 `pxx`8   0`pp0`p0 `p 0.`~8dpp@0 fp` @ `0?@? @    0pk?`p@?~\` g?:{*'?,8 _~ H OOd@(@0рwC;8p0 <p <|0x 00 k000> `x0 b@0  ``8  1`80 80@x38a` 0p00` \0a080C 0p ``  `0`8p ``8 p0p 0 `?88` p0B? 0 @`'8?0|`B`? @` `n 8?@C @F0 x~ O0G 0X00|pC>0x 9p0f8p0  `?p ?~ x  `|?7  @< @?   <@  @ 8@` ` ?`> `0w>>?8x `000@8`@ pp0p@ `  x0 ` 0<^0G`| 0<~A00 N``80 `  xO00 ``<  @`` i `1A` 0? p 1@`0`pA0#O``@0  ?~ 0` 00` p``  0 p?? ``=8`  ? `0@0p? ǘ<``?`0`0 0 0 <@@`0@< 0|0  0>1p@`0 @800<?`8<`0 `0 00<?`8 ? `00/`0 `008?@980`>8|`  0q<808?` l0?8`> `` 1?>8pp??00`x ` c9<|`p?C``0|8`@ 0  8{0<|`p`0``p}0p0 0@0 ` p8

xp``0 000 8 0 0 p``0p?0000pp` ?p |00 00088 p 0``@ x0/x; py 9p1p`381p< 0`1<1p8`0``a|qpnq`8``3p>  p@`??p~ pp``p>f pq`  ``@p 0xa0``` 0xa0`@` 0` 80 @CG 8p ``@@8 ` 0 @x?  @ `8@3?@? p@c |0 ``@8 @p<0`0Ã@p0`p6C`88<f`A`?0_`6 p ?00 @`31 0 0800` `08 ?0@? `0p8`  0@< `0 088`8@ `0` 88p`0```0p``88 p0 o@8<`800  o@0x00  00p o`0 `000`pp`p@ @` @ 8 p < ?p x{`p@`q0300`@>3p#!0` fbx? 0 G0~0h }ǀ0<1h 0 8< ( `D s `0r@cp`  0Ï`pp?8 @`L80 @@8<p 0 @0` 00?8|x@?p|  @8`0 p`8`00 0@0 <d  `px` ```?g0@ ``@~ ``0?@ | 00@y2 0x 00  @` p 0 0@8?0  p@x p0`|#0 `@0``f ` ``p ?8 ` f8  `8 `f x 4|x8  x`| @  |~ >`x `p8 0Af`<  0 F80 0 00 @0gf   0p! 0 x`0 0>@ ```#`  ~hL`0>0` `` &`8`` 3`8p 0`08lp`>@ `?@x`0? `0x `  B @x `8` @`f<Bþ`   `"`|<f|~8  @``. ~l00  8@ <`0@!l 4  pp@ |`%  1?x   `?`1x {8xxx8p@@1 x 8 xp00`@9p880`1p  > 0p `@`8 `80``   @ @@ @@ @@ `@ `@@@`0`@08`@@ @@@@8@@ >@08`8`00@0??À`Fx?}|{f?  ?>?> @00?8  `000  0p  0  @?@@A A,C@G@ @? @p @@>@  @@ @ D   `0 ppV0pb 800 0`pC6 0@8 À< <0À8 `88 `0; ?A0 `89 @3 `xp 0``Xqx|0@7`` 10<  F8`` 10`g`06 1 1~ `` >0p `  <! x`>`` p~``     ` `0  0 0 8 @ >8 0 '8`0@ | c @>#x```cÀ`>p0`A??O  @ <7@0 0xpp> <0 0p >@0 0p8@ó0   00  @ 0!`G 1@"0À0p`߀ a@C0 px` @0 À >`0 D` `p~?pN@` x@|0@p8`À@`~H`8 c`8|8 `A `ρ|0 xxÃ`@@`=`8 0`a<0`80`<0`cp0? y>0c``p~I 08 0x@c0H p 0|a``0a  8 3x0>~q>@`# cg~8@36`p2`A c~8@36 0 02`0a A s>0p xO 6` a A= 4@`! ? d@@! @pp d@@``p  @ |88q 3@??`6 @G ?>O 8#x?"vG`?^ } > ?X?p`~```@`````0pp `0~ @# 3À@  @xCc00`` < c@ dGg00 q <3o`@ !FMn0 90| l1@ y18|p`8x !@a` 0pxp p3 a`c0` `@ pp0`{3 agp0` 0ǀ p <=1{< 9n88 8p 89q< A0l0`?9p8 ap|pp9x0 c`88 0x|X0 7#`8xۀ '80 )AO10(000```3;>c0_c0o80 x 00  xpp8 0``0 `3> `C  `0m@x  `` `8@  90 8` 80 8 0?88 8   88  |p 8 )<0pp08@?0pp `0@`a<p 0a0 x1q` 1Ã? 0`  !3@ >3π<|p!?q?x 8la?vÀ|Ap p<x `pp? g0@0`v @8~<0 8p000@x0 `  0``pg00`` 80?g x``0 `p?<`Fp`9 <10~>l`8 ǃ0` @`8c = b p b?< `8  p ` 0 0 ~? 0   ` 30@080sxx`000`G2 0 x?`p` 1 `xC< 8 00 1 @x $.| 0 #@x/D`|0c`8`a p0c? @p1 Fp@01<@0`@8100`80xxp`0?< 8< 0pG 8p ?p<`<~ 8x09p0l{ p` 0 p 0`s03 ;0vc n0 8|`` p  p00 0X  00 0p11 `0 0`30a8  8p~n3`0 00?8 ```0/|0`00y< ` `0|0=x<``0` fx @00|@ `q0 3  8`0>c0 #@`p0` g0 0``a@f 8`a `n  a0x < 08 pxC8 8`8``~ ? 0C0 `0`0| 8 Fp @0  0~0`?8 0|`0` 80   0 0@8`x?0 0 xpx<p 0 ` ` ~`x?|0 ` ` 0` 08x< `0`` `, 88 ` ?`p  x#`p??Pp@ x||<p```~   0000`q@  <(@0` @0 <00  p0  00 @   1 À0` ~`0|` 8`000< <` 008 g00 p0 `  `00 x0> ` @0 0 ?0`@@?0` wp`<@` s0`  `p` ` #8`A`@   ``0 ~0`` >0`p 0`0 `800p 8` 00``01xP 8<800@`` <60@l 003`0@01p`|p3>90!0`` |0@a0` 00@0`8 `?p0 @?` ` ?(p`? `0 `<00`0 80  0p p 8 |߀ l؀ ` A`G`<0 @`p `0|p800 8 @8 À80 8 c00 `8 700`8 <x `<`v 80xp<8p|pf?>`N0F~<@F30>x#0 C88 80 @8 ``p | x?p 0@` 8` ` 8` `6a  `3` ?0`c>00x0`x8 0ӷ0`x 0w0``0``@|08`p@`x` ``ǀ``?`p`008<``a0```0 `|0`0p` |0 `9`x`0`s|0p`p08` ?00`0p8` 8p0X8pp?8px01|>`0|1 0x0<0@ @x8````x0<`` @`@`|> @`@`088f>p7`8`p0c? C<  p`0   @|  0p 00 @@   0008`   000 X 0  00p0 008 A0`0` 00!0pp@h000 <00p8g`008 |000?Cc`8<p00?pg`00``0`0x`0|| 0<``0O`````p` @8 p`/ p ` 0`| ~p`p  8`00@@ ``0` @ ?|8< <d0 "0~ @8`c38|<`ap<|p`a8|```xp8<|`000?>?0 080 `0x|` `0x`<` p0  00p0` 0 @ ` `  π0` 0 `B0` 0  p0w00 8p@c00ǀ w3``q00 y #`q00?`0 ; c p0q08p03 0p 8p0p``0 3 00 @ `|0` 01 @0810p000 `? @ >0 00>`?  `>x 80``0 7@`@?@``q{8@@`?@p`p?EW?@``@000Px@p`@00  @ `@ 000` `0`@ 080` 0`0`@ p80 0 0 `p0   0``p~008`` p~00`0 ` 0<`0  80 0f00 0Gp8 x` p 8 `@ p @x<???3'0$`0$`<0` 00#(x00`0 p0 @ 8@0 @`00 ` 0 :  a 0 >00c0 |`|f0`$0 <0 0 0 ? `8> `p?```?<|C߁<`?|ρ8`p|p`8<<psp <;`  0 @0 @<<0 8@88 0@8 ?8 @ ~@` <@0 @8@0`8?@8`@8`@8 `0@ 08 ``>@ 88p`` 8 <88 @0 8 889@0 8 x|`@     |@@` g@` ``<?0@@pp|`8@ ~8p?@8 <H 8 >80@0 8c 0@0  @L00 @>`L0<x0l ?@01d`p38 l` 8c0`p l` <a``p h`c` 8(`_0`8`p`0|8```p?`p  p`  0` 00?@00x0p?8x`  `` `pp80`88@ <08x`p0x?   |<80``p`8 P>>`??1?@``080000 0 ? 0>0p@?0`8`00>`0 xp8`8<00` 0?``000010`p`p`` ```xn p`ppp|0 ``p8o`8|`0``pp```0``0 0  `0 0 p` 0 @0  0 @0 >@ ?@` 0@`` 800<` 88`1@88`?@@8`>@@0`=0`@0`y 0``8 p8gp00`| p{0 00`?p00?`08 |x00 8 0 0  0`8`p?8?? ?/ ? ?00?8 p0 ?8p `0 ?08 07`` p@@0?  8`@0`x?00 0@0`?01 @00``?0a7  @0 0 p  ` <@0 0 0<`  8` 8x 0 80?    800 `p 8 a08@ 0 8`` `p  `@p0`  ```p 00p ` `` ` 0 8 `0\0@`0  0 8 0p``0p``  p` <` `0p``  f| `0```? `_90`0 ``8ǀ0` 0``p`0p  0? 880c @0<$ |?>8 ~?8 ? 8  ` ` x`>  8 0`=`<8 @``0 `0 `  10 ` !0  a00'A 00<`C `80 f@a @80`@ax/<[p s8`` `` 0;0  `` 80ox0 `00 0`?`00 700p0 0`7@9 00 &`8 0=000< @037088?o30?_8f00  @800 8` ` pᰈ```0 a `` p00 pcD0` 8 `  FXB@M `` <` `xF```` <0p` 0f`a ~p n`appxap ppq<`p` ~q8p  `8 0p` p| ``0`` `8p ><< `0186<<` 0 ,l0$d@80p@`0`@0B @@  ` ` ` @`@!@`2@` `@`@  ? 00`0 `?8 0 0pM޽9%(` 0p `0  ?p1?p00` 0p1   ``@  ` a @@0  ```08 0@0  `0@? 781p `0pa py c =0p `0 d`p m08 `0`x00~ 0̀0``0 Nx0  0 0@0` `0 |0 `@09@ `0 so0'8|p`0  cC0 Cp`0 ac0`` 00 `8`pc0`0``0p`8C?`0` 0pp<0 00  ~08`<``00 `8  `8 x  0 0 0 ,0 p $  g  &0     1  @ a   ` 80 0@a ` ` 0`p`< 08X@ ` ><f```x `000`28`@06`p@a @p0`0`?00```0@ p0` `8> `0?000?0  0  0`P ?p`p @p`p``0?`?@?0`p >q``p  `p  0p<0  p0À?>p>pp0! 0? `pp8P@a 0? kp`x|8C np@ `>p~`C p|n0p|0A` #:00px8C 0000px8? 0 ?p pxhx@|`p8l1p0>?0`p8px ``<8 `p@8`p {p?pp p p 0À` @@ `@ 9`8` @<ppp<` Ax? ~? ~00?  `  |=`?@ c08~@ 0 C fp\@` #2 A B~'p?@"cc  A0 C/| @$80CA@ @0p ~|~>@8x 0` @`|88@8 0a0`0@A1  `a 0A@ B?> D !@ s~<0x#00 @ @8 =p 18 @y`    p@0`0 `` `@? ` u00~?@`@<?6@00À0 8  9p` p``@@p `0``|p  `0@` @0p  @` 0 pc x8a>  `d |g` d>l<0` <x  `< 0   ~> C8>00 0 80  <0  0 A p?pp <0 p` ?p@@?pC@`@ `@?` ``` ̌>`@`0   Lx``  0 0`  0 00` 0 `>0 a0` p8 l0>@`< 00s`xn@@? 8`8 ?f@p8@80 `00@00` 0x0@0`` 0xp 0 `p!x0`8a  ap0a `pp 9@? 0`1@ 80`0p@pp a``@p? p`a0xp`?0|p p8p``p0`00@88  > 68 8C`8|pg8|@80@ 80p? `/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot unpack the ITU test vectors for V.56ter! exit $RETVAL fi #rm ${ITUDATA} unzip software/V56ter/V56tere/Software.zip >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot unpack the ITU test vectors for V.56ter! exit $RETVAL fi mv ./software/V56ter/V56tere/*.TST . chmod 644 *.TST rm -rf software echo The ITU test vectors for V.56ter should now be in the v56ter directory spandsp-0.0.6/spandsp.spec0000664000175000017500000000445512345135437012453 00000000000000Summary: A DSP library for telephony. Name: spandsp Version: 0.0.6 Release: 1 License: LGPL Group: System Environment/Libraries URL: http://www.soft-switch.org/spandsp BuildRoot: %{_tmppath}/%{name}-%{version}-root Source: http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.6.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libtiff-devel BuildRequires: audiofile-devel BuildRequires: doxygen # for xsltproc: BuildRequires: libxslt %description SpanDSP is a library of DSP functions for telephony, in the 8000 sample per second world of E1s, T1s, and higher order PCM channels. It contains low level functions, such as basic filters. It also contains higher level functions, such as cadenced supervisory tone detection, and a complete software FAX machine. The software has been designed to avoid intellectual property issues, using mature techniques where all relevant patents have expired. See the file DueDiligence for important information about these intellectual property issues. %package devel Summary: SpanDSP development files Group: Development/Libraries Requires: spandsp = %{version} Requires: libtiff-devel PreReq: /sbin/install-info %description devel SpanDSP development files. %prep %setup -q %build %configure --enable-doc --disable-static --disable-rpath make %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} rm %{buildroot}%{_libdir}/libspandsp.la %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc DueDiligence ChangeLog AUTHORS COPYING NEWS README %{_libdir}/libspandsp.so.* %files devel %defattr(-,root,root,-) %doc doc/api %{_includedir}/spandsp.h %{_includedir}/spandsp %{_libdir}/libspandsp.so %{_libdir}/pkgconfig/spandsp.pc %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %changelog * Wed Sep 24 2008 Tzafrir Cohen 0.0.5-1 - Preparing for 0.0.5pre4 release - License: LGPL * Mon Jun 23 2008 Steve Underwood 0.0.5-1 - Cleared out the dependency on libxml2 * Sun Dec 31 2006 Steve Underwood 0.0.3-1 - Preparing for 0.0.3 release * Sat Oct 16 2004 Steve Underwood 0.0.2-1 - Preparing for 0.0.2 release * Thu Apr 15 2004 Steve Underwood 0.0.1-1 - Initial version spandsp-0.0.6/Makefile.am0000664000175000017500000000536511422612260012151 00000000000000## ## SpanDSP - a series of DSP components for telephony ## ## Makefile.am - Process this file with automake to produce Makefile.in ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU Lesser General Public License version 2.1, ## as published by the Free Software Foundation. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU Lesser General Public License for more details. ## ## You should have received a copy of the GNU Lesser General Public ## License along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. AM_CFLAGS = $(COMP_VENDOR_CFLAGS) AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS) noinst_SCRIPTS = spandsp.spec MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = autogen.sh \ DueDiligence \ debian/changelog \ debian/compat \ debian/control \ debian/copyright \ debian/libspandsp6.install \ debian/libspandsp-dev.install \ debian/libspandsp-doc.install \ debian/rules \ debian/watch \ README.testdata \ spandsp.spec \ spandsp/fax-tests.dtd \ spandsp/fax-tests.xml \ spandsp/global-tones.xml \ spandsp/tones.dtd \ spandsp/tsb85.xml \ unpack_g722_data.sh \ unpack_g726_data.sh \ unpack_gsm0610_data.sh \ unpack_v56ter_data.sh \ wrapper.xsl if COND_DOC MAYBE_DOC=doc endif if COND_TESTDATA MAYBE_TESTDATA=test-data endif if COND_TESTS MAYBE_TESTDATA=test-data MAYBE_TESTS=spandsp-sim tests endif SUBDIRS = src $(MAYBE_DOC) $(MAYBE_TESTDATA) $(MAYBE_TESTS) DIST_SUBDIRS = src doc test-data spandsp-sim tests pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = spandsp.pc faq: faq.xml cd faq ; xsltproc ../wrapper.xsl ../faq.xml rpm: rpm-build rpm-build: $(MAKE) -$(MAKEFLAGS) bump.rpm.release $(MAKE) -$(MAKEFLAGS) dist rm -rf rpm/BUILD/* rm -f rpm/RPMS/*/* rm -f rpm/SOURCES/* rm -f rpm/SPECS/* rm -f rpm/SRPMS/* rpmbuild -ta --sign @PACKAGE@-@VERSION@.tar.gz bump.rpm.release: spandsp.spec VERSION="x"; \ test -f $(srcdir)/rpm.release && . $(srcdir)/rpm.release; \ NEXT_RELEASE=0; \ test "$$VERSION" = "@VERSION@" && NEXT_RELEASE="$$RELEASE"; \ RELEASE=`expr $$NEXT_RELEASE + 1`; \ echo "VERSION=@VERSION@" >$(srcdir)/rpm.release; \ echo "RELEASE=$$RELEASE" >>$(srcdir)/rpm.release; \ sed 's/^Release: .*/Release: '$$RELEASE'/' \ spandsp.spec.new; \ mv spandsp.spec.new spandsp.spec spandsp-0.0.6/configure.ac0000664000175000017500000005264712343626352012422 00000000000000# # SpanDSP - a series of DSP components for telephony # # configure.ac - Process this file with autoconf to produce configure # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 2.1, # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # @start 1 AC_INIT([spandsp], [0.0.6]) SPANDSP_MAJOR_VERSION=0 SPANDSP_MINOR_VERSION=0 SPANDSP_MICRO_VERSION=6 SPANDSP_LT_CURRENT=2 SPANDSP_LT_REVISION=0 SPANDSP_LT_AGE=0 m4_include(m4/ax_compiler_vendor.m4) m4_include(m4/ax_check_real_file.m4) m4_include(m4/ax_fixed_point_machine.m4) m4_include(m4/ax_misaligned_access_fails.m4) m4_include(m4/ax_c99_features.m4) m4_include(m4/ax_check_export_capability.m4) m4_include(m4/ax_check_arm_neon.m4) VERSION=$SPANDSP_MAJOR_VERSION.$SPANDSP_MINOR_VERSION.$SPANDSP_MICRO_VERSION PACKAGE=spandsp AC_SUBST(SPANDSP_LT_CURRENT) AC_SUBST(SPANDSP_LT_REVISION) AC_SUBST(SPANDSP_LT_AGE) AC_CONFIG_SRCDIR([src/tone_generate.c]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_HEADERS([src/config.h:config-h.in]) AM_INIT_AUTOMAKE([1.9.5]) AC_CANONICAL_HOST #AC_CANONICAL_BUILD AC_PROG_CC AC_PROG_CXX AC_PROG_GCC_TRADITIONAL AC_PROG_LIBTOOL AC_LANG([C]) AX_COMPILER_VENDOR if test "${build}" != "${host}" then # If we are doing a Canadian Cross, in which the host and build systems # are not the same, we set reasonable default values for the tools. CC_FOR_BUILD=${CC_FOR_BUILD-gcc} CPPFLAGS_FOR_BUILD="\$(CPPFLAGS)" CC=${CC-${host_alias}-gcc} CFLAGS=${CFLAGS-"-g -O2"} CXX=${CXX-${host_alias}-c++} CXXFLAGS=${CXXFLAGS-"-g -O2"} else # Set reasonable default values for some tools even if not Canadian. # Of course, these are different reasonable default values, originally # specified directly in the Makefile. # We don't export, so that autoconf can do its job. # Note that all these settings are above the fragment inclusion point # in Makefile.in, so can still be overridden by fragments. # This is all going to change when we autoconfiscate... CC_FOR_BUILD="\$(CC)" CPPFLAGS_FOR_BUILD="\$(CPPFLAGS)" AC_PROG_CC # We must set the default linker to the linker used by gcc for the correct # operation of libtool. If LD is not defined and we are using gcc, try to # set the LD default to the ld used by gcc. if test -z "$LD" then if test "$GCC" = yes then case $build in *-*-mingw*) gcc_prog_ld=`$CC -print-prog-name=ld 2>&1 | tr -d '\015'` ;; *) gcc_prog_ld=`$CC -print-prog-name=ld 2>&1` ;; esac case $gcc_prog_ld in # Accept absolute paths. [[\\/]* | [A-Za-z]:[\\/]*)] LD="$gcc_prog_ld" ;; esac fi fi CXX=${CXX-"c++"} CFLAGS=${CFLAGS-"-g -O2"} CXXFLAGS=${CXXFLAGS-"-g -O2"} fi AC_DEFUN([REMOVE_FROM_VAR],[ new_val="" removed=0 for i in $$1; do if test "x$i" != "x$2"; then new_val="$new_val $i" else removed=1 fi done if test $removed = "1"; then echo " removed \"$2\" from $1" $1=$new_val fi ]) AC_C_CONST AC_C_INLINE AC_C_VOLATILE AC_CHECK_TYPES(long long) AC_CHECK_TYPES(long double) AC_TYPE_SIGNAL AC_ARG_ENABLE(doc, [ --enable-doc Build the documentation]) AC_ARG_ENABLE(tests, [ --enable-tests Build the test programs]) AC_ARG_ENABLE(test_data, [ --enable-test-data Build TIFF test files for some ITU test images]) AC_ARG_ENABLE(mmx, [ --enable-mmx Enable MMX support]) AC_ARG_ENABLE(sse, [ --enable-sse Enable SSE support]) AC_ARG_ENABLE(sse2, [ --enable-sse2 Enable SSE2 support]) AC_ARG_ENABLE(sse3, [ --enable-sse3 Enable SSE3 support]) AC_ARG_ENABLE(ssse3, [ --enable-ssse3 Enable SSSE3 support]) AC_ARG_ENABLE(sse4_1, [ --enable-sse4-1 Enable SSE4.1 support]) AC_ARG_ENABLE(sse4_2, [ --enable-sse4-2 Enable SSE4.2 support]) AC_ARG_ENABLE(sse4a, [ --enable-sse4a Enable SSE4A support]) AC_ARG_ENABLE(sse5, [ --enable-sse5 Enable SSE5 support]) AC_ARG_ENABLE(avx, [ --enable-avx Enable AVX support]) AC_ARG_ENABLE(fixed_point, [ --enable-fixed-point Enable fixed point support]) # The following is for MSVC, where we may be using a local copy of libtiff, built alongside spandsp AC_ARG_ENABLE(builtin_tiff, [AC_HELP_STRING([--enable-builtin-tiff],[build with builtin libtiff])],[enable_builtin_tiff="$enableval"],[enable_builtin_tiff="no"]) AC_FUNC_ERROR_AT_LINE AC_FUNC_VPRINTF AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_FUNC_REALLOC AC_FUNC_SELECT_ARGTYPES AX_C99_FUNC_LRINT AX_C99_FUNC_LRINTF AX_C99_FUNC_LLRINT AX_C99_FUNC_LLRINTF if test "x$ac_cv_c99_lrint" = "xno" ; then if test "x$ac_cv_c99_lrintf" = "xno" ; then AC_MSG_WARN([[*** Missing C99 standard functions lrint() and lrintf().]]) AC_MSG_WARN([[*** This may cause benign compiler warnings on some systems (ie Solaris).]]) fi fi AX_C99_FLEXIBLE_ARRAY AC_CHECK_FUNCS([memmove]) AC_CHECK_FUNCS([memset]) AC_CHECK_FUNCS([select]) AC_CHECK_FUNCS([strcasecmp]) AC_CHECK_FUNCS([strchr]) AC_CHECK_FUNCS([strdup]) AC_CHECK_FUNCS([strerror]) AC_CHECK_FUNCS([strstr]) AC_CHECK_FUNCS([strtol]) AC_CHECK_FUNCS([gettimeofday]) AC_CHECK_FUNCS([drand48]) AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_HEADER_TIME # Check for header files. AC_CHECK_HEADERS([socket.h]) AC_CHECK_HEADERS([inttypes.h], [INSERT_INTTYPES_HEADER="#include "]) AC_CHECK_HEADERS([stdint.h], [INSERT_STDINT_HEADER="#include "]) AC_CHECK_HEADERS([stdatomic.h]) AC_CHECK_HEADERS([stdbool.h], [INSERT_STDBOOL_HEADER="#include "], [INSERT_STDBOOL_HEADER="#include "]) AC_CHECK_HEADERS([unistd.h]) AC_CHECK_HEADERS([stdlib.h]) AC_CHECK_HEADERS([string.h]) AC_CHECK_HEADERS([strings.h]) AC_CHECK_HEADERS([malloc.h]) AC_CHECK_HEADERS([tgmath.h], [INSERT_TGMATH_HEADER="#include "]) AC_CHECK_HEADERS([math.h], [INSERT_MATH_HEADER="#include "]) AC_CHECK_HEADERS([float.h]) AC_CHECK_HEADERS([fcntl.h]) AC_CHECK_HEADERS([sys/time.h]) AC_CHECK_HEADERS([sys/select.h]) AC_CHECK_HEADERS([sys/ioctl.h]) AC_CHECK_HEADERS([sys/fcntl.h]) AC_CHECK_HEADERS([sndfile.h]) AC_CHECK_HEADERS([fenv.h]) AC_CHECK_HEADERS([fftw3.h], , [AC_CHECK_HEADERS([fftw.h])]) AC_CHECK_HEADERS([pcap.h]) AC_CHECK_HEADERS([pthread.h]) if test "${build}" == "${host}" then AC_CHECK_HEADERS([X11/X.h]) fi # Determine XML2 include path AC_MSG_CHECKING(for libxml/xmlmemory.h) # Can we include headers using system include dirs? AC_TRY_COMPILE([#include ], [int a = 1;], XML2_INCLUDE=" ", XML2_INCLUDE= ) # Hunt through several possible directories to find the includes for libxml2 if test "x$XML2_INCLUDE" = "x"; then old_CPPFLAGS="$CPPFLAGS" for i in $xml2_include_dir /usr/include /usr/local/include /usr/include/libxml2 /usr/local/include/libxml2 ; do CPPFLAGS="$old_CPPFLAGS -I$i" AC_TRY_COMPILE([#include ], [int a = 1;], XML2_INCLUDE="-I$i", XML2_INCLUDE= ) if test "x$XML2_INCLUDE" != "x"; then break; fi done CPPFLAGS="$old_CPPFLAGS $XML2_INCLUDE" fi AC_CHECK_HEADERS([libxml/xmlmemory.h]) AC_CHECK_HEADERS([libxml/parser.h]) AC_CHECK_HEADERS([libxml/xinclude.h]) AC_LANG([C++]) AC_CHECK_HEADERS([FL/Fl.H]) AC_CHECK_HEADERS([FL/Fl_Overlay_Window.H]) AC_CHECK_HEADERS([FL/Fl_Light_Button.H]) AC_CHECK_HEADERS([FL/fl_draw.H]) AC_CHECK_HEADERS([FL/Fl_Cartesian.H], [], [], [],[[#include ]]) AC_CHECK_HEADERS([FL/Fl_Audio_Meter.H], [], [], [],[[#include ]]) AC_LANG([C]) if test "${build}" == "${host}" then case "${host}" in x86_64-*) # X86_64 Linux machines may have both 64 bit and 32 bit libraries. We need to choose the right set AX_CHECK_REAL_FILE([${prefix}/lib64], libdir='${exec_prefix}/lib64') AX_CHECK_REAL_FILE([/usr/X11R6/lib64], [TESTLIBS="$TESTLIBS -L/usr/X11R6/lib64"], AC_CHECK_FILE([/usr/X11R6/lib], [TESTLIBS="$TESTLIBS -L/usr/X11R6/lib"])) # The very oldest AMD 64 bit chips support SSE2, SSE and MMX enable_sse2="yes" ;; esac fi #AC_DEFINE([SPANDSP_SUPPORT_T85], [0], [Support T.85 JBIG compression]) SPANDSP_SUPPORT_T85="#undef SPANDSP_SUPPORT_T85" #AC_DEFINE([SPANDSP_SUPPORT_V34], [0], [Support the V.34 FAX modem]) SPANDSP_SUPPORT_V34="#undef SPANDSP_SUPPORT_V34" AC_CHECK_LIB([m], [cos]) # Some platforms still seem to lack the basic single precision trig and power related function. AC_SEARCH_LIBS([sinf], [m], AC_DEFINE([HAVE_SINF], [1], [Define to 1 if you have the sinf() function.])) AC_SEARCH_LIBS([cosf], [m], AC_DEFINE([HAVE_COSF], [1], [Define to 1 if you have the cosf() function.])) AC_SEARCH_LIBS([tanf], [m], AC_DEFINE([HAVE_TANF], [1], [Define to 1 if you have the tanf() function.])) AC_SEARCH_LIBS([asinf], [m], AC_DEFINE([HAVE_ASINF], [1], [Define to 1 if you have the asinf() function.])) AC_SEARCH_LIBS([acosf], [m], AC_DEFINE([HAVE_ACOSF], [1], [Define to 1 if you have the acosf() function.])) AC_SEARCH_LIBS([atanf], [m], AC_DEFINE([HAVE_ATANF], [1], [Define to 1 if you have the atanf() function.])) AC_SEARCH_LIBS([atan2f], [m], AC_DEFINE([HAVE_ATAN2F], [1], [Define to 1 if you have the atan2f() function.])) AC_SEARCH_LIBS([ceilf], [m], AC_DEFINE([HAVE_CEILF], [1], [Define to 1 if you have the ceilf() function.])) AC_SEARCH_LIBS([floorf], [m], AC_DEFINE([HAVE_FLOORF], [1], [Define to 1 if you have the floorf() function.])) AC_SEARCH_LIBS([powf], [m], AC_DEFINE([HAVE_POWF], [1], [Define to 1 if you have the powf() function.])) AC_SEARCH_LIBS([expf], [m], AC_DEFINE([HAVE_EXPF], [1], [Define to 1 if you have the expf() function.])) AC_SEARCH_LIBS([logf], [m], AC_DEFINE([HAVE_LOGF], [1], [Define to 1 if you have the logf() function.])) AC_SEARCH_LIBS([log10f], [m], AC_DEFINE([HAVE_LOG10F], [1], [Define to 1 if you have the log10f() function.])) AC_SEARCH_LIBS([open_memstream], [m], AC_DEFINE([HAVE_OPEN_MEMSTREAM], [1], [Define to 1 if you have the open_memstream() function.])) if test -n "$enable_tests" ; then AC_CHECK_PROG([HAVE_SOX], [sox], yes) if test "x$HAVE_SOX" != "xyes" ; then AC_MSG_ERROR("Cannot make tests without sox installed") fi AC_CHECK_PROG([HAVE_PBMTOG3], [pbmtog3], yes) if test "x$HAVE_PBMTOG3" != "xyes" ; then AC_MSG_ERROR("Cannot make tests without pbmtog3 installed (does your system require a netpbm-progs package?)") fi AC_CHECK_PROG([HAVE_FAX2TIFF], [fax2tiff], yes) if test "x$HAVE_FAX2TIFF" != "xyes" ; then AC_MSG_ERROR("Cannot make tests without fax2tiff installed (does your system require a libtiff-tools package?)") fi AC_LANG([C]) # Checks for libraries. AC_CHECK_LIB([sndfile], [sf_open], SIMLIBS="$SIMLIBS -lsndfile", AC_MSG_ERROR("Cannot make tests without libsndfile (does your system require a libsndfile-devel package?)")) AC_CHECK_LIB([fftw3], [fftw_plan_dft_1d], SIMLIBS="$SIMLIBS -lfftw3", [AC_CHECK_LIB([fftw], [fftw_create_plan], SIMLIBS="$SIMLIBS -lfftw", AC_MSG_ERROR("Cannot make tests without FFTW 2 or 3 (does your system require an fftw?-devel package?)"))]) AC_CHECK_LIB([xml2], [xmlParseFile], TESTLIBS="$TESTLIBS -lxml2", AC_MSG_ERROR("Cannot make tests without libxml2 (does your system require a libxml2-devel package?)")) AC_CHECK_LIB([pcap], [pcap_open_offline], TESTLIBS="$TESTLIBS -lpcap", [AC_CHECK_LIB([wpcap], [pcap_open_offline], TESTLIBS="$TESTLIBS -lwpcap", AC_MSG_ERROR("Cannot make tests without libpcap (does your system require an libpcap-devel package?)"))]) AC_CHECK_LIB([pthread], [pthread_attr_init], TESTLIBS="$TESTLIBS -lpthread") AC_CHECK_LIB([dl], [dlopen], TESTLIBS="$TESTLIBS -ldl") AC_CHECK_LIB([Xft], [XftFontOpen], TESTLIBS="$TESTLIBS -lXft",, $TESTLIBS) AC_CHECK_LIB([Xext], [XextCreateExtension], TESTLIBS="$TESTLIBS -lXext",, $TESTLIBS) AC_CHECK_LIB([X11], [XOpenDisplay], TESTLIBS="$TESTLIBS -lX11",, $TESTLIBS) AC_LANG([C++]) AC_CHECK_LIB([fltk], [main], TESTLIBS="$TESTLIBS -lfltk -lsupc++",, $TESTLIBS) AC_CHECK_LIB([fltk_cartesian], [main], TESTLIBS="-lfltk_cartesian $TESTLIBS",, $TESTLIBS) AC_CHECK_LIB([fltk_audio_meter], [main], TESTLIBS="-lfltk_audio_meter $TESTLIBS",, $TESTLIBS) AC_LANG([C]) fi AX_CHECK_EXPORT_CAPABILITY([$host], [AC_DEFINE([SPANDSP_USE_EXPORT_CAPABILITY], [1], [Use the library symbol export capability of the compiler]) SPANDSP_USE_EXPORT_CAPABILITY="#define SPANDSP_USE_EXPORT_CAPABILITY 1"], [SPANDSP_USE_EXPORT_CAPABILITY="#undef SPANDSP_USE_EXPORT_CAPABILITY"]) case "${ax_cv_c_compiler_vendor}" in gnu) COMP_VENDOR_CFLAGS="-std=gnu99 -ffast-math -Wall -Wunused-variable -Wunused-but-set-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes $COMP_VENDOR_CFLAGS" if test "$enable_avx" = "yes" ; then COMP_VENDOR_CFLAGS="-mavx $COMP_VENDOR_CFLAGS" fi if test "$enable_sse5" = "yes" ; then COMP_VENDOR_CFLAGS="-msse5 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse4a" = "yes" ; then COMP_VENDOR_CFLAGS="-msse4a $COMP_VENDOR_CFLAGS" fi if test "$enable_sse4_2" = "yes" ; then COMP_VENDOR_CFLAGS="-msse42 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse4_1" = "yes" ; then COMP_VENDOR_CFLAGS="-msse41 $COMP_VENDOR_CFLAGS" fi if test "$enable_ssse3" = "yes" ; then COMP_VENDOR_CFLAGS="-mssse3 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse3" = "yes" ; then COMP_VENDOR_CFLAGS="-msse3 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse2" = "yes" ; then COMP_VENDOR_CFLAGS="-msse2 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse" = "yes" ; then COMP_VENDOR_CFLAGS="-msse $COMP_VENDOR_CFLAGS" fi if test "$enable_mmx" = "yes" ; then COMP_VENDOR_CFLAGS="-mmmx $COMP_VENDOR_CFLAGS" fi case $host_os in cygwin*) COMP_VENDOR_LDFLAGS="-no-undefined" ;; mingw*) COMP_VENDOR_LDFLAGS="-no-undefined -lws2_32" ;; *) COMP_VENDOR_LDFLAGS= ;; esac ;; sun) COMP_VENDOR_CFLAGS="-xc99=all -mt -xCC -errwarn=%all -xvpara $COMP_VENDOR_CFLAGS" if test "$enable_sse3" = "yes" ; then COMP_VENDOR_CFLAGS="-native -fast $COMP_VENDOR_CFLAGS" fi if test "$enable_sse2" = "yes" ; then COMP_VENDOR_CFLAGS="-native -fast $COMP_VENDOR_CFLAGS" fi if test "$enable_sse" = "yes" ; then COMP_VENDOR_CFLAGS="-native -fast $COMP_VENDOR_CFLAGS" fi if test "$enable_mmx" = "yes" ; then COMP_VENDOR_CFLAGS="-native -fast $COMP_VENDOR_CFLAGS" fi COMP_VENDOR_LDFLAGS= REMOVE_FROM_VAR(CFLAGS, -Xc) ;; intel) COMP_VENDOR_CFLAGS="-std=c99 -D_POSIX_C_SOURCE=2 -D_GNU_SOURCE=1 -Wall -Wunused-variable -Wunused-but-set-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes $COMP_VENDOR_CFLAGS" if test "$enable_avx" = "yes" ; then COMP_VENDOR_CFLAGS="-mavx $COMP_VENDOR_CFLAGS" fi if test "$enable_sse5" = "yes" ; then COMP_VENDOR_CFLAGS="-msse5 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse4a" = "yes" ; then COMP_VENDOR_CFLAGS="-msse4a $COMP_VENDOR_CFLAGS" fi if test "$enable_sse4_2" = "yes" ; then COMP_VENDOR_CFLAGS="-msse42 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse4_1" = "yes" ; then COMP_VENDOR_CFLAGS="-msse41 $COMP_VENDOR_CFLAGS" fi if test "$enable_ssse3" = "yes" ; then COMP_VENDOR_CFLAGS="-mssse3 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse3" = "yes" ; then COMP_VENDOR_CFLAGS="-msse3 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse2" = "yes" ; then COMP_VENDOR_CFLAGS="-msse2 $COMP_VENDOR_CFLAGS" fi if test "$enable_sse" = "yes" ; then COMP_VENDOR_CFLAGS="-msse $COMP_VENDOR_CFLAGS" fi if test "$enable_mmx" = "yes" ; then COMP_VENDOR_CFLAGS="-mmmx $COMP_VENDOR_CFLAGS" fi COMP_VENDOR_LDFLAGS= ;; *) COMP_VENDOR_CFLAGS="-std=c99 -Wall -Wunused-variable -Wunused-but-set-variable -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes $COMP_VENDOR_CFLAGS" COMP_VENDOR_LDFLAGS= ;; esac COMP_VENDOR_CFLAGS="-DNDEBUG $COMP_VENDOR_CFLAGS" if test "$enable_fixed_point" = "yes" ; then AC_DEFINE([SPANDSP_USE_FIXED_POINT], [1], [Enable fixed point processing, where possible, instead of floating point]) SPANDSP_USE_FIXED_POINT="#define SPANDSP_USE_FIXED_POINT 1" else AX_FIXED_POINT_MACHINE([$host], [AC_DEFINE([SPANDSP_USE_FIXED_POINT], [1], [Enable fixed point processing, where possible, instead of floating point]) SPANDSP_USE_FIXED_POINT="#define SPANDSP_USE_FIXED_POINT 1"], [SPANDSP_USE_FIXED_POINT="#undef SPANDSP_USE_FIXED_POINT"]) fi AX_MISALIGNED_ACCESS_FAILS([$host], [AC_DEFINE([SPANDSP_MISALIGNED_ACCESS_FAILS], [1], [Do not expect a misaligned memory access to work correctly]) SPANDSP_MISALIGNED_ACCESS_FAILS="#define SPANDSP_MISALIGNED_ACCESS_FAILS 1"], [SPANDSP_MISALIGNED_ACCESS_FAILS="#undef SPANDSP_MISALIGNED_ACCESS_FAILS"]) if test "$enable_avx" = "yes" ; then AC_DEFINE([SPANDSP_USE_AVX], [1], [Use the AVX instruction set (i386 and x86_64 only).]) enable_sse5"yes" fi if test "$enable_sse5" = "yes" ; then AC_DEFINE([SPANDSP_USE_SSE5], [1], [Use the SSE5 instruction set (i386 and x86_64 only).]) enable_sse4a="yes" fi if test "$enable_sse4a" = "yes" ; then AC_DEFINE([SPANDSP_USE_SSE4A], [1], [Use the SSE4A instruction set (i386 and x86_64 only).]) enable_sse4_2="yes" fi if test "$enable_sse4_2" = "yes" ; then AC_DEFINE([SPANDSP_USE_SSE4_2], [1], [Use the SSE4.2 instruction set (i386 and x86_64 only).]) enable_sse4_1="yes" fi if test "$enable_sse4_1" = "yes" ; then AC_DEFINE([SPANDSP_USE_SSE4_1], [1], [Use the SSE4.1 instruction set (i386 and x86_64 only).]) enable_ssse3="yes" fi if test "$enable_ssse3" = "yes" ; then AC_DEFINE([SPANDSP_USE_SSSE3], [1], [Use the SSSE3 instruction set (i386 and x86_64 only).]) enable_sse3="yes" fi if test "$enable_sse3" = "yes" ; then AC_DEFINE([SPANDSP_USE_SSE3], [1], [Use the SSE3 instruction set (i386 and x86_64 only).]) enable_sse2="yes" fi if test "$enable_sse2" = "yes" ; then AC_DEFINE([SPANDSP_USE_SSE2], [1], [Use the SSE2 instruction set (i386 and x86_64 only).]) enable_sse="yes" fi if test "$enable_sse" = "yes" ; then AC_DEFINE([SPANDSP_USE_SSE], [1], [Use the SSE instruction set (i386 and x86_64 only).]) enable_mmx="yes" fi if test "$enable_mmx" = "yes" ; then AC_DEFINE([SPANDSP_USE_MMX], [1], [Use the MMX instruction set (i386 and x86_64 only).]) fi AM_CONDITIONAL([COND_DOC], [test "$enable_doc" = yes]) AM_CONDITIONAL([COND_TESTS], [test "$enable_tests" = yes]) AM_CONDITIONAL([COND_TESTDATA], [test "$enable_test_data" = yes]) AM_CONDITIONAL([COND_MMX], [test "$enable_mmx" = yes]) AM_CONDITIONAL([COND_SSE], [test "$enable_sse" = yes]) AM_CONDITIONAL([COND_SSE2], [test "$enable_sse2" = yes]) AM_CONDITIONAL([COND_SSE3], [test "$enable_sse3" = yes]) AM_CONDITIONAL([COND_SSSE3], [test "$enable_ssse3" = yes]) AM_CONDITIONAL([COND_SSE4_1], [test "$enable_sse4_1" = yes]) AM_CONDITIONAL([COND_SSE4_2], [test "$enable_sse4_2" = yes]) AM_CONDITIONAL([COND_SSE4A], [test "$enable_sse4a" = yes]) AM_CONDITIONAL([COND_SSE5], [test "$enable_sse5" = yes]) AM_CONDITIONAL([COND_AVX], [test "$enable_avx" = yes]) if test "$enable_builtin_tiff" = "yes" ; then abs_tiffdir="`cd $srcdir/../tiff-3.8.2/ && pwd`" save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -I$abs_tiffdir/libtiff" AC_CHECK_HEADERS([tiffio.h]) CFLAGS="$save_CFLAGS" COMP_VENDOR_CFLAGS="-I$abs_tiffdir/libtiff $COMP_VENDOR_CFLAGS" COMP_VENDOR_LDFLAGS="-L$abs_tiffdir/libtiff $COMP_VENDOR_LDFLAGS" LIBS="$LIBS $abs_tiffdir/libtiff/libtiff.la" AC_DEFINE([HAVE_LIBTIFF], [1], [Define to 1 if you have the `tiff' library (-ltiff).]) else AC_CHECK_HEADERS([tiffio.h]) AC_CHECK_LIB([tiff], [TIFFOpen], , AC_MSG_ERROR("Cannot build without libtiff (does your system require a libtiff-devel package?)"), -lm) fi AC_CHECK_HEADERS([jpeglib.h]) AC_CHECK_LIB([jpeg], [jpeg_start_compress]) TESTLIBS="$SIMLIBS $TESTLIBS" AC_SUBST(CC_FOR_BUILD) AC_SUBST(CPPFLAGS_FOR_BUILD) AC_SUBST(COMP_VENDOR_CFLAGS) AC_SUBST(COMP_VENDOR_LDFLAGS) AC_SUBST(SIMLIBS) AC_SUBST(TESTLIBS) AC_SUBST(SPANDSP_USE_FIXED_POINT) AC_SUBST(SPANDSP_MISALIGNED_ACCESS_FAILS) AC_SUBST(SPANDSP_USE_EXPORT_CAPABILITY) AC_SUBST(SPANDSP_SUPPORT_T85) AC_SUBST(SPANDSP_SUPPORT_V34) AC_SUBST(INSERT_INTTYPES_HEADER) AC_SUBST(INSERT_STDINT_HEADER) AC_SUBST(INSERT_TGMATH_HEADER) AC_SUBST(INSERT_MATH_HEADER) AC_SUBST(INSERT_STDBOOL_HEADER) AC_CONFIG_FILES([Makefile doc/Makefile doc/doxygen src/Makefile src/spandsp.h spandsp-sim/Makefile test-data/Makefile test-data/etsi/Makefile test-data/etsi/fax/Makefile test-data/itu/Makefile test-data/itu/fax/Makefile test-data/local/Makefile tests/Makefile spandsp.pc spandsp.spec]) AC_OUTPUT # @end 1 spandsp-0.0.6/m4/0000775000175000017500000000000012357123346010516 500000000000000spandsp-0.0.6/m4/ax_fixed_point_machine.m40000664000175000017500000000262612101016575015362 00000000000000# AX_FIXED_POINT_MACHINE(MACHINE, [ACTION-IF-FIXED-POINT], [ACTION-IF-NOT-FIXED-POINT]) # ------------------------------------------------------------------------------------- # # Check if a specified machine type is a fixed point only machine. That is, if it lacks # fast floating point support. # # This is a simple lookup amongst machines known to the current autotools. So far we deal # with the embedded ARM, Blackfin, MIPS, TI DSP and XScale processors as things which lack # fast hardware floating point. # # Other candidates would be the small embedded Power PCs. # AC_DEFUN([AX_FIXED_POINT_MACHINE], [AS_VAR_PUSHDEF([ac_FixedPoint], [ac_cv_fixed_point_machine_$1])dnl AC_CACHE_CHECK([if $1 is fixed point only], ac_FixedPoint, [case $1 in arc \ | arm | arm[bl]e | arme[bl] | armv[2345] | armv[345][bl] \ | arm-* | arm[bl]e-* | arme[bl]-* | armv[345]-* \ | bfin | bfin-* \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | tic54x | c54x* | tic55x | c55x* | tic6x | c6x* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | xscale | xscalee[bl] \ | xscale-* | xscalee[bl]-* ) AS_VAR_SET(ac_FixedPoint, yes) ;; *) AS_VAR_SET(ac_FixedPoint, no) ;; esac]) AS_IF([test AS_VAR_GET(ac_FixedPoint) = yes], [$2], [$3])[]dnl AS_VAR_POPDEF([ac_FixedPoint])dnl ])# AX_FIXED_POINT_MACHINE spandsp-0.0.6/m4/ax_compiler_vendor.m40000664000175000017500000000606212101016575014553 00000000000000# =========================================================================== # http://autoconf-archive.cryp.to/ax_compiler_vendor.html # =========================================================================== # # SYNOPSIS # # AX_COMPILER_VENDOR # # DESCRIPTION # # Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, sun, # hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, microsoft, # watcom, etc. The vendor is returned in the cache variable # $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++. # # LAST MODIFICATION # # 2008-04-12 # # COPYLEFT # # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2008 Matteo Frigo # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Macro Archive. When you make and # distribute a modified version of the Autoconf Macro, you may extend this # special exception to the GPL to apply to your modified version as well. AC_DEFUN([AX_COMPILER_VENDOR], [AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, [ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=unknown # note: don't check for gcc first since some other compilers define __GNUC__ for ventest in intel:__ICC,__ECC,__INTEL_COMPILER ibm:__xlc__,__xlC__,__IBMC__,__IBMCPP__ pathscale:__PATHCC__,__PATHSCALE__ gnu:__GNUC__ sun:__SUNPRO_C,__SUNPRO_CC hp:__HP_cc,__HP_aCC dec:__DECC,__DECCXX,__DECC_VER,__DECCXX_VER borland:__BORLANDC__,__TURBOC__ comeau:__COMO__ cray:_CRAYC kai:__KCC lcc:__LCC__ metrowerks:__MWERKS__ sgi:__sgi,sgi microsoft:_MSC_VER watcom:__WATCOMC__ portland:__PGI; do vencpp="defined("`echo $ventest | cut -d: -f2 | sed 's/,/) || defined(/g'`")" AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ #if !($vencpp) thisisanerror; #endif ])], [ax_cv_]_AC_LANG_ABBREV[_compiler_vendor=`echo $ventest | cut -d: -f1`; break]) done ]) ]) spandsp-0.0.6/m4/ax_check_real_file.m40000664000175000017500000000151512101016575014441 00000000000000# AX_CHECK_REAL_FILE(FILE, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # ------------------------------------------------------------------ # # Check for the existence of FILE, and make sure it is a real file or # directory, and not a symbolic link. # AC_DEFUN([AX_CHECK_REAL_FILE], [AC_DIAGNOSE([cross], [cannot check for file existence when cross compiling])dnl AS_VAR_PUSHDEF([ac_RealFile], [ac_cv_real_file_$1])dnl AC_CACHE_CHECK([for $1], ac_RealFile, [test "$cross_compiling" = yes && AC_MSG_ERROR([cannot check for file existence when cross compiling]) if test -r "$1" then if test -h "$1" then AS_VAR_SET(ac_RealFile, no) else AS_VAR_SET(ac_RealFile, yes) fi else AS_VAR_SET(ac_RealFile, no) fi]) AS_IF([test AS_VAR_GET(ac_RealFile) = yes], [$2], [$3])[]dnl AS_VAR_POPDEF([ac_RealFile])dnl ])# AX_CHECK_REAL_FILE spandsp-0.0.6/m4/ax_check_export_capability.m40000664000175000017500000000365312101016575016246 00000000000000# @synopsis AX_CHECK_EXPORT_CAPABILITY # # Does the compiler support the exporting of library symbols? # @version 1.0 Jan 31 2009 # @author Steve Underwood # # Permission to use, copy, modify, distribute, and sell this file for any # purpose is hereby granted without fee, provided that the above copyright # and this permission notice appear in all copies. No representations are # made about the suitability of this software for any purpose. It is # provided "as is" without express or implied warranty. AC_DEFUN([AX_CHECK_EXPORT_CAPABILITY], [AC_CACHE_CHECK([if $1 supports library symbol export], ac_cv_symbol_export_capability, [# Initialize to unknown ac_cv_symbol_export_capability="no" case "${ax_cv_c_compiler_vendor}" in gnu) save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} -fvisibility=hidden" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [int foo __attribute__ ((visibility("default")));], [;] )], [AC_MSG_RESULT([yes]) COMP_VENDOR_CFLAGS="-fvisibility=hidden -DHAVE_VISIBILITY=1 $COMP_VENDOR_CFLAGS" COMP_VENDOR_CXXFLAGS="-fvisibility=hidden -DHAVE_VISIBILITY=1 $COMP_VENDOR_CXXFLAGS" ac_cv_symbol_export_capability="yes"], [AC_MSG_RESULT([no])] ) CFLAGS="${save_CFLAGS}" ;; sun) save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} -xldscope=hidden" AC_COMPILE_IFELSE( [AC_LANG_PROGRAM( [int foo __attribute__ ((visibility("default")));], [;] )], [AC_MSG_RESULT([yes]) COMP_VENDOR_CFLAGS="-xldscope=hidden -DHAVE_VISIBILITY=1 $COMP_VENDOR_CFLAGS" COMP_VENDOR_CXXFLAGS="-xldscope=hidden -DHAVE_VISIBILITY=1 $COMP_VENDOR_CXXFLAGS" ac_cv_symbol_export_capability="yes"], [AC_MSG_RESULT([no])] ) CFLAGS="${save_CFLAGS}" ;; esac]) AS_IF([test AS_VAR_GET(ac_cv_symbol_export_capability) = yes], [$2], [$3])[]dnl ]) # AX_CHECK_EXPORT_CAPABILITY spandsp-0.0.6/m4/ax_misaligned_access_fails.m40000664000175000017500000000271412101016575016177 00000000000000# AX_MISALIGNED_ACCESS_FAILS(MACHINE, [ACTION-IF-MISALIGNED-FAILS], [ACTION-IF-MISALIGNED-OK]) # ------------------------------------------------------------------------------------- # # Check if a specified machine type cannot handle misaligned data. That is, multi-byte data # types which are not properly aligned in memory fail. Many machines are happy to work with # misaligned data, but slowing down a bit. Other machines just won't tolerate such data. # # This is a simple lookup amongst machines known to the current autotools. So far we only deal # with the ARM and sparc. # A lookup is used, as many of the devices which cannot handled misaligned access are embedded # processors, for which the code normally be cross-compiled. # AC_DEFUN([AX_MISALIGNED_ACCESS_FAILS], [AS_VAR_PUSHDEF([ac_MisalignedAccessFails], [ac_cv_misaligned_access_fails_$1])dnl AC_CACHE_CHECK([if $1 fails on misaligned memory access], ac_MisalignedAccessFails, [case $1 in arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] \ | bfin \ | sparc \ | xscale | xscalee[bl] \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | bfin-* \ | sparc-* \ | xscale-* | xscalee[bl]-* ) AS_VAR_SET(ac_MisalignedAccessFails, yes) ;; *) AS_VAR_SET(ac_MisalignedAccessFails, no) ;; esac]) AS_IF([test AS_VAR_GET(ac_MisalignedAccessFails) = yes], [$2], [$3])[]dnl AS_VAR_POPDEF([ac_MisalignedAccessFails])dnl ])# MISALIGNED_ACCESS_FAILS spandsp-0.0.6/m4/ax_c99_features.m40000664000175000017500000001213012101016575013657 00000000000000# @synopsis AX_C99_FLEXIBLE_ARRAY # # Does the compiler support the 1999 ISO C Standard "struct hack". # @version 1.1 Mar 15 2004 # @author Erik de Castro Lopo # # Permission to use, copy, modify, distribute, and sell this file for any # purpose is hereby granted without fee, provided that the above copyright # and this permission notice appear in all copies. No representations are # made about the suitability of this software for any purpose. It is # provided "as is" without express or implied warranty. AC_DEFUN([AX_C99_FLEXIBLE_ARRAY], [AC_CACHE_CHECK(if have C99 struct flexible array support, ac_cv_c99_flexible_array, # Initialize to unknown ac_cv_c99_flexible_array=no AC_TRY_LINK([[ #include typedef struct { int k; char buffer [] ; } MY_STRUCT ; ]], [ MY_STRUCT *p = calloc (1, sizeof (MY_STRUCT) + 42); ], ac_cv_c99_flexible_array=yes, ac_cv_c99_flexible_array=no ))] ) # AX_C99_FLEXIBLE_ARRAY # @synopsis AX_C99_FUNC_LRINT # # Check whether C99's lrint function is available. # @version 1.3 Feb 12 2002 # @author Erik de Castro Lopo # # Permission to use, copy, modify, distribute, and sell this file for any # purpose is hereby granted without fee, provided that the above copyright # and this permission notice appear in all copies. No representations are # made about the suitability of this software for any purpose. It is # provided "as is" without express or implied warranty. # AC_DEFUN([AX_C99_FUNC_LRINT], [AC_CACHE_CHECK(for lrint, ac_cv_c99_lrint, [ lrint_save_LIBS=$LIBS LIBS="-lm" AC_TRY_LINK([ #define _ISOC9X_SOURCE 1 #define _ISOC99_SOURCE 1 #define __USE_ISOC99 1 #define __USE_ISOC9X 1 #include ], if (!lrint(3.14159)) lrint(2.7183);, ac_cv_c99_lrint=yes, ac_cv_c99_lrint=no) LIBS=$lrint_save_LIBS ]) if test "$ac_cv_c99_lrint" = yes; then AC_DEFINE(HAVE_LRINT, 1, [Define if you have C99's lrint function.]) fi ])# AX_C99_FUNC_LRINT # @synopsis AX_C99_FUNC_LRINTF # # Check whether C99's lrintf function is available. # @version 1.3 Feb 12 2002 # @author Erik de Castro Lopo # # Permission to use, copy, modify, distribute, and sell this file for any # purpose is hereby granted without fee, provided that the above copyright # and this permission notice appear in all copies. No representations are # made about the suitability of this software for any purpose. It is # provided "as is" without express or implied warranty. # AC_DEFUN([AX_C99_FUNC_LRINTF], [AC_CACHE_CHECK(for lrintf, ac_cv_c99_lrintf, [ lrintf_save_LIBS=$LIBS LIBS="-lm" AC_TRY_LINK([ #define _ISOC9X_SOURCE 1 #define _ISOC99_SOURCE 1 #define __USE_ISOC99 1 #define __USE_ISOC9X 1 #include ], if (!lrintf(3.14159)) lrintf(2.7183);, ac_cv_c99_lrintf=yes, ac_cv_c99_lrintf=no) LIBS=$lrintf_save_LIBS ]) if test "$ac_cv_c99_lrintf" = yes; then AC_DEFINE(HAVE_LRINTF, 1, [Define if you have C99's lrintf function.]) fi ])# AX_C99_FUNC_LRINTF # @synopsis AX_C99_FUNC_LLRINT # # Check whether C99's llrint function is available. # @version 1.1 Sep 30 2002 # @author Erik de Castro Lopo # # Permission to use, copy, modify, distribute, and sell this file for any # purpose is hereby granted without fee, provided that the above copyright # and this permission notice appear in all copies. No representations are # made about the suitability of this software for any purpose. It is # provided "as is" without express or implied warranty. # AC_DEFUN([AX_C99_FUNC_LLRINT], [AC_CACHE_CHECK(for llrint, ac_cv_c99_llrint, [ llrint_save_LIBS=$LIBS LIBS="-lm" AC_TRY_LINK([ #define ISOC9X_SOURCE 1 #define _ISOC99_SOURCE 1 #define __USE_ISOC99 1 #define __USE_ISOC9X 1 #include ], long long int x ; x = llrint(3.14159) ;, ac_cv_c99_llrint=yes, ac_cv_c99_llrint=no) LIBS=$llrint_save_LIBS ]) if test "$ac_cv_c99_llrint" = yes; then AC_DEFINE(HAVE_LLRINT, 1, [Define if you have C99's llrint function.]) fi ])# AX_C99_FUNC_LLRINT # @synopsis AX_C99_FUNC_LLRINTF # # Check whether C99's llrintf function is available. # @version 1.1 Sep 30 2002 # @author Erik de Castro Lopo # # Permission to use, copy, modify, distribute, and sell this file for any # purpose is hereby granted without fee, provided that the above copyright # and this permission notice appear in all copies. No representations are # made about the suitability of this software for any purpose. It is # provided "as is" without express or implied warranty. # AC_DEFUN([AX_C99_FUNC_LLRINTF], [AC_CACHE_CHECK(for llrintf, ac_cv_c99_llrintf, [ llrintf_save_LIBS=$LIBS LIBS="-lm" AC_TRY_LINK([ #define _ISOC9X_SOURCE 1 #define _ISOC99_SOURCE 1 #define __USE_ISOC99 1 #define __USE_ISOC9X 1 #include ], long long int x ; x = llrintf(3.14159) ;, ac_cv_c99_llrintf=yes, ac_cv_c99_llrintf=no) LIBS=$llrintf_save_LIBS ]) if test "$ac_cv_c99_llrintf" = yes; then AC_DEFINE(HAVE_LLRINTF, 1, [Define if you have C99's llrintf function.]) fi ])# AX_C99_FUNC_LLRINTF spandsp-0.0.6/m4/ax_check_arm_neon.m40000664000175000017500000000330412343626254014324 00000000000000# @synopsis AX_CHECK_ARM_NEON # # Does the machine support the ARM NEON instruction set? # @version 1.01 Feb 11 2013 # @author Steve Underwood # # Permission to use, copy, modify, distribute, and sell this file for any # purpose is hereby granted without fee, provided that the above copyright # and this permission notice appear in all copies. No representations are # made about the suitability of this software for any purpose. It is # provided "as is" without express or implied warranty. AC_DEFUN([AX_CHECK_ARM_NEON], [AC_CACHE_CHECK([if $1 supports the ARM NEON instructions set], ac_cv_symbol_arm_neon, [# Initialize to unknown ac_cv_symbol_arm_neon="no" case "${ax_cv_c_compiler_vendor}" in gnu) save_CFLAGS="${CFLAGS}" CFLAGS="${CFLAGS} -mfpu=neon -mfloat-abi=hard" AC_RUN_IFELSE( [AC_LANG_PROGRAM( [ #include #include int32x4_t testfunc(int16_t *a, int16_t *b) { return vmull_s16(vld1_s16(a), vld1_s16(b)); } ], [ volatile int32x4_t z; int16_t x[[8]]; int16_t y[[8]]; z = testfunc(x, y); ] )], [AC_MSG_RESULT([yes]) COMP_VENDOR_CFLAGS="-mfpu=neon $COMP_VENDOR_CFLAGS" COMP_VENDOR_CXXFLAGS="-mfpu=neon $COMP_VENDOR_CXXFLAGS" ac_cv_symbol_arm_neon="yes"], [AC_MSG_RESULT([no])], dnl Assume "no" if cross-compiling [AC_MSG_RESULT([no])] ) CFLAGS="${save_CFLAGS}" ;; esac]) AS_IF([test AS_VAR_GET(ac_cv_symbol_arm_neon) = yes], [$2], [$3])[]dnl ]) # AX_CHECK_ARM_NEON spandsp-0.0.6/tests/0000775000175000017500000000000012357123347011341 500000000000000spandsp-0.0.6/tests/time_scale_tests.c0000664000175000017500000001151112101213607014735 00000000000000/* * SpanDSP - a series of DSP components for telephony * * time_scale_tests.c * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page time_scale_tests_page Time scaling tests \section time_scale_tests_page_sec_1 What does it do? These tests run a speech file through the time scaling routines. \section time_scale_tests_page_sec_2 How are the tests run? These tests process a speech file called pre_time_scale.wav. This file should contain 8000 sample/second 16 bits/sample linear audio. The tests read this file, change the time scale of its contents, and write the resulting audio to post_time_scale.wav. This file also contains 8000 sample/second 16 bits/sample linear audio. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include "spandsp.h" #include "spandsp/private/time_scale.h" #define BLOCK_LEN 160 #define IN_FILE_NAME "../test-data/local/short_nb_voice.wav" #define OUT_FILE_NAME "time_scale_result.wav" int main(int argc, char *argv[]) { SNDFILE *inhandle; SNDFILE *outhandle; SF_INFO info; int16_t in[BLOCK_LEN]; int16_t out[5*(BLOCK_LEN + TIME_SCALE_MAX_SAMPLE_RATE/TIME_SCALE_MIN_PITCH)]; int frames; int new_frames; int out_frames; int count; int max; time_scale_state_t state; float rate; float sample_rate; const char *in_file_name; int sweep_rate; int opt; rate = 1.8f; sweep_rate = FALSE; in_file_name = IN_FILE_NAME; while ((opt = getopt(argc, argv, "i:r:s")) != -1) { switch (opt) { case 'i': in_file_name = optarg; break; case 'r': rate = atof(optarg); break; case 's': sweep_rate = TRUE; break; default: //usage(); exit(2); break; } } if ((inhandle = sf_open(in_file_name, SFM_READ, &info)) == NULL) { printf(" Cannot open audio file '%s'\n", in_file_name); exit(2); } if (info.channels != 1) { printf(" Unexpected number of channels in audio file '%s'\n", in_file_name); exit(2); } sample_rate = info.samplerate; memset(&info, 0, sizeof(info)); info.frames = 0; info.samplerate = sample_rate; info.channels = 1; info.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16; info.sections = 1; info.seekable = 1; if ((outhandle = sf_open(OUT_FILE_NAME, SFM_WRITE, &info)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME); exit(2); } if ((time_scale_init(&state, (int) sample_rate, rate)) == NULL) { fprintf(stderr, " Cannot start the time scaler\n"); exit(2); } max = time_scale_max_output_len(&state, BLOCK_LEN); printf("Rate is %f, longest output block is %d\n", rate, max); count = 0; while ((frames = sf_readf_short(inhandle, in, BLOCK_LEN))) { new_frames = time_scale(&state, out, in, frames); out_frames = sf_writef_short(outhandle, out, new_frames); if (out_frames != new_frames) { fprintf(stderr, " Error writing audio file\n"); exit(2); } if (sweep_rate && ++count > 100) { if (rate > 0.5f) { rate -= 0.1f; if (rate >= 0.99f && rate <= 1.01f) rate -= 0.1f; time_scale_init(&state, SAMPLE_RATE, rate); max = time_scale_max_output_len(&state, BLOCK_LEN); printf("Rate is %f, longest output block is %d\n", rate, max); } count = 0; } } if (sf_close(inhandle)) { printf(" Cannot close audio file '%s'\n", in_file_name); exit(2); } if (sf_close(outhandle)) { printf(" Cannot close audio file '%s'\n", OUT_FILE_NAME); exit(2); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/bell_mf_tx_tests.c0000664000175000017500000001152112101212401014733 00000000000000/* * SpanDSP - a series of DSP components for telephony * * bell_mf_tx_tests.c - Test the Bell MF generator. * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page bell_mf_tx_tests_page Bell MF generation tests \section bell_mf_tx_tests_page_sec_1 What does it do? ???. \section bell_mf_tx_tests_page_sec_2 How does it work? ???. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define OUTPUT_FILE_NAME "bell_mf.wav" int main(int argc, char *argv[]) { bell_mf_tx_state_t *gen; int16_t amp[16384]; int len; SNDFILE *outhandle; int add_digits; if ((outhandle = sf_open_telephony_write(OUTPUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } gen = bell_mf_tx_init(NULL); len = bell_mf_tx(gen, amp, 16384); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); if (bell_mf_tx_put(gen, "123", -1)) printf("Ooops\n"); len = bell_mf_tx(gen, amp, 16384); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); if (bell_mf_tx_put(gen, "456", -1)) printf("Ooops\n"); len = bell_mf_tx(gen, amp, 160); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); if (bell_mf_tx_put(gen, "789", -1)) printf("Ooops\n"); len = bell_mf_tx(gen, amp, 160); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); if (bell_mf_tx_put(gen, "*#", -1)) printf("Ooops\n"); len = bell_mf_tx(gen, amp, 160); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); add_digits = 1; do { len = bell_mf_tx(gen, amp, 160); printf("Generated %d samples\n", len); if (len > 0) sf_writef_short(outhandle, amp, len); if (add_digits) { if (bell_mf_tx_put(gen, "1234567890", -1)) { printf("Digit buffer full\n"); add_digits = 0; } } } while (len > 0); bell_mf_tx_init(gen); len = bell_mf_tx(gen, amp, 16384); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); if (bell_mf_tx_put(gen, "123", -1)) printf("Ooops\n"); len = bell_mf_tx(gen, amp, 16384); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); if (bell_mf_tx_put(gen, "456", -1)) printf("Ooops\n"); len = bell_mf_tx(gen, amp, 160); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); if (bell_mf_tx_put(gen, "789", -1)) printf("Ooops\n"); len = bell_mf_tx(gen, amp, 160); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); if (bell_mf_tx_put(gen, "0*#", -1)) printf("Ooops\n"); len = bell_mf_tx(gen, amp, 160); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); if (bell_mf_tx_put(gen, "ABC", -1)) printf("Ooops\n"); len = bell_mf_tx(gen, amp, 160); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); add_digits = 1; do { len = bell_mf_tx(gen, amp, 160); printf("Generated %d samples\n", len); if (len > 0) sf_writef_short(outhandle, amp, len); if (add_digits) { if (bell_mf_tx_put(gen, "1234567890", -1)) { printf("Digit buffer full\n"); add_digits = 0; } } } while (len > 0); if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME); exit (2); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/lpc10_tests.c0000664000175000017500000001734712101216654013571 00000000000000/* * SpanDSP - a series of DSP components for telephony * * lpc10_tests.c - Test the LPC10 low bit rate speech codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page lpc10_tests_page LPC10 codec tests \section lpc10_tests_page_sec_1 What does it do? \section lpc10_tests_page_sec_2 How is it used? To perform a general audio quality test, lpc10 should be run. The file ../test-data/local/dam9.wav will be compressed to LPC10 data, decompressed, and the resulting audio stored in post_lpc10.wav. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define BLOCK_LEN 180 #define BLOCKS_PER_READ 5 #define IN_FILE_NAME "../test-data/local/dam9.wav" #define REF_FILE_NAME "../test-data/local/dam9_lpc55.wav" #define COMPRESS_FILE_NAME "lpc10_out.lpc10" #define DECOMPRESS_FILE_NAME "lpc10_in.lpc10" #define OUT_FILE_NAME "post_lpc10.wav" int main(int argc, char *argv[]) { SNDFILE *inhandle; SNDFILE *refhandle; SNDFILE *outhandle; int frames; double pre_energy; double post_energy; double ref_energy; double diff_energy; int16_t pre_amp[BLOCKS_PER_READ*BLOCK_LEN]; int16_t post_amp[BLOCKS_PER_READ*BLOCK_LEN]; int16_t ref_amp[BLOCKS_PER_READ*BLOCK_LEN]; int16_t log_amp[BLOCKS_PER_READ*BLOCK_LEN*3]; uint8_t lpc10_data[BLOCKS_PER_READ*7]; double xx; lpc10_encode_state_t *lpc10_enc_state; lpc10_decode_state_t *lpc10_dec_state; int i; int block_no; int log_error; int compress; int decompress; const char *in_file_name; int compress_file; int decompress_file; int len; int opt; int enc_len; int dec_len; compress = FALSE; decompress = FALSE; log_error = TRUE; in_file_name = IN_FILE_NAME; while ((opt = getopt(argc, argv, "cdi:l")) != -1) { switch (opt) { case 'c': compress = TRUE; break; case 'd': decompress = TRUE; break; case 'i': in_file_name = optarg; break; case 'l': log_error = FALSE; break; default: //usage(); exit(2); } } compress_file = -1; decompress_file = -1; inhandle = NULL; refhandle = NULL; outhandle = NULL; if (!decompress) { if ((inhandle = sf_open_telephony_read(in_file_name, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", in_file_name); exit(2); } if ((refhandle = sf_open_telephony_read(REF_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", REF_FILE_NAME); exit(2); } } else { if ((decompress_file = open(DECOMPRESS_FILE_NAME, O_RDONLY)) < 0) { fprintf(stderr, " Cannot open decompressed data file '%s'\n", DECOMPRESS_FILE_NAME); exit(2); } } if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME); exit(2); } if ((lpc10_enc_state = lpc10_encode_init(NULL, TRUE)) == NULL) { fprintf(stderr, " Cannot create encoder\n"); exit(2); } if ((lpc10_dec_state = lpc10_decode_init(NULL, TRUE)) == NULL) { fprintf(stderr, " Cannot create decoder\n"); exit(2); } if (compress) { if ((compress_file = open(COMPRESS_FILE_NAME, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) { fprintf(stderr, " Cannot create compressed data file '%s'\n", COMPRESS_FILE_NAME); exit(2); } } pre_energy = 0.0; post_energy = 0.0; ref_energy = 0.0; diff_energy = 0.0; if (decompress) { while ((len = read(decompress_file, lpc10_data, BLOCKS_PER_READ*7)) > 0) { lpc10_decode(lpc10_dec_state, post_amp, lpc10_data, len/7); sf_writef_short(outhandle, post_amp, BLOCK_LEN*len/7); } } else { block_no = 0; while ((frames = sf_readf_short(inhandle, pre_amp, BLOCKS_PER_READ*BLOCK_LEN)) == BLOCKS_PER_READ*BLOCK_LEN && (frames = sf_readf_short(refhandle, ref_amp, BLOCKS_PER_READ*BLOCK_LEN)) == BLOCKS_PER_READ*BLOCK_LEN) { enc_len = lpc10_encode(lpc10_enc_state, lpc10_data, pre_amp, BLOCKS_PER_READ*BLOCK_LEN); if (compress) write(compress_file, lpc10_data, enc_len); dec_len = lpc10_decode(lpc10_dec_state, post_amp, lpc10_data, enc_len); for (i = 0; i < dec_len; i++) { pre_energy += (double) pre_amp[i]*(double) pre_amp[i]; post_energy += (double) post_amp[i]*(double) post_amp[i]; ref_energy += (double) ref_amp[i]*(double) ref_amp[i]; /* The reference file has some odd clipping, so eliminate this from the energy measurement. */ if (ref_amp[i] == 32767 || ref_amp[i] == -32768) xx = 0.0; else xx = post_amp[i] - ref_amp[i]; diff_energy += (double) xx*(double) xx; log_amp[i] = xx; } block_no++; if (log_error) sf_writef_short(outhandle, log_amp, dec_len); else sf_writef_short(outhandle, post_amp, dec_len); } if (sf_close_telephony(inhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", in_file_name); exit(2); } if (sf_close_telephony(refhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", REF_FILE_NAME); exit(2); } } if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME); exit(2); } if (compress) close(compress_file); if (decompress) close(decompress_file); lpc10_encode_release(lpc10_enc_state); lpc10_decode_release(lpc10_dec_state); if (!decompress) { printf("Output energy is %f%% of input energy.\n", 100.0*post_energy/pre_energy); printf("Difference energy is %f%% of the total.\n", 100.0*diff_energy/ref_energy); if (fabs(1.0 - post_energy/pre_energy) > 0.05 || fabs(diff_energy/post_energy) > 0.03) { printf("Tests failed.\n"); exit(2); } printf("Tests passed.\n"); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/regression_tests.sh0000775000175000017500000004702412101005732015211 00000000000000#!/bin/sh # # SpanDSP - a series of DSP components for telephony # # regression_tests.sh # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 2.1, # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ITUTESTS_TIF=../test-data/itu/fax/itutests.tif MIXEDSIZES_TIF=../test-data/itu/fax/mixed_size_pages.tif STDOUT_DEST=xyzzy STDERR_DEST=xyzzy2 echo Performing basic spandsp regression tests echo ./ademco_contactid_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo ademco_contactid_tests failed! exit $RETVAL fi echo ademco_contactid_tests completed OK ./adsi_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo adsi_tests failed! exit $RETVAL fi echo adsi_tests completed OK ./async_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo async_tests failed! exit $RETVAL fi echo async_tests completed OK ./at_interpreter_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo at_interpreter_tests failed! exit $RETVAL fi echo at_interpreter_tests completed OK ./awgn_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo awgn_tests failed! exit $RETVAL fi echo awgn_tests completed OK ./bell_mf_rx_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo bell_mf_rx_tests failed! exit $RETVAL fi echo bell_mf_rx_tests completed OK ./bell_mf_tx_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo bell_mf_tx_tests failed! exit $RETVAL fi echo bell_mf_tx_tests completed OK ./bert_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo bert_tests failed! exit $RETVAL fi echo bert_tests completed OK ./bit_operations_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo bit_operations_tests failed! exit $RETVAL fi echo bit_operations_tests completed OK ./complex_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo complex_tests failed! exit $RETVAL fi echo complex_tests completed OK ./complex_vector_float_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo complex_vector_float_tests failed! exit $RETVAL fi echo complex_vector_float_tests completed OK ./complex_vector_int_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo complex_vector_int_tests failed! exit $RETVAL fi echo complex_vector_int_tests completed OK ./crc_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo crc_tests failed! exit $RETVAL fi echo crc_tests completed OK ./dc_restore_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo dc_restore_tests failed! exit $RETVAL fi echo dc_restore_tests completed OK ./dds_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo dds_tests failed! exit $RETVAL fi echo dds_tests completed OK ./dtmf_rx_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo dtmf_rx_tests failed! exit $RETVAL fi echo dtmf_rx_tests completed OK ./dtmf_tx_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo dtmf_tx_tests failed! exit $RETVAL fi echo dtmf_tx_tests completed OK #./echo_tests >$STDOUT_DEST 2>$STDERR_DEST #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo echo_tests failed! # exit $RETVAL #fi #echo echo_tests completed OK echo echo_tests not enabled #Try the ITU test pages without ECM rm -f fax_tests_1.tif ./fax_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo fax_tests failed! exit $RETVAL fi # Now use tiffcmp to check the results. It will return non-zero if any page images differ. The -t # option means the normal differences in tags will be ignored. tiffcmp -t ${ITUTESTS_TIF} fax_tests_1.tif >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo fax_tests failed! exit $RETVAL fi #Try the ITU test pages with ECM rm -f fax_tests_1.tif ./fax_tests -e >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo fax_tests -e failed! exit $RETVAL fi # Now use tiffcmp to check the results. It will return non-zero if any page images differ. The -t # option means the normal differences in tags will be ignored. tiffcmp -t ${ITUTESTS_TIF} fax_tests_1.tif >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo fax_tests -e failed! exit $RETVAL fi #Try some mixed sized test pages without ECM rm -f fax_tests_1.tif ./fax_tests -i ${MIXEDSIZES_TIF} >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo fax_tests mixed-sizes failed! exit $RETVAL fi # Now use tiffcmp to check the results. It will return non-zero if any page images differ. The -t # option means the normal differences in tags will be ignored. tiffcmp -t ${MIXEDSIZES_TIF} fax_tests_1.tif >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo fax_tests mixed-sizes failed! exit $RETVAL fi echo fax_tests completed OK ./fsk_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo fsk_tests failed! exit $RETVAL fi echo fsk_tests completed OK #./g1050_tests >$STDOUT_DEST 2>$STDERR_DEST #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo g1050_tests failed! # exit $RETVAL #fi #echo g1050_tests completed OK ./g711_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo g711_tests failed! exit $RETVAL fi echo g711_tests completed OK ./g722_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo g722_tests failed! exit $RETVAL fi echo g722_tests completed OK ./g726_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo g726_tests failed! exit $RETVAL fi echo g726_tests completed OK ./gsm0610_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo gsm0610_tests failed! exit $RETVAL fi echo gsm0610_tests completed OK ./hdlc_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo hdlc_tests failed! exit $RETVAL fi echo hdlc_tests completed OK ./ima_adpcm_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo ima_adpcm_tests failed! exit $RETVAL fi echo ima_adpcm_tests completed OK ./image_translate_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo image_translate_tests failed! exit $RETVAL fi echo image_translate_tests completed OK ./logging_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo logging_tests failed! exit $RETVAL fi echo logging_tests completed OK ./lpc10_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo lpc10_tests failed! exit $RETVAL fi echo lpc10_tests completed OK ./math_fixed_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo math_fixed_tests failed! exit $RETVAL fi echo math_fixed_tests completed OK ./modem_echo_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo modem_echo_tests failed! exit $RETVAL fi echo modem_echo_tests completed OK ./modem_connect_tones_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo modem_connect_tones_tests failed! exit $RETVAL fi echo modem_connect_tones_tests completed OK ./noise_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo noise_tests failed! exit $RETVAL fi echo noise_tests completed OK ./oki_adpcm_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo oki_adpcm_tests failed! exit $RETVAL fi echo oki_adpcm_tests completed OK #./playout_tests >$STDOUT_DEST 2>$STDERR_DEST #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo playout_tests failed! # exit $RETVAL #fi #echo playout_tests completed OK echo playout_tests not enabled #./plc_tests >$STDOUT_DEST 2>$STDERR_DEST #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo plc_tests failed! # exit $RETVAL #fi #echo plc_tests completed OK echo plc_tests not enabled ./power_meter_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo power_meter_tests failed! exit $RETVAL fi echo power_meter_tests completed OK ./queue_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo queue_tests failed! exit $RETVAL fi echo queue_tests completed OK ./r2_mf_rx_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo r2_mf_rx_tests failed! exit $RETVAL fi echo r2_mf_rx_tests completed OK ./r2_mf_tx_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo r2_mf_tx_tests failed! exit $RETVAL fi echo r2_mf_tx_tests completed OK #./rfc2198_sim_tests >$STDOUT_DEST 2>$STDERR_DEST #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo rfc2198_sim_tests failed! # exit $RETVAL #fi #echo rfc2198_sim_tests completed OK ./saturated_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo saturated_tests failed! exit $RETVAL fi echo saturated_tests completed OK ./schedule_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo schedule_tests failed! exit $RETVAL fi echo schedule_tests completed OK #./sig_tone_tests >$STDOUT_DEST 2>$STDERR_DEST #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo sig_tone_tests failed! # exit $RETVAL #fi #echo sig_tone_tests completed OK echo sig_tone_tests not enabled #./super_tone_rx_tests >$STDOUT_DEST 2>$STDERR_DEST #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo super_tone_rx_tests failed! # exit $RETVAL #fi #echo super_tone_rx_tests completed OK echo super_tone_rx_tests not enabled #./super_tone_tx_tests >$STDOUT_DEST 2>$STDERR_DEST #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo super_tone_tx_tests failed! # exit $RETVAL #fi #echo super_tone_tx_tests completed OK echo super_tone_tx_tests not enabled #./swept_tone_tests >$STDOUT_DEST 2>$STDERR_DEST #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo swept_tone_tests failed! # exit $RETVAL #fi #echo swept_tone_tests completed OK echo swept_tone_tests not enabled ./t31_tests -r >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo t31_tests -r failed! exit $RETVAL fi ./t31_tests -s >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo t31_tests -s failed! exit $RETVAL fi echo t31_tests completed OK ./t38_core_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo t38_core_tests failed! exit $RETVAL fi echo t38_core_tests completed OK rm -f t38.tif ./t38_gateway_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo t38_gateway_tests failed! exit $RETVAL fi # Now use tiffcmp to check the results. It will return non-zero if any page images differ. The -t # option means the normal differences in tags will be ignored. tiffcmp -t ${ITUTESTS_TIF} t38.tif >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo t38_gateway_tests failed! exit $RETVAL fi rm -f t38.tif ./t38_gateway_tests -e >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo t38_gateway_tests -e failed! exit $RETVAL fi # Now use tiffcmp to check the results. It will return non-zero if any page images differ. The -t # option means the normal differences in tags will be ignored. tiffcmp -t ${ITUTESTS_TIF} t38.tif >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo t38_gateway_tests -e failed! exit $RETVAL fi echo t38_gateway_tests completed OK rm -f t38.tif ./t38_gateway_to_terminal_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo t38_gateway_to_terminal_tests failed! exit $RETVAL fi # Now use tiffcmp to check the results. It will return non-zero if any page images differ. The -t # option means the normal differences in tags will be ignored. tiffcmp -t ${ITUTESTS_TIF} t38.tif >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo t38_gateway_to_terminal_tests failed! exit $RETVAL fi rm -f t38.tif ./t38_gateway_to_terminal_tests -e >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo t38_gateway_to_terminal_tests -e failed! exit $RETVAL fi # Now use tiffcmp to check the results. It will return non-zero if any page images differ. The -t # option means the normal differences in tags will be ignored. tiffcmp -t ${ITUTESTS_TIF} t38.tif >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo t38_gateway_to_terminal_tests -e failed! exit $RETVAL fi echo t38_gateway_to_terminal_tests completed OK ./t38_non_ecm_buffer_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo t38_non_ecm_buffer_tests failed! exit $RETVAL fi echo t38_non_ecm_buffer_tests completed OK rm -f t38.tif ./t38_terminal_to_gateway_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo t38_terminal_to_gateway_tests failed! exit $RETVAL fi # Now use tiffcmp to check the results. It will return non-zero if any page images differ. The -t # option means the normal differences in tags will be ignored. tiffcmp -t ${ITUTESTS_TIF} t38.tif >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo t38_terminal_to_gateway_tests failed! exit $RETVAL fi rm -f t38.tif ./t38_terminal_to_gateway_tests -e >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo t38_terminal_to_gateway_tests -e failed! exit $RETVAL fi # Now use tiffcmp to check the results. It will return non-zero if any page images differ. The -t # option means the normal differences in tags will be ignored. tiffcmp -t ${ITUTESTS_TIF} t38.tif >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo t38_terminal_to_gateway_tests -e failed! exit $RETVAL fi echo t38_terminal_to_gateway_tests completed OK rm -f t38.tif ./t38_terminal_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo t38_terminal_tests failed! exit $RETVAL fi # Now use tiffcmp to check the results. It will return non-zero if any page images differ. The -t # option means the normal differences in tags will be ignored. tiffcmp -t ${ITUTESTS_TIF} t38.tif >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo t38_terminal_tests failed! exit $RETVAL fi rm -f t38.tif ./t38_terminal_tests -e >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo t38_terminal_tests -e failed! exit $RETVAL fi # Now use tiffcmp to check the results. It will return non-zero if any page images differ. The -t # option means the normal differences in tags will be ignored. tiffcmp -t ${ITUTESTS_TIF} t38.tif >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo t38_terminal_tests -e failed! exit $RETVAL fi echo t38_terminal_tests completed OK rm -f t4_tests_receive.tif ./t4_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo t4_tests failed! exit $RETVAL fi echo t4_tests completed OK #rm -f t4_t6_tests_receive.tif #./t4_t6_tests >$STDOUT_DEST 2>$STDERR_DEST #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo t4_t6_tests failed! # exit $RETVAL #fi #echo t4_t6_tests completed OK #rm -f t81_t82_arith_coding_tests_receive.tif #./t4_tests >$STDOUT_DEST 2>$STDERR_DEST #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo t81_t82_arith_coding_tests failed! # exit $RETVAL #fi #echo t81_t82_arith_coding_tests completed OK echo t81_t82_arith_coding_tests not enabled #rm -f t85_tests_receive.tif #./t4_tests >$STDOUT_DEST 2>$STDERR_DEST #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo t85_tests failed! # exit $RETVAL #fi #echo t85_tests completed OK echo t85_tests not enabled #./time_scale_tests >$STDOUT_DEST 2>$STDERR_DEST #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo time_scale_tests failed! # exit $RETVAL #fi #echo time_scale_tests completed OK echo time_scale_tests not enabled ./timezone_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo timezone_tests failed! exit $RETVAL fi echo timezone_tests completed OK #./tone_detect_tests >$STDOUT_DEST 2>$STDERR_DEST #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo tone_detect_tests failed! # exit $RETVAL #fi #echo tone_detect_tests completed OK echo tone_detect_tests not enabled #./tone_generate_tests >$STDOUT_DEST 2>$STDERR_DEST #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo tone_generate_tests failed! # exit $RETVAL #fi #echo tone_generate_tests completed OK echo tone_generate_tests not enabled ./v17_tests -b 14400 -s -42 -n -66 >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo v17_tests failed! exit $RETVAL fi ./v17_tests -b 12000 -s -42 -n -61 >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo v17_tests failed! exit $RETVAL fi ./v17_tests -b 9600 -s -42 -n -59 >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo v17_tests failed! exit $RETVAL fi ./v17_tests -b 7200 -s -42 -n -56 >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo v17_tests failed! exit $RETVAL fi echo v17_tests completed OK #./v22bis_tests -b 2400 >$STDOUT_DEST 2>$STDERR_DEST #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo v22bis_tests failed! # exit $RETVAL #fi #./v22bis_tests -b 1200 >$STDOUT_DEST 2>$STDERR_DEST #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo v22bis_tests failed! # exit $RETVAL #fi #echo v22bis_tests completed OK echo v22bis_tests not enabled ./v27ter_tests -b 4800 -s -42 -n -57 >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo v27ter_tests failed! exit $RETVAL fi ./v27ter_tests -b 2400 -s -42 -n -51 >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo v27ter_tests failed! exit $RETVAL fi echo v27ter_tests completed OK ./v29_tests -b 9600 -s -42 -n -62 >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo v29_tests failed! exit $RETVAL fi ./v29_tests -b 7200 -s -42 -n -58 >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo v29_tests failed! exit $RETVAL fi ./v29_tests -b 4800 -s -42 -n -54 >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo v29_tests failed! exit $RETVAL fi echo v29_tests completed OK #./v32bis_tests -b 14400 -s -42 -n -66 >$STDOUT_DEST 2>$STDERR_DEST #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo v32bis_tests failed! # exit $RETVAL #fi #echo v32bis_tests completed OK #./v42_tests >$STDOUT_DEST 2>$STDERR_DEST #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo v42_tests failed! # exit $RETVAL #fi #echo v42_tests completed OK echo v42_tests not enabled #./v42bis_tests.sh >/dev/null #RETVAL=$? #if [ $RETVAL != 0 ] #then # echo v42bis_tests failed! # exit $RETVAL #fi #echo v42bis_tests completed OK echo v42bis_tests not enabled ./v8_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo v8_tests failed! exit $RETVAL fi echo v8_tests completed OK ./v18_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo v18_tests failed! exit $RETVAL fi echo v18_tests completed OK ./vector_float_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo vector_float_tests failed! exit $RETVAL fi echo vector_float_tests completed OK ./vector_int_tests >$STDOUT_DEST 2>$STDERR_DEST RETVAL=$? if [ $RETVAL != 0 ] then echo vector_int_tests failed! exit $RETVAL fi echo vector_int_tests completed OK echo echo All regression tests successfully completed spandsp-0.0.6/tests/modem_connect_tones_tests.c0000664000175000017500000015012212101217400016647 00000000000000/* * SpanDSP - a series of DSP components for telephony * * modem_connect_tones_tests.c * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page modem_connect_tones_tests_page Modem connect tones tests \section modem_connect_tones_rx_tests_page_sec_1 What does it do? These tests... */ /* Enable the following definition to enable direct probing into the FAX structures */ //#define WITH_SPANDSP_INTERNALS #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define SAMPLES_PER_CHUNK 160 #define OUTPUT_FILE_NAME "modem_connect_tones.wav" #define MITEL_DIR "../test-data/mitel/" #define BELLCORE_DIR "../test-data/bellcore/" #define FALSE 0 #define TRUE (!FALSE) #define LEVEL_MAX -5 #define LEVEL_MIN -48 #define LEVEL_MIN_ACCEPT -43 #define LEVEL_MIN_REJECT -44 /* The 1100Hz tone is supposed to be within 38Hz, according to T.30. Allow another 8Hz for FDM, even though you rarely see that used today. */ #define CED_FREQ_TOLERANCE (38 + 8) #define CED_FREQ_BLACKOUT (80) /* The 2100Hz tone is supposed to be within 15Hz, according to T.30. Allow another 8Hz for FDM, even though you rarely see that used today. */ #define CNG_FREQ_TOLERANCE (15 + 8) #define CNG_FREQ_BLACKOUT (80) #define AM_FREQ_TOLERANCE (1) const char *bellcore_files[] = { MITEL_DIR "mitel-cm7291-talkoff.wav", BELLCORE_DIR "tr-tsy-00763-1.wav", BELLCORE_DIR "tr-tsy-00763-2.wav", BELLCORE_DIR "tr-tsy-00763-3.wav", BELLCORE_DIR "tr-tsy-00763-4.wav", BELLCORE_DIR "tr-tsy-00763-5.wav", BELLCORE_DIR "tr-tsy-00763-6.wav", "" }; enum { PERFORM_TEST_1A = (1 << 1), PERFORM_TEST_1B = (1 << 2), PERFORM_TEST_1C = (1 << 3), PERFORM_TEST_1D = (1 << 4), PERFORM_TEST_1E = (1 << 5), PERFORM_TEST_2A = (1 << 6), PERFORM_TEST_2B = (1 << 7), PERFORM_TEST_2C = (1 << 8), PERFORM_TEST_2D = (1 << 9), PERFORM_TEST_2E = (1 << 10), PERFORM_TEST_3A = (1 << 11), PERFORM_TEST_3B = (1 << 12), PERFORM_TEST_3C = (1 << 13), PERFORM_TEST_3D = (1 << 14), PERFORM_TEST_3E = (1 << 15), PERFORM_TEST_4 = (1 << 16), PERFORM_TEST_5A = (1 << 17), PERFORM_TEST_5B = (1 << 18), PERFORM_TEST_6A = (1 << 19), PERFORM_TEST_6B = (1 << 20), PERFORM_TEST_7A = (1 << 21), PERFORM_TEST_7B = (1 << 22), PERFORM_TEST_8 = (1 << 23) }; int preamble_count = 0; int preamble_on_at = -1; int preamble_off_at = -1; int hits = 0; int when = 0; static int preamble_get_bit(void *user_data) { static int bit_no = 0; int bit; /* Generate a section of HDLC flag octet preamble. Then generate some random bits, which should not look like preamble. */ if (++preamble_count < 255) { bit = (bit_no < 2) ? 0 : 1; if (++bit_no >= 8) bit_no = 0; #if 0 /* Inject some bad bits */ if (rand()%15 == 0) return bit ^ 1; #endif } else { bit = rand() & 1; } return bit; } /*- End of function --------------------------------------------------------*/ static void cng_detected(void *user_data, int tone, int level, int delay) { printf("%s (%d) declared at %fs, delay %d (%ddBm0)\n", modem_connect_tone_to_str(tone), tone, (float) when/SAMPLE_RATE, delay, level); if (tone == MODEM_CONNECT_TONES_FAX_CNG) hits++; } /*- End of function --------------------------------------------------------*/ static void preamble_detected(void *user_data, int tone, int level, int delay) { printf("%s (%d) declared at bit %d (%ddBm0)\n", modem_connect_tone_to_str(tone), tone, preamble_count, level); if (tone == MODEM_CONNECT_TONES_FAX_PREAMBLE) preamble_on_at = preamble_count; else preamble_off_at = preamble_count; /*endif*/ } /*- End of function --------------------------------------------------------*/ static void ced_detected(void *user_data, int tone, int level, int delay) { printf("%s (%d) declared at %fs, delay %d (%ddBm0)\n", modem_connect_tone_to_str(tone), tone, (float) when/SAMPLE_RATE, delay, level); if (tone == MODEM_CONNECT_TONES_FAX_PREAMBLE || tone == MODEM_CONNECT_TONES_ANS) { hits++; } } /*- End of function --------------------------------------------------------*/ static void ans_pr_detected(void *user_data, int tone, int level, int delay) { printf("%s (%d) declared at %fs, delay %d (%ddBm0)\n", modem_connect_tone_to_str(tone), tone, (float) when/SAMPLE_RATE, delay, level); if (tone == MODEM_CONNECT_TONES_ANS_PR) hits++; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int i; int j; int pitch; int depth; int level; int interval; int cycle; int16_t amp[8000]; modem_connect_tones_rx_state_t cng_rx; modem_connect_tones_rx_state_t ced_rx; modem_connect_tones_rx_state_t ans_pr_rx; modem_connect_tones_tx_state_t modem_tone_tx; awgn_state_t chan_noise_source; SNDFILE *inhandle; SNDFILE *outhandle; int outframes; int frames; int samples; int hit; int false_hit; int false_miss; power_meter_t power_state; int power; int max_power; int level2; int max_level2; int tone_type; int test_list; int opt; char *decode_test_file; fsk_tx_state_t preamble_tx; test_list = 0; decode_test_file = NULL; while ((opt = getopt(argc, argv, "d:")) != -1) { switch (opt) { case 'd': decode_test_file = optarg; break; default: //usage(); exit(2); break; } } argc -= optind; argv += optind; for (i = 0; i < argc; i++) { if (strcasecmp(argv[i], "1a") == 0) test_list |= PERFORM_TEST_1A; else if (strcasecmp(argv[i], "1b") == 0) test_list |= PERFORM_TEST_1B; else if (strcasecmp(argv[i], "1c") == 0) test_list |= PERFORM_TEST_1C; else if (strcasecmp(argv[i], "1d") == 0) test_list |= PERFORM_TEST_1D; else if (strcasecmp(argv[i], "1e") == 0) test_list |= PERFORM_TEST_1E; else if (strcasecmp(argv[i], "2a") == 0) test_list |= PERFORM_TEST_2A; else if (strcasecmp(argv[i], "2b") == 0) test_list |= PERFORM_TEST_2B; else if (strcasecmp(argv[i], "2c") == 0) test_list |= PERFORM_TEST_2C; else if (strcasecmp(argv[i], "2d") == 0) test_list |= PERFORM_TEST_2D; else if (strcasecmp(argv[i], "2e") == 0) test_list |= PERFORM_TEST_2E; else if (strcasecmp(argv[i], "3a") == 0) test_list |= PERFORM_TEST_3A; else if (strcasecmp(argv[i], "3b") == 0) test_list |= PERFORM_TEST_3B; else if (strcasecmp(argv[i], "3c") == 0) test_list |= PERFORM_TEST_3C; else if (strcasecmp(argv[i], "3d") == 0) test_list |= PERFORM_TEST_3D; else if (strcasecmp(argv[i], "3e") == 0) test_list |= PERFORM_TEST_3E; else if (strcasecmp(argv[i], "4") == 0) test_list |= PERFORM_TEST_4; else if (strcasecmp(argv[i], "5a") == 0) test_list |= PERFORM_TEST_5A; else if (strcasecmp(argv[i], "5b") == 0) test_list |= PERFORM_TEST_5B; else if (strcasecmp(argv[i], "6a") == 0) test_list |= PERFORM_TEST_6A; else if (strcasecmp(argv[i], "6b") == 0) test_list |= PERFORM_TEST_6B; else if (strcasecmp(argv[i], "7a") == 0) test_list |= PERFORM_TEST_7A; else if (strcasecmp(argv[i], "7b") == 0) test_list |= PERFORM_TEST_7B; else if (strcasecmp(argv[i], "8") == 0) test_list |= PERFORM_TEST_8; else { fprintf(stderr, "Unknown test '%s' specified\n", argv[i]); exit(2); } } if (decode_test_file == NULL && test_list == 0) test_list = 0xFFFFFFFF; if ((outhandle = sf_open_telephony_write(OUTPUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } if ((test_list & PERFORM_TEST_1A)) { printf("Test 1a: CNG generation to a file\n"); modem_connect_tones_tx_init(&modem_tone_tx, MODEM_CONNECT_TONES_FAX_CNG); for (i = 0; i < 20*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); outframes = sf_writef_short(outhandle, amp, samples); if (outframes != samples) { fprintf(stderr, " Error writing audio file\n"); exit(2); } /*endif*/ } /*endfor*/ } /*endif*/ if ((test_list & PERFORM_TEST_1B)) { printf("Test 1b: CED/ANS generation to a file\n"); modem_connect_tones_tx_init(&modem_tone_tx, MODEM_CONNECT_TONES_FAX_CED); for (i = 0; i < 20*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); outframes = sf_writef_short(outhandle, amp, samples); if (outframes != samples) { fprintf(stderr, " Error writing audio file\n"); exit(2); } /*endif*/ } /*endfor*/ } /*endif*/ if ((test_list & PERFORM_TEST_1C)) { printf("Test 1c: ANSam (Modulated ANS) generation to a file\n"); /* Some with modulation */ modem_connect_tones_tx_init(&modem_tone_tx, MODEM_CONNECT_TONES_ANSAM); for (i = 0; i < 20*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); outframes = sf_writef_short(outhandle, amp, samples); if (outframes != samples) { fprintf(stderr, " Error writing audio file\n"); exit(2); } /*endif*/ } /*endfor*/ } /*endif*/ if ((test_list & PERFORM_TEST_1D)) { printf("Test 1d: ANS/ (EC-disable) generation to a file\n"); /* Some without modulation, but with phase reversals */ modem_connect_tones_tx_init(&modem_tone_tx, MODEM_CONNECT_TONES_ANS_PR); for (i = 0; i < 20*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); outframes = sf_writef_short(outhandle, amp, samples); if (outframes != samples) { fprintf(stderr, " Error writing audio file\n"); exit(2); } /*endif*/ } /*endfor*/ } /*endif*/ if ((test_list & PERFORM_TEST_1E)) { printf("Test 1e: ANSam/ (Modulated EC-disable) generation to a file\n"); /* Some with modulation and phase reversals */ modem_connect_tones_tx_init(&modem_tone_tx, MODEM_CONNECT_TONES_ANSAM_PR); for (i = 0; i < 20*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); outframes = sf_writef_short(outhandle, amp, samples); if (outframes != samples) { fprintf(stderr, " Error writing audio file\n"); exit(2); } /*endif*/ } /*endfor*/ } /*endif*/ if (sf_close_telephony(outhandle)) { printf(" Cannot close audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } /*endif*/ if ((test_list & PERFORM_TEST_2A)) { printf("Test 2a: CNG detection with frequency\n"); tone_type = MODEM_CONNECT_TONES_FAX_CNG; awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f); false_hit = FALSE; false_miss = FALSE; for (pitch = 600; pitch <= 1600; pitch++) { /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, tone_type); /* Fudge things for the test */ modem_tone_tx.tone_phase_rate = dds_phase_rate(pitch); modem_connect_tones_rx_init(&cng_rx, tone_type, NULL, NULL); power_meter_init(&power_state, 5); power = 0; max_power = 0; level2 = 0; max_level2 = 0; for (i = 0; i < 10*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); for (j = 0; j < samples; j++) { amp[j] += awgn(&chan_noise_source); power = power_meter_update(&power_state, amp[j]); if (power > max_power) max_power = power; /*endif*/ level2 += ((abs(amp[j]) - level2) >> 5); if (level2 > max_level2) max_level2 = level2; } /*endfor*/ modem_connect_tones_rx(&cng_rx, amp, samples); } /*endfor*/ hit = modem_connect_tones_rx_get(&cng_rx); if (pitch < (1100 - CED_FREQ_BLACKOUT) || pitch > (1100 + CED_FREQ_BLACKOUT)) { if (hit != MODEM_CONNECT_TONES_NONE) false_hit = TRUE; /*endif*/ } else if (pitch > (1100 - CED_FREQ_TOLERANCE) && pitch < (1100 + CED_FREQ_TOLERANCE)) { if (hit != tone_type) false_miss = TRUE; /*endif*/ } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %d\n", pitch, cng_rx.channel_level, cng_rx.notch_level, hit); /*endif*/ } /*endfor*/ if (false_hit || false_miss) { printf("Test failed.\n"); exit(2); } /*endif*/ printf("Test passed.\n"); } /*endif*/ if ((test_list & PERFORM_TEST_2B)) { printf("Test 2b: CED/ANS detection with frequency\n"); awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f); false_hit = FALSE; false_miss = FALSE; for (pitch = 1600; pitch < 2600; pitch++) { /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, MODEM_CONNECT_TONES_ANS); /* Fudge things for the test */ modem_tone_tx.tone_phase_rate = dds_phase_rate(pitch); modem_connect_tones_rx_init(&ced_rx, MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE, NULL, NULL); for (i = 0; i < 10*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); for (j = 0; j < samples; j++) amp[j] += awgn(&chan_noise_source); /*endfor*/ modem_connect_tones_rx(&ced_rx, amp, samples); } /*endfor*/ hit = modem_connect_tones_rx_get(&ced_rx); if (pitch < (2100 - CNG_FREQ_BLACKOUT) || pitch > (2100 + CNG_FREQ_BLACKOUT)) { if (hit != MODEM_CONNECT_TONES_NONE) false_hit = TRUE; /*endif*/ } else if (pitch > (2100 - CNG_FREQ_TOLERANCE) && pitch < (2100 + CNG_FREQ_TOLERANCE)) { if (hit != MODEM_CONNECT_TONES_FAX_CED) false_miss = TRUE; /*endif*/ } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %d\n", pitch, ced_rx.channel_level, ced_rx.notch_level, hit); /*endif*/ } if (false_hit || false_miss) { printf("Test failed.\n"); exit(2); } /*endif*/ printf("Test passed.\n"); } /*endif*/ if ((test_list & PERFORM_TEST_2C)) { printf("Test 2c: ANSam detection with frequency\n"); tone_type = MODEM_CONNECT_TONES_ANSAM; awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f); false_hit = FALSE; false_miss = FALSE; for (pitch = 2000; pitch <= 2200; pitch++) { /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, tone_type); /* Fudge things for the test */ modem_tone_tx.tone_phase_rate = dds_phase_rate(pitch); modem_connect_tones_rx_init(&ans_pr_rx, tone_type, NULL, NULL); for (i = 0; i < 10*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); for (j = 0; j < samples; j++) amp[j] += awgn(&chan_noise_source); /*endfor*/ modem_connect_tones_rx(&ans_pr_rx, amp, samples); } /*endfor*/ hit = modem_connect_tones_rx_get(&ans_pr_rx); if (pitch < (2100 - CNG_FREQ_BLACKOUT) || pitch > (2100 + CNG_FREQ_BLACKOUT)) { if (hit != MODEM_CONNECT_TONES_NONE) false_hit = TRUE; /*endif*/ } else if (pitch > (2100 - CNG_FREQ_TOLERANCE) && pitch < (2100 + CNG_FREQ_TOLERANCE)) { if (hit != tone_type) false_miss = TRUE; /*endif*/ } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %d\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); /*endif*/ } /*endfor*/ if (false_hit || false_miss) { printf("Test failed.\n"); exit(2); } /*endif*/ printf("Test passed.\n"); } /*endif*/ if ((test_list & PERFORM_TEST_2D)) { printf("Test 2d: ANS/ (EC-disable) detection with frequency\n"); tone_type = MODEM_CONNECT_TONES_ANS_PR; awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f); false_hit = FALSE; false_miss = FALSE; for (pitch = 2000; pitch <= 2200; pitch++) { /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, tone_type); /* Fudge things for the test */ modem_tone_tx.tone_phase_rate = dds_phase_rate(pitch); modem_connect_tones_rx_init(&ans_pr_rx, tone_type, NULL, NULL); for (i = 0; i < 10*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); for (j = 0; j < samples; j++) amp[j] += awgn(&chan_noise_source); /*endfor*/ modem_connect_tones_rx(&ans_pr_rx, amp, samples); } /*endfor*/ hit = modem_connect_tones_rx_get(&ans_pr_rx); if (pitch < (2100 - CNG_FREQ_BLACKOUT) || pitch > (2100 + CNG_FREQ_BLACKOUT)) { if (hit != MODEM_CONNECT_TONES_NONE) false_hit = TRUE; /*endif*/ } else if (pitch > (2100 - CNG_FREQ_TOLERANCE) && pitch < (2100 + CNG_FREQ_TOLERANCE)) { if (hit != tone_type) false_miss = TRUE; /*endif*/ } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %d\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); /*endif*/ } /*endfor*/ if (false_hit || false_miss) { printf("Test failed.\n"); exit(2); } /*endif*/ printf("Test passed.\n"); } /*endif*/ if ((test_list & PERFORM_TEST_2E)) { printf("Test 2e: ANSam/ (Modulated EC-disable) detection with frequency\n"); tone_type = MODEM_CONNECT_TONES_ANSAM_PR; awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f); false_hit = FALSE; false_miss = FALSE; for (pitch = 2000; pitch <= 2200; pitch++) { /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, tone_type); /* Fudge things for the test */ modem_tone_tx.tone_phase_rate = dds_phase_rate(pitch); modem_connect_tones_rx_init(&ans_pr_rx, tone_type, NULL, NULL); for (i = 0; i < 10*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); for (j = 0; j < samples; j++) amp[j] += awgn(&chan_noise_source); /*endfor*/ modem_connect_tones_rx(&ans_pr_rx, amp, samples); } /*endfor*/ hit = modem_connect_tones_rx_get(&ans_pr_rx); if (pitch < (2100 - CNG_FREQ_BLACKOUT) || pitch > (2100 + CNG_FREQ_BLACKOUT)) { if (hit != MODEM_CONNECT_TONES_NONE) false_hit = TRUE; /*endif*/ } else if (pitch > (2100 - CNG_FREQ_TOLERANCE) && pitch < (2100 + CNG_FREQ_TOLERANCE)) { if (hit != tone_type) false_miss = TRUE; /*endif*/ } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %d\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); /*endif*/ } /*endfor*/ if (false_hit || false_miss) { printf("Test failed.\n"); exit(2); } /*endif*/ printf("Test passed.\n"); } /*endif*/ if ((test_list & PERFORM_TEST_3A)) { printf("Test 3a: CNG detection with level\n"); tone_type = MODEM_CONNECT_TONES_FAX_CNG; awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f); false_hit = FALSE; false_miss = FALSE; for (pitch = 1100 - CED_FREQ_TOLERANCE; pitch <= 1100 + CED_FREQ_TOLERANCE; pitch += 2*CED_FREQ_TOLERANCE) { for (level = LEVEL_MAX; level >= LEVEL_MIN; level--) { /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, tone_type); /* Fudge things for the test */ modem_tone_tx.tone_phase_rate = dds_phase_rate(pitch); modem_tone_tx.level = dds_scaling_dbm0(level); modem_connect_tones_rx_init(&cng_rx, tone_type, NULL, NULL); for (i = 0; i < 10*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); for (j = 0; j < samples; j++) amp[j] += awgn(&chan_noise_source); /*endfor*/ modem_connect_tones_rx(&cng_rx, amp, samples); } /*endfor*/ hit = modem_connect_tones_rx_get(&cng_rx); if (level < LEVEL_MIN_REJECT) { if (hit != MODEM_CONNECT_TONES_NONE) false_hit = TRUE; /*endif*/ } else if (level > LEVEL_MIN_ACCEPT) { if (hit != tone_type) false_miss = TRUE; /*endif*/ } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) printf("Detected at %5dHz %4ddB %12" PRId32 " %12" PRId32 " %d\n", pitch, level, cng_rx.channel_level, cng_rx.notch_level, hit); /*endif*/ } /*endfor*/ } /*endfor*/ if (false_hit || false_miss) { printf("Test failed.\n"); exit(2); } /*endif*/ printf("Test passed.\n"); } /*endif*/ if ((test_list & PERFORM_TEST_3B)) { printf("Test 3b: CED/ANS detection with level\n"); tone_type = MODEM_CONNECT_TONES_ANS; awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f); false_hit = FALSE; false_miss = FALSE; for (pitch = 2100 - CNG_FREQ_TOLERANCE; pitch <= 2100 + CNG_FREQ_TOLERANCE; pitch += 2*CNG_FREQ_TOLERANCE) { for (level = LEVEL_MAX; level >= LEVEL_MIN; level--) { /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, tone_type); /* Fudge things for the test */ modem_tone_tx.tone_phase_rate = dds_phase_rate(pitch); modem_tone_tx.level = dds_scaling_dbm0(level); modem_connect_tones_rx_init(&ced_rx, MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE, NULL, NULL); for (i = 0; i < 10*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); for (j = 0; j < samples; j++) amp[j] += awgn(&chan_noise_source); /*endfor*/ modem_connect_tones_rx(&ced_rx, amp, samples); } /*endfor*/ hit = modem_connect_tones_rx_get(&ced_rx); if (level < LEVEL_MIN_REJECT) { if (hit != MODEM_CONNECT_TONES_NONE) false_hit = TRUE; /*endif*/ } else if (level > LEVEL_MIN_ACCEPT) { if (hit != tone_type) false_miss = TRUE; /*endif*/ } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) printf("Detected at %5dHz %4ddB %12" PRId32 " %12" PRId32 " %d\n", pitch, level, ced_rx.channel_level, ced_rx.notch_level, hit); /*endif*/ } /*endfor*/ } /*endfor*/ if (false_hit || false_miss) { printf("Test failed.\n"); exit(2); } /*endif*/ printf("Test passed.\n"); } /*endif*/ if ((test_list & PERFORM_TEST_3C)) { printf("Test 3c: ANSam detection with level\n"); tone_type = MODEM_CONNECT_TONES_ANSAM; awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f); false_hit = FALSE; false_miss = FALSE; for (pitch = 2100 - CNG_FREQ_TOLERANCE; pitch <= 2100 + CNG_FREQ_TOLERANCE; pitch += 2*CNG_FREQ_TOLERANCE) { //for (level = LEVEL_MAX; level >= LEVEL_MIN; level--) for (level = -26; level >= -26; level--) { /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, tone_type); /* Fudge things for the test */ modem_tone_tx.tone_phase_rate = dds_phase_rate(pitch); modem_tone_tx.level = dds_scaling_dbm0(level); modem_tone_tx.mod_level = modem_tone_tx.level*20/100; modem_connect_tones_rx_init(&ans_pr_rx, tone_type, NULL, NULL); for (i = 0; i < 10*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); for (j = 0; j < samples; j++) amp[j] += awgn(&chan_noise_source); /*endfor*/ modem_connect_tones_rx(&ans_pr_rx, amp, samples); } /*endfor*/ hit = modem_connect_tones_rx_get(&ans_pr_rx); if (level < LEVEL_MIN_REJECT) { if (hit != MODEM_CONNECT_TONES_NONE) false_hit = TRUE; /*endif*/ } else if (level > LEVEL_MIN_ACCEPT) { if (hit != tone_type) false_miss = TRUE; /*endif*/ } /*endif*/ //if (hit != MODEM_CONNECT_TONES_NONE) printf("Detected at %5dHz %4ddB %12" PRId32 " %12" PRId32 " %d\n", pitch, level, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); /*endif*/ } /*endfor*/ } /*endfor*/ if (false_hit || false_miss) { printf("Test failed.\n"); exit(2); } /*endif*/ printf("Test passed.\n"); } /*endif*/ if ((test_list & PERFORM_TEST_3D)) { printf("Test 3d: ANS/ (EC-disable) detection with level\n"); tone_type = MODEM_CONNECT_TONES_ANS_PR; awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f); false_hit = FALSE; false_miss = FALSE; for (pitch = 2100 - CNG_FREQ_TOLERANCE; pitch <= 2100 + CNG_FREQ_TOLERANCE; pitch += 2*CNG_FREQ_TOLERANCE) { for (level = LEVEL_MAX; level >= LEVEL_MIN; level--) { /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, tone_type); /* Fudge things for the test */ modem_tone_tx.tone_phase_rate = dds_phase_rate(pitch); modem_tone_tx.level = dds_scaling_dbm0(level); modem_connect_tones_rx_init(&ans_pr_rx, tone_type, NULL, NULL); for (i = 0; i < 10*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); for (j = 0; j < samples; j++) amp[j] += awgn(&chan_noise_source); /*endfor*/ modem_connect_tones_rx(&ans_pr_rx, amp, samples); } /*endfor*/ hit = modem_connect_tones_rx_get(&ans_pr_rx); if (level < LEVEL_MIN_REJECT) { if (hit != MODEM_CONNECT_TONES_NONE) false_hit = TRUE; /*endif*/ } else if (level > LEVEL_MIN_ACCEPT) { if (hit != tone_type) false_miss = TRUE; /*endif*/ } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) printf("Detected at %5dHz %4ddB %12" PRId32 " %12" PRId32 " %d\n", pitch, level, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); /*endif*/ } /*endfor*/ } /*endfor*/ if (false_hit || false_miss) { printf("Test failed.\n"); exit(2); } /*endif*/ printf("Test passed.\n"); } /*endif*/ if ((test_list & PERFORM_TEST_3E)) { printf("Test 3e: ANSam/ (Modulated EC-disable) detection with level\n"); tone_type = MODEM_CONNECT_TONES_ANSAM_PR; awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f); false_hit = FALSE; false_miss = FALSE; for (pitch = 2100 - CNG_FREQ_TOLERANCE; pitch <= 2100 + CNG_FREQ_TOLERANCE; pitch += 2*CNG_FREQ_TOLERANCE) { for (level = LEVEL_MAX; level >= LEVEL_MIN; level--) { /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, tone_type); /* Fudge things for the test */ modem_tone_tx.tone_phase_rate = dds_phase_rate(pitch); modem_tone_tx.level = dds_scaling_dbm0(level); modem_tone_tx.mod_level = modem_tone_tx.level*20/100; modem_connect_tones_rx_init(&ans_pr_rx, tone_type, NULL, NULL); for (i = 0; i < 10*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); for (j = 0; j < samples; j++) amp[j] += awgn(&chan_noise_source); /*endfor*/ modem_connect_tones_rx(&ans_pr_rx, amp, samples); } /*endfor*/ hit = modem_connect_tones_rx_get(&ans_pr_rx); if (level < LEVEL_MIN_REJECT) { if (hit != MODEM_CONNECT_TONES_NONE) false_hit = TRUE; /*endif*/ } else if (level > LEVEL_MIN_ACCEPT) { if (hit != tone_type) false_miss = TRUE; /*endif*/ } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) printf("Detected at %5dHz %4ddB %12" PRId32 " %12" PRId32 " %d\n", pitch, level, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); /*endif*/ } /*endfor*/ } /*endfor*/ if (false_hit || false_miss) { printf("Test failed.\n"); exit(2); } /*endif*/ printf("Test passed.\n"); } /*endif*/ if ((test_list & PERFORM_TEST_4)) { printf("Test 4: CED detection, when stimulated with V.21 preamble\n"); false_hit = FALSE; false_miss = FALSE; /* Send 255 bits of preamble (0.85s, the minimum specified preamble for T.30), and then some random bits. Check the preamble detector comes on, and goes off at reasonable times. */ fsk_tx_init(&preamble_tx, &preset_fsk_specs[FSK_V21CH2], preamble_get_bit, NULL); modem_connect_tones_rx_init(&ced_rx, MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE, preamble_detected, NULL); for (i = 0; i < 2*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = fsk_tx(&preamble_tx, amp, SAMPLES_PER_CHUNK); modem_connect_tones_rx(&ced_rx, amp, samples); } /*endfor*/ for (i = 0; i < SAMPLE_RATE/10; i += SAMPLES_PER_CHUNK) { memset(amp, 0, sizeof(int16_t)*SAMPLES_PER_CHUNK); modem_connect_tones_rx(&ced_rx, amp, SAMPLES_PER_CHUNK); } /*endfor*/ if (preamble_on_at < 40 || preamble_on_at > 50 || preamble_off_at < 580 || preamble_off_at > 620) { printf("Test failed.\n"); exit(2); } /*endif*/ printf("Test passed.\n"); } /*endif*/ if ((test_list & PERFORM_TEST_5A)) { printf("Test 5A: ANS and ANS/ detection with reversal interval\n"); tone_type = MODEM_CONNECT_TONES_ANS_PR; awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f); false_hit = FALSE; false_miss = FALSE; for (interval = 400; interval < 800; interval++) { printf("Reversal interval = %d\n", interval); /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, tone_type); modem_connect_tones_rx_init(&ans_pr_rx, tone_type, ans_pr_detected, NULL); hits = 0; for (i = 0; i < 10*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { when = i; samples = SAMPLES_PER_CHUNK; for (j = 0; j < samples; j++) { if (--modem_tone_tx.hop_timer <= 0) { modem_tone_tx.hop_timer = ms_to_samples(interval); modem_tone_tx.tone_phase += 0x80000000; } /*endif*/ amp[j] = dds_mod(&modem_tone_tx.tone_phase, modem_tone_tx.tone_phase_rate, modem_tone_tx.level, 0); } for (j = 0; j < samples; j++) amp[j] += awgn(&chan_noise_source); /*endfor*/ modem_connect_tones_rx(&ans_pr_rx, amp, samples); } /*endfor*/ if (interval < (450 - 25) || interval > (450 + 25)) { if (hits != 0) false_hit = TRUE; /*endif*/ } else if (interval > (450 - 25) && interval < (450 + 25)) { if (hits == 0) false_miss = TRUE; /*endif*/ } /*endif*/ if (hits) printf("Detected at %5dHz %4ddB %dms %12" PRId32 " %12" PRId32 " %d\n", 2100, -11, interval, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hits); /*endif*/ } /*endfor*/ if (false_hit || false_miss) { printf("Test failed.\n"); exit(2); } /*endif*/ printf("Test passed.\n"); } /*endif*/ if ((test_list & PERFORM_TEST_5B)) { printf("Test 5B: ANS and ANS/ detection with mixed reversal intervals\n"); awgn_init_dbm0(&chan_noise_source, 7162534, -60.0f); tone_type = MODEM_CONNECT_TONES_ANS_PR; false_hit = FALSE; false_miss = FALSE; interval = 450; printf("Reversal interval = %d\n", interval); /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, tone_type); modem_connect_tones_rx_init(&ans_pr_rx, tone_type, ans_pr_detected, NULL); cycle = 0; hits = 0; for (i = 0; i < 60*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { when = i; samples = SAMPLES_PER_CHUNK; for (j = 0; j < samples; j++) { if (--modem_tone_tx.hop_timer <= 0) { if (++cycle == 10) interval = 1000; if (cycle == 20) interval = 450; modem_tone_tx.hop_timer = ms_to_samples(interval); modem_tone_tx.tone_phase += 0x80000000; } amp[j] = dds_mod(&modem_tone_tx.tone_phase, modem_tone_tx.tone_phase_rate, modem_tone_tx.level, 0); } /*endfor*/ for (j = 0; j < samples; j++) amp[j] += awgn(&chan_noise_source); /*endfor*/ modem_connect_tones_rx(&ans_pr_rx, amp, samples); /* TODO: Add test result detection logic. */ } /*endfor*/ if (false_hit || false_miss) { printf("Test failed.\n"); exit(2); } /*endif*/ printf("Test passed.\n"); } /*endif*/ if ((test_list & PERFORM_TEST_6A)) { printf("Test 6a: ANSam detection with AM pitch\n"); tone_type = MODEM_CONNECT_TONES_ANSAM; awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f); false_hit = FALSE; false_miss = FALSE; for (pitch = 5; pitch < 25; pitch++) { /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, tone_type); /* Fudge things for the test */ modem_tone_tx.mod_phase_rate = dds_phase_rate(pitch); modem_connect_tones_rx_init(&ans_pr_rx, tone_type, NULL, NULL); for (i = 0; i < 10*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); for (j = 0; j < samples; j++) amp[j] += awgn(&chan_noise_source); /*endfor*/ modem_connect_tones_rx(&ans_pr_rx, amp, samples); } /*endfor*/ hit = modem_connect_tones_rx_get(&ans_pr_rx); if (pitch < (15 - 10) || pitch > (15 + 10)) { if (hit == tone_type) false_hit = TRUE; /*endif*/ } else if (pitch > (15 - AM_FREQ_TOLERANCE) && pitch < (15 + AM_FREQ_TOLERANCE)) { if (hit != tone_type) false_miss = TRUE; /*endif*/ } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %d\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); /*endif*/ } /*endfor*/ if (false_hit || false_miss) { printf("Test failed.\n"); exit(2); } /*endif*/ printf("Test passed.\n"); } /*endif*/ if ((test_list & PERFORM_TEST_6B)) { printf("Test 6b: ANSam/ (Modulated EC-disable) detection with AM pitch\n"); tone_type = MODEM_CONNECT_TONES_ANSAM_PR; awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f); false_hit = FALSE; false_miss = FALSE; for (pitch = 5; pitch < 25; pitch++) { /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, tone_type); /* Fudge things for the test */ modem_tone_tx.mod_phase_rate = dds_phase_rate(pitch); modem_connect_tones_rx_init(&ans_pr_rx, tone_type, NULL, NULL); for (i = 0; i < 10*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); for (j = 0; j < samples; j++) amp[j] += awgn(&chan_noise_source); /*endfor*/ modem_connect_tones_rx(&ans_pr_rx, amp, samples); } /*endfor*/ hit = modem_connect_tones_rx_get(&ans_pr_rx); if (pitch < (15 - 10) || pitch > (15 + 10)) { if (hit == tone_type) false_hit = TRUE; /*endif*/ } else if (pitch > (15 - AM_FREQ_TOLERANCE) && pitch < (15 + AM_FREQ_TOLERANCE)) { if (hit != tone_type) false_miss = TRUE; /*endif*/ } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %d\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); /*endif*/ } /*endfor*/ if (false_hit || false_miss) { printf("Test failed.\n"); exit(2); } /*endif*/ printf("Test passed.\n"); } /*endif*/ if ((test_list & PERFORM_TEST_7A)) { printf("Test 7a: ANSam detection with AM depth\n"); tone_type = MODEM_CONNECT_TONES_ANSAM; pitch = 2100; awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f); false_hit = FALSE; false_miss = FALSE; for (depth = 0; depth < 40; depth++) { /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, tone_type); /* Fudge things for the test */ modem_tone_tx.mod_level = modem_tone_tx.level*depth/100; modem_connect_tones_rx_init(&ans_pr_rx, tone_type, NULL, NULL); for (i = 0; i < 10*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); for (j = 0; j < samples; j++) amp[j] += awgn(&chan_noise_source); /*endfor*/ modem_connect_tones_rx(&ans_pr_rx, amp, samples); } /*endfor*/ hit = modem_connect_tones_rx_get(&ans_pr_rx); if (depth < 10) { if (hit == tone_type) false_hit = TRUE; /*endif*/ } else if (depth > 15) { if (hit != tone_type) false_miss = TRUE; /*endif*/ } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %d\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); /*endif*/ } /*endfor*/ if (false_hit || false_miss) { printf("Test failed.\n"); exit(2); } /*endif*/ printf("Test passed.\n"); } /*endif*/ if ((test_list & PERFORM_TEST_7B)) { printf("Test 7b: ANSam/ (Modulated EC-disable) detection with AM depth\n"); tone_type = MODEM_CONNECT_TONES_ANSAM_PR; pitch = 2100; awgn_init_dbm0(&chan_noise_source, 7162534, -50.0f); false_hit = FALSE; false_miss = FALSE; for (depth = 0; depth < 40; depth++) { /* Use the transmitter to test the receiver */ modem_connect_tones_tx_init(&modem_tone_tx, tone_type); /* Fudge things for the test */ modem_tone_tx.mod_level = modem_tone_tx.level*depth/100; modem_connect_tones_rx_init(&ans_pr_rx, tone_type, NULL, NULL); for (i = 0; i < 10*SAMPLE_RATE; i += SAMPLES_PER_CHUNK) { samples = modem_connect_tones_tx(&modem_tone_tx, amp, SAMPLES_PER_CHUNK); for (j = 0; j < samples; j++) amp[j] += awgn(&chan_noise_source); /*endfor*/ modem_connect_tones_rx(&ans_pr_rx, amp, samples); } /*endfor*/ hit = modem_connect_tones_rx_get(&ans_pr_rx); if (depth < 10) { if (hit == tone_type) false_hit = TRUE; /*endif*/ } else if (depth > 15) { if (hit != tone_type) false_miss = TRUE; /*endif*/ } /*endif*/ if (hit != MODEM_CONNECT_TONES_NONE) printf("Detected at %5dHz %12" PRId32 " %12" PRId32 " %d\n", pitch, ans_pr_rx.channel_level, ans_pr_rx.notch_level, hit); /*endif*/ } /*endfor*/ if (false_hit || false_miss) { printf("Test failed.\n"); exit(2); } /*endif*/ printf("Test passed.\n"); } /*endif*/ if ((test_list & PERFORM_TEST_8)) { /* Talk-off test */ /* Here we use the BellCore and Mitel talk off test tapes, intended for DTMF detector testing. Presumably they should also have value here, but I am not sure. If those voice snippets were chosen to be tough on DTMF detectors, they might go easy on detectors looking for different pitches. However, the Mitel DTMF test tape is known (the hard way) to exercise 2280Hz tone detectors quite well. */ printf("Test 8: Talk-off test\n"); modem_connect_tones_rx_init(&cng_rx, MODEM_CONNECT_TONES_FAX_CNG, NULL, NULL); modem_connect_tones_rx_init(&ced_rx, MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE, NULL, NULL); modem_connect_tones_rx_init(&ans_pr_rx, MODEM_CONNECT_TONES_ANS_PR, NULL, NULL); for (j = 0; bellcore_files[j][0]; j++) { if ((inhandle = sf_open_telephony_read(bellcore_files[j], 1)) == NULL) { fprintf(stderr, " Cannot open speech file '%s'\n", bellcore_files[j]); exit (2); } /*endif*/ when = 0; hits = 0; while ((frames = sf_readf_short(inhandle, amp, 8000))) { when++; modem_connect_tones_rx(&cng_rx, amp, frames); modem_connect_tones_rx(&ced_rx, amp, frames); modem_connect_tones_rx(&ans_pr_rx, amp, frames); if (modem_connect_tones_rx_get(&cng_rx) != MODEM_CONNECT_TONES_NONE) { /* This is not a true measure of hits, as there might be more than one in a block of data. However, since the only good result is no hits, this approximation is OK. */ printf("Hit CNG at %ds\n", when); hits++; modem_connect_tones_rx_init(&cng_rx, MODEM_CONNECT_TONES_FAX_CNG, NULL, NULL); } /*endif*/ if (modem_connect_tones_rx_get(&ced_rx) != MODEM_CONNECT_TONES_NONE) { printf("Hit CED at %ds\n", when); hits++; modem_connect_tones_rx_init(&ced_rx, MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE, NULL, NULL); } /*endif*/ if (modem_connect_tones_rx_get(&ans_pr_rx) != MODEM_CONNECT_TONES_NONE) { printf("Hit EC disable at %ds\n", when); hits++; modem_connect_tones_rx_init(&ans_pr_rx, MODEM_CONNECT_TONES_ANS_PR, NULL, NULL); } /*endif*/ } /*endwhile*/ if (sf_close_telephony(inhandle)) { fprintf(stderr, " Cannot close speech file '%s'\n", bellcore_files[j]); exit(2); } /*endif*/ printf(" File %d gave %d false hits.\n", j + 1, hits); } /*endfor*/ if (hits > 0) { printf("Test failed.\n"); exit(2); } /*endif*/ printf("Test passed.\n"); } /*endif*/ if (decode_test_file) { printf("Decode file '%s'\n", decode_test_file); modem_connect_tones_rx_init(&cng_rx, MODEM_CONNECT_TONES_FAX_CNG, cng_detected, NULL); modem_connect_tones_rx_init(&ced_rx, MODEM_CONNECT_TONES_FAX_CED_OR_PREAMBLE, ced_detected, NULL); modem_connect_tones_rx_init(&ans_pr_rx, MODEM_CONNECT_TONES_ANS_PR, ans_pr_detected, NULL); hits = 0; if ((inhandle = sf_open_telephony_read(decode_test_file, 1)) == NULL) { fprintf(stderr, " Cannot open speech file '%s'\n", decode_test_file); exit (2); } /*endif*/ when = 0; hits = 0; while ((frames = sf_readf_short(inhandle, amp, 8000))) { when++; modem_connect_tones_rx(&cng_rx, amp, frames); modem_connect_tones_rx(&ced_rx, amp, frames); modem_connect_tones_rx(&ans_pr_rx, amp, frames); } /*endwhile*/ if (sf_close_telephony(inhandle)) { fprintf(stderr, " Cannot close speech file '%s'\n", decode_test_file); exit(2); } /*endif*/ printf(" File gave %d hits.\n", hits); } printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/t38_core_tests.c0000664000175000017500000005410612101215500014257 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t38_core_tests.c - Tests for the T.38 FoIP core module. * * Written by Steve Underwood * * Copyright (C) 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page t38_core_tests_page T.38 core tests \section t38_core_tests_page_sec_1 What does it do? These tests exercise the T.38 core ASN.1 processing code. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #if !defined(_WIN32) #include #endif //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #define MAX_FIELDS 42 #define MAX_FIELD_LEN 8192 static int t38_version; static int succeeded = TRUE; static int ok_indicator_packets; static int bad_indicator_packets; static int ok_data_packets; static int bad_data_packets; static int missing_packets; static int skip; static uint8_t field_body[MAX_FIELDS][MAX_FIELD_LEN]; static int field_len[MAX_FIELDS]; static int seq_no; static int msg_list[1000000]; static int msg_list_ptr; static int msg_list_ptr2; static uint8_t concat[1000000]; static int concat_len; static int rx_missing_attack_handler(t38_core_state_t *s, void *user_data, int rx_seq_no, int expected_seq_no) { //printf("Hit missing\n"); return 0; } /*- End of function --------------------------------------------------------*/ static int rx_indicator_attack_handler(t38_core_state_t *s, void *user_data, int indicator) { //printf("Hit indicator %d\n", indicator); return 0; } /*- End of function --------------------------------------------------------*/ static int rx_data_attack_handler(t38_core_state_t *s, void *user_data, int data_type, int field_type, const uint8_t *buf, int len) { //printf("Hit data %d, field %d\n", data_type, field_type); return 0; } /*- End of function --------------------------------------------------------*/ static int rx_missing_handler(t38_core_state_t *s, void *user_data, int rx_seq_no, int expected_seq_no) { missing_packets++; //printf("Hit missing\n"); return 0; } /*- End of function --------------------------------------------------------*/ static int rx_indicator_handler(t38_core_state_t *s, void *user_data, int indicator) { if (indicator == msg_list[msg_list_ptr2++]) ok_indicator_packets++; else bad_indicator_packets++; //printf("Hit indicator %d\n", indicator); return 0; } /*- End of function --------------------------------------------------------*/ static int rx_data_handler(t38_core_state_t *s, void *user_data, int data_type, int field_type, const uint8_t *buf, int len) { if (data_type == msg_list[msg_list_ptr2] && field_type == msg_list[msg_list_ptr2 + 1]) ok_data_packets++; else bad_data_packets++; msg_list_ptr2 += 2; //printf("Hit data %d, field %d\n", data_type, field_type); return 0; } /*- End of function --------------------------------------------------------*/ static int tx_packet_handler(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count) { t38_core_state_t *t; t = (t38_core_state_t *) user_data; span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d, count %d\n", s->tx_seq_no, len, count); if (t38_core_rx_ifp_packet(t, buf, len, seq_no) < 0) succeeded = FALSE; seq_no++; return 0; } /*- End of function --------------------------------------------------------*/ static int tx_concat_packet_handler(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count) { span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d, count %d\n", s->tx_seq_no, len, count); memcpy(&concat[concat_len], buf, len); concat_len += len; seq_no++; return 0; } /*- End of function --------------------------------------------------------*/ static int encode_decode_tests(t38_core_state_t *a, t38_core_state_t *b) { t38_data_field_t field[MAX_FIELDS]; int i; int j; ok_indicator_packets = 0; bad_indicator_packets = 0; ok_data_packets = 0; bad_data_packets = 0; missing_packets = 0; msg_list_ptr = 0; msg_list_ptr2 = 0; /* Try all the indicator types */ for (i = 0; i < 100; i++) { msg_list[msg_list_ptr++] = i; if (t38_core_send_indicator(a, i) < 0) { msg_list_ptr--; break; } } /* Try all the data types, as single field messages with no data */ for (i = 0; i < 100; i++) { for (j = 0; j < 100; j++) { msg_list[msg_list_ptr++] = i; msg_list[msg_list_ptr++] = j; skip = 99; if (t38_core_send_data(a, i, j, (uint8_t *) "", 0, T38_PACKET_CATEGORY_CONTROL_DATA) < 0) { msg_list_ptr -= 2; break; } } if (j == 0) break; } /* Try all the data types and field types, as single field messages with data */ for (i = 0; i < 100; i++) { for (j = 0; j < 100; j++) { msg_list[msg_list_ptr++] = i; msg_list[msg_list_ptr++] = j; skip = 99; if (t38_core_send_data(a, i, j, (uint8_t *) "ABCD", 4, T38_PACKET_CATEGORY_CONTROL_DATA) < 0) { msg_list_ptr -= 2; break; } } if (j == 0) break; } /* Try all the data types and field types, as multi-field messages, but with 0 fields */ for (i = 0; i < 100; i++) { for (j = 0; j < 100; j++) { skip = 1; if (t38_core_send_data_multi_field(a, i, field, 0, T38_PACKET_CATEGORY_CONTROL_DATA) < 0) break; } if (j == 0) break; } /* Try all the data types and field types, as multi-field messages */ for (i = 0; i < 100; i++) { for (j = 0; j < 100; j++) { msg_list[msg_list_ptr++] = i; msg_list[msg_list_ptr++] = j; msg_list[msg_list_ptr++] = i; msg_list[msg_list_ptr++] = T38_FIELD_T4_NON_ECM_SIG_END; skip = 1; field_len[0] = 444; field_len[1] = 333; field[0].field_type = j; field[0].field = field_body[0]; field[0].field_len = field_len[0]; field[1].field_type = T38_FIELD_T4_NON_ECM_SIG_END; field[1].field = field_body[1]; field[1].field_len = field_len[1]; if (t38_core_send_data_multi_field(a, i, field, 2, T38_PACKET_CATEGORY_CONTROL_DATA) < 0) { msg_list_ptr -= 4; break; } } if (j == 0) break; } printf("Indicator packets: OK = %d, bad = %d\n", ok_indicator_packets, bad_indicator_packets); printf("Data packets: OK = %d, bad = %d\n", ok_data_packets, bad_data_packets); printf("Missing packets = %d\n", missing_packets); if (t38_version == 0) { if (ok_indicator_packets != 16 || bad_indicator_packets != 0) { printf("Tests failed\n"); return -1; } if (ok_data_packets != 288 || bad_data_packets != 0) { printf("Tests failed\n"); return -1; } } else { if (ok_indicator_packets != 23 || bad_indicator_packets != 0) { printf("Tests failed\n"); return -1; } if (ok_data_packets != 720 || bad_data_packets != 0) { printf("Tests failed\n"); return -1; } } if (missing_packets > 0) { printf("Tests failed\n"); return -1; } return 0; } /*- End of function --------------------------------------------------------*/ static int encode_then_decode_tests(t38_core_state_t *a, t38_core_state_t *b) { t38_data_field_t field[MAX_FIELDS]; int len; int i; int j; ok_indicator_packets = 0; bad_indicator_packets = 0; ok_data_packets = 0; bad_data_packets = 0; missing_packets = 0; msg_list_ptr = 0; msg_list_ptr2 = 0; /* Try all the indicator types */ for (i = 0; i < 100; i++) { msg_list[msg_list_ptr++] = i; if (t38_core_send_indicator(a, i) < 0) { msg_list_ptr--; break; } } /* Try all the data types, as single field messages with no data */ for (i = 0; i < 100; i++) { for (j = 0; j < 100; j++) { msg_list[msg_list_ptr++] = i; msg_list[msg_list_ptr++] = j; skip = 99; if (t38_core_send_data(a, i, j, (uint8_t *) "", 0, T38_PACKET_CATEGORY_CONTROL_DATA) < 0) { msg_list_ptr -= 2; break; } } if (j == 0) break; } /* Try all the data types and field types, as single field messages with data */ for (i = 0; i < 100; i++) { for (j = 0; j < 100; j++) { msg_list[msg_list_ptr++] = i; msg_list[msg_list_ptr++] = j; skip = 99; if (t38_core_send_data(a, i, j, (uint8_t *) "ABCD", 4, T38_PACKET_CATEGORY_CONTROL_DATA) < 0) { msg_list_ptr -= 2; break; } } if (j == 0) break; } /* Try all the data types and field types, as multi-field messages, but with 0 fields */ for (i = 0; i < 100; i++) { for (j = 0; j < 100; j++) { skip = 1; if (t38_core_send_data_multi_field(a, i, field, 0, T38_PACKET_CATEGORY_CONTROL_DATA) < 0) break; } if (j == 0) break; } /* Try all the data types and field types, as multi-field messages */ for (i = 0; i < 100; i++) { for (j = 0; j < 100; j++) { msg_list[msg_list_ptr++] = i; msg_list[msg_list_ptr++] = j; msg_list[msg_list_ptr++] = i; msg_list[msg_list_ptr++] = T38_FIELD_T4_NON_ECM_SIG_END; skip = 1; field_len[0] = 444; field_len[1] = 333; field[0].field_type = j; field[0].field = field_body[0]; field[0].field_len = field_len[0]; field[1].field_type = T38_FIELD_T4_NON_ECM_SIG_END; field[1].field = field_body[1]; field[1].field_len = field_len[1]; if (t38_core_send_data_multi_field(a, i, field, 2, T38_PACKET_CATEGORY_CONTROL_DATA) < 0) { msg_list_ptr -= 4; break; } } if (j == 0) break; } /* Now split up the big concatented block of IFP packets. */ for (i = 0, seq_no = 0; i < concat_len; i += len) { if ((len = t38_core_rx_ifp_stream(b, &concat[i], concat_len - i, seq_no)) < 0) succeeded = FALSE; seq_no++; } printf("Indicator packets: OK = %d, bad = %d\n", ok_indicator_packets, bad_indicator_packets); printf("Data packets: OK = %d, bad = %d\n", ok_data_packets, bad_data_packets); printf("Missing packets = %d\n", missing_packets); if (t38_version == 0) { if (ok_indicator_packets != 16 || bad_indicator_packets != 0) { printf("Tests failed\n"); return -1; } if (ok_data_packets != 288 || bad_data_packets != 0) { printf("Tests failed\n"); return -1; } } else { if (ok_indicator_packets != 23 || bad_indicator_packets != 0) { printf("Tests failed\n"); return -1; } if (ok_data_packets != 720 || bad_data_packets != 0) { printf("Tests failed\n"); return -1; } } if (missing_packets > 0) { printf("Tests failed\n"); return -1; } return 0; } /*- End of function --------------------------------------------------------*/ static int attack_tests(t38_core_state_t *s, int packets) { int i; int j; int len; uint8_t buf[1024]; int seq_no; srand(1234567); /* Send lots of random junk, of increasing length. Much of this will decode as valid IFP frames, but none of it should cause trouble. */ seq_no = 0; for (len = 1; len < 70; len++) { for (i = 0; i < packets; i++) { for (j = 0; j < len; j++) buf[j] = (rand() >> 16) & 0xFF; t38_core_rx_ifp_packet(s, buf, len, seq_no); seq_no = (seq_no + 1) & 0xFFFF; } } return 0; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { t38_core_state_t t38_core_a; t38_core_state_t t38_core_b; int attack_packets; int opt; attack_packets = 100000; while ((opt = getopt(argc, argv, "a:")) != -1) { switch (opt) { case 'a': attack_packets = atoi(optarg); break; default: //usage(); exit(2); break; } } /* Tests in UDP type mode, for UDPTL and RTP */ for (t38_version = 0; t38_version < 2; t38_version++) { seq_no = 0; printf("Using T.38 version %d\n", t38_version); if (t38_core_init(&t38_core_a, rx_indicator_handler, rx_data_handler, rx_missing_handler, &t38_core_b, tx_packet_handler, &t38_core_b) == NULL) { fprintf(stderr, "Cannot start the T.38 core\n"); exit(2); } if (t38_core_init(&t38_core_b, rx_indicator_handler, rx_data_handler, rx_missing_handler, &t38_core_a, tx_packet_handler, &t38_core_a) == NULL) { fprintf(stderr, "Cannot start the T.38 core\n"); exit(2); } t38_set_t38_version(&t38_core_a, t38_version); t38_set_t38_version(&t38_core_b, t38_version); span_log_set_level(&t38_core_a.logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG); span_log_set_tag(&t38_core_a.logging, "T.38-A"); span_log_set_level(&t38_core_b.logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG); span_log_set_tag(&t38_core_b.logging, "T.38-B"); /* Encode and decode all possible frame types, one by one */ if (encode_decode_tests(&t38_core_a, &t38_core_b)) { printf("Encode/decode tests failed\n"); exit(2); } if (t38_core_init(&t38_core_a, rx_indicator_attack_handler, rx_data_attack_handler, rx_missing_attack_handler, &t38_core_b, tx_packet_handler, &t38_core_b) == NULL) { fprintf(stderr, "Cannot start the T.38 core\n"); exit(2); } t38_set_t38_version(&t38_core_a, t38_version); //span_log_set_level(&t38_core_a.logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG); //span_log_set_tag(&t38_core_a.logging, "T.38-A"); if (attack_tests(&t38_core_a, attack_packets)) { printf("Attack tests failed\n"); exit(2); } } /* Tests in TCP without TPKT mode, like T.38 version 0 */ for (t38_version = 0; t38_version < 2; t38_version++) { seq_no = 0; concat_len = 0; printf("Using T.38 version %d\n", t38_version); if (t38_core_init(&t38_core_a, rx_indicator_handler, rx_data_handler, rx_missing_handler, &t38_core_b, tx_concat_packet_handler, &t38_core_b) == NULL) { fprintf(stderr, "Cannot start the T.38 core\n"); exit(2); } if (t38_core_init(&t38_core_b, rx_indicator_handler, rx_data_handler, rx_missing_handler, &t38_core_a, tx_concat_packet_handler, &t38_core_a) == NULL) { fprintf(stderr, "Cannot start the T.38 core\n"); exit(2); } t38_set_t38_version(&t38_core_a, t38_version); t38_set_t38_version(&t38_core_b, t38_version); t38_set_pace_transmission(&t38_core_a, FALSE); t38_set_pace_transmission(&t38_core_b, FALSE); t38_set_data_transport_protocol(&t38_core_a, T38_TRANSPORT_TCP); t38_set_data_transport_protocol(&t38_core_b, T38_TRANSPORT_TCP); span_log_set_level(&t38_core_a.logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG); span_log_set_tag(&t38_core_a.logging, "T.38-A"); span_log_set_level(&t38_core_b.logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG); span_log_set_tag(&t38_core_b.logging, "T.38-B"); /* Encode all possible frames types into a large block, and then decode them */ if (encode_then_decode_tests(&t38_core_a, &t38_core_b)) { printf("Encode then decode tests failed\n"); exit(2); } if (t38_core_init(&t38_core_a, rx_indicator_attack_handler, rx_data_attack_handler, rx_missing_attack_handler, &t38_core_b, tx_packet_handler, &t38_core_b) == NULL) { fprintf(stderr, "Cannot start the T.38 core\n"); exit(2); } t38_set_t38_version(&t38_core_a, t38_version); t38_set_pace_transmission(&t38_core_a, FALSE); t38_set_data_transport_protocol(&t38_core_a, T38_TRANSPORT_TCP); //span_log_set_level(&t38_core_a.logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG); //span_log_set_tag(&t38_core_a.logging, "T.38-A"); if (attack_tests(&t38_core_a, attack_packets)) { printf("Attack tests failed\n"); exit(2); } } /* Tests in TCP with TPKT mode, like T.38 versions >0 */ for (t38_version = 0; t38_version < 2; t38_version++) { seq_no = 0; concat_len = 0; printf("Using T.38 version %d\n", t38_version); if (t38_core_init(&t38_core_a, rx_indicator_handler, rx_data_handler, rx_missing_handler, &t38_core_b, tx_concat_packet_handler, &t38_core_b) == NULL) { fprintf(stderr, "Cannot start the T.38 core\n"); exit(2); } if (t38_core_init(&t38_core_b, rx_indicator_handler, rx_data_handler, rx_missing_handler, &t38_core_a, tx_concat_packet_handler, &t38_core_a) == NULL) { fprintf(stderr, "Cannot start the T.38 core\n"); exit(2); } t38_set_t38_version(&t38_core_a, t38_version); t38_set_t38_version(&t38_core_b, t38_version); t38_set_pace_transmission(&t38_core_a, FALSE); t38_set_pace_transmission(&t38_core_b, FALSE); t38_set_data_transport_protocol(&t38_core_a, T38_TRANSPORT_TCP_TPKT); t38_set_data_transport_protocol(&t38_core_b, T38_TRANSPORT_TCP_TPKT); span_log_set_level(&t38_core_a.logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG); span_log_set_tag(&t38_core_a.logging, "T.38-A"); span_log_set_level(&t38_core_b.logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG); span_log_set_tag(&t38_core_b.logging, "T.38-B"); /* Encode all possible frames types into a large block, and then decode them */ if (encode_then_decode_tests(&t38_core_a, &t38_core_b)) { printf("Encode then decode tests failed\n"); exit(2); } if (t38_core_init(&t38_core_a, rx_indicator_attack_handler, rx_data_attack_handler, rx_missing_attack_handler, &t38_core_b, tx_packet_handler, &t38_core_b) == NULL) { fprintf(stderr, "Cannot start the T.38 core\n"); exit(2); } t38_set_t38_version(&t38_core_a, t38_version); t38_set_pace_transmission(&t38_core_a, FALSE); t38_set_data_transport_protocol(&t38_core_a, T38_TRANSPORT_TCP_TPKT); //span_log_set_level(&t38_core_a.logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG); //span_log_set_tag(&t38_core_a.logging, "T.38-A"); if (attack_tests(&t38_core_a, attack_packets)) { printf("Attack tests failed\n"); exit(2); } } if (!succeeded) { printf("Tests failed\n"); exit(2); } printf("Tests passed\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/make_g168_css.c0000664000175000017500000003264412101217251013751 00000000000000/* * SpanDSP - a series of DSP components for telephony * * makecss.c - Create the composite source signal (CSS) for G.168 testing. * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page makecss_page CSS construction for G.168 testing \section makecss_page_sec_1 What does it do? ???. \section makecss_page_sec_2 How does it work? ???. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #if defined(HAVE_FFTW3_H) #include #else #include #endif //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp/g168models.h" #if !defined(NULL) #define NULL (void *) 0 #endif #define FAST_SAMPLE_RATE 44100.0 #define C1_VOICED_SAMPLES 2144 /* 48.62ms at 44100 samples/second => 2144.142 */ #define C1_NOISE_SAMPLES 8820 /* 200ms at 44100 samples/second => 8820.0 */ #define C1_SILENCE_SAMPLES 4471 /* 101.38ms at 44100 samples/second => 4470.858 */ #define C3_VOICED_SAMPLES 3206 /* 72.69ms at 44100 samples/second => 3205.629 */ #define C3_NOISE_SAMPLES 8820 /* 200ms at 44100 samples/second => 8820.0 */ #define C3_SILENCE_SAMPLES 5614 /* 127.31ms at 44100 samples/second => 5614.371 */ static double scaling(double f, double start, double end, double start_gain, double end_gain) { double scale; scale = start_gain + (f - start)*(end_gain - start_gain)/(end - start); return scale; } /*- End of function --------------------------------------------------------*/ static double peak(const int16_t amp[], int len) { int16_t peak; int i; peak = 0; for (i = 0; i < len; i++) { if (abs(amp[i]) > peak) peak = abs(amp[i]); } return peak/32767.0; } /*- End of function --------------------------------------------------------*/ static double rms(const int16_t amp[], int len) { double ms; int i; ms = 0.0; for (i = 0; i < len; i++) ms += amp[i]*amp[i]; return sqrt(ms/len)/32767.0; } /*- End of function --------------------------------------------------------*/ static double rms_to_dbm0(double rms) { return 20.0*log10(rms) + DBM0_MAX_POWER; } /*- End of function --------------------------------------------------------*/ static double rms_to_db(double rms) { return 20.0*log10(rms); } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { #if defined(HAVE_FFTW3_H) double in[8192][2]; double out[8192][2]; #else fftw_complex in[8192]; fftw_complex out[8192]; #endif fftw_plan p; int16_t voiced_sound[8192]; int16_t noise_sound[8830]; int16_t silence_sound[8192]; int i; int voiced_length; int randy; double f; double pk; double ms; double scale; SNDFILE *filehandle; SF_INFO info; awgn_state_t noise_source; memset(&info, 0, sizeof(info)); info.frames = 0; info.samplerate = FAST_SAMPLE_RATE; info.channels = 1; info.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16; info.sections = 1; info.seekable = 1; if ((filehandle = sf_open("sound_c1.wav", SFM_WRITE, &info)) == NULL) { fprintf(stderr, " Failed to open result file\n"); exit(2); } printf("Generate C1\n"); /* The sequence is 48.62ms of voiced sound from table C.1 of G.168 200.0ms of pseudo-noise 101.38ms of silence The above is then repeated phase inverted. The voice comes straight from C.1, repeated enough times to fill out the 48.62ms period - i.e. 16 copies of the sequence. The pseudo noise section is random numbers filtered by the spectral pattern in Figure C.2 */ /* The set of C1 voice samples is ready for use in the output file. */ voiced_length = sizeof(css_c1)/sizeof(css_c1[0]); for (i = 0; i < voiced_length; i++) voiced_sound[i] = css_c1[i]; pk = peak(voiced_sound, voiced_length); ms = rms(voiced_sound, voiced_length); printf("Voiced level = %.2fdB, crest factor = %.2fdB\n", rms_to_dbm0(ms), rms_to_db(pk/ms)); #if defined(HAVE_FFTW3_H) p = fftw_plan_dft_1d(8192, in, out, FFTW_BACKWARD, FFTW_ESTIMATE); #else p = fftw_create_plan(8192, FFTW_BACKWARD, FFTW_ESTIMATE); #endif for (i = 0; i < 8192; i++) { #if defined(HAVE_FFTW3_H) in[i][0] = 0.0; in[i][1] = 0.0; #else in[i].re = 0.0; in[i].im = 0.0; #endif } for (i = 1; i <= 3715; i++) { f = FAST_SAMPLE_RATE*i/8192.0; #if 1 if (f < 50.0) scale = -60.0; else if (f < 100.0) scale = scaling(f, 50.0, 100.0, -25.8, -12.8); else if (f < 200.0) scale = scaling(f, 100.0, 200.0, -12.8, 17.4); else if (f < 215.0) scale = scaling(f, 200.0, 215.0, 17.4, 17.8); else if (f < 500.0) scale = scaling(f, 215.0, 500.0, 17.8, 12.2); else if (f < 1000.0) scale = scaling(f, 500.0, 1000.0, 12.2, 7.2); else if (f < 2850.0) scale = scaling(f, 1000.0, 2850.0, 7.2, 0.0); else if (f < 3600.0) scale = scaling(f, 2850.0, 3600.0, 0.0, -2.0); else if (f < 3660.0) scale = scaling(f, 3600.0, 3660.0, -2.0, -20.0); else if (f < 3680.0) scale = scaling(f, 3600.0, 3680.0, -20.0, -30.0); else scale = -60.0; #else scale = 0.0; #endif randy = ((rand() >> 10) & 0x1) ? 1.0 : -1.0; #if defined(HAVE_FFTW3_H) in[i][0] = randy*pow(10.0, scale/20.0)*35.0; in[8192 - i][0] = -in[i][0]; #else in[i].re = randy*pow(10.0, scale/20.0)*35.0; in[8192 - i].re = -in[i].re; #endif } #if defined(HAVE_FFTW3_H) fftw_execute(p); #else fftw_one(p, in, out); #endif for (i = 0; i < 8192; i++) { #if defined(HAVE_FFTW3_H) noise_sound[i] = out[i][1]; #else noise_sound[i] = out[i].im; #endif } pk = peak(noise_sound, 8192); ms = rms(noise_sound, 8192); printf("Filtered noise level = %.2fdB, crest factor = %.2fdB\n", rms_to_dbm0(ms), rms_to_db(pk/ms)); for (i = 0; i < 8192; i++) silence_sound[i] = 0.0; for (i = 0; i < 16; i++) sf_writef_short(filehandle, voiced_sound, voiced_length); printf("%d samples of voice\n", 16*voiced_length); sf_writef_short(filehandle, noise_sound, 8192); sf_writef_short(filehandle, noise_sound, C1_NOISE_SAMPLES - 8192); printf("%d samples of noise\n", C1_NOISE_SAMPLES); sf_writef_short(filehandle, silence_sound, C1_SILENCE_SAMPLES); printf("%d samples of silence\n", C1_SILENCE_SAMPLES); /* Now phase invert the C1 set of samples. */ voiced_length = sizeof(css_c1)/sizeof(css_c1[0]); for (i = 0; i < voiced_length; i++) voiced_sound[i] = -css_c1[i]; for (i = 0; i < 8192; i++) noise_sound[i] = -noise_sound[i]; for (i = 0; i < 16; i++) sf_writef_short(filehandle, voiced_sound, voiced_length); printf("%d samples of voice\n", 16*voiced_length); sf_writef_short(filehandle, noise_sound, 8192); sf_writef_short(filehandle, noise_sound, C1_NOISE_SAMPLES - 8192); printf("%d samples of noise\n", C1_NOISE_SAMPLES); sf_writef_short(filehandle, silence_sound, C1_SILENCE_SAMPLES); printf("%d samples of silence\n", C1_SILENCE_SAMPLES); if (sf_close(filehandle)) { fprintf(stderr, " Cannot close speech file '%s'\n", "sound_c1.wav"); exit(2); } memset(&info, 0, sizeof(info)); info.frames = 0; info.samplerate = FAST_SAMPLE_RATE; info.channels = 1; info.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16; info.sections = 1; info.seekable = 1; if ((filehandle = sf_open("sound_c3.wav", SFM_WRITE, &info)) == NULL) { fprintf(stderr, " Failed to open result file\n"); exit(2); } printf("Generate C3\n"); /* The sequence is 72.69ms of voiced sound from table C.3 of G.168 200.0ms of pseudo-noise 127.31ms of silence The above is then repeated phase inverted. The voice comes straight from C.3, repeated enough times to fill out the 72.69ms period - i.e. 14 copies of the sequence. The pseudo noise section is AWGN filtered by the spectral pattern in Figure C.2. Since AWGN has the quality of being its own Fourier transform, we can use an approach like the one above for the C1 signal, using AWGN samples instead of randomly alternating ones and zeros. */ /* Take the supplied set of C3 voice samples. */ voiced_length = (sizeof(css_c3)/sizeof(css_c3[0])); for (i = 0; i < voiced_length; i++) voiced_sound[i] = css_c3[i]; pk = peak(voiced_sound, voiced_length); ms = rms(voiced_sound, voiced_length); printf("Voiced level = %.2fdB, crest factor = %.2fdB\n", rms_to_dbm0(ms), rms_to_db(pk/ms)); awgn_init_dbm0(&noise_source, 7162534, rms_to_dbm0(ms)); for (i = 0; i < 8192; i++) noise_sound[i] = awgn(&noise_source); pk = peak(noise_sound, 8192); ms = rms(noise_sound, 8192); printf("Unfiltered noise level = %.2fdB, crest factor = %.2fdB\n", rms_to_dbm0(ms), rms_to_db(pk/ms)); /* Now filter them */ #if defined(HAVE_FFTW3_H) p = fftw_plan_dft_1d(8192, in, out, FFTW_BACKWARD, FFTW_ESTIMATE); #else p = fftw_create_plan(8192, FFTW_BACKWARD, FFTW_ESTIMATE); #endif for (i = 0; i < 8192; i++) { #if defined(HAVE_FFTW3_H) in[i][0] = 0.0; in[i][1] = 0.0; #else in[i].re = 0.0; in[i].im = 0.0; #endif } for (i = 1; i <= 3715; i++) { f = FAST_SAMPLE_RATE*i/8192.0; #if 1 if (f < 50.0) scale = -60.0; else if (f < 100.0) scale = scaling(f, 50.0, 100.0, -25.8, -12.8); else if (f < 200.0) scale = scaling(f, 100.0, 200.0, -12.8, 17.4); else if (f < 215.0) scale = scaling(f, 200.0, 215.0, 17.4, 17.8); else if (f < 500.0) scale = scaling(f, 215.0, 500.0, 17.8, 12.2); else if (f < 1000.0) scale = scaling(f, 500.0, 1000.0, 12.2, 7.2); else if (f < 2850.0) scale = scaling(f, 1000.0, 2850.0, 7.2, 0.0); else if (f < 3600.0) scale = scaling(f, 2850.0, 3600.0, 0.0, -2.0); else if (f < 3660.0) scale = scaling(f, 3600.0, 3660.0, -2.0, -20.0); else if (f < 3680.0) scale = scaling(f, 3600.0, 3680.0, -20.0, -30.0); else scale = -60.0; #else scale = 0.0; #endif #if defined(HAVE_FFTW3_H) in[i][0] = noise_sound[i]*pow(10.0, scale/20.0)*0.0106; in[8192 - i][0] = -in[i][0]; #else in[i].re = noise_sound[i]*pow(10.0, scale/20.0)*0.0106; in[8192 - i].re = -in[i].re; #endif } #if defined(HAVE_FFTW3_H) fftw_execute(p); #else fftw_one(p, in, out); #endif for (i = 0; i < 8192; i++) { #if defined(HAVE_FFTW3_H) noise_sound[i] = out[i][1]; #else noise_sound[i] = out[i].im; #endif } pk = peak(noise_sound, 8192); ms = rms(noise_sound, 8192); printf("Filtered noise level = %.2fdB, crest factor = %.2fdB\n", rms_to_dbm0(ms), rms_to_db(pk/ms)); for (i = 0; i < 14; i++) sf_writef_short(filehandle, voiced_sound, voiced_length); printf("%d samples of voice\n", 14*voiced_length); sf_writef_short(filehandle, noise_sound, 8192); sf_writef_short(filehandle, noise_sound, C3_NOISE_SAMPLES - 8192); printf("%d samples of noise\n", C3_NOISE_SAMPLES); sf_writef_short(filehandle, silence_sound, C3_SILENCE_SAMPLES); printf("%d samples of silence\n", C3_SILENCE_SAMPLES); /* Now phase invert the C3 set of samples. */ voiced_length = (sizeof(css_c3)/sizeof(css_c3[0])); for (i = 0; i < voiced_length; i++) voiced_sound[i] = -css_c3[i]; for (i = 0; i < 8192; i++) noise_sound[i] = -noise_sound[i]; for (i = 0; i < 14; i++) sf_writef_short(filehandle, voiced_sound, voiced_length); printf("%d samples of voice\n", 14*voiced_length); sf_writef_short(filehandle, noise_sound, 8192); sf_writef_short(filehandle, noise_sound, C3_NOISE_SAMPLES - 8192); printf("%d samples of noise\n", C3_NOISE_SAMPLES); sf_writef_short(filehandle, silence_sound, C3_SILENCE_SAMPLES); printf("%d samples of silence\n", C3_SILENCE_SAMPLES); if (sf_close(filehandle)) { fprintf(stderr, " Cannot close speech file '%s'\n", "sound_c3.wav"); exit(2); } fftw_destroy_plan(p); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/g1050_tests.c0000664000175000017500000001626012101216453013374 00000000000000/* * SpanDSP - a series of DSP components for telephony * * g1050_tests.c - Tests for the G.1050/TIA-921 model. * * Written by Steve Underwood * * Copyright (C) 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #if defined(HAVE_FL_FL_H) && defined(HAVE_FL_FL_CARTESIAN_H) && defined(HAVE_FL_FL_AUDIO_METER_H) #define ENABLE_GUI #endif #include #include #include #include #include #include #include #if defined(HAVE_MATH_H) #define GEN_CONST #endif //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #if defined(ENABLE_GUI) #include "media_monitor.h" #endif #define PACKET_SIZE 256 #define PACKET_INTERVAL 20 #define SIMULATION_TIME 300 #define MODEL_NO 8 #define SPEED_PATTERN_NO 133 int main(int argc, char *argv[]) { g1050_state_t *s; double *packet_arrival_times; int packets_per_sec; int num_packets; int model_no; int speed_pattern_no; int simulation_time; int i; int len; uint8_t put_pkt[256]; uint8_t get_pkt[256]; int put_pkt_len; int get_pkt_len; int get_seq_no; double get_departure_time; double get_arrival_time; int packets_put; int packets_really_put; int packets_got; int oos_packets_got; int missing_packets_got; int highest_seq_no_got; int opt; FILE *out_file; #if defined(ENABLE_GUI) int use_gui; #endif #if defined(ENABLE_GUI) use_gui = FALSE; #endif model_no = MODEL_NO; speed_pattern_no = SPEED_PATTERN_NO; simulation_time = SIMULATION_TIME; while ((opt = getopt(argc, argv, "gm:s:t:")) != -1) { switch (opt) { case 'g': #if defined(ENABLE_GUI) use_gui = TRUE; #else fprintf(stderr, "Graphical monitoring not available\n"); exit(2); #endif break; case 'm': model_no = optarg[0] - 'A' + 1; if (model_no < 0 || model_no > 8) { fprintf(stderr, "Bad model ID '%s'\n", optarg); exit(2); } break; case 's': speed_pattern_no = atoi(optarg); if (speed_pattern_no < 1 || speed_pattern_no > 133) { fprintf(stderr, "Bad link speed pattern %s\n", optarg); exit(2); } break; case 't': simulation_time = atoi(optarg); break; default: //usage(); exit(2); break; } } argc -= optind; argv += optind; if ((out_file = fopen("g1050_tests.txt", "w")) == NULL) { fprintf(stderr, "Can't open %s\n", "g1050_tests.txt"); return 2; } packets_per_sec = 1000/PACKET_INTERVAL; num_packets = packets_per_sec*simulation_time; if ((packet_arrival_times = calloc(num_packets, sizeof(double))) == NULL) { fprintf(stderr, "Can't allocate the data buffers\n"); return 2; } for (i = 0; i < num_packets; i++) packet_arrival_times[i] = 0.0; /* If we don't initialise this random number generator it gives endless zeros on some systems. */ /* Use a fixed seed to produce identical results in successive runs of the simulation, for debug purposes. */ srand48(0x1234567); if ((s = g1050_init(model_no, speed_pattern_no, PACKET_SIZE, packets_per_sec)) == NULL) { fprintf(stderr, "Failed to start the G.1050 model\n"); exit(2); } g1050_dump_parms(model_no, speed_pattern_no); #if defined(ENABLE_GUI) if (use_gui) start_media_monitor(); #endif for (i = 0; i < 256; i++) put_pkt[i] = i; put_pkt_len = 256; get_pkt_len = -1; get_seq_no = -1; get_arrival_time = -1; packets_put = 0; packets_really_put = 0; packets_got = 0; oos_packets_got = 0; missing_packets_got = 0; highest_seq_no_got = -1; for (i = 0; i < num_packets; i++) { if ((len = g1050_put(s, put_pkt, put_pkt_len, i, (double) i*0.001*PACKET_INTERVAL)) > 0) packets_really_put++; packets_put++; if (i == 5) g1050_queue_dump(s); if (i >= 5) { do { get_pkt_len = g1050_get(s, get_pkt, 256, (double) i*0.001*PACKET_INTERVAL, &get_seq_no, &get_departure_time, &get_arrival_time); if (get_pkt_len >= 0) { #if defined(ENABLE_GUI) if (use_gui) media_monitor_rx(get_seq_no, get_departure_time, get_arrival_time); #endif packets_got++; if (get_seq_no < highest_seq_no_got) oos_packets_got++; else if (get_seq_no > highest_seq_no_got + 1) missing_packets_got += (get_seq_no - highest_seq_no_got - 1); if (get_seq_no > highest_seq_no_got) highest_seq_no_got = get_seq_no; fprintf(out_file, "%d, %.3f, %.8f\n", get_seq_no, get_seq_no*0.001*PACKET_INTERVAL, get_arrival_time); } } while (get_pkt_len >= 0); } #if defined(ENABLE_GUI) if (use_gui) media_monitor_update_display(); #endif } /* Clear out anything remaining in the queue, by jumping forwards in time */ do { get_pkt_len = g1050_get(s, get_pkt, 256, (double) i*0.001*PACKET_INTERVAL + 5.0, &get_seq_no, &get_departure_time, &get_arrival_time); if (get_pkt_len >= 0) { packets_got++; fprintf(out_file, "%d, %.3f, %.8f\n", get_seq_no, get_seq_no*0.001*PACKET_INTERVAL, get_arrival_time); } } while (get_pkt_len >= 0); fclose(out_file); printf("Put %d packets. Really put %d packets. Got %d packets.\n", packets_put, packets_really_put, packets_got); printf("%d OOS packets, %d missing packets\n", oos_packets_got, missing_packets_got - oos_packets_got); if (packets_really_put != packets_got) { printf("%d packets queued, but only %d received\n", packets_really_put, packets_got); exit(2); } printf("%.3f%% of packets lost\n", 100.0*(packets_put - packets_really_put)/packets_put); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/vector_float_tests.c0000664000175000017500000003650311422612267015341 00000000000000/* * SpanDSP - a series of DSP components for telephony * * vector_float_tests.c * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include "spandsp.h" static void vec_copyf_dumb(float z[], const float x[], int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]; } /*- End of function --------------------------------------------------------*/ static int test_vec_copyf(void) { int i; float x[100]; float za[100]; float zb[100]; printf("Testing vec_copyf()\n"); for (i = 0; i < 99; i++) { x[i] = i; za[i] = -1.0f; zb[i] = -1.0f; } vec_copyf_dumb(za + 3, x + 1, 0); vec_copyf(zb + 3, x + 1, 0); for (i = 0; i < 99; i++) { if (za[i] != zb[i]) { printf("vec_copyf() - %d %f %f\n", i, za[i], zb[i]); printf("Tests failed\n"); exit(2); } } vec_copyf_dumb(za + 3, x + 1, 1); vec_copyf(zb + 3, x + 1, 1); for (i = 0; i < 99; i++) { if (za[i] != zb[i]) { printf("vec_copyf() - %d %f %f\n", i, za[i], zb[i]); printf("Tests failed\n"); exit(2); } } vec_copyf_dumb(za + 3, x + 1, 29); vec_copyf(zb + 3, x + 1, 29); for (i = 0; i < 99; i++) { if (za[i] != zb[i]) { printf("vec_copyf() - %d %f %f\n", i, za[i], zb[i]); printf("Tests failed\n"); exit(2); } } return 0; } /*- End of function --------------------------------------------------------*/ static void vec_negatef_dumb(float z[], const float x[], int n) { int i; for (i = 0; i < n; i++) z[i] = -x[i]; } /*- End of function --------------------------------------------------------*/ static int test_vec_negatef(void) { int i; float x[100]; float za[100]; float zb[100]; printf("Testing vec_negatef()\n"); for (i = 0; i < 99; i++) { x[i] = i; za[i] = -1.0f; zb[i] = -1.0f; } vec_negatef_dumb(za + 3, x + 1, 0); vec_negatef(zb + 3, x + 1, 0); for (i = 0; i < 99; i++) { if (za[i] != zb[i]) { printf("vec_negatef() - %d %f %f\n", i, za[i], zb[i]); printf("Tests failed\n"); exit(2); } } vec_negatef_dumb(za + 3, x + 1, 1); vec_negatef(zb + 3, x + 1, 1); for (i = 0; i < 99; i++) { if (za[i] != zb[i]) { printf("vec_megatef() - %d %f %f\n", i, za[i], zb[i]); printf("Tests failed\n"); exit(2); } } vec_negatef_dumb(za + 3, x + 1, 29); vec_negatef(zb + 3, x + 1, 29); for (i = 0; i < 99; i++) { if (za[i] != zb[i]) { printf("vec_negatef() - %d %f %f\n", i, za[i], zb[i]); printf("Tests failed\n"); exit(2); } } return 0; } /*- End of function --------------------------------------------------------*/ static void vec_zerof_dumb(float z[], int n) { int i; for (i = 0; i < n; i++) z[i] = 0.0f; } /*- End of function --------------------------------------------------------*/ static int test_vec_zerof(void) { int i; float za[100]; float zb[100]; printf("Testing vec_zerof()\n"); for (i = 0; i < 99; i++) { za[i] = -1.0f; zb[i] = -1.0f; } vec_zerof_dumb(za + 3, 0); vec_zerof(zb + 3, 0); for (i = 0; i < 99; i++) { if (za[i] != zb[i]) { printf("vec_zerof() - %d %f %f\n", i, za[i], zb[i]); printf("Tests failed\n"); exit(2); } } vec_zerof_dumb(za + 3, 1); vec_zerof(zb + 3, 1); for (i = 0; i < 99; i++) { if (za[i] != zb[i]) { printf("vec_zerof() - %d %f %f\n", i, za[i], zb[i]); printf("Tests failed\n"); exit(2); } } vec_zerof_dumb(za + 3, 29); vec_zerof(zb + 3, 29); for (i = 0; i < 99; i++) { if (za[i] != zb[i]) { printf("vec_zerof() - %d %f %f\n", i, za[i], zb[i]); printf("Tests failed\n"); exit(2); } } return 0; } /*- End of function --------------------------------------------------------*/ static void vec_setf_dumb(float z[], float x, int n) { int i; for (i = 0; i < n; i++) z[i] = x; } /*- End of function --------------------------------------------------------*/ static int test_vec_setf(void) { int i; float za[100]; float zb[100]; printf("Testing vec_setf()\n"); for (i = 0; i < 99; i++) { za[i] = -1.0f; zb[i] = -1.0f; } vec_setf_dumb(za + 3, 42.0f, 0); vec_setf(zb + 3, 42.0f, 0); for (i = 0; i < 99; i++) { if (za[i] != zb[i]) { printf("vec_setf() - %d %f %f\n", i, za[i], zb[i]); printf("Tests failed\n"); exit(2); } } vec_setf_dumb(za + 3, 42.0f, 1); vec_setf(zb + 3, 42.0f, 1); for (i = 0; i < 99; i++) { if (za[i] != zb[i]) { printf("vec_setf() - %d %f %f\n", i, za[i], zb[i]); printf("Tests failed\n"); exit(2); } } vec_setf_dumb(za + 3, 42.0f, 29); vec_setf(zb + 3, 42.0f, 29); for (i = 0; i < 99; i++) { if (za[i] != zb[i]) { printf("vec_setf() - %d %f %f\n", i, za[i], zb[i]); printf("Tests failed\n"); exit(2); } } return 0; } /*- End of function --------------------------------------------------------*/ static double vec_dot_prod_dumb(const double x[], const double y[], int n) { int i; double z; z = 0.0; for (i = 0; i < n; i++) z += x[i]*y[i]; return z; } /*- End of function --------------------------------------------------------*/ static int test_vec_dot_prod(void) { int i; double x[100]; double y[100]; double zsa; double zsb; double ratio; printf("Testing vec_dot_prod()\n"); for (i = 0; i < 99; i++) { x[i] = rand(); y[i] = rand(); } for (i = 1; i < 99; i++) { zsa = vec_dot_prod(x, y, i); zsb = vec_dot_prod_dumb(x, y, i); ratio = zsa/zsb; if (ratio < 0.9999 || ratio > 1.0001) { printf("vec_dot_prod() - %f %f\n", zsa, zsb); printf("Tests failed\n"); exit(2); } } return 0; } /*- End of function --------------------------------------------------------*/ static float vec_dot_prodf_dumb(const float x[], const float y[], int n) { int i; float z; z = 0.0; for (i = 0; i < n; i++) z += x[i]*y[i]; return z; } /*- End of function --------------------------------------------------------*/ static int test_vec_dot_prodf(void) { int i; float x[100]; float y[100]; float zsa; float zsb; float ratio; printf("Testing vec_dot_prodf()\n"); for (i = 0; i < 99; i++) { x[i] = rand(); y[i] = rand(); } for (i = 1; i < 99; i++) { zsa = vec_dot_prodf(x, y, i); zsb = vec_dot_prodf_dumb(x, y, i); ratio = zsa/zsb; if (ratio < 0.9999f || ratio > 1.0001f) { printf("vec_dot_prodf() - %e %e\n", zsa, zsb); printf("Tests failed\n"); exit(2); } } return 0; } /*- End of function --------------------------------------------------------*/ static void vec_addf_dumb(float z[], const float x[], const float y[], int n) { int i; for (i = 0; i < n; i++) z[i] = x[i] + y[i]; } /*- End of function --------------------------------------------------------*/ static int test_vec_addf(void) { int i; int j; float x[100]; float y[100]; float zsa[100]; float zsb[100]; float ratio; printf("Testing vec_addf()\n"); for (i = 0; i < 99; i++) { x[i] = rand(); y[i] = rand(); } for (i = 1; i < 90; i++) { /* Force address misalignment, to check this works OK */ vec_addf(zsa + 1, x + 1, y + 1, i); vec_addf_dumb(zsb + 1, x + 1, y + 1, i); for (j = 1; j <= i; j++) { ratio = zsa[j]/zsb[j]; if (ratio < 0.9999f || ratio > 1.0001f) { printf("vec_mulf() - %d %e %e\n", j, zsa[j], zsb[j]); printf("Tests failed\n"); exit(2); } } } return 0; } /*- End of function --------------------------------------------------------*/ static void vec_subf_dumb(float z[], const float x[], const float y[], int n) { int i; for (i = 0; i < n; i++) z[i] = x[i] - y[i]; } /*- End of function --------------------------------------------------------*/ static int test_vec_subf(void) { int i; int j; float x[100]; float y[100]; float zsa[100]; float zsb[100]; float ratio; printf("Testing vec_subf()\n"); for (i = 0; i < 99; i++) { x[i] = rand(); y[i] = rand(); } for (i = 1; i < 90; i++) { /* Force address misalignment, to check this works OK */ vec_subf(zsa + 1, x + 1, y + 1, i); vec_subf_dumb(zsb + 1, x + 1, y + 1, i); for (j = 1; j <= i; j++) { ratio = zsa[j]/zsb[j]; if (ratio < 0.9999f || ratio > 1.0001f) { printf("vec_mulf() - %d %e %e\n", j, zsa[j], zsb[j]); printf("Tests failed\n"); exit(2); } } } return 0; } /*- End of function --------------------------------------------------------*/ static void vec_mulf_dumb(float z[], const float x[], const float y[], int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]*y[i]; } /*- End of function --------------------------------------------------------*/ static int test_vec_mulf(void) { int i; int j; float x[100]; float y[100]; float zsa[100]; float zsb[100]; float ratio; printf("Testing vec_mulf()\n"); for (i = 0; i < 99; i++) { x[i] = rand(); y[i] = rand(); } for (i = 1; i < 90; i++) { /* Force address misalignment, to check this works OK */ vec_mulf(zsa + 1, x + 1, y + 1, i); vec_mulf_dumb(zsb + 1, x + 1, y + 1, i); for (j = 1; j <= i; j++) { ratio = zsa[j]/zsb[j]; if (ratio < 0.9999f || ratio > 1.0001f) { printf("vec_mulf() - %d %e %e\n", j, zsa[j], zsb[j]); printf("Tests failed\n"); exit(2); } } } return 0; } /*- End of function --------------------------------------------------------*/ #define LMS_LEAK_RATE 0.9999f static void vec_lmsf_dumb(const float x[], float y[], int n, float error) { int i; for (i = 0; i < n; i++) { /* Leak a little to tame uncontrolled wandering */ y[i] = y[i]*LMS_LEAK_RATE + x[i]*error; } } /*- End of function --------------------------------------------------------*/ static int test_vec_lmsf(void) { int i; int j; float x[100]; float ya[100]; float yb[100]; float ratio; printf("Testing vec_lmsf()\n"); for (i = 0; i < 99; i++) { x[i] = rand(); ya[i] = yb[i] = rand(); } for (i = 1; i < 99; i++) { vec_lmsf(x, ya, i, 0.1f); vec_lmsf_dumb(x, yb, i, 0.1f); for (j = 0; j < i; j++) { ratio = ya[j]/yb[j]; if (ratio < 0.9999f || ratio > 1.0001f) { printf("vec_lmsf() - %d %e %e\n", j, ya[j], yb[j]); printf("Tests failed\n"); exit(2); } } } return 0; } /*- End of function --------------------------------------------------------*/ static void vec_scaledxy_addf_dumb(float z[], const float x[], float x_scale, const float y[], float y_scale, int n) { int i; for (i = 0; i < n; i++) z[i] = x[i]*x_scale + y[i]*y_scale; } /*- End of function --------------------------------------------------------*/ static int test_vec_scaledxy_addf(void) { int i; int j; float x[100]; float y[100]; float za[100]; float zb[100]; float ratio; printf("Testing vec_scaledxy_addf()\n"); for (i = 0; i < 99; i++) { x[i] = rand(); y[i] = rand(); } for (i = 1; i < 99; i++) { vec_scaledxy_addf(za, x, 2.5f, y, 1.5f, i); vec_scaledxy_addf_dumb(zb, x, 2.5f, y, 1.5f, i); for (j = 0; j < i; j++) { ratio = za[j]/zb[j]; if (ratio < 0.9999f || ratio > 1.0001f) { printf("vec_scaledxy_addf() - %d %e %e\n", j, za[j], zb[j]); printf("Tests failed\n"); exit(2); } } } return 0; } /*- End of function --------------------------------------------------------*/ static void vec_scaledy_addf_dumb(float z[], const float x[], const float y[], float y_scale, int n) { int i; for (i = 0; i < n; i++) z[i] = x[i] + y[i]*y_scale; } /*- End of function --------------------------------------------------------*/ static int test_vec_scaledy_addf(void) { int i; int j; float x[100]; float y[100]; float za[100]; float zb[100]; float ratio; printf("Testing vec_scaledy_addf()\n"); for (i = 0; i < 99; i++) { x[i] = rand(); y[i] = rand(); } for (i = 1; i < 99; i++) { vec_scaledy_addf(za, x, y, 1.5f, i); vec_scaledy_addf_dumb(zb, x, y, 1.5f, i); for (j = 0; j < i; j++) { ratio = za[j]/zb[j]; if (ratio < 0.9999f || ratio > 1.0001f) { printf("vec_scaledy_addf() - %d %e %e\n", j, za[j], zb[j]); printf("Tests failed\n"); exit(2); } } } return 0; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { test_vec_copyf(); test_vec_negatef(); test_vec_zerof(); test_vec_setf(); test_vec_addf(); test_vec_subf(); test_vec_mulf(); test_vec_scaledxy_addf(); test_vec_scaledy_addf(); test_vec_dot_prod(); test_vec_dot_prodf(); test_vec_lmsf(); printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/tsb85_tests.c0000664000175000017500000014340412350612640013612 00000000000000/* * SpanDSP - a series of DSP components for telephony * * tsb85_tests.c * * Written by Steve Underwood * * Copyright (C) 2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include #include #include #if defined(HAVE_LIBXML_XMLMEMORY_H) #include #endif #if defined(HAVE_LIBXML_PARSER_H) #include #endif #if defined(HAVE_LIBXML_XINCLUDE_H) #include #endif //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #include "fax_tester.h" #include "fax_utils.h" #define OUTPUT_TIFF_FILE_NAME "tsb85.tif" #define OUTPUT_WAVE_FILE_NAME "tsb85.wav" #define SAMPLES_PER_CHUNK 160 SNDFILE *out_handle; int use_receiver_not_ready = FALSE; int test_local_interrupt = FALSE; const char *output_tiff_file_name; int log_audio = FALSE; fax_state_t *fax; faxtester_state_t state; uint8_t image[1000000]; uint8_t awaited[1000]; int awaited_len = 0; char image_path[1024]; t30_exchanged_info_t expected_rx_info; char next_tx_file[1000]; static int timein_x = -1; static int timeout_x = -1; static int next_step(faxtester_state_t *s); static bool test_for_call_clear = false; static int call_clear_timer = 0; static bool far_end_cleared_call = false; struct { const char *tag; int code; } t30_status[] = { {"OK", T30_ERR_OK}, {"CEDTONE", T30_ERR_CEDTONE}, {"T0_EXPIRED", T30_ERR_T0_EXPIRED}, {"T1_EXPIRED", T30_ERR_T1_EXPIRED}, {"T3_EXPIRED", T30_ERR_T3_EXPIRED}, {"HDLC_CARRIER", T30_ERR_HDLC_CARRIER}, {"CANNOT_TRAIN", T30_ERR_CANNOT_TRAIN}, {"OPER_INT_FAIL", T30_ERR_OPER_INT_FAIL}, {"INCOMPATIBLE", T30_ERR_INCOMPATIBLE}, {"RX_INCAPABLE", T30_ERR_RX_INCAPABLE}, {"TX_INCAPABLE", T30_ERR_TX_INCAPABLE}, {"NORESSUPPORT", T30_ERR_NORESSUPPORT}, {"NOSIZESUPPORT", T30_ERR_NOSIZESUPPORT}, {"UNEXPECTED", T30_ERR_UNEXPECTED}, {"TX_BADDCS", T30_ERR_TX_BADDCS}, {"TX_BADPG", T30_ERR_TX_BADPG}, {"TX_ECMPHD", T30_ERR_TX_ECMPHD}, {"TX_GOTDCN", T30_ERR_TX_GOTDCN}, {"TX_INVALRSP", T30_ERR_TX_INVALRSP}, {"TX_NODIS", T30_ERR_TX_NODIS}, {"TX_PHBDEAD", T30_ERR_TX_PHBDEAD}, {"TX_PHDDEAD", T30_ERR_TX_PHDDEAD}, {"TX_T5EXP", T30_ERR_TX_T5EXP}, {"RX_ECMPHD", T30_ERR_RX_ECMPHD}, {"RX_GOTDCS", T30_ERR_RX_GOTDCS}, {"RX_INVALCMD", T30_ERR_RX_INVALCMD}, {"RX_NOCARRIER", T30_ERR_RX_NOCARRIER}, {"RX_NOEOL", T30_ERR_RX_NOEOL}, {"RX_NOFAX", T30_ERR_RX_NOFAX}, {"RX_T2EXPDCN", T30_ERR_RX_T2EXPDCN}, {"RX_T2EXPD", T30_ERR_RX_T2EXPD}, {"RX_T2EXPFAX", T30_ERR_RX_T2EXPFAX}, {"RX_T2EXPMPS", T30_ERR_RX_T2EXPMPS}, {"RX_T2EXPRR", T30_ERR_RX_T2EXPRR}, {"RX_T2EXP", T30_ERR_RX_T2EXP}, {"RX_DCNWHY", T30_ERR_RX_DCNWHY}, {"RX_DCNDATA", T30_ERR_RX_DCNDATA}, {"RX_DCNFAX", T30_ERR_RX_DCNFAX}, {"RX_DCNPHD", T30_ERR_RX_DCNPHD}, {"RX_DCNRRD", T30_ERR_RX_DCNRRD}, {"RX_DCNNORTN", T30_ERR_RX_DCNNORTN}, {"FILEERROR", T30_ERR_FILEERROR}, {"NOPAGE", T30_ERR_NOPAGE}, {"BADTIFF", T30_ERR_BADTIFF}, {"BADPAGE", T30_ERR_BADPAGE}, {"BADTAG", T30_ERR_BADTAG}, {"BADTIFFHDR", T30_ERR_BADTIFFHDR}, {"NOMEM", T30_ERR_NOMEM}, {"RETRYDCN", T30_ERR_RETRYDCN}, {"CALLDROPPED", T30_ERR_CALLDROPPED}, {"NOPOLL", T30_ERR_NOPOLL}, {"IDENT_UNACCEPTABLE", T30_ERR_IDENT_UNACCEPTABLE}, {"SUB_UNACCEPTABLE", T30_ERR_SUB_UNACCEPTABLE}, {"SEP_UNACCEPTABLE", T30_ERR_SEP_UNACCEPTABLE}, {"PSA_UNACCEPTABLE", T30_ERR_PSA_UNACCEPTABLE}, {"SID_UNACCEPTABLE", T30_ERR_SID_UNACCEPTABLE}, {"PWD_UNACCEPTABLE", T30_ERR_PWD_UNACCEPTABLE}, {"TSA_UNACCEPTABLE", T30_ERR_TSA_UNACCEPTABLE}, {"IRA_UNACCEPTABLE", T30_ERR_IRA_UNACCEPTABLE}, {"CIA_UNACCEPTABLE", T30_ERR_CIA_UNACCEPTABLE}, {"ISP_UNACCEPTABLE", T30_ERR_ISP_UNACCEPTABLE}, {"CSA_UNACCEPTABLE", T30_ERR_CSA_UNACCEPTABLE}, {NULL, -1} }; static int phase_b_handler(t30_state_t *s, void *user_data, int result) { int i; int status; const char *u; i = (intptr_t) user_data; status = T30_ERR_OK; if ((u = t30_get_rx_ident(s))) { printf("%c: Phase B: remote ident '%s'\n", i, u); if (expected_rx_info.ident[0] && strcmp(expected_rx_info.ident, u)) { printf("%c: Phase B: remote ident incorrect! - expected '%s'\n", i, expected_rx_info.ident); status = T30_ERR_IDENT_UNACCEPTABLE; } } else { if (expected_rx_info.ident[0]) { printf("%c: Phase B: remote ident missing!\n", i); status = T30_ERR_IDENT_UNACCEPTABLE; } } if ((u = t30_get_rx_sub_address(s))) { printf("%c: Phase B: remote sub-address '%s'\n", i, u); if (expected_rx_info.sub_address[0] && strcmp(expected_rx_info.sub_address, u)) { printf("%c: Phase B: remote sub-address incorrect! - expected '%s'\n", i, expected_rx_info.sub_address); status = T30_ERR_SUB_UNACCEPTABLE; } } else { if (expected_rx_info.sub_address[0]) { printf("%c: Phase B: remote sub-address missing!\n", i); status = T30_ERR_SUB_UNACCEPTABLE; } } if ((u = t30_get_rx_polled_sub_address(s))) { printf("%c: Phase B: remote polled sub-address '%s'\n", i, u); if (expected_rx_info.polled_sub_address[0] && strcmp(expected_rx_info.polled_sub_address, u)) { printf("%c: Phase B: remote polled sub-address incorrect! - expected '%s'\n", i, expected_rx_info.polled_sub_address); status = T30_ERR_PSA_UNACCEPTABLE; } } else { if (expected_rx_info.polled_sub_address[0]) { printf("%c: Phase B: remote polled sub-address missing!\n", i); status = T30_ERR_PSA_UNACCEPTABLE; } } if ((u = t30_get_rx_selective_polling_address(s))) { printf("%c: Phase B: remote selective polling address '%s'\n", i, u); if (expected_rx_info.selective_polling_address[0] && strcmp(expected_rx_info.selective_polling_address, u)) { printf("%c: Phase B: remote selective polling address incorrect! - expected '%s'\n", i, expected_rx_info.selective_polling_address); status = T30_ERR_SEP_UNACCEPTABLE; } } else { if (expected_rx_info.selective_polling_address[0]) { printf("%c: Phase B: remote selective polling address missing!\n", i); status = T30_ERR_SEP_UNACCEPTABLE; } } if ((u = t30_get_rx_sender_ident(s))) { printf("%c: Phase B: remote sender ident '%s'\n", i, u); if (expected_rx_info.sender_ident[0] && strcmp(expected_rx_info.sender_ident, u)) { printf("%c: Phase B: remote sender ident incorrect! - expected '%s'\n", i, expected_rx_info.sender_ident); status = T30_ERR_SID_UNACCEPTABLE; } } else { if (expected_rx_info.sender_ident[0]) { printf("%c: Phase B: remote sender ident missing!\n", i); status = T30_ERR_SID_UNACCEPTABLE; } } if ((u = t30_get_rx_password(s))) { printf("%c: Phase B: remote password '%s'\n", i, u); if (expected_rx_info.password[0] && strcmp(expected_rx_info.password, u)) { printf("%c: Phase B: remote password incorrect! - expected '%s'\n", i, expected_rx_info.password); status = T30_ERR_PWD_UNACCEPTABLE; } } else { if (expected_rx_info.password[0]) { printf("%c: Phase B: remote password missing!\n", i); status = T30_ERR_PWD_UNACCEPTABLE; } } printf("%c: Phase B handler on channel %d - (0x%X) %s\n", i, i, result, t30_frametype(result)); return status; } /*- End of function --------------------------------------------------------*/ static int phase_d_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; i = (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase D", i); printf("%c: Phase D handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result)); fax_log_page_transfer_statistics(s, tag); fax_log_tx_parameters(s, tag); fax_log_rx_parameters(s, tag); if (use_receiver_not_ready) t30_set_receiver_not_ready(s, 3); if (test_local_interrupt) { if (i == 'A') { printf("%c: Initiating interrupt request\n", i); t30_local_interrupt_request(s, TRUE); } else { switch (result) { case T30_PIP: case T30_PRI_MPS: case T30_PRI_EOM: case T30_PRI_EOP: printf("%c: Accepting interrupt request\n", i); t30_local_interrupt_request(s, TRUE); break; case T30_PIN: break; } } } return T30_ERR_OK; } /*- End of function --------------------------------------------------------*/ static void phase_e_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; i = (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase E", i); printf("%c: Phase E handler on channel %c - (%d) %s\n", i, i, result, t30_completion_code_to_str(result)); fax_log_final_transfer_statistics(s, tag); fax_log_tx_parameters(s, tag); fax_log_rx_parameters(s, tag); } /*- End of function --------------------------------------------------------*/ static void t30_real_time_frame_handler(t30_state_t *s, void *user_data, int direction, const uint8_t *msg, int len) { if (msg == NULL) { } else { fprintf(stderr, "T.30: Real time frame handler - %s, %s, length = %d\n", (direction) ? "line->T.30" : "T.30->line", t30_frametype(msg[2]), len); } } /*- End of function --------------------------------------------------------*/ static int document_handler(t30_state_t *s, void *user_data, int event) { int i; i = (intptr_t) user_data; fprintf(stderr, "%c: Document handler on channel %c - event %d\n", i, i, event); if (next_tx_file[0]) { t30_set_tx_file(s, next_tx_file, -1, -1); next_tx_file[0] = '\0'; return TRUE; } return FALSE; } /*- End of function --------------------------------------------------------*/ static void faxtester_real_time_frame_handler(faxtester_state_t *s, void *user_data, int direction, const uint8_t *msg, int len) { if (msg == NULL) { while (next_step(s) == 0) ; /*endwhile*/ } else { fprintf(stderr, "TST: Real time frame handler - %s, %s, length = %d\n", (direction) ? "line->tester" : "tester->line", t30_frametype(msg[2]), len); if (direction && msg[1] == awaited[1]) { if ((awaited_len >= 0 && len != abs(awaited_len)) || (awaited_len < 0 && len < abs(awaited_len)) || memcmp(msg, awaited, abs(awaited_len)) != 0) { span_log_buf(&s->logging, SPAN_LOG_FLOW, "Expected", awaited, abs(awaited_len)); span_log_buf(&s->logging, SPAN_LOG_FLOW, "Received", msg, len); printf("Test failed\n"); exit(2); } } if (msg[1] == awaited[1]) { while (next_step(s) == 0) ; /*endwhile*/ } } } /*- End of function --------------------------------------------------------*/ static void faxtester_front_end_step_complete_handler(faxtester_state_t *s, void *user_data) { while (next_step(s) == 0) ; /*endwhile*/ } /*- End of function --------------------------------------------------------*/ static void faxtester_front_end_step_timeout_handler(faxtester_state_t *s, void *user_data) { span_log(&s->logging, SPAN_LOG_FLOW, "FAX tester step timed out\n"); printf("Test failed\n"); exit(2); } /*- End of function --------------------------------------------------------*/ static void fax_prepare(void) { t30_state_t *t30; logging_state_t *logging; t30 = fax_get_t30_state(fax); fax_set_transmit_on_idle(fax, TRUE); fax_set_tep_mode(fax, TRUE); #if 0 t30_set_tx_ident(t30, "1234567890"); t30_set_tx_sub_address(t30, "Sub-address"); t30_set_tx_sender_ident(t30, "Sender ID"); t30_set_tx_password(t30, "Password"); t30_set_tx_polled_sub_address(t30, "Polled sub-address"); t30_set_tx_selective_polling_address(t30, "Sel polling address"); #endif t30_set_tx_nsf(t30, (const uint8_t *) "\x50\x00\x00\x00Spandsp NSF\x00", 16); //t30_set_tx_nss(t30, (const uint8_t *) "\x50\x00\x00\x00Spandsp NSS\x00", 16); t30_set_tx_nsc(t30, (const uint8_t *) "\x50\x00\x00\x00Spandsp NSC\x00", 16); t30_set_ecm_capability(t30, TRUE); t30_set_supported_t30_features(t30, T30_SUPPORT_IDENTIFICATION | T30_SUPPORT_SELECTIVE_POLLING | T30_SUPPORT_SUB_ADDRESSING); t30_set_supported_image_sizes(t30, T30_SUPPORT_US_LETTER_LENGTH | T30_SUPPORT_US_LEGAL_LENGTH | T30_SUPPORT_UNLIMITED_LENGTH | T30_SUPPORT_215MM_WIDTH | T30_SUPPORT_255MM_WIDTH | T30_SUPPORT_303MM_WIDTH); t30_set_supported_resolutions(t30, T30_SUPPORT_STANDARD_RESOLUTION | T30_SUPPORT_FINE_RESOLUTION | T30_SUPPORT_SUPERFINE_RESOLUTION | T30_SUPPORT_R8_RESOLUTION | T30_SUPPORT_R16_RESOLUTION | T30_SUPPORT_300_300_RESOLUTION | T30_SUPPORT_400_400_RESOLUTION | T30_SUPPORT_600_600_RESOLUTION | T30_SUPPORT_1200_1200_RESOLUTION | T30_SUPPORT_300_600_RESOLUTION | T30_SUPPORT_400_800_RESOLUTION | T30_SUPPORT_600_1200_RESOLUTION); t30_set_supported_modems(t30, T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17); t30_set_supported_compressions(t30, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION); t30_set_phase_b_handler(t30, phase_b_handler, (void *) (intptr_t) 'A'); t30_set_phase_d_handler(t30, phase_d_handler, (void *) (intptr_t) 'A'); t30_set_phase_e_handler(t30, phase_e_handler, (void *) (intptr_t) 'A'); t30_set_real_time_frame_handler(t30, t30_real_time_frame_handler, (void *) (intptr_t) 'A'); t30_set_document_handler(t30, document_handler, (void *) (intptr_t) 'A'); logging = fax_get_logging_state(fax); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW); span_log_set_tag(logging, "A"); logging = t30_get_logging_state(t30); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW); span_log_set_tag(logging, "A"); #if 0 span_log_set_level(&fax.modems.v27ter_rx.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW); span_log_set_tag(&fax.modems.v27ter_rx.logging, "A"); span_log_set_level(&fax.modems.v29_rx.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW); span_log_set_tag(&fax.modems.v29_rx.logging, "A"); span_log_set_level(&fax.modems.v17_rx.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW); span_log_set_tag(&fax.modems.v17_rx.logging, "A"); #endif } /*- End of function --------------------------------------------------------*/ static int string_to_msg(uint8_t msg[], uint8_t mask[], const char buf[]) { int i; int x; const char *t; msg[0] = 0; mask[0] = 0xFF; i = 0; t = (char *) buf; while (*t) { /* Skip white space */ while (isspace((int) *t)) t++; /* If we find ... we allow arbitrary addition info beyond this point in the message */ if (t[0] == '.' && t[1] == '.' && t[2] == '.') { return -i; } else if (isxdigit((int) *t)) { for ( ; isxdigit((int) *t); t++) { x = *t; if (x >= 'a') x -= 0x20; if (x >= 'A') x -= ('A' - 10); else x -= '0'; msg[i] = (msg[i] << 4) | x; } mask[i] = 0xFF; if (*t == '/') { /* There is a mask following the byte */ mask[i] = 0; for (t++; isxdigit((int) *t); t++) { x = *t; if (x >= 'a') x -= 0x20; if (x >= 'A') x -= ('A' - 10); else x -= '0'; mask[i] = (mask[i] << 4) | x; } } if (*t && !isspace((int) *t)) { /* Bad string */ return 0; } i++; } } return i; } /*- End of function --------------------------------------------------------*/ #if 0 static void string_test2(const uint8_t msg[], int len) { int i; if (len > 0) { for (i = 0; i < len - 1; i++) printf("%02X ", msg[i]); printf("%02X", msg[i]); } } /*- End of function --------------------------------------------------------*/ static void string_test3(const char buf[]) { uint8_t msg[1000]; uint8_t mask[1000]; int len; int i; len = string_to_msg(msg, mask, buf); printf("Len = %d: ", len); string_test2(msg, abs(len)); printf("/"); string_test2(mask, abs(len)); printf("\n"); } /*- End of function --------------------------------------------------------*/ static int string_test(void) { string_test3("FF C8 12 34 56 78"); string_test3("FF C8 12/55 34 56/aA 78 "); string_test3("FF C8 12/55 34 56/aA 78 ..."); string_test3("FF C8 12/55 34 56/aA 78..."); string_test3("FF C8 12/55 34 56/aA 78 ... 99 88 77"); exit(0); } /*- End of function --------------------------------------------------------*/ #endif static void corrupt_image(faxtester_state_t *s, uint8_t image[], int len, const char *bad_rows) { int i; int j; int k; uint32_t bits; uint32_t bitsx; int list[1000]; int x; int row; const char *t; /* Form the list of rows to be hit */ x = 0; t = bad_rows; while (*t) { while (isspace((int) *t)) t++; if (sscanf(t, "%d", &list[x]) < 1) break; x++; while (isdigit((int) *t)) t++; if (*t == ',') t++; } /* Go through the image, and corrupt the first bit of every listed row */ bits = 0x7FF; bitsx = 0x7FF; row = 0; for (i = 0; i < len; i++) { bits ^= (image[i] << 11); bitsx ^= (image[i] << 11); for (j = 0; j < 8; j++) { if ((bits & 0xFFF) == 0x800) { /* We are at an EOL. Is this row in the list of rows to be corrupted? */ row++; for (k = 0; k < x; k++) { if (list[k] == row) { /* Corrupt this row. TSB85 says to hit the first bit after the EOL */ bitsx ^= 0x1000; } } } bits >>= 1; bitsx >>= 1; } image[i] = (bitsx >> 3) & 0xFF; } span_log(&s->logging, SPAN_LOG_FLOW, "%d rows found. %d corrupted\n", row, x); } /*- End of function --------------------------------------------------------*/ static int next_step(faxtester_state_t *s) { int delay; int flags; xmlChar *dir; xmlChar *type; xmlChar *modem; xmlChar *value; xmlChar *tag; xmlChar *bad_rows; xmlChar *crc_error; xmlChar *pattern; xmlChar *timein; xmlChar *timeout; xmlChar *min_bits; xmlChar *frame_size; xmlChar *block; xmlChar *compression; uint8_t buf[1000]; uint8_t mask[1000]; char path[1024]; int i; int j; int hdlc; int short_train; int min_row_bits; int ecm_frame_size; int ecm_block; int compression_type; int len; t4_tx_state_t t4_tx_state; t30_state_t *t30; t30_stats_t t30_stats; test_for_call_clear = false; if (s->cur == NULL) { if (!s->final_delayed) { /* Add a bit of waiting at the end, to ensure everything gets flushed through, any timers can expire, etc. */ faxtester_set_timeout(s, -1); faxtester_set_rx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE); faxtester_set_tx_type(s, T30_MODEM_PAUSE, 0, 120000, FALSE); s->final_delayed = TRUE; return 1; } /* Finished */ printf("Test passed\n"); exit(0); } while (s->cur && xmlStrcmp(s->cur->name, (const xmlChar *) "step") != 0) s->cur = s->cur->next; if (s->cur == NULL) { /* Finished */ printf("Test passed\n"); exit(0); } dir = xmlGetProp(s->cur, (const xmlChar *) "dir"); type = xmlGetProp(s->cur, (const xmlChar *) "type"); modem = xmlGetProp(s->cur, (const xmlChar *) "modem"); value = xmlGetProp(s->cur, (const xmlChar *) "value"); tag = xmlGetProp(s->cur, (const xmlChar *) "tag"); bad_rows = xmlGetProp(s->cur, (const xmlChar *) "bad_rows"); crc_error = xmlGetProp(s->cur, (const xmlChar *) "crc_error"); pattern = xmlGetProp(s->cur, (const xmlChar *) "pattern"); timein = xmlGetProp(s->cur, (const xmlChar *) "timein"); timeout = xmlGetProp(s->cur, (const xmlChar *) "timeout"); min_bits = xmlGetProp(s->cur, (const xmlChar *) "min_bits"); frame_size = xmlGetProp(s->cur, (const xmlChar *) "frame_size"); block = xmlGetProp(s->cur, (const xmlChar *) "block"); compression = xmlGetProp(s->cur, (const xmlChar *) "compression"); s->cur = s->cur->next; span_log(&s->logging, SPAN_LOG_FLOW, "Dir - %s, type - %s, modem - %s, value - %s, timein - %s, timeout - %s, tag - %s\n", (dir) ? (const char *) dir : "", (type) ? (const char *) type : "", (modem) ? (const char *) modem : "", (value) ? (const char *) value : "", (timein) ? (const char *) timein : "", (timeout) ? (const char *) timeout : "", (tag) ? (const char *) tag : ""); if (type == NULL) return 1; if (timein) timein_x = atoi((const char *) timein); else timein_x = -1; if (timeout) timeout_x = atoi((const char *) timeout); else timeout_x = -1; if (dir && strcasecmp((const char *) dir, "R") == 0) { /* Receive always has a timeout applied. */ if (timeout_x < 0) timeout_x = 7000; faxtester_set_timeout(s, timeout_x); if (modem) { hdlc = (strcasecmp((const char *) type, "PREAMBLE") == 0); short_train = (strcasecmp((const char *) type, "TCF") != 0); faxtester_set_tx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE); if (strcasecmp((const char *) modem, "V.21") == 0) { faxtester_set_rx_type(s, T30_MODEM_V21, 300, FALSE, TRUE); } else if (strcasecmp((const char *) modem, "V.17/14400") == 0) { faxtester_set_rx_type(s, T30_MODEM_V17, 14400, short_train, hdlc); } else if (strcasecmp((const char *) modem, "V.17/12000") == 0) { faxtester_set_rx_type(s, T30_MODEM_V17, 12000, short_train, hdlc); } else if (strcasecmp((const char *) modem, "V.17/9600") == 0) { faxtester_set_rx_type(s, T30_MODEM_V17, 9600, short_train, hdlc); } else if (strcasecmp((const char *) modem, "V.17/7200") == 0) { faxtester_set_rx_type(s, T30_MODEM_V17, 7200, short_train, hdlc); } else if (strcasecmp((const char *) modem, "V.29/9600") == 0) { faxtester_set_rx_type(s, T30_MODEM_V29, 9600, FALSE, hdlc); } else if (strcasecmp((const char *) modem, "V.29/7200") == 0) { faxtester_set_rx_type(s, T30_MODEM_V29, 7200, FALSE, hdlc); } else if (strcasecmp((const char *) modem, "V.27ter/4800") == 0) { faxtester_set_rx_type(s, T30_MODEM_V27TER, 4800, FALSE, hdlc); } else if (strcasecmp((const char *) modem, "V.27ter/2400") == 0) { faxtester_set_rx_type(s, T30_MODEM_V27TER, 2400, FALSE, hdlc); } else { span_log(&s->logging, SPAN_LOG_FLOW, "Unrecognised modem\n"); } } if (strcasecmp((const char *) type, "SET") == 0) { if (strcasecmp((const char *) tag, "IDENT") == 0) strcpy(expected_rx_info.ident, (const char *) value); else if (strcasecmp((const char *) tag, "SUB") == 0) strcpy(expected_rx_info.sub_address, (const char *) value); else if (strcasecmp((const char *) tag, "SEP") == 0) strcpy(expected_rx_info.selective_polling_address, (const char *) value); else if (strcasecmp((const char *) tag, "PSA") == 0) strcpy(expected_rx_info.polled_sub_address, (const char *) value); else if (strcasecmp((const char *) tag, "SID") == 0) strcpy(expected_rx_info.sender_ident, (const char *) value); else if (strcasecmp((const char *) tag, "PWD") == 0) strcpy(expected_rx_info.password, (const char *) value); return 0; } else if (strcasecmp((const char *) type, "CNG") == 0) { /* Look for CNG */ faxtester_set_rx_type(s, T30_MODEM_CNG, 0, FALSE, FALSE); faxtester_set_tx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE); } else if (strcasecmp((const char *) type, "CED") == 0) { /* Look for CED */ faxtester_set_rx_type(s, T30_MODEM_CED, 0, FALSE, FALSE); faxtester_set_tx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE); } else if (strcasecmp((const char *) type, "HDLC") == 0) { i = string_to_msg(buf, mask, (const char *) value); bit_reverse(awaited, buf, abs(i)); awaited_len = i; } else if (strcasecmp((const char *) type, "TCF") == 0) { } else if (strcasecmp((const char *) type, "MSG") == 0) { } else if (strcasecmp((const char *) type, "PP") == 0) { } else if (strcasecmp((const char *) type, "SILENCE") == 0) { faxtest_set_rx_silence(s); } else if (strcasecmp((const char *) type, "CLEAR") == 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Far end should drop the call\n"); test_for_call_clear = true; call_clear_timer = 0; } else { span_log(&s->logging, SPAN_LOG_FLOW, "Unrecognised type '%s'\n", (const char *) type); return 0; } } else { faxtester_set_timeout(s, timeout_x); if (modem) { hdlc = (strcasecmp((const char *) type, "PREAMBLE") == 0); short_train = (strcasecmp((const char *) type, "TCF") != 0); faxtester_set_rx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE); if (strcasecmp((const char *) modem, "V.21") == 0) { faxtester_set_tx_type(s, T30_MODEM_V21, 300, FALSE, TRUE); } else if (strcasecmp((const char *) modem, "V.17/14400") == 0) { faxtester_set_tx_type(s, T30_MODEM_V17, 14400, short_train, hdlc); } else if (strcasecmp((const char *) modem, "V.17/12000") == 0) { faxtester_set_tx_type(s, T30_MODEM_V17, 12000, short_train, hdlc); } else if (strcasecmp((const char *) modem, "V.17/9600") == 0) { faxtester_set_tx_type(s, T30_MODEM_V17, 9600, short_train, hdlc); } else if (strcasecmp((const char *) modem, "V.17/7200") == 0) { faxtester_set_tx_type(s, T30_MODEM_V17, 7200, short_train, hdlc); } else if (strcasecmp((const char *) modem, "V.29/9600") == 0) { faxtester_set_tx_type(s, T30_MODEM_V29, 9600, FALSE, hdlc); } else if (strcasecmp((const char *) modem, "V.29/7200") == 0) { faxtester_set_tx_type(s, T30_MODEM_V29, 7200, FALSE, hdlc); } else if (strcasecmp((const char *) modem, "V.27ter/4800") == 0) { faxtester_set_tx_type(s, T30_MODEM_V27TER, 4800, FALSE, hdlc); } else if (strcasecmp((const char *) modem, "V.27ter/2400") == 0) { faxtester_set_tx_type(s, T30_MODEM_V27TER, 2400, FALSE, hdlc); } else { span_log(&s->logging, SPAN_LOG_FLOW, "Unrecognised modem\n"); } } if (strcasecmp((const char *) type, "SET") == 0) { t30 = fax_get_t30_state(fax); if (strcasecmp((const char *) tag, "IDENT") == 0) t30_set_tx_ident(t30, (const char *) value); else if (strcasecmp((const char *) tag, "SUB") == 0) t30_set_tx_sub_address(t30, (const char *) value); else if (strcasecmp((const char *) tag, "SEP") == 0) t30_set_tx_selective_polling_address(t30, (const char *) value); else if (strcasecmp((const char *) tag, "PSA") == 0) t30_set_tx_polled_sub_address(t30, (const char *) value); else if (strcasecmp((const char *) tag, "SID") == 0) t30_set_tx_sender_ident(t30, (const char *) value); else if (strcasecmp((const char *) tag, "PWD") == 0) t30_set_tx_password(t30, (const char *) value); else if (strcasecmp((const char *) tag, "RXFILE") == 0) { if (value) t30_set_rx_file(t30, (const char *) value, -1); else t30_set_rx_file(t30, output_tiff_file_name, -1); } else if (strcasecmp((const char *) tag, "TXFILE") == 0) { sprintf(next_tx_file, "%s/%s", image_path, (const char *) value); printf("Push '%s'\n", next_tx_file); } return 0; } else if (strcasecmp((const char *) type, "CALL") == 0) { fax = fax_init(NULL, FALSE); fax_prepare(); next_tx_file[0] = '\0'; t30 = fax_get_t30_state(fax); t30_set_rx_file(t30, output_tiff_file_name, -1); /* Avoid libtiff 3.8.2 and earlier bug on complex 2D lines. */ t30_set_rx_encoding(t30, T4_COMPRESSION_ITU_T4_1D); if (value) { sprintf(path, "%s/%s", image_path, (const char *) value); t30_set_tx_file(t30, path, -1, -1); } return 0; } else if (strcasecmp((const char *) type, "ANSWER") == 0) { fax = fax_init(NULL, TRUE); fax_prepare(); next_tx_file[0] = '\0'; t30 = fax_get_t30_state(fax); /* Avoid libtiff 3.8.2 and earlier bug on complex 2D lines. */ t30_set_rx_encoding(t30, T4_COMPRESSION_ITU_T4_1D); if (value) { sprintf(path, "%s/%s", image_path, (const char *) value); t30_set_tx_file(t30, path, -1, -1); } return 0; } else if (strcasecmp((const char *) type, "CNG") == 0) { faxtester_set_rx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE); faxtester_set_tx_type(s, T30_MODEM_CNG, 0, FALSE, FALSE); } else if (strcasecmp((const char *) type, "CED") == 0) { faxtester_set_rx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE); faxtester_set_tx_type(s, T30_MODEM_CED, 0, FALSE, FALSE); } else if (strcasecmp((const char *) type, "WAIT") == 0) { delay = (value) ? atoi((const char *) value) : 1; faxtester_set_rx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE); faxtester_set_tx_type(s, T30_MODEM_PAUSE, 0, delay, FALSE); } else if (strcasecmp((const char *) type, "PREAMBLE") == 0) { flags = (value) ? atoi((const char *) value) : 37; faxtester_send_hdlc_flags(s, flags); } else if (strcasecmp((const char *) type, "POSTAMBLE") == 0) { flags = (value) ? atoi((const char *) value) : 5; faxtester_send_hdlc_flags(s, flags); } else if (strcasecmp((const char *) type, "HDLC") == 0) { i = string_to_msg(buf, mask, (const char *) value); bit_reverse(buf, buf, abs(i)); if (crc_error && strcasecmp((const char *) crc_error, "0") == 0) faxtester_send_hdlc_msg(s, buf, abs(i), FALSE); else faxtester_send_hdlc_msg(s, buf, abs(i), TRUE); } else if (strcasecmp((const char *) type, "TCF") == 0) { if (value) i = atoi((const char *) value); else i = 450; if (pattern) { /* TODO: implement proper patterns */ j = atoi((const char *) pattern); memset(image, 0x55, j); if (i > j) memset(image + j, 0, i - j); } else { memset(image, 0, i); } faxtester_set_non_ecm_image_buffer(s, image, i); } else if (strcasecmp((const char *) type, "MSG") == 0) { /* A non-ECM page */ min_row_bits = (min_bits) ? atoi((const char *) min_bits) : 0; sprintf(path, "%s/%s", image_path, (const char *) value); if (t4_tx_init(&t4_tx_state, path, -1, -1) == NULL) { span_log(&s->logging, SPAN_LOG_FLOW, "Failed to init T.4 send\n"); printf("Test failed\n"); exit(2); } t4_tx_set_min_bits_per_row(&t4_tx_state, min_row_bits); t4_tx_set_header_info(&t4_tx_state, NULL); compression_type = T4_COMPRESSION_ITU_T4_1D; if (compression) { if (strcasecmp((const char *) compression, "T.4 2D") == 0) compression_type = T4_COMPRESSION_ITU_T4_2D; else if (strcasecmp((const char *) compression, "T.6") == 0) compression_type = T4_COMPRESSION_ITU_T6; } t4_tx_set_tx_encoding(&t4_tx_state, compression_type); if (t4_tx_start_page(&t4_tx_state)) { span_log(&s->logging, SPAN_LOG_FLOW, "Failed to start T.4 send\n"); printf("Test failed\n"); exit(2); } len = t4_tx_get_chunk(&t4_tx_state, image, sizeof(image)); if (bad_rows) { span_log(&s->logging, SPAN_LOG_FLOW, "We need to corrupt the image\n"); corrupt_image(s, image, len, (const char *) bad_rows); } t4_tx_release(&t4_tx_state); span_log(&s->logging, SPAN_LOG_FLOW, "Non-ECM image is %d bytes\n", len); faxtester_set_non_ecm_image_buffer(s, image, len); } else if (strcasecmp((const char *) type, "PP") == 0) { min_row_bits = (min_bits) ? atoi((const char *) min_bits) : 0; ecm_block = (block) ? atoi((const char *) block) : 0; ecm_frame_size = (frame_size) ? atoi((const char *) frame_size) : 64; i = (crc_error) ? atoi((const char *) crc_error) : -1; sprintf(path, "%s/%s", image_path, (const char *) value); if (t4_tx_init(&t4_tx_state, path, -1, -1) == NULL) { span_log(&s->logging, SPAN_LOG_FLOW, "Failed to init T.4 send\n"); printf("Test failed\n"); exit(2); } t4_tx_set_min_bits_per_row(&t4_tx_state, min_row_bits); t4_tx_set_header_info(&t4_tx_state, NULL); compression_type = T4_COMPRESSION_ITU_T4_1D; if (compression) { if (strcasecmp((const char *) compression, "T.4 2D") == 0) compression_type = T4_COMPRESSION_ITU_T4_2D; else if (strcasecmp((const char *) compression, "T.6") == 0) compression_type = T4_COMPRESSION_ITU_T6; } t4_tx_set_tx_encoding(&t4_tx_state, compression_type); if (t4_tx_start_page(&t4_tx_state)) { span_log(&s->logging, SPAN_LOG_FLOW, "Failed to start T.4 send\n"); printf("Test failed\n"); exit(2); } /*endif*/ len = t4_tx_get_chunk(&t4_tx_state, image, sizeof(image)); if (bad_rows) { span_log(&s->logging, SPAN_LOG_FLOW, "We need to corrupt the image\n"); corrupt_image(s, image, len, (const char *) bad_rows); } /*endif*/ t4_tx_release(&t4_tx_state); span_log(&s->logging, SPAN_LOG_FLOW, "ECM image is %d bytes\n", len); faxtester_set_ecm_image_buffer(s, image, len, ecm_block, ecm_frame_size, i); } else if (strcasecmp((const char *) type, "CLEAR") == 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Time to drop the call\n"); t30 = fax_get_t30_state(fax); t30_terminate(t30); return 0; } else if (strcasecmp((const char *) type, "STATUS") == 0) { if (value) { for (i = 0; t30_status[i].code >= 0; i++) { if (strcmp(t30_status[i].tag, (const char *) value) == 0) break; } if (t30_status[i].code >= 0) delay = t30_status[i].code; else delay = atoi((const char *) value); t30 = fax_get_t30_state(fax); t30_get_transfer_statistics(t30, &t30_stats); span_log(&s->logging, SPAN_LOG_FLOW, "Expect status %d. Got %d\n", delay, t30_stats.current_status); if (delay != t30_stats.current_status) { printf("Test failed\n"); exit(2); } } return 0; } else { span_log(&s->logging, SPAN_LOG_FLOW, "Unrecognised type '%s'\n", (const char *) type); return 0; } /*endif*/ } /*endif*/ return 1; } /*- End of function --------------------------------------------------------*/ static void exchange(faxtester_state_t *s) { int16_t amp[SAMPLES_PER_CHUNK]; int16_t out_amp[2*SAMPLES_PER_CHUNK]; int len; int i; int total_audio_time; logging_state_t *logging; output_tiff_file_name = OUTPUT_TIFF_FILE_NAME; if (log_audio) { if ((out_handle = sf_open_telephony_write(OUTPUT_WAVE_FILE_NAME, 2)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUTPUT_WAVE_FILE_NAME); printf("Test failed\n"); exit(2); } /*endif*/ } /*endif*/ total_audio_time = 0; faxtester_set_transmit_on_idle(&state, TRUE); faxtester_set_real_time_frame_handler(&state, faxtester_real_time_frame_handler, NULL); faxtester_set_front_end_step_complete_handler(&state, faxtester_front_end_step_complete_handler, NULL); faxtester_set_front_end_step_timeout_handler(&state, faxtester_front_end_step_timeout_handler, NULL); fax = fax_init(NULL, FALSE); fax_prepare(); next_tx_file[0] = '\0'; while (next_step(s) == 0) ; /*endwhile*/ for (;;) { len = fax_tx(fax, amp, SAMPLES_PER_CHUNK); faxtester_rx(s, amp, len); if (log_audio) { for (i = 0; i < len; i++) out_amp[2*i + 0] = amp[i]; /*endfor*/ } /*endif*/ total_audio_time += SAMPLES_PER_CHUNK; logging = t30_get_logging_state(fax_get_t30_state(fax)); span_log_bump_samples(logging, len); #if 0 span_log_bump_samples(&fax.modems.v27ter_rx.logging, len); span_log_bump_samples(&fax.modems.v29_rx.logging, len); span_log_bump_samples(&fax.modems.v17_rx.logging, len); #endif logging = fax_get_logging_state(fax); span_log_bump_samples(logging, len); span_log_bump_samples(&s->logging, len); len = faxtester_tx(s, amp, SAMPLES_PER_CHUNK); if (fax_rx(fax, amp, len)) break; /*endif*/ if (log_audio) { for (i = 0; i < len; i++) out_amp[2*i + 1] = amp[i]; /*endfor*/ if (sf_writef_short(out_handle, out_amp, SAMPLES_PER_CHUNK) != SAMPLES_PER_CHUNK) break; /*endif*/ } /*endif*/ if (test_for_call_clear && !far_end_cleared_call) { call_clear_timer += len; if (!t30_call_active(fax_get_t30_state(fax))) { span_log(&s->logging, SPAN_LOG_FLOW, "Far end cleared after %dms (limits %dms to %dms)\n", call_clear_timer/8, timein_x, timeout_x); if (call_clear_timer/8 < timein_x || call_clear_timer/8 > timeout_x) { printf("Test failed\n"); exit(2); } span_log(&s->logging, SPAN_LOG_FLOW, "Clear time OK\n"); far_end_cleared_call = true; test_for_call_clear = false; while (next_step(s) == 0) ; /*endwhile*/ } /*endif*/ } /*endif*/ } /*endfor*/ if (log_audio) { if (sf_close_telephony(out_handle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_WAVE_FILE_NAME); printf("Test failed\n"); exit(2); } /*endif*/ } /*endif*/ } /*- End of function --------------------------------------------------------*/ static int parse_config(faxtester_state_t *s, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { xmlChar *x; xmlChar *y; while (cur) { if (xmlStrcmp(cur->name, (const xmlChar *) "path") == 0) { if ((x = xmlGetProp(cur, (const xmlChar *) "type")) && (y = xmlGetProp(cur, (const xmlChar *) "value"))) { if (strcasecmp((const char *) x, "IMAGE") == 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Found '%s' '%s'\n", (char *) x, (char *) y); strcpy(image_path, (const char *) y); } /*endif*/ } /*endif*/ } /*endif*/ cur = cur->next; } /*endwhile*/ return -1; } /*- End of function --------------------------------------------------------*/ static int parse_test_group(faxtester_state_t *s, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur, const char *test) { xmlChar *x; while (cur) { if (xmlStrcmp(cur->name, (const xmlChar *) "test") == 0) { if ((x = xmlGetProp(cur, (const xmlChar *) "name"))) { if (xmlStrcmp(x, (const xmlChar *) test) == 0) { span_log(&s->logging, SPAN_LOG_FLOW, "Found '%s'\n", (char *) x); s->cur = cur->xmlChildrenNode; return 0; } /*endif*/ } /*endif*/ } /*endif*/ cur = cur->next; } /*endwhile*/ return -1; } /*- End of function --------------------------------------------------------*/ static int get_test_set(faxtester_state_t *s, const char *test_file, const char *test) { xmlParserCtxtPtr ctxt; xmlDocPtr doc; xmlNsPtr ns; xmlNodePtr cur; ns = NULL; xmlKeepBlanksDefault(0); xmlCleanupParser(); if ((ctxt = xmlNewParserCtxt()) == NULL) { fprintf(stderr, "Failed to allocate parser context\n"); printf("Test failed\n"); exit(2); } /* parse the file, activating the DTD validation option */ if ((doc = xmlCtxtReadFile(ctxt, test_file, NULL, XML_PARSE_XINCLUDE | XML_PARSE_DTDVALID)) == NULL) { fprintf(stderr, "Failed to read the XML document\n"); printf("Test failed\n"); exit(2); } if (ctxt->valid == 0) { fprintf(stderr, "Failed to validate the XML document\n"); xmlFreeDoc(doc); xmlFreeParserCtxt(ctxt); printf("Test failed\n"); exit(2); } xmlFreeParserCtxt(ctxt); /* Check the document is of the right kind */ if ((cur = xmlDocGetRootElement(doc)) == NULL) { xmlFreeDoc(doc); fprintf(stderr, "Empty document\n"); printf("Test failed\n"); exit(2); } /*endif*/ if (xmlStrcmp(cur->name, (const xmlChar *) "fax-tests")) { xmlFreeDoc(doc); fprintf(stderr, "Document of the wrong type, root node != fax-tests"); printf("Test failed\n"); exit(2); } /*endif*/ cur = cur->xmlChildrenNode; while (cur && xmlIsBlankNode(cur)) cur = cur->next; /*endwhile*/ if (cur == NULL) { printf("Test failed\n"); exit(2); } /*endif*/ while (cur) { if (xmlStrcmp(cur->name, (const xmlChar *) "config") == 0) { parse_config(s, doc, ns, cur->xmlChildrenNode); } /*endif*/ if (xmlStrcmp(cur->name, (const xmlChar *) "test-group") == 0) { if (parse_test_group(s, doc, ns, cur->xmlChildrenNode, test) == 0) { /* We found the test we want, so run it. */ exchange(s); break; } /*endif*/ } /*endif*/ cur = cur->next; } /*endwhile*/ xmlFreeDoc(doc); return 0; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { const char *xml_file_name; const char *test_name; int opt; #if 0 string_test(); #endif xml_file_name = "../spandsp/tsb85.xml"; test_name = "MRGN01"; log_audio = FALSE; while ((opt = getopt(argc, argv, "lx:")) != -1) { switch (opt) { case 'l': log_audio = TRUE; break; case 'x': xml_file_name = optarg; break; default: //usage(); exit(2); break; } } argc -= optind; argv += optind; if (argc > 0) test_name = argv[0]; strcpy(image_path, "."); faxtester_init(&state, TRUE); memset(&expected_rx_info, 0, sizeof(expected_rx_info)); span_log_set_level(&state.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW); span_log_set_tag(&state.logging, "B"); get_test_set(&state, xml_file_name, test_name); faxtester_release(&state); printf("Done\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/v18_tests.c0000664000175000017500000027453212101213356013265 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v18_tests.c * * Written by Steve Underwood * * Copyright (C) 2004-2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page v18_tests_page V.18 tests \section v18_tests_page_sec_1 What does it do? */ /* Enable the following definition to enable direct probing into the spandsp structures */ //#define WITH_SPANDSP_INTERNALS #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define FALSE 0 #define TRUE (!FALSE) #define OUTPUT_FILE_NAME "v18.wav" #define SAMPLES_PER_CHUNK 160 int log_audio = FALSE; SNDFILE *outhandle = NULL; char *decode_test_file = NULL; int good_message_received; const char *qbf_tx = "The quick Brown Fox Jumps Over The Lazy dog 0123456789!@#$%^&*()'"; const char *qbf_rx = "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG 0123456789!X$$/'+.()'"; const char *full_baudot_rx = "\b \n\n\n\r?\n\n\n !\"$$/+'().+,-./" "0123456789:;(=)?" "XABCDEFGHIJKLMNOPQRSTUVWXYZ(/)' " "'ABCDEFGHIJKLMNOPQRSTUVWXYZ(!) "; static void put_text_msg(void *user_data, const uint8_t *msg, int len) { if (strcmp((const char *) msg, qbf_rx)) { printf("Result:\n%s\n", msg); printf("Reference result:\n%s\n", qbf_rx); } else { good_message_received = TRUE; } } /*- End of function --------------------------------------------------------*/ static void basic_tests(int mode) { int16_t amp[SAMPLES_PER_CHUNK]; int outframes; int len; int push; int i; v18_state_t *v18_a; v18_state_t *v18_b; logging_state_t *logging; printf("Testing %s\n", v18_mode_to_str(mode)); v18_a = v18_init(NULL, TRUE, mode, put_text_msg, NULL); logging = v18_get_logging_state(v18_a); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "A"); v18_b = v18_init(NULL, FALSE, mode, put_text_msg, NULL); logging = v18_get_logging_state(v18_b); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "B"); /* Fake an OK condition for the first message test */ good_message_received = TRUE; push = 0; if (v18_put(v18_a, qbf_tx, -1) != strlen(qbf_tx)) { printf("V.18 put failed\n"); exit(2); } for (i = 0; i < 100000; i++) { if (push == 0) { if ((len = v18_tx(v18_a, amp, SAMPLES_PER_CHUNK)) == 0) push = 10; } else { len = 0; /* Push a little silence through, to flush things out */ if (--push == 0) { if (!good_message_received) { printf("No message received\n"); exit(2); } good_message_received = FALSE; if (v18_put(v18_a, qbf_tx, -1) != strlen(qbf_tx)) { printf("V.18 put failed\n"); exit(2); } } } if (len < SAMPLES_PER_CHUNK) { memset(&[len], 0, sizeof(int16_t)*(SAMPLES_PER_CHUNK - len)); len = SAMPLES_PER_CHUNK; } if (log_audio) { outframes = sf_writef_short(outhandle, amp, len); if (outframes != len) { fprintf(stderr, " Error writing audio file\n"); exit(2); } } v18_rx(v18_b, amp, len); } v18_free(v18_a); v18_free(v18_b); } /*- End of function --------------------------------------------------------*/ static int test_misc_01(void) { /* III.5.4.1.1 No disconnection test Purpose: To verify that the DCE does not initiate a disconnection. Preamble: N/A Method: A call is made to the TUT from the tester which remains off hook for 10 minutes without sending any signal. Pass criteria: The TUT should answer the call and enter the probing state after 3 seconds. The TUT should continue to probe until the test is terminated. Comments: This feature should also be verified by observation during the automoding tests. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_misc_02(void) { /* III.5.4.1.2 Automatic resumption of automoding Purpose: To ensure that the DCE can be configured to automatically re-assume the automode calling state after 10 s of no valid signal. Preamble: The TUT should be configured to automatically re-assume the initial automoding state. Method: The tester should set up a call to the TUT in V.21 mode and then drop the carrier. The tester will then transmit silence for 11 seconds followed by a 1300 Hz tone for 5 seconds (i.e. V.23). Pass criteria: 1) Ten seconds after dropping the carrier the TUT should return to state Monitor 1. 2) After 2.7±0.3 seconds the TUT should select V.23 mode and send a 390 Hz tone. Comments: The TUT should indicate that carrier has been lost at some time after the 1650 Hz signal is lost. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_misc_03(void) { /* III.5.4.1.3 Retention of selected mode on loss of signal Purpose: To ensure that the DCE stays in the selected transmission mode if it is not configured to automatically re-assume the initial automoding state. Preamble: The TUT should be configured to remain in the selected transmission mode when the carrier is lost. Method: The tester should set up a call to the TUT in V.21 mode, for example. It will drop the carrier for 9 seconds and then re-start transmission of the same carrier for 1 second followed by a short message. Pass criteria: The TUT should resume operation in V.21 mode and capture the entire test message. Comments: The TUT should indicate that carrier has been lost at some time after the carrier signal is removed and not disconnect. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_misc_04(void) { /* III.5.4.1.4 Detection of BUSY tone Purpose: To ensure that the DCE provides the call progress indication "BUSY" in presence of the national busy tone. Preamble: N/A Method: The TUT should be configured to dial out and then be presented with the appropriate national busy tone. Pass criteria: Detection of busy tone should be displayed by the TUT. Comments: ITU-T V.18 specifies that the DCE should not hang up, but that is intended to apply to the case where a connection is established and then lost. A terminal may automatically hang up when busy tone is detected. PABX busy tones may differ in frequency and cadence from national parameters. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_misc_05(void) { /* III.5.4.1.5 Detection of RINGING Purpose: To ensure that the DCE provides the call progress indication "RINGING" in presence of the national ringing tone. Preamble: N/A Method: The tester will make a call to the TUT using the nationally recommended cadence and the minimum recommended ring voltage/current. Pass criteria: The RINGING condition should be visually indicated by the TUT. Comments: This test should be repeated across a range of valid timings and ring voltages. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_misc_06(void) { /* III.5.4.1.6 "LOSS OF CARRIER" indication Purpose: To ensure that the DCE provides the call progress indication "LOSS OF CARRIER" upon a loss of carrier in full duplex modes, i.e. V.21, V.23, Bell 103. Preamble: N/A Method: Set up a call in each of the full duplex modes and force a carrier failure to the TUT. Pass criteria: Loss of carrier should be indicated and disappear when the carrier is restored. Comments: The V.18 modem should not automatically disconnect when used in a manual conversation mode. However, a V.18 equipped terminal may disconnect based on operational decisions, e.g. when it is a terminal in automatic answering machine mode. There may be other cases, e.g. where the V.18 DCE is used in a gateway, when automatic disconnection is required. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_misc_07(void) { /* III.5.4.1.7 Call progress indication Purpose: To ensure that the DCE provides the call progress indication "CONNECT(x)" upon a connection. Preamble: N/A Method: Correct CONNECT messages should be verified during the Automode tests that follow. Pass criteria: The relevant mode should be indicated by the DCE when automoding is complete. However, this may possibly not be indicated by the DTE. Comments: The possible modes are: V.21, V.23, Baudot 45, Baudot 50, EDT, Bell 103, DTMF. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_misc_08(void) { /* III.5.4.1.8 Circuit 135 Test Purpose: To ensure that the DCE implements circuit 135 or an equivalent way of indicating presence of a signal. Preamble: N/A Method: A call from the TUT should be answered in voice mode after 20 seconds. The tester will transmit sampled voice messages. V.24 circuit 135 or its equivalent should be observed. Pass criteria: The ring tone and speech shall be indicated by circuit 135. Comment: The response times and signal level thresholds of Circuit 135 are not specified in ITU-T V.18 or V.24 and therefore the pattern indicated may vary. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_misc_09(void) { /* III.5.4.1.9 Connection procedures Purpose: To ensure that the TUT implements the call connect procedure described in clause 6. Preamble: N/A Method: TBD Pass criteria: TBD Comment: TBD */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_01(void) { /* III.5.4.2.1 CI and XCI signal coding and cadence Purpose: To verify that TUT correctly emits the CI and XCI signals with the ON/OFF cadence defined in 5.1.1. Preamble: N/A Method: V.21 demodulator is used to decode the CI sequence and a timer to measure the silence intervals between them. The XCI signal is also monitored and decoded to check for correct coding and timing of the signal. Pass criteria: 1) No signal should be transmitted for one second after connecting to the line. 2) Four CI patterns are transmitted for each repetition. 3) No signal is transmitted for two seconds after the end of each CI. 4) Each CI must have the correct bit pattern. 5) The CI patterns followed by two seconds of silence must be repeated twice. 6) One second after every 3 blocks CI an XCI signal must be transmitted. 7) The XCI should have the structure defined in 3.11. 8) The whole sequence should be repeated until the call is cleared. 9) When V.18 to V.18, the XCI must not force V.23 or Minitel mode. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_02(void) { /* III.5.4.2.2 ANS signal detection Purpose: To verify that TUT correctly detects the ANS (2100 Hz) signal during the two-second interval (Toff) between transmission of CI sequences. Preamble: Make a V.18 call from the TUT. Method: The Test System waits for the TUT to stop transmitting a CI and responds with an ANS signal. The V.21 demodulator is used to decode the TXP sequence and a timer measures the silence intervals between them. ANS should be transmitted for 2 seconds. Pass criteria: 1) No signal should be transmitted by TUT for 0.5 seconds from detection of ANS. 2) The TUT should reply with transmission of TXP as defined in 5.1.2. 3) Verify that TXP sequence has correct bit pattern. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_03(void) { /* III.5.4.2.3 End of ANS signal detection Purpose: The TUT should stop sending TXP at the end of the current sequence when the ANS tone ceases. Preamble: Test ORG-02 should be successfully completed immediately prior to this test. Method: The tester sends ANS for 2 seconds followed by silence. The tester will then monitor for cessation of TXP at the end of the answer tone. Pass criteria: The TUT should stop sending TXP at the end of the current sequence when ANS tone ceases. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_04(void) { /* III.5.4.2.4 ANS tone followed by TXP Purpose: To check correct detection of V.18 modem. Preamble: Tests ORG-02 and ORG-03 should be successfully completed prior to this test. Method: Tester transmits ANS for 2.5 seconds followed by 75 ms of no tone then transmits 3 TXP sequences using V.21 (2) and starts a 1 s timer. It will then transmit 1650 Hz for 5 seconds. Pass criteria: 1) TUT should initially respond with TXP. 2) TUT should stop sending TXP within 0.2 seconds of end of ANS. 3) TUT should respond with 980 Hz carrier within 1 second of end of 3 TXP sequences. 4) Data should be transmitted and received according to ITU-T T.140 to comply with the V.18 operational requirements. Comments: The TUT should indicate that V.18 mode has been selected. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_05(void) { /* III.5.4.2.5 ANS tone followed by 1650 Hz Purpose: To check correct detection of V.21 modem upper channel when preceded by answer tone and to confirm discrimination between V.21 and V.18 modes. Preamble: Tests ORG-02 and ORG-03 should be successfully completed prior to this test. Method: Tester transmits ANS for 2.5 seconds followed by 75 ms of no tone then transmits 1650 Hz and starts a 0.7 second timer. Pass criteria: 1) TUT should initially respond with TXP. 2) TUT should stop sending TXP within 0.2 seconds of end of ANS. 3) TUT should respond with 980 Hz at 0.5(+0.2-0.0) seconds of start of 1650 Hz. 4) Data should be transmitted and received at 300 bit/s complying with Annex F. Comments: Selection of ITU-T V.21 as opposed to ITU-T V.18 should be confirmed by examination of TUT. If there is no visual indication, verify by use of ITU-T T.50 for ITU-T V.21 as opposed to UTF-8 coded ISO 10646 character set for ITU-T V.18. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_06(void) { /* III.5.4.2.6 ANS tone followed by 1300 Hz Purpose: To check correct detection of V.23 modem upper channel when preceded by answer tone. Preamble: Tests ORG-02 and ORG-03 should be successfully completed prior to this test. Method: Tester transmits ANS for 2.5 seconds followed by 75 ms of no tone then transmits 1300 Hz and starts a 2.7 s timer. Pass criteria: 1) TUT should initially respond with TXP. 2) TUT should stop sending TXP within 0.2 seconds of end of ANS. 3) TUT should respond with 390 Hz after 1.7(+0.2-0.0) seconds of start of 1300 Hz. 4) Data should be transmitted and received at 75 bit/s and 1200 bit/s respectively by the TUT to comply with Annex E. Comments: The TUT should indicate that V.23 mode has been selected. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_07(void) { /* III.5.4.2.7 ANS tone followed by no tone Purpose: To confirm that TUT does not lock up under this condition. Preamble: Tests ORG-02 and ORG-03 should be successfully completed prior to this test. Method: Tester transmits ANS for 2.5 seconds followed by no tone for 10 s. It then transmits DTMF tones for 2 seconds. Pass criteria: 1) TUT should initially respond with TXP. 2) TUT should stop sending TXP within 0.2 seconds of end of ANS. 3) TUT should return to Monitor 1 state and then connect in DTMF mode within 12 seconds of the end of ANS tone. Comments: This condition would cause the terminal to lock up if the V.18 standard is followed literally. It may however, occur when connected to certain Swedish textphones if the handset is lifted just after the start of an automatically answered incoming call. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_08(void) { /* III.5.4.2.8 Bell 103 (2225 Hz signal) detection Purpose: To verify that the TUT correctly detects the Bell 103 upper channel signal during the 2-second interval between transmission of CI sequences. Preamble: N/A Method: The tester waits for a CI and then sends a 2225 Hz signal for 5 seconds. Pass criteria: 1) The TUT should respond with a 1270 Hz tone in 0.5±0.1 seconds. 2) Data should be transmitted and received at 300 bit/s to comply with Annex D. Comments: The TUT should indicate that Bell 103 mode has been selected. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_09(void) { /* III.5.4.2.9 V.21 (1650 Hz signal) detection Purpose: To verify that the TUT correctly detects the V.21 upper channel signal during the 2-second interval between transmission of CI sequences. Preamble: N/A Method: The tester waits for a CI and then sends a 1650 Hz signal for 5 seconds. Pass criteria: 1) The TUT should respond with a 980 Hz tone in 0.5±0.1 seconds. 2) Data should be transmitted and received at 300 bit/s to comply with Annex F. Comments: */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_10(void) { /* III.5.4.2.10 The TUT should indicate that V.21 mode has been selected. V.23 (1300 Hz signal) detection Purpose: To verify that the TUT correctly detects the V.23 upper channel signal during the 2-second interval between transmission of CI sequences. Preamble: N/A Method: The tester waits for a CI and then sends a 1300 Hz signal for 5 seconds. Pass criteria: 1) The TUT should respond with a 390 Hz tone in 1.7±0.1 seconds. 2) Data should be transmitted and received at 75 bit/s and 1200 bit/s respectively by the TUT to comply with Annex E. Comments: */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_11(void) { /* III.5.4.2.11 The TUT should indicate that V.23 mode has been selected. V.23 (390 Hz signal) detection Purpose: To confirm correct selection of V.23 reverse mode during sending of XCI. Preamble: N/A Method: The tester should wait for the start of the XCI signal and then send 390 Hz to TUT for 5 seconds. Pass criteria: 1) The TUT should complete the XCI as normal. 2) The TUT should then maintain the 1300 Hz tone while the 390 Hz test tone is present. 3) Data should be transmitted and received at 1200 bit/s and 75 bit/s respectively by the TUT to comply with Annex E when connection is indicated. Comments: */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_12(void) { /* III.5.4.2.12 The TUT should indicate that V.23 mode has been selected at least 3 seconds after the start of the 390 Hz tone. 5 bit mode (Baudot) detection tests Purpose: To confirm detection of Baudot modulation at various bit rates that may be encountered. Preamble: N/A Method: The tester transmits the 5-bit coded characters "0" to "9" followed by "abcdef" at (a) 45.45, (b) 47.6, (c) 50 and (d) 100 bits per second. When TUT indicates a connection, type at least 5 characters back to the tester so that correct selection of bit rate can be confirmed. Pass criteria: 1) TUT should select Baudot mode and the appropriate bit rate. 2) The tester will analyse the bit rate of received characters, which should be at either 45.45 or 50 bits per second as appropriate. Comments: 45.45 and 50 bit/s are the commonly used Baudot bit rates. However, certain textphones can operate at higher rates (e.g. 100 bit/s). Responding at either 45.45 or 50 bit/s is acceptable to these devices which normally fall back to the selected rate. 47.6 bit/s may possibly be encountered from another V.18 textphone in the automode answer state. The TUT may then select either 45.45 or 50 bit/s for the transmission. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_13(void) { /* III.5.4.2.13 DTMF signal detection Purpose: To verify whether the TUT correctly recognizes DTMF signals during the 2-second interval between transmission of CI. Preamble: N/A Method: The tester will send a single DTMF tone of 40 ms duration to TUT. When TUT indicates a connection, type at least 5 characters back to the tester so that correct selection of mode can be confirmed. Pass criteria: The tester will analyse the received characters to confirm DTMF mode selection. Comments: TUT should indicate that it has selected DTMF mode. The DTMF capabilities of the TUT should comply with ITU-T Q.24 for the Danish Administration while receiving for best possible performance. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_14(void) { /* III.5.4.2.14 EDT rate detection Purpose: To confirm detection of EDT modems by detecting the transmission rate of received characters. Preamble: N/A Method: The tester transmits EDT characters "abcdef" to TUT at 110 bit/s. When TUT indicates that the connection is established, type characters "abcdef" back to the tester. The same characters will then be transmitted back to the TUT. Pass criteria: Ensure correct reception of characters by tester and TUT. Comments: The TUT should be able to determine the rate on the six characters given. If it takes more than this then performance is probably inadequate as too many characters would be lost. Some characters may be lost during the detection process. However, the number lost should be minimal. The data bits and parity are specified in Annex C. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_15(void) { /* III.5.4.2.15 Rate detection test Purpose: To verify the presence of 980/1180 Hz at a different signalling rate than 110 bit/s returns the TUT modem to the "monitor A" state. Preamble: N/A Method: The tester transmits 980/1180 Hz signals at 300 bit/s for 2 seconds. Pass criteria: The TUT should not select EDT or any other mode and should continue to transmit the CI signal. Comments: Echoes of the CI sequences may be detected at 300 bit/s. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_16(void) { /* III.5.4.2.16 980 Hz detection Purpose: To confirm correct selection of V.21 reverse mode. Preamble: N/A Method: The tester sends 980 Hz to TUT for 5 seconds. Pass criteria: 1) TUT should respond with 1650 Hz tone after 1.5±0.1 seconds after start of 980 Hz tone. 2) Data should be transmitted and received at 300 bit/s complying with Annex F. Comments: */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_17(void) { /* III.5.4.2.17 The TUT should indicate that V.21 mode has been selected. Loss of signal after 980 Hz Purpose: To confirm that TUT returns to the Monitor 1 state if 980 Hz signal disappears. Preamble: N/A Method: The tester sends 980 Hz to TUT for 1.2 seconds followed by silence for 5 seconds. Pass criteria: TUT should not respond to the 980 Hz tone and resume sending CI signals after a maximum of 2.4 seconds from the end of the 980 Hz tone. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_18(void) { /* III.5.4.2.18 Tr timer Purpose: To confirm that TUT returns to the Monitor 1 state if Timer Tr expires. Preamble: N/A Method: The tester sends 980 Hz to TUT for 1.2 seconds followed by 1650 Hz for 5 seconds with no pause. Pass criteria: TUT should respond with 980 Hz after 1.3±0.1 seconds of 1650 Hz. Comments: This implies timer Tr has expired 2 seconds after the start of the 980 Hz tone and then 1650 Hz has been detected for 0.5 seconds. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_19(void) { /* III.5.4.2.19 Bell 103 (1270 Hz signal) detection Purpose: To confirm correct selection of Bell 103 reverse mode. Preamble: N/A Method: The tester sends 1270 Hz to TUT for 5 seconds. Pass criteria: 1) TUT should respond with 2225 Hz tone after 0.7±0.1 s. 2) Data should be transmitted and received at 300 bit/s complying with Annex D. Comments: */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_20(void) { /* III.5.4.2.20 The TUT should indicate that Bell 103 mode has been selected. Immunity to network tones Purpose: To ensure that the TUT does not interpret network tones as valid signals. Preamble: N/A Method: The tester will first send a dial tone to the TUT, this will be followed by a ringing tone and a network congestion tone. The frequencies and cadences of the tones will vary according to the country setting. The tester must be configured for the same country as the TUT. Pass criteria: The countries supported by the TUT should be noted along with the response to each tone. The tones should either be ignored or reported as the relevant network tone to the user. Comments: V.18 is required to recognize and report RINGING and BUSY tones. Other network tones may be ignored. Some devices may only provide a visual indication of the presence and cadence of the tones for instance by a flashing light. The TUT may disconnect on reception of tones indicating a failed call attempt. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_21(void) { /* III.5.4.2.21 Immunity to non-textphone modems Purpose: To ensure that the TUT does not interpret modem tones not supported by V.18 as valid text telephone tones. Preamble: N/A Method: The tester will respond with an ANS tone (2100 Hz) followed by simulated (a) V.32 bis and (b) V.34 modem training sequences. Pass criteria: The tones should either be ignored or reported back to the user. No textphone modem should be selected. Comments: Some high speed modems may fall back to a compatibility mode, e.g. V.21 or V.23 that should be correctly detected by the TUT. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_22(void) { /* III.5.4.2.22 Immunity to fax tones Purpose: To ensure that the TUT will not interpret a called fax machine as being a textphone. Preamble: N/A Method: The tester will respond as if it were a typical group 3 fax machine in automatic answer mode. It should send a CED tone (2100 Hz) plus Digital Identification Signal (DIS) as defined in ITU-T T.30. Pass criteria: The TUT should ignore the received tones. Comments: Ideally the TUT should detect the presence of a fax machine and report it back to the user. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_23(void) { /* III.5.4.2.23 Immunity to voice Purpose: To ensure that the TUT does not misinterpret speech as a valid textphone signal. Preamble: N/A Method: The tester will respond with sampled speech. A number of phrases recorded from typical male and female speakers will be transmitted. This will include a typical network announcement. Pass criteria: The TUT should ignore the speech. Comments: Ideally the TUT should report the presence of speech back to the user, e.g. via circuit 135. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_24(void) { /* III.5.4.2.24 ANSam signal detection Purpose: To verify that TUT correctly detects the ANSam (2100 Hz modulated) signal during the two-second interval (Toff) between transmission of CI sequences. Preamble: Make a V.18 call from the TUT. Method: The Test System waits for the TUT to stop transmitting a CI and responds with an ANSam signal. The V.21 demodulator is used to decode the CM sequence. ANSam should be transmitted for 2 seconds. Pass criteria: 1) No signal should be transmitted by TUT for 0.5 seconds from detection of ANSam. 2) The TUT should reply with transmission of CM as defined in 5.2.13. 3) Verify that CM sequence has correct bit pattern. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_org_25(void) { /* III.5.4.2.25 V.8 calling procedure Purpose: To verify that TUT correctly performs a V.8 call negotiation. Preamble: Make a V.18 call from the TUT. Answer with ANSam from the Tester and with JM for V.21 on the CM. Method: The Test System waits for the TUT to start transmitting V.21 carrier (1). Pass criteria: The TUT should connect by sending V.21 carrier (1). */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_01(void) { /* III.5.4.3.1 Ta timer Purpose: To ensure that on connecting the call, the DCE starts timer Ta (3 seconds) and on expiry begins probing. Preamble: N/A Method: The tester makes a call to the TUT and attempts to determine when the TUT answers the call. It will then monitor for any signal. Pass criteria: The TUT should start probing 3 seconds after answering the call. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_02(void) { /* III.5.4.3.2 CI signal detection Purpose: To confirm the correct detection and response to the V.18 CI signal. Preamble: N/A Method: The tester will transmit 2 sequences of 4 CI patterns separated by 2 seconds. It will monitor for ANS and measure duration. Pass criteria: 1) The TUT should respond after either the first or second CI with ANSam tone. 2) ANSam tone should remain for 3 seconds ±0.5 s followed by silence. Comments: The ANSam tone is a modulated 2100 Hz tone. It may have phase reversals. The XCI signal is tested in a separate test. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_03(void) { /* III.5.4.3.3 Early termination of ANSam tone Purpose: To confirm that the TUT will respond correctly to TXP signals, i.e. by stopping ANSam tone on reception of TXP signal. Preamble: N/A Method: The tester will transmit 2 sequences of 4 CI patterns separated by 2 seconds. On reception of the ANSam tone the tester will wait 0.5 seconds and then begin transmitting the TXP signal in V.21 (1) mode. Pass criteria: 1) On reception of the TXP signal, the TUT should remain silent for 75±5 ms. 2) The TUT should then transmit 3 TXP sequences in V.21(2) mode. 3) The 3 TXPs should be followed by continuous 1650 Hz. 4) Correct transmission and reception of T.140 data should be verified after the V.18 mode connection is completed. Comments: The TUT should indicate V.18 mode. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_04(void) { /* III.5.4.3.4 Tt timer Purpose: To ensure that after detection of ANSam the TUT will return to Monitor A after timer Tt expires. Preamble: Successful completion of test ANS-03. Method: After completion of test ANS-03 the tester will continue to monitor for signals. Pass criteria: The TUT should start probing 3 seconds after ANSam disappears. Comments: It is assumed that timer Ta is restarted on return to Monitor A. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_05(void) { /* III.5.4.3.5 ANS tone followed by 980 Hz Purpose: To check correct detection of V.21 modem lower channel when preceded by answer tone. Preamble: N/A Method: Tester transmits ANS for 2.5 seconds followed by 75 ms of no tone then transmits 980 Hz and starts a 1 s timer. Pass criteria: TUT should respond with 1650 Hz within 400±100 ms of start of 980 Hz. Comments: The TUT should indicate that V.21 mode has been selected. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_06(void) { /* III.5.4.3.6 ANS tone followed by 1300 Hz Purpose: To check correct detection of V.23 modem upper channel when preceded by answer tone. Preamble: N/A Method: Tester transmits ANS for 2.5 seconds followed by 75 ms of no tone then transmits 1300 Hz and starts a 2-s timer. Pass criteria: TUT should respond with 390 Hz after 1.7(+0.2-0.0) seconds of start of 1300 Hz. Comments: The TUT should indicate that V.23 mode has been selected. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_07(void) { /* III.5.4.3.7 ANS tone followed by 1650 Hz Purpose: To check correct detection of V.21 modem upper channel when preceded by answer tone and to confirm discrimination between V.21 and V.18 modes. Preamble: N/A Method: Tester transmits ANS for 2.5 seconds followed by 75 ms of no tone then transmits 1650 Hz and starts a 1-second timer. Pass criteria: TUT should respond with 980 Hz within 400±100 ms of start of 1650 Hz. Comments: The TUT should indicate that V.21 mode has been selected. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_08(void) { /* III.5.4.3.8 980 Hz followed by 1650 Hz Purpose: To ensure the correct selection of V.21 modem channel when certain types of Swedish textphones are encountered. Preamble: N/A Method: The tester will simulate a call from a Diatext2 textphone that alternates between 980 Hz and 1650 Hz until a connection is made. Pass criteria: The TUT should respond with the appropriate carrier depending on when it connects. Comments: The TUT should indicate a V.21 connection. The time for which each frequency is transmitted is random and varies between 0.64 and 2.56 seconds. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_09(void) { /* III.5.4.3.9 980 Hz calling tone detection Purpose: To confirm correct detection of 980 Hz calling tones as defined in V.25. Preamble: N/A Method: The tester will send bursts of 980 Hz signals (a) 400 ms, (b) 500 ms, (c) 700 ms and (d) 800 ms followed by 1 second of silence. Pass criteria: 1) The TUT should not respond to bursts of 400 or 800 ms. 2) The TUT should immediately begin probing after a burst of 980 Hz for 500 or 700 ms followed by 1 second of silence. Comments: */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_10(void) { /* III.5.4.3.10 The probe sent by the TUT will depend on the country setting. V.21 detection by timer Purpose: To confirm correct selection of V.21 calling modem when the received signal is not modulated, i.e. there is no 1180 Hz. Preamble: N/A Method: The tester sends 980 Hz to TUT for 2 seconds. Pass criteria: The TUT should respond with a 1650 Hz tone in 1.5±0.1 seconds. Comments: The TUT should indicate that V.21 mode has been selected. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_11(void) { /* III.5.4.3.11 EDT detection by rate Purpose: To confirm detection of EDT modems by detecting the transmission rate of received characters. Preamble: N/A Method: The tester transmits EDT characters "abcdef" to TUT at 110 bit/s. When TUT indicates that the connection is established, type characters "abcdef" back to the tester. The same characters will then be transmitted back to the TUT. Pass criteria: Ensure correct reception of characters by tester and TUT. Comments: The TUT should indicate that EDT mode has been selected. Some characters may be lost during the detection process. However, the number lost should be minimal. The data bits and parity are specified in Annex C. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_12(void) { /* III.5.4.3.12 V.21 Detection by rate Purpose: To confirm detection of V.21 modem low channel by detecting the transmission rate of received characters and to ensure correct discrimination between V.18 and V.21 modes. Preamble: N/A Method: The tester transmits characters "abcdef" to TUT using V.21 (1) at 300 bit/s. When TUT indicates that the connection is established, type characters "abcdef" back to the tester. The same characters will then be transmitted back to the TUT. Pass criteria: Ensure correct reception of characters by tester and TUT. Comments: This situation is unlikely to occur in practice unless the DCE is sending a V.21 (1650 Hz) probe. However, it is catered for in V.18. It is more likely that this is where CI or TXP characters would be detected (see test ANS-02). */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_13(void) { /* III.5.4.3.13 Tr timer Purpose: To ensure that the TUT returns to the Monitor A state on expiry of timer Tr (2 seconds). Timer Tr is started when a modulated V.21 (1) signal is detected. Preamble: N/A Method: The tester will transmit 980 Hz for 200 ms followed by alternating 980 Hz/1180 Hz at 110 bit/s for 100 ms followed by 980 Hz for 1 second. Pass criteria: The TUT should begin probing 4±0.5 seconds after the 980 Hz signal is removed. Comments: It is not possible to be precise on timings for this test since the definition of a "modulated signal" as in 5.2.4.4 is not specified. Therefore it is not known exactly when timer Tr will start. It is assumed that timer Ta is restarted on re-entering the Monitor A state. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_14(void) { /* III.5.4.3.14 Te timer Purpose: To ensure that the TUT returns to the Monitor A on expiry of timer Te (2.7 seconds). Timer Te is started when a 980 Hz signal is detected. Preamble: N/A Method: The tester will transmit 980 Hz for 200 ms followed silence for 7 s. Pass criteria: The TUT should begin probing 5.5±0.5 seconds after the 980 Hz signal is removed. Comments: It is assumed that timer Ta (3 seconds) is restarted on re-entering the Monitor A state. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_15(void) { /* III.5.4.3.15 5 Bit mode (Baudot) detection tests Purpose: To confirm detection of Baudot modulation at various bit rates that may be encountered. Preamble: N/A Method: The tester transmits the 5-bit coded characters "0" to "9" followed by "abcdef" at (a) 45.45, (b) 47.6, (c) 50 and (d) 100 bits per second. When TUT indicates a connection, type at least 5 characters back to the tester so that correct selection of bit rate can be confirmed. Pass criteria: 1) The TUT should select Baudot mode and the appropriate bit rate. 2) The tester will analyse the bit rate of received characters, which should be at an appropriate rate, and confirm the carrier on/off times before and after the characters. Comments: 45.45 and 50 bit/s are the commonly used Baudot bit rates. However, some textphones can transmit at higher rates, e.g. 100 bit/s. Responding at either 45.45 or 50 bit/s is acceptable to these devices which then fall back to the selected rate. A rate of 47.6 bit/s may be encountered from another V.18 textphone in the automode answer state. The TUT may then select either 45.45 or 50 bit/s for the transmission. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_16(void) { /* III.5.4.3.16 DTMF signal detection Purpose: To verify whether the TUT correctly recognizes DTMF signals. Preamble: N/A Method: The tester will send a single DTMF tone of 40 ms duration to TUT. When TUT indicates a connection, type at least 5 characters back to the tester so that correct selection of mode can be confirmed. Pass criteria: Tester will analyse the received characters to confirm DTMF mode selection. Comments: The TUT should indicate that it has selected DTMF mode. The DTMF capabilities of the TUT should comply with ITU-T Q.24 for the Danish Administration. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_17(void) { /* III.5.4.3.17 Bell 103 (1270 Hz signal) detection Purpose: To ensure correct detection and selection of Bell 103 modems. Preamble: N/A Method: The tester sends 1270 Hz to TUT for 5 seconds. Pass criteria: TUT should respond with 2225 Hz tone after 0.7±0.1 s. Comments: The TUT should indicate that Bell 103 mode has been selected. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_18(void) { /* III.5.4.3.18 Bell 103 (2225 Hz signal) detection Purpose: To ensure correct detection and selection of Bell 103 modems in reverse mode. Preamble: N/A Method: The tester sends 2225 Hz to TUT for 5 seconds. Pass criteria: The TUT should respond with 1270 Hz after 1±0.2 seconds. Comments: The TUT should indicate that Bell 103 mode has been selected. Bell 103 modems use 2225 Hz as both answer tone and higher frequency of the upper channel. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_19(void) { /* III.5.4.3.19 V.21 Reverse mode (1650 Hz) detection Purpose: To ensure correct detection and selection of V.21 reverse mode. Preamble: N/A Method: The tester sends 1650 Hz to TUT for 5 seconds. Pass criteria: The TUT should respond with 980 Hz after 0.4±0.2 seconds. Comments: The TUT should indicate that V.21 mode has been selected. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_20(void) { /* III.5.4.3.20 1300 Hz calling tone discrimination Purpose: To confirm correct detection of 1300 Hz calling tones as defined in ITU-T V.25. Preamble: N/A Method: The tester will send 1300 Hz bursts of (a) 400 ms, (b) 500 ms, (c) 700 ms and (d) 800 ms followed by 1 second of silence. Pass criteria: 1) The TUT should not respond to bursts of 400 or 800 ms. 2) The TUT should immediately begin probing after a burst of 1300 Hz for 500 or 700 ms followed by 1 second of silence. Comments: */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_21(void) { /* III.5.4.3.21 The probe sent by the TUT will depend on the country setting. V.23 Reverse mode (1300 Hz) detection Purpose: To ensure correct detection and selection of V.23 reverse mode. Preamble: N/A Method: The tester sends 1300 Hz only, with no XCI signals, to TUT for 5 seconds. Pass criteria: The TUT should respond with 390 Hz after 1.7±0.1 seconds. Comments: The TUT should indicate that V.23 mode has been selected. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_22(void) { /* III.5.4.3.22 1300 Hz with XCI test Purpose: To ensure correct detection of the XCI signal and selection of V.18 mode. Preamble: N/A Method: The tester sends XCI signal as defined in 3.11. On reception of ANS it will become silent for 500 ms then transmit the TXP signal in V.21 (1) mode. Pass criteria: The TUT should respond with TXP using V.21 (2) and select V.18 mode. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_23(void) { /* III.5.4.3.23 Stimulate mode country settings Purpose: To ensure that the TUT steps through the probes in the specified order for the country selected. Preamble: The TUT should be configured for each of the possible probe orders specified in Appendix I in turn. Method: The tester will call the TUT, wait for Ta to expire and then monitor the probes sent by the TUT. Pass criteria: The TUT should use the orders described in Appendix I. Comments: The order of the probes is not mandatory. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_24(void) { /* III.5.4.3.24 Stimulate carrierless mode probe message Purpose: To ensure that the TUT sends the correct probe message for each of the carrierless modes. Preamble: N/A Method: The tester will call the TUT, wait for Ta to expire and then monitor the probes sent by the TUT. Pass criteria: The TUT should send the user defined probe message for Annexes A, B, and C modes followed by a pause of Tm (default 3) seconds. Comments: */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_25(void) { /* III.5.4.3.25 The carrierless modes are those described in Annexes A, B and C. Interrupted carrierless mode probe Purpose: To ensure that the TUT continues probing from the point of interruption a maximum of 20 s after a failed connect attempt. Preamble: The TUT should be configured for the UK country setting. Method: The tester will call the TUT, wait for Ta to expire and then during the pause after the first Baudot probe it will send a 200 ms burst of 1270 Hz followed by silence for 30 s. Pass criteria: The TUT should transmit silence on detecting the 1270 Hz tone and then continue probing starting with the V.23 probe 20 seconds after the end of the 1270 Hz signal. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_26(void) { /* III.5.4.3.26 Stimulate carrier mode probe time Purpose: To ensure that the TUT sends each carrier mode for time Tc (default 6 seconds) preceded by the correct answer tone. Preamble: None. Method: The tester will call the TUT, wait for Ta to expire and then monitor the probes sent by the TUT. Pass criteria: The TUT should send the ANS tone (2100 Hz) for 1 second followed by silence for 75±5 ms and then the 1650 Hz, 1300 Hz and 2225 Hz probes for time Tc. Comments: The carrier modes are those described in Annexes D, E, and F. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_27(void) { /* III.5.4.3.27 V.23 mode (390 Hz) detection Purpose: To confirm correct selection of V.23 mode. Preamble: N/A Method: The tester waits until the 1300 Hz probe is detected from the TUT and then transmits 390 Hz for 11 seconds. Pass criteria: 1) After 3 seconds of the 390 Hz signal the TUT should indicate that V.23 has been selected. 2) The tester will confirm that the 1300 Hz carrier is maintained for at least 4 seconds beyond the normal probe duration, i.e. Tc (= 6 s default) + 4 s = 10 seconds total. Comments: */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_28(void) { /* III.5.4.3.28 All known V.23 devices need to receive 1300 Hz tone before they will respond with 390 Hz. When the 1300 Hz probe is not being transmitted, a 390 Hz tone may be interpreted as a 400 Hz network tone. Interrupted carrier mode probe Purpose: To ensure that the TUT continues probing from the point of interruption a maximum of 4 s after a failed connect attempt. Preamble: The TUT should be configured for the UK country setting. Method: The tester will call the TUT, wait for Ta to expire and then during the first V.21 probe it will send a 200 ms burst of 1270 Hz followed by silence for 30 s. Pass criteria: The TUT should transmit silence on detecting the 1270 Hz tone and then continue probing with the Baudot stored message 4 seconds after the end of the 1270 Hz burst. Comments: It is most likely that the TUT will return to probing time Ta (3 seconds) after the 1270 Hz tone ceases. This condition needs further clarification. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_29(void) { /* III.5.4.3.29 Stimulate mode response during probe Purpose: To ensure that the TUT is able to detect an incoming signal while transmitting a carrier mode probe. Preamble: N/A Method: The tester will step through each possible response as defined in tests ANS-08 to ANS-23 for each of the carrier mode probes and for each pause after a carrierless mode probe message. Pass criteria: The TUT should respond as described in the appropriate test above. Comments: The TUT may not respond to any signals while a carrierless mode probe is being sent since these modes are half duplex. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_30(void) { /* III.5.4.3.30 Immunity to network tones Purpose: To ensure that the TUT does not interpret network tones as valid signals. Preamble: N/A Method: The tester will first send a busy tone to the TUT this will be followed by a number unobtainable tone. The frequencies and cadences of the tones will vary according to the country setting. The tester must be configured for the same country as the TUT. Pass criteria: The countries supported by the TUT should be noted along with the response to each tone. The tones should either be ignored or reported as the relevant network tone to the user. Comments: V.18 is required to recognize and report RINGING and BUSY tones. Other network tones may be ignored. Some devices may only provide a visual indication of the presence and cadence of the tones for instance by a flashing light. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_31(void) { /* III.5.4.3.31 Immunity to fax calling tones Purpose: To determine whether the TUT can discriminate fax calling tones. Preamble: N/A Method: The tester will call the TUT and send the fax calling tone, CNG. This is an 1100 Hz tone with cadence of 0.5 seconds ON and 3 seconds OFF as defined in ITU-T T.30. Pass criteria: The TUT should not respond to this signal and may report it as being a calling fax machine. Comments: This is an optional test as detection of the fax calling tone is not required by ITU-T V.18. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_32(void) { /* III.5.4.3.32 Immunity to voice Purpose: To ensure that the TUT does not misinterpret speech as a valid textphone signal. Preamble: N/A Method: The tester will respond with sampled speech. A number of phrases recorded from typical male and female speakers will be transmitted. This will include a typical network announcement. Pass criteria: The TUT should ignore the speech. Comments: Ideally the TUT should report the presence of speech back to the user. This is an optional test. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_ans_33(void) { /* III.5.4.3.33 CM detection and V.8 answering Purpose: To confirm that the TUT will respond correctly to CM signals and connect according to V.8 procedures. Preamble: N/A Method: The tester will transmit 2 sequences of 4 CI patterns separated by 2 seconds. On reception of the ANSam tone the tester will wait 0.5 seconds and then begin transmitting the CM signal with textphone and V.21 specified. Pass criteria: 1) On reception of the CM signal, the TUT should transmit JM with textphone and V.21. 2) The TUT should then transmit in V.21 (2) mode. 3) The JM should be followed by continuous 1650 Hz. 4) Correct transmission and reception of T.140 data should be verified after the V.18 mode connection is completed. Comments: The TUT should indicate V.18 mode. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_mon_01(void) { printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_mon_21(void) { /* III.5.4.4.1 Automode monitor Ta timer test Purpose: To ensure that on entering monitor mode, timer Ta (3 seconds) is not active and that the TUT does not enter the probing state. Preamble: N/A Method: The TUT should be put into monitor state. The tester will then monitor for signals for 1 minute. Pass criteria: The TUT should not start probing. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_mon_22(void) { /* III.5.4.4.2 Automode monitor 1300 Hz calling tone discrimination Purpose: To confirm correct detection and reporting of 1300 Hz calling tones as defined in ITU-T V.25. Preamble: N/A Method: The tester will send 1300 Hz bursts of (a) 400 ms, (b) 500 ms, (c) 700 ms and (d) 800 ms followed by 1 second of silence. Pass criteria: 1) The TUT should not respond to bursts of 400 or 800 ms. 2) The TUT should report detection of calling tones to the DTE after a burst of 1300 Hz for 500 or 700 ms followed by 1 second of silence. Comments: In automode answer, the 1300 Hz calling causes the DCE to start probing. In monitor mode it should only report detection to the DTE. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_mon_23(void) { /* III.5.4.4.3 Automode monitor 980 Hz calling tone discrimination Purpose: To confirm correct detection and reporting of 980 Hz calling tones as defined in ITU-T V.25. Preamble: N/A Method: The tester will send 980 Hz bursts of (a) 400 ms, (b) 500 ms, (c) 700 ms and (d) 800 ms followed by 1 second of silence. Pass criteria: 1) The TUT should not respond to bursts of 400 or 800 ms. 2) The TUT should report detection of calling tones to the DTE after a burst of 980 Hz for 500 or 700 ms followed by 1 second of silence. Comments: In automode answer, the 980 Hz calling causes the DCE to start probing. In monitor mode it should only report detection to the DTE. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_x_01(void) { /* III.5.4.5.1 Baudot carrier timing and receiver disabling Purpose: To verify that the TUT sends unmodulated carrier for 150 ms before a new character and disables its receiver for 300 ms after a character is transmitted. Preamble: Establish a call between the tester and TUT in Baudot mode. Method: The operator should send a single character from the TUT. The tester will immediately start sending a unique character sequence. Examination of the TUT display will show when its receiver is re-enabled. Pass criteria: 1) The TUT should send unmodulated carrier for 150 ms before the beginning of the start bit. 2) The receiver should be re-enabled after 300 ms. 3) The tester will confirm that 1 start bit and at least 1.5 stop bits are used. Comments: The carrier should be maintained during the 300 ms after a character. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_x_02(void) { /* III.5.4.5.2 Baudot bit rate confirmation Purpose: To verify that the TUT uses the correct bit rates in the Baudot mode. Preamble: Establish a call between the tester and TUT in Baudot mode for each of the two tests. Method: The operator should select Baudot (a) 45 bit/s followed by (b) 50 bit/s modes and transmit the string "abcdef" at each rate. Pass criteria: The tester will measure the bit timings and confirm the rates. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_x_03(void) { /* III.5.4.5.3 Baudot probe bit rate confirmation Purpose: To verify that the TUT uses the correct bit rates in the Baudot mode probe during automoding. Preamble: Set the user defined carrierless mode probe message to the string "abcdef" if possible. Set the TUT country setting to "United States". A call should be initiated from the tester to the TUT. Method: The tester will wait for the Baudot mode probe and measure the bit rate. Pass criteria: The tester will measure the bit timings and confirm the rate of 47.6 bit/s. Comments: The probe message must be long enough for the tester to establish the bit rate. "GA" may not be sufficient. */ printf("Test not yet implemented\n"); return 1; } /*- End of function --------------------------------------------------------*/ static int test_x_04(void) { char result[1024]; char *t; int ch; int xx; int yy; int i; v18_state_t *v18_state; logging_state_t *logging; /* III.5.4.5.4 5 Bit to T.50 character conversion Purpose: To check that the character conversion tables in Annex A have been correctly implemented. Preamble: Establish a call between the tester and TUT in Baudot mode at 45 bit/s. Method: The tester will send all possible characters preceded by the relevant case shift command one at a time and wait for a response from the TUT operator. Each character should be responded to at the TUT by typing the received character or if the character is not available. Pass criteria: 1) The tester will verify that each character is correctly echoed back by the TUT. The operator should verify that each character is correctly displayed on the TUT. 2) The TUT will send the LTRS symbol before its first character and the appropriate mode character (either LTRS or FIGS) after every 72 subsequent characters. Comments: The tester should indicate which character has been sent in each case. Some of the characters may not be available from the TUT keyboard and can be ignored. It is assumed that the character conversion is the same for Baudot at 50 bit/s and any other supported speed. */ v18_state = v18_init(NULL, TRUE, V18_MODE_5BIT_45, NULL, NULL); logging = v18_get_logging_state(v18_state); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, ""); printf("Original:\n"); t = result; for (i = 0; i < 127; i++) { ch = i; printf("%c", ch); xx = v18_encode_baudot(v18_state, ch); if (xx) { if ((xx & 0x3E0)) { yy = v18_decode_baudot(v18_state, (xx >> 5) & 0x1F); if (yy) *t++ = yy; } yy = v18_decode_baudot(v18_state, xx & 0x1F); if (yy) *t++ = yy; } } printf("\n"); *t = '\0'; v18_free(v18_state); printf("Result:\n%s\n", result); printf("Reference result:\n%s\n", full_baudot_rx); if (strcmp(result, full_baudot_rx) != 0) return -1; return 0; } /*- End of function --------------------------------------------------------*/ static int test_x_05(void) { /* III.5.4.5.5 DTMF receiver disabling Purpose: To verify that the TUT disables its DTMF receiver for 300 ms when a character is transmitted. Preamble: Establish a call between the tester and TUT in DTMF mode. Method: The operator should send a single "e" character from the TUT which will result in sending a single DTMF tone to the tester. The tester will immediately start sending a unique character sequence using single DTMF tones. Examination of the TUT display will show when its receiver is re-enabled. Pass criteria: The receiver should be re-enabled after 300 ms. */ printf("Test not yet implemented\n"); return 0; } /*- End of function --------------------------------------------------------*/ static int test_x_06(void) { char msg[128]; char dtmf[1024]; char result[1024]; const char *ref; int i; /* III.5.4.5.6 DTMF character conversion Purpose: To check that the character conversion tables in Annex B have been correctly implemented. Preamble: Establish a call between the tester and TUT in DTMF mode. Method: The tester will send each character from the set in Annex B, waiting for a response after each one. Each character should be responded to at the TUT by typing the same character. Pass criteria: The tester will verify that each character is correctly echoed back by the TUT. Comments: The conversion table is specified in Annex B. The receiver at the tester may be re- enabled 100 ms after transmission of each character to maximize likelihood of receiving character from the TUT. It is assumed that the echo delay in the test system is negligible. */ for (i = 0; i < 127; i++) msg[i] = i + 1; msg[127] = '\0'; printf("%s\n", msg); v18_encode_dtmf(NULL, dtmf, msg); printf("%s\n", dtmf); v18_decode_dtmf(NULL, result, dtmf); ref = "\b \n\n\n?\n\n\n %+().+,-.0123456789:;(=)" "?XABCDEFGHIJKLMNOPQRSTUVWXYZ\xC6\xD8\xC5" " abcdefghijklmnopqrstuvwxyz\xE6\xF8\xE5 \b"; printf("Result:\n%s\n", result); printf("Reference result:\n%s\n", ref); if (strcmp(result, ref) != 0) return -1; return 0; } /*- End of function --------------------------------------------------------*/ static int test_x_07(void) { /* III.5.4.5.7 EDT carrier timing and receiver disabling Purpose: To verify that the TUT sends unmodulated carrier for 300 ms before a character and disables its receiver for 300 ms after a character is transmitted. Preamble: Establish a call between the tester and TUT in EDT mode. Method: The operator should send a single character from the TUT. The tester will immediately start sending a unique character sequence. Examination of the TUT display will show when its receiver is re-enabled. Pass criteria: 1) The TUT should send unmodulated carrier for 300 ms before the beginning of the start bit. 2) The receiver should be re-enabled after 300 ms. 3) The tester will confirm that 1 start bit and at least 1.5 stop bits are used. Comments: The carrier should be maintained during the 300 ms after a character. */ printf("Test not yet implemented\n"); return 0; } /*- End of function --------------------------------------------------------*/ static int test_x_08(void) { /* III.5.4.5.8 EDT bit rate and character structure Purpose: To verify that the TUT uses the correct bit rate and character structure in the EDT mode. Preamble: Establish a call between the tester and TUT in EDT mode. Method: The operator should transmit the string "abcdef" from the TUT. Pass criteria: 1) The tester should measure the bit timings and confirm that the rate is 110 bit/s. 2) The tester should confirm that 1 start bit, 7 data bits, 1 even parity bit and 2 stop bits are used. */ printf("Test not yet implemented\n"); return 0; } /*- End of function --------------------------------------------------------*/ static int test_x_09(void) { /* III.5.4.5.9 V.23 calling mode character format Purpose: To verify that the TUT uses the correct character format in the V.23 calling mode. Preamble: Establish a call from the TUT to the tester in V.23 mode. Method: The operator should transmit the string "abcdef" from the TUT. The tester will echo characters back to the TUT as they are received. The tester will then transmit the string "abcdef" with ODD parity to the TUT. Pass criteria: 1) Confirm that 1 start bit, 7 data bits, 1 even parity bit and 2 stop bits are transmitted. 2) The operator should confirm that there is no local echo at the TUT by checking that there are no duplicate characters on the TUT display. 3) The received string should be correctly displayed despite the incorrect parity. */ printf("Test not yet implemented\n"); return 0; } /*- End of function --------------------------------------------------------*/ static int test_x_10(void) { /* III.5.4.5.10 V.23 answer mode character format Purpose: To verify that the TUT uses the correct character format in the V.23 answer mode. Preamble: Establish a call from the tester to the TUT in V.23 mode. Method: The tester will transmit the string "abcdef" with ODD parity. The TUT should echo characters back to the tester as they are received. The operator should then transmit the string "abcdef" from the TUT. Pass criteria: 1) The received string should be correctly displayed at the TUT despite the incorrect parity. 2) Confirm that 1 start bit, 7 data bits, 1 even parity bit and 2 stop bits are transmitted by the TUT. 3) The tester should confirm that there is remote echo from TUT. 4) The operator should confirm that there is local echo on the TUT. Comments: */ printf("Test not yet implemented\n"); return 0; } /*- End of function --------------------------------------------------------*/ static int test_x_11(void) { /* III.5.4.5.11 This test is only applicable to Minitel Dialogue terminals. Prestel and Minitel Normal terminals cannot operate in this mode. V.21 character structure Purpose: To verify that the TUT uses the character structure in the V.21 mode. Preamble: Establish a call from the TUT to the tester in V.21 mode. Method: The operator should transmit a string from the TUT that is long enough to cause the display to word wrap followed by "abcdef", new line (CR+LF). The tester will then transmit the string "123456", BACKSPACE (0/8) with ODD parity to the TUT. Pass criteria: 1) The tester should confirm that 1 start bit, 7 data bits, 1 even parity bit and 1 stop bits are transmitted. 2) The word wrap should not result in CR+LF. 3) The forced new line should be indicated by CR+LF. 4) The last five characters on the TUT display should be "12345" (no "6") correctly displayed despite the incorrect parity. */ printf("Test not yet implemented\n"); return 0; } /*- End of function --------------------------------------------------------*/ static int test_x_12(void) { /* III.5.4.5.12 V.18 mode Purpose: To verify that the TUT uses the protocol defined in ITU-T T.140. Preamble: Establish a call from the TUT to the tester in V.18 mode. Method: The operator should transmit a string from the TUT that is long enough to cause the display to word wrap followed by "abcdef", new line (CR+LF), new line (UNICODE preferred). The tester will then transmit the string "123456", BACKSPACE. Pass criteria: The tester should confirm UTF8 encoded UNICODE characters are used with the controls specified in ITU-T T.140. */ printf("Test not yet implemented\n"); return 0; } /*- End of function --------------------------------------------------------*/ static void put_v18_msg(void *user_data, const uint8_t *msg, int len) { char buf[1024]; memcpy(buf, msg, len); buf[len] = '\0'; printf("Received (%d bytes) '%s'\n", len, buf); } /*- End of function --------------------------------------------------------*/ static int decode_test_data_file(int mode, const char *filename) { int16_t amp[SAMPLES_PER_CHUNK]; SNDFILE *inhandle; int len; v18_state_t *v18_state; logging_state_t *logging; printf("Decoding as '%s'\n", v18_mode_to_str(mode)); /* We will decode the audio from a file. */ if ((inhandle = sf_open_telephony_read(decode_test_file, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", decode_test_file); exit(2); } v18_state = v18_init(NULL, FALSE, mode, put_v18_msg, NULL); logging = v18_get_logging_state(v18_state); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, ""); for (;;) { if ((len = sf_readf_short(inhandle, amp, SAMPLES_PER_CHUNK)) <= 0) break; v18_rx(v18_state, amp, len); } if (sf_close_telephony(inhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", decode_test_file); exit(2); } v18_free(v18_state); return 0; } /*- End of function --------------------------------------------------------*/ const struct { const char *title; int (*func)(void); } test_list[] = { {"III.3.2.1 Operational requirements tests", NULL}, {"MISC-01 4 (1) No Disconnection Test", test_misc_01}, {"MISC-02 4 (2) Automatic resumption of automoding", test_misc_02}, {"MISC-03 4 (2) Retention of selected mode on loss of signal", test_misc_03}, {"MISC-04 4 (4) Detection of BUSY tone", test_misc_04}, {"MISC-05 4 (4) Detection of RINGING", test_misc_05}, {"MISC-06 4 (4) LOSS OF CARRIER indication", test_misc_06}, {"MISC-07 4 (4) Call progress indication", test_misc_07}, {"MISC-08 4 (5) Circuit 135 test", test_misc_08}, {"MISC-09 4 (6) Connection Procedures", test_misc_09}, {"III.3.2.2 Automode originate tests", NULL}, {"ORG-01 5.1.1 CI & XCI Signal coding and cadence", test_org_01}, {"ORG-02 5.1.3 ANS Signal Detection", test_org_02}, {"ORG-03 5.2.3.1 End of ANS signal detection", test_org_03}, {"ORG-04 5.1.3.2 ANS tone followed by TXP", test_org_04}, {"ORG-05 5.1.3.3 ANS tone followed by 1650Hz", test_org_05}, {"ORG-06 5.1.3.4 ANS tone followed by 1300Hz", test_org_06}, {"ORG-07 5.1.3 ANS tone followed by no tone", test_org_07}, {"ORG-08 5.1.4 Bell 103 (2225Hz Signal) Detection", test_org_08}, {"ORG-09 5.1.5 V.21 (1650Hz Signal) Detection", test_org_09}, {"ORG-10 5.1.6 V.23 (1300Hz Signal) Detection", test_org_10}, {"ORG-11 5.1.7 V.23 (390Hz Signal) Detection", test_org_11}, {"ORG-12a to d 5.1.8 5 Bit Mode (Baudot) Detection Tests", test_org_12}, {"ORG-13 5.1.9 DTMF signal detection", test_org_13}, {"ORG-14 5.1.10 EDT Rate Detection", test_org_14}, {"ORG-15 5.1.10.1 Rate Detection Test", test_org_15}, {"ORG-16 5.1.10.2 980Hz Detection", test_org_16}, {"ORG-17 5.1.10.3 Loss of signal after 980Hz", test_org_17}, {"ORG-18 5.1.10.3 Tr Timer", test_org_18}, {"ORG-19 5.1.11 Bell 103 (1270Hz Signal) Detection", test_org_19}, {"ORG-20 Immunity to Network Tones", test_org_20}, {"ORG-21a to b Immunity to other non-textphone modems", test_org_21}, {"ORG-22 Immunity to Fax Tones", test_org_22}, {"ORG-23 Immunity to Voice", test_org_23}, {"ORG-24 5.1.2 ANSam detection", test_org_24}, {"ORG-25 6.1 V.8 originate call", test_org_25}, {"III.3.2.3 Automode answer tests", NULL}, {"ANS-01 5.2.1 Ta timer", test_ans_01}, {"ANS-02 5.2.2 CI Signal Detection", test_ans_02}, {"ANS-03 5.2.2.1 Early Termination of ANS tone", test_ans_03}, {"ANS-04 5.2.2.2 Tt Timer", test_ans_04}, {"ANS-05 5.2.3.2 ANS tone followed by 980Hz", test_ans_05}, {"ANS-06 5.2.3.2 ANS tone followed by 1300Hz", test_ans_06}, {"ANS-07 5.2.3.3 ANS tone followed by 1650Hz", test_ans_07}, {"ANS-08 5.2.4.1 980Hz followed by 1650Hz", test_ans_08}, {"ANS-09a to d 5.2.4.2 980Hz calling tone detection", test_ans_09}, {"ANS-10 5.2.4.3 V.21 Detection by Timer", test_ans_10}, {"ANS-11 5.2.4.4.1 EDT Detection by Rate", test_ans_11}, {"ANS-12 5.2.4.4.2 V.21 Detection by Rate", test_ans_12}, {"ANS-13 5.2.4.4.3 Tr Timer", test_ans_13}, {"ANS-14 5.2.4.5 Te Timer", test_ans_14}, {"ANS-15a to d 5.2.5 5 Bit Mode (Baudot) Detection Tests", test_ans_15}, {"ANS-16 5.2.6 DTMF Signal Detection", test_ans_16}, {"ANS-17 5.2.7 Bell 103 (1270Hz signal) detection", test_ans_17}, {"ANS-18 5.2.8 Bell 103 (2225Hz signal) detection", test_ans_18}, {"ANS-19 5.2.9 V.21 Reverse Mode (1650Hz) Detection", test_ans_19}, {"ANS-20a to d 5.2.10 1300Hz Calling Tone Discrimination", test_ans_20}, {"ANS-21 5.2.11 V.23 Reverse Mode (1300Hz) Detection", test_ans_21}, {"ANS-22 1300Hz with XCI Test", test_ans_22}, {"ANS-23 5.2.12 Stimulate Mode Country Settings", test_ans_23}, {"ANS-24 5.2.12.1 Stimulate Carrierless Mode Probe Message", test_ans_24}, {"ANS-25 5.2.12.1.1 Interrupted Carrierless Mode Probe", test_ans_25}, {"ANS-26 5.2.12.2 Stimulate Carrier Mode Probe Time", test_ans_26}, {"ANS-27 5.2.12.2.1 V.23 Mode (390Hz) Detection", test_ans_27}, {"ANS-28 5.2.12.2.2 Interrupted Carrier Mode Probe", test_ans_28}, {"ANS-29 5.2.12.2.2 Stimulate Mode Response During Probe", test_ans_29}, {"ANS-30 Immunity to Network Tones", test_ans_30}, {"ANS-31 Immunity to Fax Calling Tones", test_ans_31}, {"ANS-32 Immunity to Voice", test_ans_32}, {"ANS-33 5.2.2.1 V.8 CM detection and V.8 Answering", test_ans_33}, {"III.3.2.4 Automode monitor tests", NULL}, {"MON-01 to -20 5.3 Repeat all answer mode tests excluding tests ANS-01, ANS-20 and ANS-23 to ANS-29", test_mon_01}, {"MON-21 5.3 Automode Monitor Ta timer", test_mon_21}, {"MON-22a to d 5.3 Automode Monitor 1300Hz Calling Tone Discrimination", test_mon_22}, {"MON-23a to d 5.3 Automode Monitor 980Hz Calling Tone Discrimination", test_mon_23}, {"III.3.2.5 ITU-T V.18 annexes tests", NULL}, {"X-01 A.1 Baudot carrier timing and receiver disabling", test_x_01}, {"X-02 A.2 Baudot bit rate confirmation", test_x_02}, {"X-03 A.3 Baudot probe bit rate confirmation", test_x_03}, {"X-04 A.4 5 Bit to T.50 Character Conversion", test_x_04}, {"X-05 B.1 DTMF receiver disabling", test_x_05}, {"X-06 B.2 DTMF character conversion", test_x_06}, {"X-07 C.1 EDT carrier timing and receiver disabling", test_x_07}, {"X-08 C.2-3 EDT bit rate and character structure", test_x_08}, {"X-09 E V.23 calling mode character format", test_x_09}, {"X-10 E V.23 answer mode character format", test_x_10}, {"X-11 F.4-5 V.21 character structure", test_x_11}, {"X-12 G.1-3 V.18 mode", test_x_12}, {"", NULL} }; int main(int argc, char *argv[]) { int i; int res; int hit; const char *match; int test_standard; int opt; match = NULL; test_standard = -1; while ((opt = getopt(argc, argv, "d:ls:")) != -1) { switch (opt) { case 'd': decode_test_file = optarg; break; case 'l': log_audio = TRUE; break; case 's': test_standard = atoi(optarg); break; default: //usage(); exit(2); break; } } if (decode_test_file) { decode_test_data_file(test_standard, decode_test_file); exit(0); } argc -= optind; argv += optind; if (argc > 0) match = argv[0]; outhandle = NULL; if (log_audio) { if ((outhandle = sf_open_telephony_write(OUTPUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } } hit = FALSE; for (i = 0; test_list[i].title[0]; i++) { if (test_list[i].func && (match == NULL || (strncmp(match, test_list[i].title, strlen(match)) == 0 && test_list[i].title[strlen(match)] == ' '))) { hit = TRUE; printf("%s\n", test_list[i].title); res = test_list[i].func(); if (res < 0) { printf(" Test failed\n"); exit(2); } if (res == 0) { printf(" Test passed\n"); } } else { if (match == NULL) printf("%s\n", test_list[i].title); } } if (!hit) { printf("Test not found\n"); exit(2); } basic_tests(V18_MODE_5BIT_45); basic_tests(V18_MODE_5BIT_45 | 0x100); if (log_audio) { if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } } printf("Tests passed\n"); return 0; return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/t31_tests.c0000664000175000017500000007540412101214305013246 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t31_tests.c - Tests for the T.31 modem. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page t31_tests_page T.31 tests \section t31_tests_page_sec_1 What does it do? */ /* Enable the following definition to enable direct probing into the FAX structures */ //#define WITH_SPANDSP_INTERNALS #if defined(HAVE_CONFIG_H) #include "config.h" #endif #if defined(HAVE_FL_FL_H) && defined(HAVE_FL_FL_CARTESIAN_H) && defined(HAVE_FL_FL_AUDIO_METER_H) #define ENABLE_GUI #endif #include #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp/t30_fcf.h" #include "spandsp-sim.h" #if defined(ENABLE_GUI) #include "media_monitor.h" #endif #include "fax_utils.h" #define INPUT_FILE_NAME "../test-data/itu/fax/itu1.tif" #define OUTPUT_FILE_NAME "t31.tif" #define OUTPUT_WAVE_FILE_NAME "t31_tests.wav" enum { ETX = 0x03, DLE = 0x10, SUB = 0x1A }; #define MANUFACTURER "www.soft-switch.org" #define SAMPLES_PER_CHUNK 160 struct command_response_s { const char *command; int len_command; const char *response; int len_response; }; g1050_state_t *path_a_to_b; g1050_state_t *path_b_to_a; double when = 0.0; int t38_mode = FALSE; #define EXCHANGE(a,b) {a, sizeof(a) - 1, b, sizeof(b) - 1} #define RESPONSE(b) {"", 0, b, sizeof(b) - 1} #define FAST_RESPONSE(b) {NULL, -1, b, sizeof(b) - 1} #define FAST_SEND(b) {(const char *) 1, -2, b, sizeof(b) - 1} #define FAST_SEND_TCF(b) {(const char *) 2, -2, b, sizeof(b) - 1} #define END_OF_SEQUENCE {NULL, -1, NULL, -1} static const struct command_response_s fax_send_test_seq[] = { EXCHANGE("ATE0\r", "ATE0\r\r\nOK\r\n"), EXCHANGE("AT+FCLASS=1\r", "\r\nOK\r\n"), EXCHANGE("ATD123456789\r", "\r\nCONNECT\r\n"), // AT+FRH=3 is implied when dialing in the AT+FCLASS=1 state //RESPONSE("\xFF\x03\x10\x03"), //RESPONSE("\r\nOK\r\n"), //EXCHANGE("AT+FRH=3\r", "\r\nCONNECT\r\n"), // RESPONSE("\xFF\x03\x40\x31\x31\x31\x31\x31\x31\x31\x31\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x1e\x46\x10\x03"), RESPONSE("\r\nOK\r\n"), EXCHANGE("AT+FRH=3\r", "\r\nCONNECT\r\n"), // RESPONSE("\xFF\x13\x80\x00\xEE\xF8\x80\x80\x91\x80\x80\x80\x18\x78\x57\x10\x03"), // For audio FAXing //RESPONSE("\xFF\x13\x80\x04\xEE\xF8\x80\x80\x91\x80\x80\x80\x18\xE4\xE7\x10\x03"), // For T.38 FAXing RESPONSE("\r\nOK\r\n"), //EXCHANGE("AT+FRH=3\r", "\r\nNO CARRIER\r\n"), EXCHANGE("AT+FTH=3\r", "\r\nCONNECT\r\n"), // EXCHANGE("\xFF\x03\x43\x32\x32\x32\x32\x32\x32\x32\x32\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x10\x03", "\r\nCONNECT\r\n"), // EXCHANGE("\xFF\x13\x83\x01\xC6\x80\x80\x80\x80\x01\xFD\x13\x10\x03", "\r\nOK\r\n"), //Do a wait for timed silence at this point, or there won't be one in the tests EXCHANGE("AT+FRS=7\r", "\r\nOK\r\n"), //EXCHANGE("AT+FTS=8;+FTM=96\r", "\r\nCONNECT\r\n"), EXCHANGE("AT+FTS=8\r", "\r\nOK\r\n"), EXCHANGE("AT+FTM=96\r", "\r\nCONNECT\r\n"), // FAST_SEND_TCF("\r\nOK\r\n"), EXCHANGE("AT+FRH=3\r", "\r\nCONNECT\r\n"), // RESPONSE("\xFF\x13\x84\xEA\x7D\x10\x03"), RESPONSE("\r\nOK\r\n"), EXCHANGE("AT+FTM=96\r", "\r\nCONNECT\r\n"), // FAST_SEND("\r\nOK\r\n"), //EXCHANGE("AT+FTS=8;+FTH=3\r", "\r\nCONNECT\r\n"), EXCHANGE("AT+FTS=8\r", "\r\nOK\r\n"), EXCHANGE("AT+FTH=3\r", "\r\nCONNECT\r\n"), // EXCHANGE("\xFF\x13\x2E\x10\x03", "\r\nOK\r\n"), EXCHANGE("AT+FRH=3\r", "\r\nCONNECT\r\n"), // RESPONSE("\xFF\x13\x8C\xA2\xF1\x10\x03"), RESPONSE("\r\nOK\r\n"), EXCHANGE("AT+FTH=3\r", "\r\nCONNECT\r\n"), // EXCHANGE("\xFF\x13\xFB\x10\x03", "\r\nOK\r\n"), EXCHANGE("ATH0\r", "\r\nOK\r\n"), END_OF_SEQUENCE }; static const struct command_response_s fax_receive_test_seq[] = { EXCHANGE("ATE0\r", "ATE0\r\r\nOK\r\n"), EXCHANGE("AT+FCLASS=1\r", "\r\nOK\r\n"), RESPONSE("\r\nRING\r\n"), EXCHANGE("ATA\r", "\r\nCONNECT\r\n"), // EXCHANGE("\xFF\x03\x40\x32\x32\x32\x32\x32\x32\x32\x32\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x10\x03", "\r\nCONNECT\r\n"), // EXCHANGE("\xFF\x13\x80\x01\xCE\xF4\x80\x80\x81\x80\x80\x80\x18\x10\x03", "\r\nOK\r\n"), EXCHANGE("AT+FRH=3\r", "\r\nCONNECT\r\n"), // RESPONSE("\xFF\x03\x43\x31\x31\x31\x31\x31\x31\x31\x31\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\xAA\x1F\x10\x03"), RESPONSE("\r\nOK\r\n"), EXCHANGE("AT+FRH=3\r", "\r\nCONNECT\r\n"), // RESPONSE("\xFF\x13\x83\x00\xC6\x74\x53\x00\x10\x03"), RESPONSE("\r\nOK\r\n"), EXCHANGE("AT+FRM=96\r", "\r\nCONNECT\r\n"), // FAST_RESPONSE(NULL), RESPONSE("\r\nNO CARRIER\r\n"), EXCHANGE("AT+FTH=3\r", "\r\nCONNECT\r\n"), // EXCHANGE("\xFF\x13\x84\x10\x03", "\r\nOK\r\n"), EXCHANGE("AT+FRM=96\r", "\r\nCONNECT\r\n"), // FAST_RESPONSE(NULL), RESPONSE("\r\nNO CARRIER\r\n"), EXCHANGE("AT+FRH=3\r", "\r\nCONNECT\r\n"), // RESPONSE("\xFF\x13\x2F\x33\x66\x10\x03"), RESPONSE("\r\nOK\r\n"), EXCHANGE("AT+FTH=3\r", "\r\nCONNECT\r\n"), // EXCHANGE("\xFF\x13\x8C\x10\x03", "\r\nOK\r\n"), EXCHANGE("AT+FRH=3\r", "\r\nCONNECT\r\n"), // RESPONSE("\xFF\x13\xfb\x9a\xf6\x10\x03"), RESPONSE("\r\nOK\r\n"), EXCHANGE("ATH0\r", "\r\nOK\r\n"), END_OF_SEQUENCE }; static const struct command_response_s v34_fax_send_test_seq[] = { EXCHANGE("ATE0\r", "ATE0\r\r\nOK\r\n"), EXCHANGE("AT+A8E=3,,\r", "\r\nOK\r\n"), EXCHANGE("AT+FCLASS=1.0\r", "\r\nOK\r\n"), EXCHANGE("AT+F34=14,4,2\r", "\r\nOK\r\n"), EXCHANGE("ATD123456789\r", "\r\n+A8A:1\r\nOK\r\n"), EXCHANGE("AT+A8M=8185D490\r", "\r\n+A8M:8185D490\r\nOK\r\n"), EXCHANGE("ATO\r", "\r\n+A8J:1\r\n+F34=14,2\r\nCONNECT\r\n"), // RESPONSE("\x10\x6B\x10\x7D\x10\x6F" "\xFF\x13\x80\x00\xEE\xF8\x80\x80\x91\x80\x80\x80\x18\x78\x57\x10\x03"), // For audio FAXing //RESPONSE("\x10\x6B\x10\x7D\x10\x6F" ""\xFF\x13\x80\x04\xEE\xF8\x80\x80\x91\x80\x80\x80\x18\xE4\xE7\x10\x03"), // For T.38 FAXing // // EXCHANGE("\xFF\x13\x83\x01\xC6\x80\x80\x80\x80\x01\xFD\x13\x10\x03", "\xFF\x13\x84\xEA\x7D\x10\x03"), EXCHANGE("\x10\x04", "\x10\x04\x10\x7D"), // EXCHANGE("\x10\x6B", "\x10\x6B\x10\x79\x10\x6F"), // // // EXCHANGE("\x10\x03", "\xFF\x13\x8C\xA2\xF1\x10\x03"), // EXCHANGE("\xFF\x13\xFB\x10\x03\x10\x04", "\r\nOK\r\n"), EXCHANGE("ATH\r", "\r\nOK\r\n"), END_OF_SEQUENCE }; static const struct command_response_s v34_fax_receive_test_seq[] = { EXCHANGE("ATE0\r", "ATE0\r\r\nOK\r\n"), EXCHANGE("AT+A8E=,2,\r", "\r\nOK\r\n"), EXCHANGE("AT+FCLASS=1.0\r", "\r\nOK\r\n"), EXCHANGE("AT+F34=10\r", "\r\nOK\r\n"), RESPONSE("\r\nRING\r\n"), EXCHANGE("ATA\r", "\r\n+A8M:8185D490\r\nOK\r\n"), EXCHANGE("AT+A8M=8185D490;O\r", "\r\n+A8J:1\r\n+F34:10,1\r\nCONNECT\r\n"), RESPONSE("\x10\x10\x10"), EXCHANGE("ATH\r", "\r\nOK\r\n"), END_OF_SEQUENCE }; static const struct command_response_s v34_fax_receive_a_test_seq[] = { EXCHANGE("ATE0\r", "ATE0\r\r\nOK\r\n"), EXCHANGE("AT+A8E=,3,\r", "\r\nOK\r\n"), EXCHANGE("AT+FCLASS=1.0\r", "\r\nOK\r\n"), EXCHANGE("AT+F34=10\r", "\r\nOK\r\n"), RESPONSE("\r\nRING\r\n"), EXCHANGE("ATA\r", "\r\n+A8C:1\r\n+A8C:1\r\n"), EXCHANGE("X", "\r\nOK\r\n"), EXCHANGE("AT+A8E=,2,\r", "\r\n+A8M:8185D490\r\nOK\r\n"), EXCHANGE("AT+A8M=8185D490\r", "\r\n+A8J:1\r\n+F34:10,1\r\nCONNECT\r\n"), RESPONSE("\x10\x10\x10"), EXCHANGE("ATH\r", "\r\nOK\r\n"), END_OF_SEQUENCE }; static const struct command_response_s v34_fax_receive_b_test_seq[] = { EXCHANGE("ATE0\r", "ATE0\r\r\nOK\r\n"), EXCHANGE("AT+A8E=,3,\r", "\r\nOK\r\n"), EXCHANGE("AT+FCLASS=1.0\r", "\r\nOK\r\n"), EXCHANGE("AT+F34=10\r", "\r\nOK\r\n"), RESPONSE("\r\nRING\r\n"), EXCHANGE("ATA\r", "\r\nA8I:81\r\n"), RESPONSE("A8I:81\r\n"), EXCHANGE("X", "\r\nOK\r\n"), EXCHANGE("AT+A8E=,2,\r", "\r\n+A8M:8185D490\r\nOK\r\n"), END_OF_SEQUENCE }; char *decode_test_file = NULL; int countdown = 0; int command_response_test_step = -1; char response_buf[1000]; int response_buf_ptr = 0; int answered = FALSE; int kick = FALSE; int dled = FALSE; int done = FALSE; int sequence_terminated = FALSE; static const struct command_response_s *fax_test_seq; int test_seq_ptr = 0; t31_state_t *t31_state; static int phase_b_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; i = (int) (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase B", i); printf("%c: Phase B handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result)); fax_log_rx_parameters(s, tag); return T30_ERR_OK; } /*- End of function --------------------------------------------------------*/ static int phase_d_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; i = (int) (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase D", i); printf("%c: Phase D handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result)); fax_log_page_transfer_statistics(s, tag); fax_log_tx_parameters(s, tag); fax_log_rx_parameters(s, tag); return T30_ERR_OK; } /*- End of function --------------------------------------------------------*/ static void phase_e_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; i = (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase E", i); printf("Phase E handler on channel %c\n", i); fax_log_final_transfer_statistics(s, tag); fax_log_tx_parameters(s, tag); fax_log_rx_parameters(s, tag); //exit(0); } /*- End of function --------------------------------------------------------*/ static int modem_call_control(t31_state_t *s, void *user_data, int op, const char *num) { switch (op) { case AT_MODEM_CONTROL_ANSWER: printf("\nModem control - Answering\n"); answered = TRUE; break; case AT_MODEM_CONTROL_CALL: printf("\nModem control - Dialing '%s'\n", num); t31_call_event(t31_state, AT_CALL_EVENT_CONNECTED); break; case AT_MODEM_CONTROL_HANGUP: printf("\nModem control - Hanging up\n"); done = TRUE; break; case AT_MODEM_CONTROL_OFFHOOK: printf("\nModem control - Going off hook\n"); break; case AT_MODEM_CONTROL_DTR: printf("\nModem control - DTR %d\n", (int) (intptr_t) num); break; case AT_MODEM_CONTROL_RTS: printf("\nModem control - RTS %d\n", (int) (intptr_t) num); break; case AT_MODEM_CONTROL_CTS: printf("\nModem control - CTS %d\n", (int) (intptr_t) num); break; case AT_MODEM_CONTROL_CAR: printf("\nModem control - CAR %d\n", (int) (intptr_t) num); break; case AT_MODEM_CONTROL_RNG: printf("\nModem control - RNG %d\n", (int) (intptr_t) num); break; case AT_MODEM_CONTROL_DSR: printf("\nModem control - DSR %d\n", (int) (intptr_t) num); break; default: printf("\nModem control - operation %d\n", op); break; } /*endswitch*/ return 0; } /*- End of function --------------------------------------------------------*/ static int at_tx_handler(at_state_t *s, void *user_data, const uint8_t *buf, size_t len) { size_t i; i = 0; if (fax_test_seq[test_seq_ptr].command == NULL) { /* TCF or non-ECM image data expected */ for ( ; i < len; i++) { if (dled) { if (buf[i] == ETX) { printf("\nFast data ended\n"); response_buf_ptr = 0; response_buf[response_buf_ptr] = '\0'; test_seq_ptr++; if (fax_test_seq[test_seq_ptr].command == NULL && fax_test_seq[test_seq_ptr].command == NULL) sequence_terminated = TRUE; if (fax_test_seq[test_seq_ptr].command) kick = TRUE; break; } dled = FALSE; } else { if (buf[i] == DLE) dled = TRUE; } } i++; if (i >= len) return 0; } for ( ; i < len; i++) { response_buf[response_buf_ptr++] = buf[i]; putchar(buf[i]); } response_buf[response_buf_ptr] = '\0'; printf("Expected "); for (i = 0; i < response_buf_ptr; i++) printf("%02x ", fax_test_seq[test_seq_ptr].response[i] & 0xFF); printf("\n"); printf("Response "); for (i = 0; i < response_buf_ptr; i++) printf("%02x ", response_buf[i] & 0xFF); printf("\n"); printf("Match %d against %d\n", response_buf_ptr, fax_test_seq[test_seq_ptr].len_response); if (response_buf_ptr >= fax_test_seq[test_seq_ptr].len_response && memcmp(fax_test_seq[test_seq_ptr].response, response_buf, fax_test_seq[test_seq_ptr].len_response) == 0) { printf("\nMatched\n"); test_seq_ptr++; if (fax_test_seq[test_seq_ptr].command == NULL && fax_test_seq[test_seq_ptr].command == NULL) sequence_terminated = TRUE; response_buf_ptr = 0; response_buf[response_buf_ptr] = '\0'; if (fax_test_seq[test_seq_ptr].command) kick = TRUE; else dled = FALSE; } return 0; } /*- End of function --------------------------------------------------------*/ static int t38_tx_packet_handler(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count) { int i; /* This routine queues messages between two instances of T.38 processing, from the T.38 terminal side. */ span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d, count %d\n", s->tx_seq_no, len, count); for (i = 0; i < count; i++) { if (g1050_put(path_a_to_b, buf, len, s->tx_seq_no, when) < 0) printf("Lost packet %d\n", s->tx_seq_no); } return 0; } /*- End of function --------------------------------------------------------*/ static int t31_tx_packet_handler(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count) { int i; /* This routine queues messages between two instances of T.38 processing, from the T.31 modem side. */ span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d, count %d\n", s->tx_seq_no, len, count); for (i = 0; i < count; i++) { if (g1050_put(path_b_to_a, buf, len, s->tx_seq_no, when) < 0) printf("Lost packet %d\n", s->tx_seq_no); } return 0; } /*- End of function --------------------------------------------------------*/ static int t30_tests(int t38_mode, int use_gui, int log_audio, int test_sending, int g1050_model_no, int g1050_speed_pattern_no) { t38_terminal_state_t *t38_state; fax_state_t *fax_state; int fast_send; int fast_send_tcf; int fast_blocks; uint8_t fast_buf[1000]; uint8_t msg[1024]; int msg_len; int t30_len; int t31_len; int t38_version; int without_pacing; int use_tep; int seq_no; double tx_when; double rx_when; t30_state_t *t30; t38_core_state_t *t38_core; logging_state_t *logging; int i; int k; int outframes; int16_t t30_amp[SAMPLES_PER_CHUNK]; int16_t t31_amp[SAMPLES_PER_CHUNK]; int16_t silence[SAMPLES_PER_CHUNK]; int16_t out_amp[2*SAMPLES_PER_CHUNK]; SNDFILE *wave_handle; SNDFILE *in_handle; /* Test the T.31 modem against the full FAX machine in spandsp */ /* Set up the test environment */ t38_version = 1; without_pacing = FALSE; use_tep = FALSE; wave_handle = NULL; if (log_audio) { if ((wave_handle = sf_open_telephony_write(OUTPUT_WAVE_FILE_NAME, 2)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUTPUT_WAVE_FILE_NAME); exit(2); } } in_handle = NULL; if (decode_test_file) { if ((in_handle = sf_open_telephony_read(decode_test_file, 1)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", decode_test_file); exit(2); } } srand48(0x1234567); if ((path_a_to_b = g1050_init(g1050_model_no, g1050_speed_pattern_no, 100, 33)) == NULL) { fprintf(stderr, "Failed to start IP network path model\n"); exit(2); } if ((path_b_to_a = g1050_init(g1050_model_no, g1050_speed_pattern_no, 100, 33)) == NULL) { fprintf(stderr, "Failed to start IP network path model\n"); exit(2); } t38_state = NULL; fax_state = NULL; if (test_sending) { if (t38_mode) { if ((t38_state = t38_terminal_init(NULL, FALSE, t38_tx_packet_handler, t31_state)) == NULL) { fprintf(stderr, "Cannot start the T.38 channel\n"); exit(2); } t30 = t38_terminal_get_t30_state(t38_state); } else { fax_state = fax_init(NULL, FALSE); t30 = fax_get_t30_state(fax_state); } t30_set_rx_file(t30, OUTPUT_FILE_NAME, -1); fax_test_seq = fax_send_test_seq; countdown = 0; } else { if (t38_mode) { if ((t38_state = t38_terminal_init(NULL, TRUE, t38_tx_packet_handler, t31_state)) == NULL) { fprintf(stderr, "Cannot start the T.38 channel\n"); exit(2); } t30 = t38_terminal_get_t30_state(t38_state); } else { fax_state = fax_init(NULL, TRUE); t30 = fax_get_t30_state(fax_state); } t30_set_tx_file(t30, INPUT_FILE_NAME, -1, -1); fax_test_seq = fax_receive_test_seq; countdown = 250; } if (t38_mode) { t38_core = t38_terminal_get_t38_core_state(t38_state); t38_set_t38_version(t38_core, t38_version); t38_terminal_set_config(t38_state, without_pacing); t38_terminal_set_tep_mode(t38_state, use_tep); } t30_set_tx_ident(t30, "11111111"); t30_set_supported_modems(t30, T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17); //t30_set_tx_nsf(t30, (const uint8_t *) "\x50\x00\x00\x00Spandsp\x00", 12); t30_set_phase_b_handler(t30, phase_b_handler, (void *) 'A'); t30_set_phase_d_handler(t30, phase_d_handler, (void *) 'A'); t30_set_phase_e_handler(t30, phase_e_handler, (void *) 'A'); if (t38_mode) logging = t38_terminal_get_logging_state(t38_state); else logging = t30_get_logging_state(t30); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, (t38_mode) ? "T.38" : "FAX"); if (t38_mode) { t38_core = t38_terminal_get_t38_core_state(t38_state); span_log_set_level(&t38_core->logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(&t38_core->logging, "T.38"); logging = t30_get_logging_state(t30); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38"); } else { logging = fax_get_logging_state(fax_state); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "FAX"); } memset(silence, 0, sizeof(silence)); memset(t30_amp, 0, sizeof(t30_amp)); /* Now set up and run the T.31 modem */ if ((t31_state = t31_init(NULL, at_tx_handler, NULL, modem_call_control, NULL, t31_tx_packet_handler, NULL)) == NULL) { fprintf(stderr, " Cannot start the T.31 modem\n"); exit(2); } logging = t31_get_logging_state(t31_state); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.31"); if (t38_mode) { t38_core = t31_get_t38_core_state(t31_state); logging = t38_core_get_logging_state(t38_core); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.31"); span_log_set_level(&t31_state->at_state.logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(&t31_state->at_state.logging, "T.31"); t31_set_mode(t31_state, TRUE); t38_set_t38_version(t38_core, t38_version); } fast_send = FALSE; fast_send_tcf = TRUE; fast_blocks = 0; kick = TRUE; #if defined(ENABLE_GUI) if (use_gui) start_media_monitor(); #endif while (!done) { if (countdown) { /* Deal with call setup, through the AT interface. */ if (answered) { countdown = 0; t31_call_event(t31_state, AT_CALL_EVENT_ANSWERED); } else if (--countdown == 0) { t31_call_event(t31_state, AT_CALL_EVENT_ALERTING); countdown = 250; } } if (kick) { /* Work through the script */ kick = FALSE; if (fax_test_seq[test_seq_ptr].command > (const char *) 2) { if (fax_test_seq[test_seq_ptr].command[0]) { printf("%s\n", fax_test_seq[test_seq_ptr].command); t31_at_rx(t31_state, fax_test_seq[test_seq_ptr].command, fax_test_seq[test_seq_ptr].len_command); } } else { if (fax_test_seq[test_seq_ptr].command == (const char *) 2) { printf("Fast send TCF\n"); fast_send = TRUE; fast_send_tcf = TRUE; fast_blocks = 100; } else { printf("Fast send image\n"); fast_send = TRUE; fast_send_tcf = FALSE; fast_blocks = 100; } } } if (fast_send) { /* Send fast modem data */ if (fast_send_tcf) { /* If we are sending TCF, its simply zeros */ memset(fast_buf, 0, 36); if (fast_blocks == 1) { /* Tell the modem this is the end of the TCF data */ fast_buf[34] = DLE; fast_buf[35] = ETX; } } else { /* If we are sending image data, we need to make it look like genuine image data, with proper EOL and RTC markers. */ if (fast_blocks > 1) { /* Create a chunk of white page, 1728 pixels wide. */ for (i = 0; i < 36; i += 4) { fast_buf[i] = 0x00; fast_buf[i + 1] = 0x80; fast_buf[i + 2] = 0xB2; fast_buf[i + 3] = 0x01; } } else { /* Create the end of page condition. */ for (i = 0; i < 36; i += 3) { fast_buf[i] = 0x00; fast_buf[i + 1] = 0x08; fast_buf[i + 2] = 0x80; } /* Tell the modem this is the end of the image data. */ fast_buf[34] = DLE; fast_buf[35] = ETX; } } t31_at_rx(t31_state, (char *) fast_buf, 36); if (--fast_blocks == 0) fast_send = FALSE; } if (t38_mode) { while ((msg_len = g1050_get(path_a_to_b, msg, 1024, when, &seq_no, &tx_when, &rx_when)) >= 0) { #if defined(ENABLE_GUI) if (use_gui) media_monitor_rx(seq_no, tx_when, rx_when); #endif t38_core = t31_get_t38_core_state(t31_state); t38_core_rx_ifp_packet(t38_core, msg, msg_len, seq_no); } while ((msg_len = g1050_get(path_b_to_a, msg, 1024, when, &seq_no, &tx_when, &rx_when)) >= 0) { #if defined(ENABLE_GUI) if (use_gui) media_monitor_rx(seq_no, tx_when, rx_when); #endif t38_core = t38_terminal_get_t38_core_state(t38_state); t38_core_rx_ifp_packet(t38_core, msg, msg_len, seq_no); } #if defined(ENABLE_GUI) if (use_gui) media_monitor_update_display(); #endif /* Bump the G.1050 models along */ when += (float) SAMPLES_PER_CHUNK/(float) SAMPLE_RATE; /* Bump things along on the t38_terminal side */ span_log_bump_samples(t38_terminal_get_logging_state(t38_state), SAMPLES_PER_CHUNK); t38_core = t38_terminal_get_t38_core_state(t38_state); span_log_bump_samples(t38_core_get_logging_state(t38_core), SAMPLES_PER_CHUNK); t38_terminal_send_timeout(t38_state, SAMPLES_PER_CHUNK); t31_t38_send_timeout(t31_state, SAMPLES_PER_CHUNK); } else { t30_len = fax_tx(fax_state, t30_amp, SAMPLES_PER_CHUNK); /* The receive side always expects a full block of samples, but the transmit side may not be sending any when it doesn't need to. We may need to pad with some silence. */ if (t30_len < SAMPLES_PER_CHUNK) { memset(t30_amp + t30_len, 0, sizeof(int16_t)*(SAMPLES_PER_CHUNK - t30_len)); t30_len = SAMPLES_PER_CHUNK; } if (log_audio) { for (k = 0; k < t30_len; k++) out_amp[2*k] = t30_amp[k]; } if (t31_rx(t31_state, t30_amp, t30_len)) break; t31_len = t31_tx(t31_state, t31_amp, SAMPLES_PER_CHUNK); if (t31_len < SAMPLES_PER_CHUNK) { memset(t31_amp + t31_len, 0, sizeof(int16_t)*(SAMPLES_PER_CHUNK - t31_len)); t31_len = SAMPLES_PER_CHUNK; } if (log_audio) { for (k = 0; k < t31_len; k++) out_amp[2*k + 1] = t31_amp[k]; } if (fax_rx(fax_state, t31_amp, SAMPLES_PER_CHUNK)) break; if (log_audio) { outframes = sf_writef_short(wave_handle, out_amp, SAMPLES_PER_CHUNK); if (outframes != SAMPLES_PER_CHUNK) break; } /* Bump things along on the FAX machine side */ span_log_bump_samples(fax_get_logging_state(fax_state), SAMPLES_PER_CHUNK); } /* Bump things along on the FAX machine side */ span_log_bump_samples(t30_get_logging_state(t30), SAMPLES_PER_CHUNK); /* Bump things along on the T.31 modem side */ t38_core = t31_get_t38_core_state(t31_state); span_log_bump_samples(t38_core_get_logging_state(t38_core), SAMPLES_PER_CHUNK); span_log_bump_samples(t31_get_logging_state(t31_state), SAMPLES_PER_CHUNK); span_log_bump_samples(&t31_state->at_state.logging, SAMPLES_PER_CHUNK); } if (t38_mode) t38_terminal_release(t38_state); if (decode_test_file) { if (sf_close_telephony(in_handle)) { fprintf(stderr, " Cannot close audio file '%s'\n", decode_test_file); exit(2); } } if (log_audio) { if (sf_close_telephony(wave_handle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_WAVE_FILE_NAME); exit(2); } } if (!done || !sequence_terminated) { printf("Tests failed\n"); return 2; } return 0; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int log_audio; int t38_mode; int test_sending; int use_gui; int g1050_model_no; int g1050_speed_pattern_no; int opt; decode_test_file = NULL; log_audio = FALSE; test_sending = FALSE; t38_mode = FALSE; use_gui = FALSE; g1050_model_no = 0; g1050_speed_pattern_no = 1; while ((opt = getopt(argc, argv, "d:glM:rS:st")) != -1) { switch (opt) { case 'd': decode_test_file = optarg; break; case 'g': #if defined(ENABLE_GUI) use_gui = TRUE; #else fprintf(stderr, "Graphical monitoring not available\n"); exit(2); #endif break; case 'l': log_audio = TRUE; break; case 'M': g1050_model_no = optarg[0] - 'A' + 1; break; case 'r': test_sending = FALSE; break; case 'S': g1050_speed_pattern_no = atoi(optarg); break; case 's': test_sending = TRUE; break; case 't': t38_mode = TRUE; break; default: //usage(); exit(2); break; } } t30_tests(t38_mode, use_gui, log_audio, test_sending, g1050_model_no, g1050_speed_pattern_no); printf("Tests passed\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/tsb85_extra_tests.sh0000775000175000017500000000202312354306772015211 00000000000000#!/bin/sh # # spandsp fax tests # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 2.1, # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. run_tsb85_test() { rm -f fax_tests_1.tif echo ./tsb85_tests ${TEST} ./tsb85_tests -x ../spandsp/fax-tests.xml ${TEST} 2>xyzzy2 RETVAL=$? if [ $RETVAL != 0 ] then echo tsb85_tests ${TEST} failed! exit $RETVAL fi } for TEST in PPS-MPS-lost-PPS V17-12000-V29-9600 Phase-D-collision Modem-change-at-CTC do run_tsb85_test done spandsp-0.0.6/tests/echo_monitor.cpp0000664000175000017500000003171012101212532014432 00000000000000/* * SpanDSP - a series of DSP components for telephony * * echo_monitor.cpp - Display echo canceller status, using the FLTK toolkit. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #if defined(HAVE_FL_FL_H) && defined(HAVE_FL_FL_CARTESIAN_H) #define __STDC_LIMIT_MACROS #include #include #include #include #include #include #include #if defined(HAVE_FFTW3_H) #include #else #include #endif #include #include #include #include #include #include #include "spandsp.h" #include "echo_monitor.h" struct line_model_monitor_s { Fl_Double_Window *w; Fl_Audio_Meter *audio_meter; Fl_Group *c_spec; Fl_Group *c_right; Fl_Group *c_can; Fl_Group *c_line_model; Ca_Canvas *canvas_spec; Ca_X_Axis *spec_freq; Ca_Y_Axis *spec_amp; Ca_Line *spec_re; double spec_re_plot[2*512]; Ca_Canvas *canvas_can; Ca_X_Axis *can_x; Ca_Y_Axis *can_y; Ca_Line *can_re; double can_re_plot[512]; Ca_Canvas *canvas_line_model; Ca_X_Axis *line_model_x; Ca_Y_Axis *line_model_y; Ca_Line *line_model_re; double line_model_re_plot[512]; int in_ptr; #if defined(HAVE_FFTW3_H) double in[1024][2]; double out[1024][2]; #else fftw_complex in[1024]; fftw_complex out[1024]; #endif fftw_plan p; }; static int skip = 0; static struct line_model_monitor_s echo; static struct line_model_monitor_s *s = &echo; int echo_can_monitor_can_update(const int16_t *coeffs, int len) { int i; float min; float max; if (s->can_re) delete s->can_re; s->canvas_can->current(s->canvas_can); i = 0; min = coeffs[i]; max = coeffs[i]; for (i = 0; i < len; i++) { s->can_re_plot[2*i] = i; s->can_re_plot[2*i + 1] = coeffs[i]; if (min > coeffs[i]) min = coeffs[i]; if (max < coeffs[i]) max = coeffs[i]; } s->can_y->maximum((max == min) ? max + 0.2 : max); s->can_y->minimum(min); s->can_re = new Ca_Line(len, s->can_re_plot, 0, 0, FL_BLUE, CA_NO_POINT); if (++skip >= 100) { skip = 0; Fl::check(); } return 0; } /*- End of function --------------------------------------------------------*/ int echo_can_monitor_line_model_update(const int32_t *coeffs, int len) { int i; float min; float max; if (s->line_model_re) delete s->line_model_re; s->canvas_line_model->current(s->canvas_line_model); i = 0; min = coeffs[i]; max = coeffs[i]; for (i = 0; i < len; i++) { s->line_model_re_plot[2*i] = i; s->line_model_re_plot[2*i + 1] = coeffs[i]; if (min > coeffs[i]) min = coeffs[i]; if (max < coeffs[i]) max = coeffs[i]; } s->line_model_y->maximum((max == min) ? max + 0.2 : max); s->line_model_y->minimum(min); s->line_model_re = new Ca_Line(len, s->line_model_re_plot, 0, 0, FL_BLUE, CA_NO_POINT); if (++skip >= 100) { skip = 0; Fl::check(); } return 0; } /*- End of function --------------------------------------------------------*/ int echo_can_monitor_line_spectrum_update(const int16_t amp[], int len) { int i; int x; for (i = 0; i < len; i++) s->audio_meter->sample(amp[i]/32768.0); if (s->in_ptr + len < 512) { /* Just add this fragment to the buffer. */ for (i = 0; i < len; i++) #if defined(HAVE_FFTW3_H) s->in[s->in_ptr + i][0] = amp[i]; #else s->in[s->in_ptr + i].re = amp[i]; #endif s->in_ptr += len; return 0; } if (len >= 512) { /* We have enough for a whole block. Use the last 512 samples we have. */ x = len - 512; for (i = 0; i < 512; i++) #if defined(HAVE_FFTW3_H) s->in[i][0] = amp[x + i]; #else s->in[i].re = amp[x + i]; #endif } else { /* We want the last 512 samples. */ x = 512 - len; for (i = 0; i < x; i++) #if defined(HAVE_FFTW3_H) s->in[i][0] = s->in[s->in_ptr - x + i][0]; #else s->in[i].re = s->in[s->in_ptr - x + i].re; #endif for (i = x; i < 512; i++) #if defined(HAVE_FFTW3_H) s->in[i][0] = amp[i - x]; #else s->in[i].re = amp[i - x]; #endif } s->in_ptr = 0; #if defined(HAVE_FFTW3_H) fftw_execute(s->p); #else fftw_one(s->p, s->in, s->out); #endif if (s->spec_re) delete s->spec_re; s->canvas_spec->current(s->canvas_spec); for (i = 0; i < 512; i++) { s->spec_re_plot[2*i] = i*4000.0/512.0; #if defined(HAVE_FFTW3_H) s->spec_re_plot[2*i + 1] = 10.0*log10((s->out[i][0]*s->out[i][0] + s->out[i][1]*s->out[i][1])/(256.0*32768*256.0*32768) + 1.0e-10) + 3.14; #else s->spec_re_plot[2*i + 1] = 10.0*log10((s->out[i].re*s->out[i].re + s->out[i].im*s->out[i].im)/(256.0*32768*256.0*32768) + 1.0e-10) + 3.14; #endif } s->spec_re = new Ca_Line(512, s->spec_re_plot, 0, 0, FL_BLUE, CA_NO_POINT); Fl::check(); return 0; } /*- End of function --------------------------------------------------------*/ int start_echo_can_monitor(int len) { char buf[132 + 1]; float x; float y; int i; s->w = new Fl_Double_Window(850, 400, "Echo canceller monitor"); s->c_spec = new Fl_Group(0, 0, 380, 400); s->c_spec->box(FL_DOWN_BOX); s->c_spec->align(FL_ALIGN_TOP | FL_ALIGN_INSIDE); s->canvas_spec = new Ca_Canvas(60, 30, 300, 300, "Spectrum"); s->canvas_spec->box(FL_PLASTIC_DOWN_BOX); s->canvas_spec->color(7); s->canvas_spec->align(FL_ALIGN_TOP); s->canvas_spec->border(15); s->spec_freq = new Ca_X_Axis(65, 330, 290, 30, "Freq (Hz)"); s->spec_freq->align(FL_ALIGN_BOTTOM); s->spec_freq->minimum(0); s->spec_freq->maximum(4000); s->spec_freq->label_format("%g"); s->spec_freq->minor_grid_color(fl_gray_ramp(20)); s->spec_freq->major_grid_color(fl_gray_ramp(15)); s->spec_freq->label_grid_color(fl_gray_ramp(10)); s->spec_freq->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->spec_freq->minor_grid_style(FL_DOT); s->spec_freq->major_step(5); s->spec_freq->label_step(1); s->spec_freq->axis_color(FL_BLACK); s->spec_freq->axis_align(CA_BOTTOM | CA_LINE); s->spec_amp = new Ca_Y_Axis(20, 35, 40, 290, "Amp (dBmO)"); s->spec_amp->align(FL_ALIGN_LEFT); s->spec_amp->minimum(-80.0); s->spec_amp->maximum(10.0); s->spec_amp->minor_grid_color(fl_gray_ramp(20)); s->spec_amp->major_grid_color(fl_gray_ramp(15)); s->spec_amp->label_grid_color(fl_gray_ramp(10)); //s->spec_amp->grid_visible(CA_MINOR_TICK | CA_MAJOR_TICK | CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->spec_amp->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->spec_amp->minor_grid_style(FL_DOT); s->spec_amp->major_step(5); s->spec_amp->label_step(1); s->spec_amp->axis_color(FL_BLACK); s->spec_amp->current(); s->spec_re = NULL; s->c_spec->end(); s->c_right = new Fl_Group(440, 0, 465, 405); s->c_can = new Fl_Group(380, 0, 415, 200); s->c_can->box(FL_DOWN_BOX); s->c_can->align(FL_ALIGN_TOP | FL_ALIGN_INSIDE); s->c_can->current(); s->canvas_can = new Ca_Canvas(460, 35, 300, 100, "Canceller coefficients"); s->canvas_can->box(FL_PLASTIC_DOWN_BOX); s->canvas_can->color(7); s->canvas_can->align(FL_ALIGN_TOP); Fl_Group::current()->resizable(s->canvas_can); s->canvas_can->border(15); s->can_x = new Ca_X_Axis(465, 135, 290, 30, "Tap"); s->can_x->align(FL_ALIGN_BOTTOM); s->can_x->minimum(0.0); s->can_x->maximum((float) len); s->can_x->label_format("%g"); s->can_x->minor_grid_color(fl_gray_ramp(20)); s->can_x->major_grid_color(fl_gray_ramp(15)); s->can_x->label_grid_color(fl_gray_ramp(10)); s->can_x->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->can_x->minor_grid_style(FL_DOT); s->can_x->major_step(5); s->can_x->label_step(1); s->can_x->axis_align(CA_BOTTOM | CA_LINE); s->can_x->axis_color(FL_BLACK); s->can_x->current(); s->can_y = new Ca_Y_Axis(420, 40, 40, 90, "Amp"); s->can_y->align(FL_ALIGN_LEFT); s->can_y->minimum(-0.1); s->can_y->maximum(0.1); s->can_y->minor_grid_color(fl_gray_ramp(20)); s->can_y->major_grid_color(fl_gray_ramp(15)); s->can_y->label_grid_color(fl_gray_ramp(10)); s->can_y->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->can_y->minor_grid_style(FL_DOT); s->can_y->major_step(5); s->can_y->label_step(1); s->can_y->axis_color(FL_BLACK); s->can_y->current(); s->c_can->end(); s->can_re = NULL; s->c_line_model = new Fl_Group(380, 200, 415, 200); s->c_line_model->box(FL_DOWN_BOX); s->c_line_model->align(FL_ALIGN_TOP | FL_ALIGN_INSIDE); s->c_line_model->current(); s->canvas_line_model = new Ca_Canvas(460, 235, 300, 100, "Line impulse response model"); s->canvas_line_model->box(FL_PLASTIC_DOWN_BOX); s->canvas_line_model->color(7); s->canvas_line_model->align(FL_ALIGN_TOP); Fl_Group::current()->resizable(s->canvas_line_model); s->canvas_line_model->border(15); s->line_model_x = new Ca_X_Axis(465, 335, 290, 30, "Tap"); s->line_model_x->align(FL_ALIGN_BOTTOM); s->line_model_x->minimum(0.0); s->line_model_x->maximum((float) len); s->line_model_x->label_format("%g"); s->line_model_x->minor_grid_color(fl_gray_ramp(20)); s->line_model_x->major_grid_color(fl_gray_ramp(15)); s->line_model_x->label_grid_color(fl_gray_ramp(10)); s->line_model_x->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->line_model_x->minor_grid_style(FL_DOT); s->line_model_x->major_step(5); s->line_model_x->label_step(1); s->line_model_x->axis_align(CA_BOTTOM | CA_LINE); s->line_model_x->axis_color(FL_BLACK); s->line_model_x->current(); s->line_model_y = new Ca_Y_Axis(420, 240, 40, 90, "Amp"); s->line_model_y->align(FL_ALIGN_LEFT); s->line_model_y->minimum(-0.1); s->line_model_y->maximum(0.1); s->line_model_y->minor_grid_color(fl_gray_ramp(20)); s->line_model_y->major_grid_color(fl_gray_ramp(15)); s->line_model_y->label_grid_color(fl_gray_ramp(10)); s->line_model_y->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->line_model_y->minor_grid_style(FL_DOT); s->line_model_y->major_step(5); s->line_model_y->label_step(1); s->line_model_y->axis_color(FL_BLACK); s->line_model_y->current(); s->c_line_model->end(); s->line_model_re = NULL; s->audio_meter = new Fl_Audio_Meter(810, 40, 10, 250, ""); s->audio_meter->box(FL_PLASTIC_UP_BOX); s->audio_meter->type(FL_VERT_AUDIO_METER); s->c_right->end(); Fl_Group::current()->resizable(s->c_right); s->w->end(); s->w->show(); #if defined(HAVE_FFTW3_H) s->p = fftw_plan_dft_1d(1024, s->in, s->out, FFTW_BACKWARD, FFTW_ESTIMATE); for (i = 0; i < 1024; i++) { s->in[i][0] = 0.0; s->in[i][1] = 0.0; } #else s->p = fftw_create_plan(1024, FFTW_BACKWARD, FFTW_ESTIMATE); for (i = 0; i < 1024; i++) { s->in[i].re = 0.0; s->in[i].im = 0.0; } #endif s->in_ptr = 0; Fl::check(); return 0; } /*- End of function --------------------------------------------------------*/ void echo_can_monitor_wait_to_end(void) { fd_set rfds; int res; struct timeval tv; fprintf(stderr, "Processing complete. Press the key to end\n"); do { usleep(100000); Fl::check(); FD_ZERO(&rfds); FD_SET(0, &rfds); tv.tv_usec = 100000; tv.tv_sec = 0; res = select(1, &rfds, NULL, NULL, &tv); } while (res <= 0); } /*- End of function --------------------------------------------------------*/ void echo_can_monitor_update_display(void) { Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); } /*- End of function --------------------------------------------------------*/ #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/g726_tests.c0000664000175000017500000011443412101216533013326 00000000000000/* * SpanDSP - a series of DSP components for telephony * * g726_tests.c - Test G.726 encode and decode. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page g726_tests_page G.726 tests \section g726_tests_page_sec_1 What does it do? Two sets of tests are performed: - The tests defined in the G.726 specification, using the test data files supplied with the specification. - A generally audio quality test, consisting of compressing and decompressing a speeech file for audible comparison. The speech file should be recorded at 16 bits/sample, 8000 samples/second, and named "pre_g726.wav". \section g726_tests_page_sec_2 How is it used? To perform the tests in the G.726 specification you need to obtain the test data files from the specification. These are copyright material, and so cannot be distributed with this test software. The files, containing test vectors, which are supplied with the G.726 specification, should be copied to itutests/g726 so the files are arranged in the same directory heirarchy in which they are supplied. That is, you should have file names like - itutests/g726/DISK1/INPUT/NRM.M - itutests/g726/DISK1/INPUT/OVR.M - itutests/g726/DISK2/INPUT/NRM.A - itutests/g726/DISK2/INPUT/OVR.A in your source tree. The ITU tests can then be run by executing g726_tests without any parameters. To perform a general audio quality test, g726_tests should be run with a parameter specifying the required bit rate for compression. The valid parameters are "-16", "-24", "-32", and "-40". The test file ../test-data/local/short_nb_voice.wav will be compressed to the specified bit rate, decompressed, and the resulting audio stored in post_g726.wav. */ /* Enable the following definition to enable direct probing into the FAX structures */ //#define WITH_SPANDSP_INTERNALS #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define BLOCK_LEN 320 #define MAX_TEST_VECTOR_LEN 40000 #define TESTDATA_DIR "../test-data/itu/g726/" #define IN_FILE_NAME "../test-data/local/short_nb_voice.wav" #define OUT_FILE_NAME "post_g726.wav" int16_t outdata[MAX_TEST_VECTOR_LEN]; uint8_t adpcmdata[MAX_TEST_VECTOR_LEN]; int16_t itudata[MAX_TEST_VECTOR_LEN]; uint8_t itu_ref[MAX_TEST_VECTOR_LEN]; uint8_t unpacked[MAX_TEST_VECTOR_LEN]; uint8_t xlaw[MAX_TEST_VECTOR_LEN]; /* Table 4 - V Reset and homing sequences for u-law Normal I-input Overload Algorithm Input Intermediate Output Input Output Input Intermediate Output (PCM) (ADPCM) (PCM) (ADPCM) (PCM) (PCM) (ADPCM) (PCM) 16F NRM.M RN16FM.I RN16FM.O I16 RI16FM.O OVR.M RV16FM.I RV16FM.O HN16FM.I HN16FM.O HI16FM.O HV16FM.I HV16FM.O 24F NRM.M RN24FM.I RN24FM.O I24 RI24FM.O OVR.M RV24FM.I RV24FM.O HN24FM.I HN24FM.O HI24FM.O HV24FM.I HV24FM.O 32F NRM.M RN32FM.I RN32FM.O I32 RI32FM.O OVR.M RV32FM.I RV32FM.O HN32FM.I HN32FM.O HI32FM.O HV32FM.I HV32FM.O 40F NRM.M RN40FM.I RN40FM.O I40 RI40FM.O OVR.M RV40FM.I RV40FM.O HN40FM.I HN40FM.O HI40FM.O HV40FM.I HV40FM.O Table 5 - V Reset and homing sequences for A-law Normal I-input Overload Algorithm Input Intermediate Output Input Output Input Intermediate Output (PCM) (ADPCM) (PCM) (ADPCM) (PCM) (PCM) (ADPCM) (PCM) 16F NRM.A RN16FA.I RN16FA.O I16 RI16FA.O OVR.A RV16FA.I RV16FA.O HN16FA.I HN16FA.O HI16FA.O HV16FA.I HV16FA.O 24F NRM.A RN24FA.I RN24FA.O I24 RI24FA.O OVR.A RV24FA.I RV24FA.O HN24FA.I HN24FA.O HI24FA.O HV24FA.I HV24FA.O 32F NRM.A RN32FA.I RN32FA.O I32 RI32FA.O OVR.A RV32FA.I RV32FA.O HN32FA.I HN32FA.O HI32FA.O HV32FA.I HV32FA.O 40F NRM.A RN40FA.I RN40FA.O I40 RI40FA.O OVR.A RV40FA.I RV40FA.O HN40FA.I HN40FA.O HI40FA.O HV40FA.I HV40FA.O Table 6 V Reset and homing cross sequences for u-law -> A-law Normal Overload Algorithm Input Intermediate Output Input Intermediate Output (PCM) (ADPCM) (PCM) (PCM) (ADPCM) (PCM) 16F NRM.M RN16FM.I RN16FC.O OVR.M RV16FM.I RV16FC.O HN16FM.I HN16FC.O HV16FM.I HV16FC.O 24F NRM.M RN24FM.I RN24FC.O OVR.M RV24FM.I RV24FC.O HN24FM.I HN24FC.O HV24FM.I HV24FC.O 32F NRM.M RN32FM.I RN32FC.O OVR.M RV32FM.I RV32FC.O HN32FM.I HN32FC.O HV32FM.I HV32FC.O 40F NRM.M RN40FM.I RN40FC.O OVR.M RV40FM.I RV40FC.O HN40FM.I HN40FC.O HV40FM.I HV40FC.O Table 7 V Reset and homing cross sequences for A-law -> u-law Normal Overload Algorithm Input Intermediate Output Input Intermediate Output (PCM) (ADPCM) (PCM) (PCM) (ADPCM) (PCM) 16F NRM.A RN16FA.I RN16FX.O OVR.A RV16FA.I RV16FX.O HN16FA.I HN16FX.O HV16FA.I HV16FX.O 24F NRM.A RN24FA.I RN24FX.O OVR.A RV24FA.I RV24FX.O HN24FA.I HN24FX.O HV24FA.I HV24FX.O 32F NRM.A RN32FA.I RN32FX.O OVR.A RV32FA.I RV32FX.O HN32FA.I HN32FX.O HV32FA.I HV32FX.O 40F NRM.A RN40FA.I RN40FX.O OVR.A RV40FA.I RV40FX.O HN40FA.I HN40FX.O HV40FA.I HV40FX.O */ #define G726_ENCODING_NONE 9999 typedef struct { const char *conditioning_pcm_file; const char *pcm_file; const char *conditioning_adpcm_file; const char *adpcm_file; const char *output_file; int rate; int compression_law; int decompression_law; } test_set_t; static test_set_t itu_test_sets[] = { /* u-law to u-law tests */ { "", TESTDATA_DIR "DISK1/INPUT/NRM.M", "", TESTDATA_DIR "DISK1/RESET/16/RN16FM.I", TESTDATA_DIR "DISK1/RESET/16/RN16FM.O", 16000, G726_ENCODING_ULAW, G726_ENCODING_ULAW }, { "", "", "", TESTDATA_DIR "DISK1/INPUT/I16", TESTDATA_DIR "DISK1/RESET/16/RI16FM.O", 16000, G726_ENCODING_NONE, G726_ENCODING_ULAW }, { "", TESTDATA_DIR "DISK1/INPUT/OVR.M", "", TESTDATA_DIR "DISK1/RESET/16/RV16FM.I", TESTDATA_DIR "DISK1/RESET/16/RV16FM.O", 16000, G726_ENCODING_ULAW, G726_ENCODING_ULAW }, { "", TESTDATA_DIR "DISK1/INPUT/NRM.M", "", TESTDATA_DIR "DISK1/RESET/24/RN24FM.I", TESTDATA_DIR "DISK1/RESET/24/RN24FM.O", 24000, G726_ENCODING_ULAW, G726_ENCODING_ULAW }, { "", "", "", TESTDATA_DIR "DISK1/INPUT/I24", TESTDATA_DIR "DISK1/RESET/24/RI24FM.O", 24000, G726_ENCODING_NONE, G726_ENCODING_ULAW }, { "", TESTDATA_DIR "DISK1/INPUT/OVR.M", "", TESTDATA_DIR "DISK1/RESET/24/RV24FM.I", TESTDATA_DIR "DISK1/RESET/24/RV24FM.O", 24000, G726_ENCODING_ULAW, G726_ENCODING_ULAW }, { "", TESTDATA_DIR "DISK1/INPUT/NRM.M", "", TESTDATA_DIR "DISK1/RESET/32/RN32FM.I", TESTDATA_DIR "DISK1/RESET/32/RN32FM.O", 32000, G726_ENCODING_ULAW, G726_ENCODING_ULAW }, { "", "", "", TESTDATA_DIR "DISK1/INPUT/I32", TESTDATA_DIR "DISK1/RESET/32/RI32FM.O", 32000, G726_ENCODING_NONE, G726_ENCODING_ULAW }, { "", TESTDATA_DIR "DISK1/INPUT/OVR.M", "", TESTDATA_DIR "DISK1/RESET/32/RV32FM.I", TESTDATA_DIR "DISK1/RESET/32/RV32FM.O", 32000, G726_ENCODING_ULAW, G726_ENCODING_ULAW }, { "", TESTDATA_DIR "DISK1/INPUT/NRM.M", "", TESTDATA_DIR "DISK1/RESET/40/RN40FM.I", TESTDATA_DIR "DISK1/RESET/40/RN40FM.O", 40000, G726_ENCODING_ULAW, G726_ENCODING_ULAW }, { "", "", "", TESTDATA_DIR "DISK1/INPUT/I40", TESTDATA_DIR "DISK1/RESET/40/RI40FM.O", 40000, G726_ENCODING_NONE, G726_ENCODING_ULAW }, { "", TESTDATA_DIR "DISK1/INPUT/OVR.M", "", TESTDATA_DIR "DISK1/RESET/40/RV40FM.I", TESTDATA_DIR "DISK1/RESET/40/RV40FM.O", 40000, G726_ENCODING_ULAW, G726_ENCODING_ULAW }, /* A-law to A-law tests */ { "", TESTDATA_DIR "DISK2/INPUT/NRM.A", "", TESTDATA_DIR "DISK2/RESET/16/RN16FA.I", TESTDATA_DIR "DISK2/RESET/16/RN16FA.O", 16000, G726_ENCODING_ALAW, G726_ENCODING_ALAW }, { "", "", "", TESTDATA_DIR "DISK2/INPUT/I16", TESTDATA_DIR "DISK2/RESET/16/RI16FA.O", 16000, G726_ENCODING_NONE, G726_ENCODING_ALAW }, { "", TESTDATA_DIR "DISK2/INPUT/OVR.A", "", TESTDATA_DIR "DISK2/RESET/16/RV16FA.I", TESTDATA_DIR "DISK2/RESET/16/RV16FA.O", 16000, G726_ENCODING_ALAW, G726_ENCODING_ALAW }, { "", TESTDATA_DIR "DISK2/INPUT/NRM.A", "", TESTDATA_DIR "DISK2/RESET/24/RN24FA.I", TESTDATA_DIR "DISK2/RESET/24/RN24FA.O", 24000, G726_ENCODING_ALAW, G726_ENCODING_ALAW }, { "", "", "", TESTDATA_DIR "DISK2/INPUT/I24", TESTDATA_DIR "DISK2/RESET/24/RI24FA.O", 24000, G726_ENCODING_NONE, G726_ENCODING_ALAW }, { "", TESTDATA_DIR "DISK2/INPUT/OVR.A", "", TESTDATA_DIR "DISK2/RESET/24/RV24FA.I", TESTDATA_DIR "DISK2/RESET/24/RV24FA.O", 24000, G726_ENCODING_ALAW, G726_ENCODING_ALAW }, { "", TESTDATA_DIR "DISK2/INPUT/NRM.A", "", TESTDATA_DIR "DISK2/RESET/32/RN32FA.I", TESTDATA_DIR "DISK2/RESET/32/RN32FA.O", 32000, G726_ENCODING_ALAW, G726_ENCODING_ALAW }, { "", "", "", TESTDATA_DIR "DISK2/INPUT/I32", TESTDATA_DIR "DISK2/RESET/32/RI32FA.O", 32000, G726_ENCODING_NONE, G726_ENCODING_ALAW }, { "", TESTDATA_DIR "DISK2/INPUT/OVR.A", "", TESTDATA_DIR "DISK2/RESET/32/RV32FA.I", TESTDATA_DIR "DISK2/RESET/32/RV32FA.O", 32000, G726_ENCODING_ALAW, G726_ENCODING_ALAW }, { "", TESTDATA_DIR "DISK2/INPUT/NRM.A", "", TESTDATA_DIR "DISK2/RESET/40/RN40FA.I", TESTDATA_DIR "DISK2/RESET/40/RN40FA.O", 40000, G726_ENCODING_ALAW, G726_ENCODING_ALAW }, { "", "", "", TESTDATA_DIR "DISK2/INPUT/I40", TESTDATA_DIR "DISK2/RESET/40/RI40FA.O", 40000, G726_ENCODING_NONE, G726_ENCODING_ALAW }, { "", TESTDATA_DIR "DISK2/INPUT/OVR.A", "", TESTDATA_DIR "DISK2/RESET/40/RV40FA.I", TESTDATA_DIR "DISK2/RESET/40/RV40FA.O", 40000, G726_ENCODING_ALAW, G726_ENCODING_ALAW }, /* u-law to A-law tests */ { "", TESTDATA_DIR "DISK1/INPUT/NRM.M", "", TESTDATA_DIR "DISK1/RESET/16/RN16FM.I", TESTDATA_DIR "DISK1/RESET/16/RN16FC.O", 16000, G726_ENCODING_ULAW, G726_ENCODING_ALAW }, { "", TESTDATA_DIR "DISK1/INPUT/OVR.M", "", TESTDATA_DIR "DISK1/RESET/16/RV16FM.I", TESTDATA_DIR "DISK1/RESET/16/RV16FC.O", 16000, G726_ENCODING_ULAW, G726_ENCODING_ALAW }, { "", TESTDATA_DIR "DISK1/INPUT/NRM.M", "", TESTDATA_DIR "DISK1/RESET/24/RN24FM.I", TESTDATA_DIR "DISK1/RESET/24/RN24FC.O", 24000, G726_ENCODING_ULAW, G726_ENCODING_ALAW }, { "", TESTDATA_DIR "DISK1/INPUT/OVR.M", "", TESTDATA_DIR "DISK1/RESET/24/RV24FM.I", TESTDATA_DIR "DISK1/RESET/24/RV24FC.O", 24000, G726_ENCODING_ULAW, G726_ENCODING_ALAW }, { "", TESTDATA_DIR "DISK1/INPUT/NRM.M", "", TESTDATA_DIR "DISK1/RESET/32/RN32FM.I", TESTDATA_DIR "DISK1/RESET/32/RN32FC.O", 32000, G726_ENCODING_ULAW, G726_ENCODING_ALAW }, { "", TESTDATA_DIR "DISK1/INPUT/OVR.M", "", TESTDATA_DIR "DISK1/RESET/32/RV32FM.I", TESTDATA_DIR "DISK1/RESET/32/RV32FC.O", 32000, G726_ENCODING_ULAW, G726_ENCODING_ALAW }, { "", TESTDATA_DIR "DISK1/INPUT/NRM.M", "", TESTDATA_DIR "DISK1/RESET/40/RN40FM.I", TESTDATA_DIR "DISK1/RESET/40/RN40FC.O", 40000, G726_ENCODING_ULAW, G726_ENCODING_ALAW }, { "", TESTDATA_DIR "DISK1/INPUT/OVR.M", "", TESTDATA_DIR "DISK1/RESET/40/RV40FM.I", TESTDATA_DIR "DISK1/RESET/40/RV40FC.O", 40000, G726_ENCODING_ULAW, G726_ENCODING_ALAW }, /* A-law to u-law tests */ { "", TESTDATA_DIR "DISK2/INPUT/NRM.A", "", TESTDATA_DIR "DISK2/RESET/16/RN16FA.I", TESTDATA_DIR "DISK2/RESET/16/RN16FX.O", 16000, G726_ENCODING_ALAW, G726_ENCODING_ULAW }, { "", TESTDATA_DIR "DISK2/INPUT/OVR.A", "", TESTDATA_DIR "DISK2/RESET/16/RV16FA.I", TESTDATA_DIR "DISK2/RESET/16/RV16FX.O", 16000, G726_ENCODING_ALAW, G726_ENCODING_ULAW }, { "", TESTDATA_DIR "DISK2/INPUT/NRM.A", "", TESTDATA_DIR "DISK2/RESET/24/RN24FA.I", TESTDATA_DIR "DISK2/RESET/24/RN24FX.O", 24000, G726_ENCODING_ALAW, G726_ENCODING_ULAW }, { "", TESTDATA_DIR "DISK2/INPUT/OVR.A", "", TESTDATA_DIR "DISK2/RESET/24/RV24FA.I", TESTDATA_DIR "DISK2/RESET/24/RV24FX.O", 24000, G726_ENCODING_ALAW, G726_ENCODING_ULAW }, { "", TESTDATA_DIR "DISK2/INPUT/NRM.A", "", TESTDATA_DIR "DISK2/RESET/32/RN32FA.I", TESTDATA_DIR "DISK2/RESET/32/RN32FX.O", 32000, G726_ENCODING_ALAW, G726_ENCODING_ULAW }, { "", TESTDATA_DIR "DISK2/INPUT/OVR.A", "", TESTDATA_DIR "DISK2/RESET/32/RV32FA.I", TESTDATA_DIR "DISK2/RESET/32/RV32FX.O", 32000, G726_ENCODING_ALAW, G726_ENCODING_ULAW }, { "", TESTDATA_DIR "DISK2/INPUT/NRM.A", "", TESTDATA_DIR "DISK2/RESET/40/RN40FA.I", TESTDATA_DIR "DISK2/RESET/40/RN40FX.O", 40000, G726_ENCODING_ALAW, G726_ENCODING_ULAW }, { "", TESTDATA_DIR "DISK2/INPUT/OVR.A", "", TESTDATA_DIR "DISK2/RESET/40/RV40FA.I", TESTDATA_DIR "DISK2/RESET/40/RV40FX.O", 40000, G726_ENCODING_ALAW, G726_ENCODING_ULAW }, /* u-law to u-law tests */ { TESTDATA_DIR "DISK1/PCM_INIT.M", TESTDATA_DIR "DISK1/INPUT/NRM.M", TESTDATA_DIR "DISK1/HOMING/16/I_INI_16.M", TESTDATA_DIR "DISK1/HOMING/16/HN16FM.I", TESTDATA_DIR "DISK1/HOMING/16/HN16FM.O", 16000, G726_ENCODING_ULAW, G726_ENCODING_ULAW }, { "", "", TESTDATA_DIR "DISK1/HOMING/16/I_INI_16.M", TESTDATA_DIR "DISK1/INPUT/I16", TESTDATA_DIR "DISK1/HOMING/16/HI16FM.O", 16000, G726_ENCODING_NONE, G726_ENCODING_ULAW }, { TESTDATA_DIR "DISK1/PCM_INIT.M", TESTDATA_DIR "DISK1/INPUT/OVR.M", TESTDATA_DIR "DISK1/HOMING/16/I_INI_16.M", TESTDATA_DIR "DISK1/HOMING/16/HV16FM.I", TESTDATA_DIR "DISK1/HOMING/16/HV16FM.O", 16000, G726_ENCODING_ULAW, G726_ENCODING_ULAW }, { TESTDATA_DIR "DISK1/PCM_INIT.M", TESTDATA_DIR "DISK1/INPUT/NRM.M", TESTDATA_DIR "DISK1/HOMING/24/I_INI_24.M", TESTDATA_DIR "DISK1/HOMING/24/HN24FM.I", TESTDATA_DIR "DISK1/HOMING/24/HN24FM.O", 24000, G726_ENCODING_ULAW, G726_ENCODING_ULAW }, { "", "", TESTDATA_DIR "DISK1/HOMING/24/I_INI_24.M", TESTDATA_DIR "DISK1/INPUT/I24", TESTDATA_DIR "DISK1/HOMING/24/HI24FM.O", 24000, G726_ENCODING_NONE, G726_ENCODING_ULAW }, { TESTDATA_DIR "DISK1/PCM_INIT.M", TESTDATA_DIR "DISK1/INPUT/OVR.M", TESTDATA_DIR "DISK1/HOMING/24/I_INI_24.M", TESTDATA_DIR "DISK1/HOMING/24/HV24FM.I", TESTDATA_DIR "DISK1/HOMING/24/HV24FM.O", 24000, G726_ENCODING_ULAW, G726_ENCODING_ULAW }, { TESTDATA_DIR "DISK1/PCM_INIT.M", TESTDATA_DIR "DISK1/INPUT/NRM.M", TESTDATA_DIR "DISK1/HOMING/32/I_INI_32.M", TESTDATA_DIR "DISK1/HOMING/32/HN32FM.I", TESTDATA_DIR "DISK1/HOMING/32/HN32FM.O", 32000, G726_ENCODING_ULAW, G726_ENCODING_ULAW }, { "", "", TESTDATA_DIR "DISK1/HOMING/32/I_INI_32.M", TESTDATA_DIR "DISK1/INPUT/I32", TESTDATA_DIR "DISK1/HOMING/32/HI32FM.O", 32000, G726_ENCODING_NONE, G726_ENCODING_ULAW }, { TESTDATA_DIR "DISK1/PCM_INIT.M", TESTDATA_DIR "DISK1/INPUT/OVR.M", TESTDATA_DIR "DISK1/HOMING/32/I_INI_32.M", TESTDATA_DIR "DISK1/HOMING/32/HV32FM.I", TESTDATA_DIR "DISK1/HOMING/32/HV32FM.O", 32000, G726_ENCODING_ULAW, G726_ENCODING_ULAW }, { TESTDATA_DIR "DISK1/PCM_INIT.M", TESTDATA_DIR "DISK1/INPUT/NRM.M", TESTDATA_DIR "DISK1/HOMING/40/I_INI_40.M", TESTDATA_DIR "DISK1/HOMING/40/HN40FM.I", TESTDATA_DIR "DISK1/HOMING/40/HN40FM.O", 40000, G726_ENCODING_ULAW, G726_ENCODING_ULAW }, { "", "", TESTDATA_DIR "DISK1/HOMING/40/I_INI_40.M", TESTDATA_DIR "DISK1/INPUT/I40", TESTDATA_DIR "DISK1/HOMING/40/HI40FM.O", 40000, G726_ENCODING_NONE, G726_ENCODING_ULAW }, { TESTDATA_DIR "DISK1/PCM_INIT.M", TESTDATA_DIR "DISK1/INPUT/OVR.M", TESTDATA_DIR "DISK1/HOMING/40/I_INI_40.M", TESTDATA_DIR "DISK1/HOMING/40/HV40FM.I", TESTDATA_DIR "DISK1/HOMING/40/HV40FM.O", 40000, G726_ENCODING_ULAW, G726_ENCODING_ULAW }, /* A-law to A-law tests */ { TESTDATA_DIR "DISK2/PCM_INIT.A", TESTDATA_DIR "DISK2/INPUT/NRM.A", TESTDATA_DIR "DISK2/HOMING/16/I_INI_16.A", TESTDATA_DIR "DISK2/HOMING/16/HN16FA.I", TESTDATA_DIR "DISK2/HOMING/16/HN16FA.O", 16000, G726_ENCODING_ALAW, G726_ENCODING_ALAW }, { "", "", TESTDATA_DIR "DISK2/HOMING/16/I_INI_16.A", TESTDATA_DIR "DISK2/INPUT/I16", TESTDATA_DIR "DISK2/HOMING/16/HI16FA.O", 16000, G726_ENCODING_NONE, G726_ENCODING_ALAW }, { TESTDATA_DIR "DISK2/PCM_INIT.A", TESTDATA_DIR "DISK2/INPUT/OVR.A", TESTDATA_DIR "DISK2/HOMING/16/I_INI_16.A", TESTDATA_DIR "DISK2/HOMING/16/HV16FA.I", TESTDATA_DIR "DISK2/HOMING/16/HV16FA.O", 16000, G726_ENCODING_ALAW, G726_ENCODING_ALAW }, { TESTDATA_DIR "DISK2/PCM_INIT.A", TESTDATA_DIR "DISK2/INPUT/NRM.A", TESTDATA_DIR "DISK2/HOMING/24/I_INI_24.A", TESTDATA_DIR "DISK2/HOMING/24/HN24FA.I", TESTDATA_DIR "DISK2/HOMING/24/HN24FA.O", 24000, G726_ENCODING_ALAW, G726_ENCODING_ALAW }, { "", "", TESTDATA_DIR "DISK2/HOMING/24/I_INI_24.A", TESTDATA_DIR "DISK2/INPUT/I24", TESTDATA_DIR "DISK2/HOMING/24/HI24FA.O", 24000, G726_ENCODING_NONE, G726_ENCODING_ALAW }, { TESTDATA_DIR "DISK2/PCM_INIT.A", TESTDATA_DIR "DISK2/INPUT/OVR.A", TESTDATA_DIR "DISK2/HOMING/24/I_INI_24.A", TESTDATA_DIR "DISK2/HOMING/24/HV24FA.I", TESTDATA_DIR "DISK2/HOMING/24/HV24FA.O", 24000, G726_ENCODING_ALAW, G726_ENCODING_ALAW }, { TESTDATA_DIR "DISK2/PCM_INIT.A", TESTDATA_DIR "DISK2/INPUT/NRM.A", TESTDATA_DIR "DISK2/HOMING/32/I_INI_32.A", TESTDATA_DIR "DISK2/HOMING/32/HN32FA.I", TESTDATA_DIR "DISK2/HOMING/32/HN32FA.O", 32000, G726_ENCODING_ALAW, G726_ENCODING_ALAW }, { "", "", TESTDATA_DIR "DISK2/HOMING/32/I_INI_32.A", TESTDATA_DIR "DISK2/INPUT/I32", TESTDATA_DIR "DISK2/HOMING/32/HI32FA.O", 32000, G726_ENCODING_NONE, G726_ENCODING_ALAW }, { TESTDATA_DIR "DISK2/PCM_INIT.A", TESTDATA_DIR "DISK2/INPUT/OVR.A", TESTDATA_DIR "DISK2/HOMING/32/I_INI_32.A", TESTDATA_DIR "DISK2/HOMING/32/HV32FA.I", TESTDATA_DIR "DISK2/HOMING/32/HV32FA.O", 32000, G726_ENCODING_ALAW, G726_ENCODING_ALAW }, { TESTDATA_DIR "DISK2/PCM_INIT.A", TESTDATA_DIR "DISK2/INPUT/NRM.A", TESTDATA_DIR "DISK2/HOMING/40/I_INI_40.A", TESTDATA_DIR "DISK2/HOMING/40/HN40FA.I", TESTDATA_DIR "DISK2/HOMING/40/HN40FA.O", 40000, G726_ENCODING_ALAW, G726_ENCODING_ALAW }, { "", "", TESTDATA_DIR "DISK2/HOMING/40/I_INI_40.A", TESTDATA_DIR "DISK2/INPUT/I40", TESTDATA_DIR "DISK2/HOMING/40/HI40FA.O", 40000, G726_ENCODING_NONE, G726_ENCODING_ALAW }, { TESTDATA_DIR "DISK2/PCM_INIT.A", TESTDATA_DIR "DISK2/INPUT/OVR.A", TESTDATA_DIR "DISK2/HOMING/40/I_INI_40.A", TESTDATA_DIR "DISK2/HOMING/40/HV40FA.I", TESTDATA_DIR "DISK2/HOMING/40/HV40FA.O", 40000, G726_ENCODING_ALAW, G726_ENCODING_ALAW }, /* u-law to A-law tests */ { TESTDATA_DIR "DISK1/PCM_INIT.M", TESTDATA_DIR "DISK1/INPUT/NRM.M", TESTDATA_DIR "DISK2/HOMING/16/I_INI_16.A", TESTDATA_DIR "DISK1/HOMING/16/HN16FM.I", TESTDATA_DIR "DISK1/HOMING/16/HN16FC.O", 16000, G726_ENCODING_ULAW, G726_ENCODING_ALAW }, { TESTDATA_DIR "DISK1/PCM_INIT.M", TESTDATA_DIR "DISK1/INPUT/OVR.M", TESTDATA_DIR "DISK2/HOMING/16/I_INI_16.A", TESTDATA_DIR "DISK1/HOMING/16/HV16FM.I", TESTDATA_DIR "DISK1/HOMING/16/HV16FC.O", 16000, G726_ENCODING_ULAW, G726_ENCODING_ALAW }, { TESTDATA_DIR "DISK1/PCM_INIT.M", TESTDATA_DIR "DISK1/INPUT/NRM.M", TESTDATA_DIR "DISK2/HOMING/24/I_INI_24.A", TESTDATA_DIR "DISK1/HOMING/24/HN24FM.I", TESTDATA_DIR "DISK1/HOMING/24/HN24FC.O", 24000, G726_ENCODING_ULAW, G726_ENCODING_ALAW }, { TESTDATA_DIR "DISK1/PCM_INIT.M", TESTDATA_DIR "DISK1/INPUT/OVR.M", TESTDATA_DIR "DISK2/HOMING/24/I_INI_24.A", TESTDATA_DIR "DISK1/HOMING/24/HV24FM.I", TESTDATA_DIR "DISK1/HOMING/24/HV24FC.O", 24000, G726_ENCODING_ULAW, G726_ENCODING_ALAW }, { TESTDATA_DIR "DISK1/PCM_INIT.M", TESTDATA_DIR "DISK1/INPUT/NRM.M", TESTDATA_DIR "DISK2/HOMING/32/I_INI_32.A", TESTDATA_DIR "DISK1/HOMING/32/HN32FM.I", TESTDATA_DIR "DISK1/HOMING/32/HN32FC.O", 32000, G726_ENCODING_ULAW, G726_ENCODING_ALAW }, { TESTDATA_DIR "DISK1/PCM_INIT.M", TESTDATA_DIR "DISK1/INPUT/OVR.M", TESTDATA_DIR "DISK2/HOMING/32/I_INI_32.A", TESTDATA_DIR "DISK1/HOMING/32/HV32FM.I", TESTDATA_DIR "DISK1/HOMING/32/HV32FC.O", 32000, G726_ENCODING_ULAW, G726_ENCODING_ALAW }, { TESTDATA_DIR "DISK1/PCM_INIT.M", TESTDATA_DIR "DISK1/INPUT/NRM.M", TESTDATA_DIR "DISK2/HOMING/40/I_INI_40.A", TESTDATA_DIR "DISK1/HOMING/40/HN40FM.I", TESTDATA_DIR "DISK1/HOMING/40/HN40FC.O", 40000, G726_ENCODING_ULAW, G726_ENCODING_ALAW }, { TESTDATA_DIR "DISK1/PCM_INIT.M", TESTDATA_DIR "DISK1/INPUT/OVR.M", TESTDATA_DIR "DISK2/HOMING/40/I_INI_40.A", TESTDATA_DIR "DISK1/HOMING/40/HV40FM.I", TESTDATA_DIR "DISK1/HOMING/40/HV40FC.O", 40000, G726_ENCODING_ULAW, G726_ENCODING_ALAW }, /* A-law to u-law tests */ { TESTDATA_DIR "DISK2/PCM_INIT.A", TESTDATA_DIR "DISK2/INPUT/NRM.A", TESTDATA_DIR "DISK1/HOMING/16/I_INI_16.M", TESTDATA_DIR "DISK2/HOMING/16/HN16FA.I", TESTDATA_DIR "DISK2/HOMING/16/HN16FX.O", 16000, G726_ENCODING_ALAW, G726_ENCODING_ULAW }, { TESTDATA_DIR "DISK2/PCM_INIT.A", TESTDATA_DIR "DISK2/INPUT/OVR.A", TESTDATA_DIR "DISK1/HOMING/16/I_INI_16.M", TESTDATA_DIR "DISK2/HOMING/16/HV16FA.I", TESTDATA_DIR "DISK2/HOMING/16/HV16FX.O", 16000, G726_ENCODING_ALAW, G726_ENCODING_ULAW }, { TESTDATA_DIR "DISK2/PCM_INIT.A", TESTDATA_DIR "DISK2/INPUT/NRM.A", TESTDATA_DIR "DISK1/HOMING/24/I_INI_24.M", TESTDATA_DIR "DISK2/HOMING/24/HN24FA.I", TESTDATA_DIR "DISK2/HOMING/24/HN24FX.O", 24000, G726_ENCODING_ALAW, G726_ENCODING_ULAW }, { TESTDATA_DIR "DISK2/PCM_INIT.A", TESTDATA_DIR "DISK2/INPUT/OVR.A", TESTDATA_DIR "DISK1/HOMING/24/I_INI_24.M", TESTDATA_DIR "DISK2/HOMING/24/HV24FA.I", TESTDATA_DIR "DISK2/HOMING/24/HV24FX.O", 24000, G726_ENCODING_ALAW, G726_ENCODING_ULAW }, { TESTDATA_DIR "DISK2/PCM_INIT.A", TESTDATA_DIR "DISK2/INPUT/NRM.A", TESTDATA_DIR "DISK1/HOMING/32/I_INI_32.M", TESTDATA_DIR "DISK2/HOMING/32/HN32FA.I", TESTDATA_DIR "DISK2/HOMING/32/HN32FX.O", 32000, G726_ENCODING_ALAW, G726_ENCODING_ULAW }, { TESTDATA_DIR "DISK2/PCM_INIT.A", TESTDATA_DIR "DISK2/INPUT/OVR.A", TESTDATA_DIR "DISK1/HOMING/32/I_INI_32.M", TESTDATA_DIR "DISK2/HOMING/32/HV32FA.I", TESTDATA_DIR "DISK2/HOMING/32/HV32FX.O", 32000, G726_ENCODING_ALAW, G726_ENCODING_ULAW }, { TESTDATA_DIR "DISK2/PCM_INIT.A", TESTDATA_DIR "DISK2/INPUT/NRM.A", TESTDATA_DIR "DISK1/HOMING/40/I_INI_40.M", TESTDATA_DIR "DISK2/HOMING/40/HN40FA.I", TESTDATA_DIR "DISK2/HOMING/40/HN40FX.O", 40000, G726_ENCODING_ALAW, G726_ENCODING_ULAW }, { TESTDATA_DIR "DISK2/PCM_INIT.A", TESTDATA_DIR "DISK2/INPUT/OVR.A", TESTDATA_DIR "DISK1/HOMING/40/I_INI_40.M", TESTDATA_DIR "DISK2/HOMING/40/HV40FA.I", TESTDATA_DIR "DISK2/HOMING/40/HV40FX.O", 40000, G726_ENCODING_ALAW, G726_ENCODING_ULAW }, { NULL, NULL, NULL, NULL, NULL, 0, 0, 0 } }; static int hex_get(char *s) { int i; int value; int x; for (value = i = 0; i < 2; i++) { x = *s++ - 0x30; if (x > 9) x -= 0x07; if (x > 15) x -= 0x20; if (x < 0 || x > 15) return -1; value <<= 4; value |= x; } return value; } /*- End of function --------------------------------------------------------*/ static int get_vector(FILE *file, uint8_t vec[]) { char buf[132 + 1]; char *s; int i; int value; while (fgets(buf, 133, file)) { s = buf; i = 0; while ((value = hex_get(s)) >= 0) { vec[i++] = value; s += 2; } return i; } return 0; } /*- End of function --------------------------------------------------------*/ static int get_test_vector(const char *file, uint8_t buf[], int max_len) { int octets; int i; int sum; FILE *infile; if ((infile = fopen(file, "r")) == NULL) { fprintf(stderr, " Failed to open '%s'\n", file); exit(2); } octets = 0; while ((i = get_vector(infile, buf + octets)) > 0) octets += i; fclose(infile); /* The last octet is a sumcheck, so the real data octets are one less than the total we have */ octets--; /* Test the checksum */ for (sum = i = 0; i < octets; i++) sum += buf[i]; if (sum%255 != (int) buf[i]) { fprintf(stderr, " Sumcheck failed in '%s' - %x %x\n", file, sum%255, buf[i]); exit(2); } return octets; } /*- End of function --------------------------------------------------------*/ static void itu_compliance_tests(void) { g726_state_t enc_state; g726_state_t dec_state; int len2; int len3; int i; int test; int bad_samples; int conditioning_samples; int samples; int conditioning_adpcm; int adpcm; len2 = 0; conditioning_samples = 0; for (test = 0; itu_test_sets[test].rate; test++) { printf("Test %2d: '%s' + '%s'\n" " -> '%s' + '%s'\n" " -> '%s' [%d, %d, %d]\n", test, itu_test_sets[test].conditioning_pcm_file, itu_test_sets[test].pcm_file, itu_test_sets[test].conditioning_adpcm_file, itu_test_sets[test].adpcm_file, itu_test_sets[test].output_file, itu_test_sets[test].rate, itu_test_sets[test].compression_law, itu_test_sets[test].decompression_law); if (itu_test_sets[test].compression_law != G726_ENCODING_NONE) { /* Test the encode side */ g726_init(&enc_state, itu_test_sets[test].rate, itu_test_sets[test].compression_law, G726_PACKING_NONE); if (itu_test_sets[test].conditioning_pcm_file[0]) { conditioning_samples = get_test_vector(itu_test_sets[test].conditioning_pcm_file, xlaw, MAX_TEST_VECTOR_LEN); printf("Test %d: Homing %d samples at %dbps\n", test, conditioning_samples, itu_test_sets[test].rate); } else { conditioning_samples = 0; } samples = get_test_vector(itu_test_sets[test].pcm_file, xlaw + conditioning_samples, MAX_TEST_VECTOR_LEN); memcpy(itudata, xlaw, samples + conditioning_samples); printf("Test %d: Compressing %d samples at %dbps\n", test, samples, itu_test_sets[test].rate); len2 = g726_encode(&enc_state, adpcmdata, itudata, conditioning_samples + samples); } /* Test the decode side */ g726_init(&dec_state, itu_test_sets[test].rate, itu_test_sets[test].decompression_law, G726_PACKING_NONE); if (itu_test_sets[test].conditioning_adpcm_file[0]) { conditioning_adpcm = get_test_vector(itu_test_sets[test].conditioning_adpcm_file, unpacked, MAX_TEST_VECTOR_LEN); printf("Test %d: Homing %d octets at %dbps\n", test, conditioning_adpcm, itu_test_sets[test].rate); } else { conditioning_adpcm = 0; } adpcm = get_test_vector(itu_test_sets[test].adpcm_file, unpacked + conditioning_adpcm, MAX_TEST_VECTOR_LEN); if (itu_test_sets[test].compression_law != G726_ENCODING_NONE) { /* Test our compressed version against the reference compressed version */ printf("Test %d: Compressed data check - %d/%d octets\n", test, conditioning_adpcm + adpcm, len2); if (conditioning_adpcm + adpcm == len2) { for (bad_samples = 0, i = conditioning_samples; i < len2; i++) { if (adpcmdata[i] != unpacked[i]) { bad_samples++; printf("Test %d: Compressed mismatch %d %x %x\n", test, i, adpcmdata[i], unpacked[i]); } } if (bad_samples > 0) { printf("Test failed\n"); exit(2); } printf("Test passed\n"); } else { printf("Test %d: Length mismatch - ref = %d, processed = %d\n", test, conditioning_adpcm + adpcm, len2); exit(2); } } len3 = g726_decode(&dec_state, outdata, unpacked, conditioning_adpcm + adpcm); /* Get the output reference data */ samples = get_test_vector(itu_test_sets[test].output_file, xlaw, MAX_TEST_VECTOR_LEN); memcpy(itu_ref, xlaw, samples); /* Test our decompressed version against the reference decompressed version */ printf("Test %d: Decompressed data check - %d/%d samples\n", test, samples, len3 - conditioning_adpcm); if (samples == len3 - conditioning_adpcm) { for (bad_samples = 0, i = 0; i < len3; i++) { if (itu_ref[i] != ((uint8_t *) outdata)[i + conditioning_adpcm]) { bad_samples++; printf("Test %d: Decompressed mismatch %d %x %x\n", test, i, itu_ref[i], ((uint8_t *) outdata)[i + conditioning_adpcm]); } } if (bad_samples > 0) { printf("Test failed\n"); exit(2); } printf("Test passed\n"); } else { printf("Test %d: Length mismatch - ref = %d, processed = %d\n", test, samples, len3 - conditioning_adpcm); exit(2); } } printf("Tests passed.\n"); } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { g726_state_t enc_state; g726_state_t dec_state; int opt; int itutests; int bit_rate; SNDFILE *inhandle; SNDFILE *outhandle; int16_t amp[1024]; int frames; int adpcm; int packing; bit_rate = 32000; itutests = TRUE; packing = G726_PACKING_NONE; while ((opt = getopt(argc, argv, "b:LR")) != -1) { switch (opt) { case 'b': bit_rate = atoi(optarg); if (bit_rate != 16000 && bit_rate != 24000 && bit_rate != 32000 && bit_rate != 40000) { fprintf(stderr, "Invalid bit rate selected. Only 16000, 24000, 32000 and 40000 are valid.\n"); exit(2); } itutests = FALSE; break; case 'L': packing = G726_PACKING_LEFT; break; case 'R': packing = G726_PACKING_RIGHT; break; default: //usage(); exit(2); } } if (itutests) { itu_compliance_tests(); } else { if ((inhandle = sf_open_telephony_read(IN_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", IN_FILE_NAME); exit(2); } if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME); exit(2); } printf("ADPCM packing is %d\n", packing); g726_init(&enc_state, bit_rate, G726_ENCODING_LINEAR, packing); g726_init(&dec_state, bit_rate, G726_ENCODING_LINEAR, packing); while ((frames = sf_readf_short(inhandle, amp, 159))) { adpcm = g726_encode(&enc_state, adpcmdata, amp, frames); frames = g726_decode(&dec_state, amp, adpcmdata, adpcm); sf_writef_short(outhandle, amp, frames); } if (sf_close_telephony(inhandle)) { printf(" Cannot close audio file '%s'\n", IN_FILE_NAME); exit(2); } if (sf_close_telephony(outhandle)) { printf(" Cannot close audio file '%s'\n", OUT_FILE_NAME); exit(2); } printf("'%s' transcoded to '%s' at %dbps.\n", IN_FILE_NAME, OUT_FILE_NAME, bit_rate); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/v42bis_tests.sh0000775000175000017500000000533112101213147014136 00000000000000#!/bin/sh # # V.42bis compression/decompression tests, as specified in V.56ter # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 2.1, # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. BASE=../test-data/itu/v56ter ./v42bis_tests -c -d ${BASE}/1.TST RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi diff ${BASE}/1.TST v42bis_tests.out RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi ./v42bis_tests -c -d ${BASE}/1X04.TST RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi diff ${BASE}/1X04.TST v42bis_tests.out RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi ./v42bis_tests -c -d ${BASE}/1X30.TST RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi diff ${BASE}/1X30.TST v42bis_tests.out RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi ./v42bis_tests -c -d ${BASE}/2.TST RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi diff ${BASE}/2.TST v42bis_tests.out RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi ./v42bis_tests -c -d ${BASE}/2X10.TST RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi diff ${BASE}/2X10.TST v42bis_tests.out RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi ./v42bis_tests -c -d ${BASE}/3.TST RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi diff ${BASE}/3.TST v42bis_tests.out RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi ./v42bis_tests -c -d ${BASE}/3X06.TST RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi diff ${BASE}/3X06.TST v42bis_tests.out RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi ./v42bis_tests -c -d ${BASE}/4.TST RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi diff ${BASE}/4.TST v42bis_tests.out RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi ./v42bis_tests -c -d ${BASE}/4X04.TST RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi diff ${BASE}/4X04.TST v42bis_tests.out RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi ./v42bis_tests -c -d ${BASE}/5.TST RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi diff ${BASE}/5.TST v42bis_tests.out RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi ./v42bis_tests -c -d ${BASE}/5X16.TST RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi diff ${BASE}/5X16.TST v42bis_tests.out RETVAL=$? if [ $RETVAL != 0 ] then exit $RETVAL fi spandsp-0.0.6/tests/Makefile.in0000664000175000017500000022344512343626375013344 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ noinst_PROGRAMS = ademco_contactid_tests$(EXEEXT) adsi_tests$(EXEEXT) \ async_tests$(EXEEXT) at_interpreter_tests$(EXEEXT) \ awgn_tests$(EXEEXT) bell_mf_rx_tests$(EXEEXT) \ bell_mf_tx_tests$(EXEEXT) bert_tests$(EXEEXT) \ bit_operations_tests$(EXEEXT) bitstream_tests$(EXEEXT) \ complex_tests$(EXEEXT) complex_vector_float_tests$(EXEEXT) \ complex_vector_int_tests$(EXEEXT) crc_tests$(EXEEXT) \ dc_restore_tests$(EXEEXT) dds_tests$(EXEEXT) \ dtmf_rx_tests$(EXEEXT) dtmf_tx_tests$(EXEEXT) \ echo_tests$(EXEEXT) fax_decode$(EXEEXT) fax_tests$(EXEEXT) \ fsk_tests$(EXEEXT) g1050_tests$(EXEEXT) g168_tests$(EXEEXT) \ g711_tests$(EXEEXT) g722_tests$(EXEEXT) g726_tests$(EXEEXT) \ gsm0610_tests$(EXEEXT) hdlc_tests$(EXEEXT) \ ima_adpcm_tests$(EXEEXT) image_translate_tests$(EXEEXT) \ line_model_tests$(EXEEXT) logging_tests$(EXEEXT) \ lpc10_tests$(EXEEXT) make_g168_css$(EXEEXT) \ math_fixed_tests$(EXEEXT) modem_connect_tones_tests$(EXEEXT) \ modem_echo_tests$(EXEEXT) noise_tests$(EXEEXT) \ oki_adpcm_tests$(EXEEXT) playout_tests$(EXEEXT) \ plc_tests$(EXEEXT) power_meter_tests$(EXEEXT) \ queue_tests$(EXEEXT) r2_mf_rx_tests$(EXEEXT) \ r2_mf_tx_tests$(EXEEXT) rfc2198_sim_tests$(EXEEXT) \ saturated_tests$(EXEEXT) schedule_tests$(EXEEXT) \ sig_tone_tests$(EXEEXT) super_tone_rx_tests$(EXEEXT) \ super_tone_tx_tests$(EXEEXT) swept_tone_tests$(EXEEXT) \ t31_tests$(EXEEXT) t35_tests$(EXEEXT) t38_core_tests$(EXEEXT) \ t38_decode$(EXEEXT) t38_gateway_tests$(EXEEXT) \ t38_gateway_to_terminal_tests$(EXEEXT) \ t38_non_ecm_buffer_tests$(EXEEXT) t38_terminal_tests$(EXEEXT) \ t38_terminal_to_gateway_tests$(EXEEXT) t4_tests$(EXEEXT) \ time_scale_tests$(EXEEXT) timezone_tests$(EXEEXT) \ tone_detect_tests$(EXEEXT) tone_generate_tests$(EXEEXT) \ tsb85_tests$(EXEEXT) v17_tests$(EXEEXT) v18_tests$(EXEEXT) \ v22bis_tests$(EXEEXT) v27ter_tests$(EXEEXT) v29_tests$(EXEEXT) \ v42_tests$(EXEEXT) v42bis_tests$(EXEEXT) v8_tests$(EXEEXT) \ vector_float_tests$(EXEEXT) vector_int_tests$(EXEEXT) \ tsb85_tests$(EXEEXT) subdir = tests DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/config/depcomp $(noinst_HEADERS) ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_check_real_file.m4 \ $(top_srcdir)/m4/ax_fixed_point_machine.m4 \ $(top_srcdir)/m4/ax_misaligned_access_fails.m4 \ $(top_srcdir)/m4/ax_c99_features.m4 \ $(top_srcdir)/m4/ax_check_export_capability.m4 \ $(top_srcdir)/m4/ax_check_arm_neon.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) am_ademco_contactid_tests_OBJECTS = ademco_contactid_tests.$(OBJEXT) ademco_contactid_tests_OBJECTS = $(am_ademco_contactid_tests_OBJECTS) am__DEPENDENCIES_1 = ademco_contactid_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = am_adsi_tests_OBJECTS = adsi_tests.$(OBJEXT) adsi_tests_OBJECTS = $(am_adsi_tests_OBJECTS) adsi_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_async_tests_OBJECTS = async_tests.$(OBJEXT) async_tests_OBJECTS = $(am_async_tests_OBJECTS) async_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_at_interpreter_tests_OBJECTS = at_interpreter_tests.$(OBJEXT) at_interpreter_tests_OBJECTS = $(am_at_interpreter_tests_OBJECTS) at_interpreter_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_awgn_tests_OBJECTS = awgn_tests.$(OBJEXT) awgn_tests_OBJECTS = $(am_awgn_tests_OBJECTS) awgn_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_bell_mf_rx_tests_OBJECTS = bell_mf_rx_tests.$(OBJEXT) bell_mf_rx_tests_OBJECTS = $(am_bell_mf_rx_tests_OBJECTS) bell_mf_rx_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_bell_mf_tx_tests_OBJECTS = bell_mf_tx_tests.$(OBJEXT) bell_mf_tx_tests_OBJECTS = $(am_bell_mf_tx_tests_OBJECTS) bell_mf_tx_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_bert_tests_OBJECTS = bert_tests.$(OBJEXT) bert_tests_OBJECTS = $(am_bert_tests_OBJECTS) bert_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_bit_operations_tests_OBJECTS = bit_operations_tests.$(OBJEXT) bit_operations_tests_OBJECTS = $(am_bit_operations_tests_OBJECTS) bit_operations_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_bitstream_tests_OBJECTS = bitstream_tests.$(OBJEXT) bitstream_tests_OBJECTS = $(am_bitstream_tests_OBJECTS) bitstream_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_complex_tests_OBJECTS = complex_tests.$(OBJEXT) complex_tests_OBJECTS = $(am_complex_tests_OBJECTS) complex_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_complex_vector_float_tests_OBJECTS = \ complex_vector_float_tests.$(OBJEXT) complex_vector_float_tests_OBJECTS = \ $(am_complex_vector_float_tests_OBJECTS) complex_vector_float_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_complex_vector_int_tests_OBJECTS = \ complex_vector_int_tests.$(OBJEXT) complex_vector_int_tests_OBJECTS = \ $(am_complex_vector_int_tests_OBJECTS) complex_vector_int_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_crc_tests_OBJECTS = crc_tests.$(OBJEXT) crc_tests_OBJECTS = $(am_crc_tests_OBJECTS) crc_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_dc_restore_tests_OBJECTS = dc_restore_tests.$(OBJEXT) dc_restore_tests_OBJECTS = $(am_dc_restore_tests_OBJECTS) dc_restore_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_dds_tests_OBJECTS = dds_tests.$(OBJEXT) dds_tests_OBJECTS = $(am_dds_tests_OBJECTS) dds_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_dtmf_rx_tests_OBJECTS = dtmf_rx_tests.$(OBJEXT) dtmf_rx_tests_OBJECTS = $(am_dtmf_rx_tests_OBJECTS) dtmf_rx_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_dtmf_tx_tests_OBJECTS = dtmf_tx_tests.$(OBJEXT) dtmf_tx_tests_OBJECTS = $(am_dtmf_tx_tests_OBJECTS) dtmf_tx_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_echo_tests_OBJECTS = echo_tests.$(OBJEXT) echo_monitor.$(OBJEXT) echo_tests_OBJECTS = $(am_echo_tests_OBJECTS) echo_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_fax_decode_OBJECTS = fax_decode.$(OBJEXT) fax_decode_OBJECTS = $(am_fax_decode_OBJECTS) fax_decode_DEPENDENCIES = $(am__DEPENDENCIES_1) am_fax_tests_OBJECTS = fax_tests.$(OBJEXT) fax_utils.$(OBJEXT) \ media_monitor.$(OBJEXT) fax_tests_OBJECTS = $(am_fax_tests_OBJECTS) fax_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_fsk_tests_OBJECTS = fsk_tests.$(OBJEXT) fsk_tests_OBJECTS = $(am_fsk_tests_OBJECTS) fsk_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_g1050_tests_OBJECTS = g1050_tests.$(OBJEXT) media_monitor.$(OBJEXT) g1050_tests_OBJECTS = $(am_g1050_tests_OBJECTS) g1050_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_g168_tests_OBJECTS = g168_tests.$(OBJEXT) g168_tests_OBJECTS = $(am_g168_tests_OBJECTS) g168_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_g711_tests_OBJECTS = g711_tests.$(OBJEXT) g711_tests_OBJECTS = $(am_g711_tests_OBJECTS) g711_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_g722_tests_OBJECTS = g722_tests.$(OBJEXT) g722_tests_OBJECTS = $(am_g722_tests_OBJECTS) g722_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_g726_tests_OBJECTS = g726_tests.$(OBJEXT) g726_tests_OBJECTS = $(am_g726_tests_OBJECTS) g726_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_gsm0610_tests_OBJECTS = gsm0610_tests.$(OBJEXT) gsm0610_tests_OBJECTS = $(am_gsm0610_tests_OBJECTS) gsm0610_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_hdlc_tests_OBJECTS = hdlc_tests.$(OBJEXT) hdlc_tests_OBJECTS = $(am_hdlc_tests_OBJECTS) hdlc_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_ima_adpcm_tests_OBJECTS = ima_adpcm_tests.$(OBJEXT) ima_adpcm_tests_OBJECTS = $(am_ima_adpcm_tests_OBJECTS) ima_adpcm_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_image_translate_tests_OBJECTS = image_translate_tests.$(OBJEXT) image_translate_tests_OBJECTS = $(am_image_translate_tests_OBJECTS) image_translate_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_line_model_tests_OBJECTS = line_model_tests.$(OBJEXT) line_model_tests_OBJECTS = $(am_line_model_tests_OBJECTS) line_model_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_logging_tests_OBJECTS = logging_tests.$(OBJEXT) logging_tests_OBJECTS = $(am_logging_tests_OBJECTS) logging_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_lpc10_tests_OBJECTS = lpc10_tests.$(OBJEXT) lpc10_tests_OBJECTS = $(am_lpc10_tests_OBJECTS) lpc10_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_make_g168_css_OBJECTS = make_g168_css.$(OBJEXT) make_g168_css_OBJECTS = $(am_make_g168_css_OBJECTS) make_g168_css_DEPENDENCIES = $(am__DEPENDENCIES_1) am_math_fixed_tests_OBJECTS = math_fixed_tests.$(OBJEXT) math_fixed_tests_OBJECTS = $(am_math_fixed_tests_OBJECTS) math_fixed_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_modem_connect_tones_tests_OBJECTS = \ modem_connect_tones_tests.$(OBJEXT) modem_connect_tones_tests_OBJECTS = \ $(am_modem_connect_tones_tests_OBJECTS) modem_connect_tones_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_modem_echo_tests_OBJECTS = modem_echo_tests.$(OBJEXT) \ echo_monitor.$(OBJEXT) modem_echo_tests_OBJECTS = $(am_modem_echo_tests_OBJECTS) modem_echo_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_noise_tests_OBJECTS = noise_tests.$(OBJEXT) noise_tests_OBJECTS = $(am_noise_tests_OBJECTS) noise_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_oki_adpcm_tests_OBJECTS = oki_adpcm_tests.$(OBJEXT) oki_adpcm_tests_OBJECTS = $(am_oki_adpcm_tests_OBJECTS) oki_adpcm_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_playout_tests_OBJECTS = playout_tests.$(OBJEXT) \ media_monitor.$(OBJEXT) playout_tests_OBJECTS = $(am_playout_tests_OBJECTS) playout_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_plc_tests_OBJECTS = plc_tests.$(OBJEXT) plc_tests_OBJECTS = $(am_plc_tests_OBJECTS) plc_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_power_meter_tests_OBJECTS = power_meter_tests.$(OBJEXT) power_meter_tests_OBJECTS = $(am_power_meter_tests_OBJECTS) power_meter_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_queue_tests_OBJECTS = queue_tests.$(OBJEXT) queue_tests_OBJECTS = $(am_queue_tests_OBJECTS) queue_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_r2_mf_rx_tests_OBJECTS = r2_mf_rx_tests.$(OBJEXT) r2_mf_rx_tests_OBJECTS = $(am_r2_mf_rx_tests_OBJECTS) r2_mf_rx_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_r2_mf_tx_tests_OBJECTS = r2_mf_tx_tests.$(OBJEXT) r2_mf_tx_tests_OBJECTS = $(am_r2_mf_tx_tests_OBJECTS) r2_mf_tx_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_rfc2198_sim_tests_OBJECTS = rfc2198_sim_tests.$(OBJEXT) \ media_monitor.$(OBJEXT) rfc2198_sim_tests_OBJECTS = $(am_rfc2198_sim_tests_OBJECTS) rfc2198_sim_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_saturated_tests_OBJECTS = saturated_tests.$(OBJEXT) saturated_tests_OBJECTS = $(am_saturated_tests_OBJECTS) saturated_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_schedule_tests_OBJECTS = schedule_tests.$(OBJEXT) schedule_tests_OBJECTS = $(am_schedule_tests_OBJECTS) schedule_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_sig_tone_tests_OBJECTS = sig_tone_tests.$(OBJEXT) sig_tone_tests_OBJECTS = $(am_sig_tone_tests_OBJECTS) sig_tone_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_super_tone_rx_tests_OBJECTS = super_tone_rx_tests.$(OBJEXT) super_tone_rx_tests_OBJECTS = $(am_super_tone_rx_tests_OBJECTS) super_tone_rx_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_super_tone_tx_tests_OBJECTS = super_tone_tx_tests.$(OBJEXT) super_tone_tx_tests_OBJECTS = $(am_super_tone_tx_tests_OBJECTS) super_tone_tx_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_swept_tone_tests_OBJECTS = swept_tone_tests.$(OBJEXT) swept_tone_tests_OBJECTS = $(am_swept_tone_tests_OBJECTS) swept_tone_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_t31_tests_OBJECTS = t31_tests.$(OBJEXT) fax_utils.$(OBJEXT) \ media_monitor.$(OBJEXT) t31_tests_OBJECTS = $(am_t31_tests_OBJECTS) t31_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_t35_tests_OBJECTS = t35_tests.$(OBJEXT) t35_tests_OBJECTS = $(am_t35_tests_OBJECTS) t35_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_t38_core_tests_OBJECTS = t38_core_tests.$(OBJEXT) t38_core_tests_OBJECTS = $(am_t38_core_tests_OBJECTS) t38_core_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_t38_decode_OBJECTS = t38_decode.$(OBJEXT) fax_utils.$(OBJEXT) \ pcap_parse.$(OBJEXT) udptl.$(OBJEXT) t38_decode_OBJECTS = $(am_t38_decode_OBJECTS) t38_decode_DEPENDENCIES = $(am__DEPENDENCIES_1) am_t38_gateway_tests_OBJECTS = t38_gateway_tests.$(OBJEXT) \ fax_utils.$(OBJEXT) media_monitor.$(OBJEXT) t38_gateway_tests_OBJECTS = $(am_t38_gateway_tests_OBJECTS) t38_gateway_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_t38_gateway_to_terminal_tests_OBJECTS = \ t38_gateway_to_terminal_tests.$(OBJEXT) fax_utils.$(OBJEXT) \ media_monitor.$(OBJEXT) t38_gateway_to_terminal_tests_OBJECTS = \ $(am_t38_gateway_to_terminal_tests_OBJECTS) t38_gateway_to_terminal_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_t38_non_ecm_buffer_tests_OBJECTS = \ t38_non_ecm_buffer_tests.$(OBJEXT) t38_non_ecm_buffer_tests_OBJECTS = \ $(am_t38_non_ecm_buffer_tests_OBJECTS) t38_non_ecm_buffer_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_t38_terminal_tests_OBJECTS = t38_terminal_tests.$(OBJEXT) \ fax_utils.$(OBJEXT) media_monitor.$(OBJEXT) t38_terminal_tests_OBJECTS = $(am_t38_terminal_tests_OBJECTS) t38_terminal_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_t38_terminal_to_gateway_tests_OBJECTS = \ t38_terminal_to_gateway_tests.$(OBJEXT) fax_utils.$(OBJEXT) \ media_monitor.$(OBJEXT) t38_terminal_to_gateway_tests_OBJECTS = \ $(am_t38_terminal_to_gateway_tests_OBJECTS) t38_terminal_to_gateway_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_t4_tests_OBJECTS = t4_tests.$(OBJEXT) t4_tests_OBJECTS = $(am_t4_tests_OBJECTS) t4_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_time_scale_tests_OBJECTS = time_scale_tests.$(OBJEXT) time_scale_tests_OBJECTS = $(am_time_scale_tests_OBJECTS) time_scale_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_timezone_tests_OBJECTS = timezone_tests.$(OBJEXT) timezone_tests_OBJECTS = $(am_timezone_tests_OBJECTS) timezone_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_tone_detect_tests_OBJECTS = tone_detect_tests.$(OBJEXT) tone_detect_tests_OBJECTS = $(am_tone_detect_tests_OBJECTS) tone_detect_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_tone_generate_tests_OBJECTS = tone_generate_tests.$(OBJEXT) tone_generate_tests_OBJECTS = $(am_tone_generate_tests_OBJECTS) tone_generate_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_tsb85_tests_OBJECTS = tsb85_tests.$(OBJEXT) fax_utils.$(OBJEXT) \ fax_tester.$(OBJEXT) tsb85_tests_OBJECTS = $(am_tsb85_tests_OBJECTS) tsb85_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_v17_tests_OBJECTS = v17_tests.$(OBJEXT) \ line_model_monitor.$(OBJEXT) modem_monitor.$(OBJEXT) v17_tests_OBJECTS = $(am_v17_tests_OBJECTS) v17_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_v18_tests_OBJECTS = v18_tests.$(OBJEXT) v18_tests_OBJECTS = $(am_v18_tests_OBJECTS) v18_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_v22bis_tests_OBJECTS = v22bis_tests.$(OBJEXT) \ line_model_monitor.$(OBJEXT) modem_monitor.$(OBJEXT) v22bis_tests_OBJECTS = $(am_v22bis_tests_OBJECTS) v22bis_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_v27ter_tests_OBJECTS = v27ter_tests.$(OBJEXT) \ line_model_monitor.$(OBJEXT) modem_monitor.$(OBJEXT) v27ter_tests_OBJECTS = $(am_v27ter_tests_OBJECTS) v27ter_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_v29_tests_OBJECTS = v29_tests.$(OBJEXT) \ line_model_monitor.$(OBJEXT) modem_monitor.$(OBJEXT) v29_tests_OBJECTS = $(am_v29_tests_OBJECTS) v29_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_v42_tests_OBJECTS = v42_tests.$(OBJEXT) v42_tests_OBJECTS = $(am_v42_tests_OBJECTS) v42_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_v42bis_tests_OBJECTS = v42bis_tests.$(OBJEXT) v42bis_tests_OBJECTS = $(am_v42bis_tests_OBJECTS) v42bis_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_v8_tests_OBJECTS = v8_tests.$(OBJEXT) v8_tests_OBJECTS = $(am_v8_tests_OBJECTS) v8_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_vector_float_tests_OBJECTS = vector_float_tests.$(OBJEXT) vector_float_tests_OBJECTS = $(am_vector_float_tests_OBJECTS) vector_float_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) am_vector_int_tests_OBJECTS = vector_int_tests.$(OBJEXT) vector_int_tests_OBJECTS = $(am_vector_int_tests_OBJECTS) vector_int_tests_DEPENDENCIES = $(am__DEPENDENCIES_1) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CXXFLAGS) $(CXXFLAGS) AM_V_CXX = $(am__v_CXX_@AM_V@) am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) am__v_CXX_0 = @echo " CXX " $@; am__v_CXX_1 = CXXLD = $(CXX) CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) am__v_CXXLD_0 = @echo " CXXLD " $@; am__v_CXXLD_1 = SOURCES = $(ademco_contactid_tests_SOURCES) $(adsi_tests_SOURCES) \ $(async_tests_SOURCES) $(at_interpreter_tests_SOURCES) \ $(awgn_tests_SOURCES) $(bell_mf_rx_tests_SOURCES) \ $(bell_mf_tx_tests_SOURCES) $(bert_tests_SOURCES) \ $(bit_operations_tests_SOURCES) $(bitstream_tests_SOURCES) \ $(complex_tests_SOURCES) $(complex_vector_float_tests_SOURCES) \ $(complex_vector_int_tests_SOURCES) $(crc_tests_SOURCES) \ $(dc_restore_tests_SOURCES) $(dds_tests_SOURCES) \ $(dtmf_rx_tests_SOURCES) $(dtmf_tx_tests_SOURCES) \ $(echo_tests_SOURCES) $(fax_decode_SOURCES) \ $(fax_tests_SOURCES) $(fsk_tests_SOURCES) \ $(g1050_tests_SOURCES) $(g168_tests_SOURCES) \ $(g711_tests_SOURCES) $(g722_tests_SOURCES) \ $(g726_tests_SOURCES) $(gsm0610_tests_SOURCES) \ $(hdlc_tests_SOURCES) $(ima_adpcm_tests_SOURCES) \ $(image_translate_tests_SOURCES) $(line_model_tests_SOURCES) \ $(logging_tests_SOURCES) $(lpc10_tests_SOURCES) \ $(make_g168_css_SOURCES) $(math_fixed_tests_SOURCES) \ $(modem_connect_tones_tests_SOURCES) \ $(modem_echo_tests_SOURCES) $(noise_tests_SOURCES) \ $(oki_adpcm_tests_SOURCES) $(playout_tests_SOURCES) \ $(plc_tests_SOURCES) $(power_meter_tests_SOURCES) \ $(queue_tests_SOURCES) $(r2_mf_rx_tests_SOURCES) \ $(r2_mf_tx_tests_SOURCES) $(rfc2198_sim_tests_SOURCES) \ $(saturated_tests_SOURCES) $(schedule_tests_SOURCES) \ $(sig_tone_tests_SOURCES) $(super_tone_rx_tests_SOURCES) \ $(super_tone_tx_tests_SOURCES) $(swept_tone_tests_SOURCES) \ $(t31_tests_SOURCES) $(t35_tests_SOURCES) \ $(t38_core_tests_SOURCES) $(t38_decode_SOURCES) \ $(t38_gateway_tests_SOURCES) \ $(t38_gateway_to_terminal_tests_SOURCES) \ $(t38_non_ecm_buffer_tests_SOURCES) \ $(t38_terminal_tests_SOURCES) \ $(t38_terminal_to_gateway_tests_SOURCES) $(t4_tests_SOURCES) \ $(time_scale_tests_SOURCES) $(timezone_tests_SOURCES) \ $(tone_detect_tests_SOURCES) $(tone_generate_tests_SOURCES) \ $(tsb85_tests_SOURCES) $(v17_tests_SOURCES) \ $(v18_tests_SOURCES) $(v22bis_tests_SOURCES) \ $(v27ter_tests_SOURCES) $(v29_tests_SOURCES) \ $(v42_tests_SOURCES) $(v42bis_tests_SOURCES) \ $(v8_tests_SOURCES) $(vector_float_tests_SOURCES) \ $(vector_int_tests_SOURCES) DIST_SOURCES = $(ademco_contactid_tests_SOURCES) $(adsi_tests_SOURCES) \ $(async_tests_SOURCES) $(at_interpreter_tests_SOURCES) \ $(awgn_tests_SOURCES) $(bell_mf_rx_tests_SOURCES) \ $(bell_mf_tx_tests_SOURCES) $(bert_tests_SOURCES) \ $(bit_operations_tests_SOURCES) $(bitstream_tests_SOURCES) \ $(complex_tests_SOURCES) $(complex_vector_float_tests_SOURCES) \ $(complex_vector_int_tests_SOURCES) $(crc_tests_SOURCES) \ $(dc_restore_tests_SOURCES) $(dds_tests_SOURCES) \ $(dtmf_rx_tests_SOURCES) $(dtmf_tx_tests_SOURCES) \ $(echo_tests_SOURCES) $(fax_decode_SOURCES) \ $(fax_tests_SOURCES) $(fsk_tests_SOURCES) \ $(g1050_tests_SOURCES) $(g168_tests_SOURCES) \ $(g711_tests_SOURCES) $(g722_tests_SOURCES) \ $(g726_tests_SOURCES) $(gsm0610_tests_SOURCES) \ $(hdlc_tests_SOURCES) $(ima_adpcm_tests_SOURCES) \ $(image_translate_tests_SOURCES) $(line_model_tests_SOURCES) \ $(logging_tests_SOURCES) $(lpc10_tests_SOURCES) \ $(make_g168_css_SOURCES) $(math_fixed_tests_SOURCES) \ $(modem_connect_tones_tests_SOURCES) \ $(modem_echo_tests_SOURCES) $(noise_tests_SOURCES) \ $(oki_adpcm_tests_SOURCES) $(playout_tests_SOURCES) \ $(plc_tests_SOURCES) $(power_meter_tests_SOURCES) \ $(queue_tests_SOURCES) $(r2_mf_rx_tests_SOURCES) \ $(r2_mf_tx_tests_SOURCES) $(rfc2198_sim_tests_SOURCES) \ $(saturated_tests_SOURCES) $(schedule_tests_SOURCES) \ $(sig_tone_tests_SOURCES) $(super_tone_rx_tests_SOURCES) \ $(super_tone_tx_tests_SOURCES) $(swept_tone_tests_SOURCES) \ $(t31_tests_SOURCES) $(t35_tests_SOURCES) \ $(t38_core_tests_SOURCES) $(t38_decode_SOURCES) \ $(t38_gateway_tests_SOURCES) \ $(t38_gateway_to_terminal_tests_SOURCES) \ $(t38_non_ecm_buffer_tests_SOURCES) \ $(t38_terminal_tests_SOURCES) \ $(t38_terminal_to_gateway_tests_SOURCES) $(t4_tests_SOURCES) \ $(time_scale_tests_SOURCES) $(timezone_tests_SOURCES) \ $(tone_detect_tests_SOURCES) $(tone_generate_tests_SOURCES) \ $(tsb85_tests_SOURCES) $(v17_tests_SOURCES) \ $(v18_tests_SOURCES) $(v22bis_tests_SOURCES) \ $(v27ter_tests_SOURCES) $(v29_tests_SOURCES) \ $(v42_tests_SOURCES) $(v42bis_tests_SOURCES) \ $(v8_tests_SOURCES) $(vector_float_tests_SOURCES) \ $(vector_int_tests_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DATA = $(noinst_DATA) HEADERS = $(noinst_HEADERS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ COMP_VENDOR_CFLAGS = @COMP_VENDOR_CFLAGS@ COMP_VENDOR_LDFLAGS = @COMP_VENDOR_LDFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_FAX2TIFF = @HAVE_FAX2TIFF@ HAVE_PBMTOG3 = @HAVE_PBMTOG3@ HAVE_SOX = @HAVE_SOX@ INSERT_INTTYPES_HEADER = @INSERT_INTTYPES_HEADER@ INSERT_MATH_HEADER = @INSERT_MATH_HEADER@ INSERT_STDBOOL_HEADER = @INSERT_STDBOOL_HEADER@ INSERT_STDINT_HEADER = @INSERT_STDINT_HEADER@ INSERT_TGMATH_HEADER = @INSERT_TGMATH_HEADER@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ $(TESTLIBS) LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIMLIBS = @SIMLIBS@ SPANDSP_LT_AGE = @SPANDSP_LT_AGE@ SPANDSP_LT_CURRENT = @SPANDSP_LT_CURRENT@ SPANDSP_LT_REVISION = @SPANDSP_LT_REVISION@ SPANDSP_MISALIGNED_ACCESS_FAILS = @SPANDSP_MISALIGNED_ACCESS_FAILS@ SPANDSP_SUPPORT_T85 = @SPANDSP_SUPPORT_T85@ SPANDSP_SUPPORT_V34 = @SPANDSP_SUPPORT_V34@ SPANDSP_USE_EXPORT_CAPABILITY = @SPANDSP_USE_EXPORT_CAPABILITY@ SPANDSP_USE_FIXED_POINT = @SPANDSP_USE_FIXED_POINT@ STRIP = @STRIP@ TESTLIBS = @TESTLIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CFLAGS = $(COMP_VENDOR_CFLAGS) AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS) noinst_DATA = sound_c1_8k.wav sound_c3_8k.wav EXTRA_DIST = fax_tests.sh \ regression_tests.sh \ tsb85_extra_tests.sh \ tsb85_tests.sh \ v42bis_tests.sh \ msvc/adsi_tests.vcproj \ msvc/complex_tests.vcproj \ msvc/complex_vector_float_tests.vcproj \ msvc/complex_vector_int_tests.vcproj \ msvc/dtmf_rx_tests.vcproj \ msvc/dtmf_tx_tests.vcproj \ msvc/queue_tests.vcproj \ msvc/t38_core_tests.vcproj \ msvc/t38_non_ecm_buffer_tests.vcproj \ msvc/t38_terminal_tests.vcproj \ msvc/v22bis_tests.vcproj \ msvc/v29_tests.vcproj \ msvc/v8_tests.vcproj \ msvc/v80_tests.vcproj \ msvc/vector_float_tests.vcproj \ msvc/vector_int_tests.vcproj MAINTAINERCLEANFILES = Makefile.in AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_builddir)/spandsp-sim -DDATADIR="\"$(pkgdatadir)\"" LIBDIR = -L$(top_builddir)/src noinst_HEADERS = echo_monitor.h \ fax_tester.h \ fax_utils.h \ line_model_monitor.h \ media_monitor.h \ modem_monitor.h \ pcap_parse.h \ udptl.h ademco_contactid_tests_SOURCES = ademco_contactid_tests.c ademco_contactid_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp adsi_tests_SOURCES = adsi_tests.c adsi_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp async_tests_SOURCES = async_tests.c async_tests_LDADD = $(LIBDIR) -lspandsp at_interpreter_tests_SOURCES = at_interpreter_tests.c at_interpreter_tests_LDADD = $(LIBDIR) -lspandsp awgn_tests_SOURCES = awgn_tests.c awgn_tests_LDADD = $(LIBDIR) -lspandsp bell_mf_rx_tests_SOURCES = bell_mf_rx_tests.c bell_mf_rx_tests_LDADD = $(LIBDIR) -lspandsp bell_mf_tx_tests_SOURCES = bell_mf_tx_tests.c bell_mf_tx_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp bert_tests_SOURCES = bert_tests.c bert_tests_LDADD = $(LIBDIR) -lspandsp bit_operations_tests_SOURCES = bit_operations_tests.c bit_operations_tests_LDADD = $(LIBDIR) -lspandsp bitstream_tests_SOURCES = bitstream_tests.c bitstream_tests_LDADD = $(LIBDIR) -lspandsp complex_tests_SOURCES = complex_tests.c complex_tests_LDADD = $(LIBDIR) -lspandsp complex_vector_float_tests_SOURCES = complex_vector_float_tests.c complex_vector_float_tests_LDADD = $(LIBDIR) -lspandsp complex_vector_int_tests_SOURCES = complex_vector_int_tests.c complex_vector_int_tests_LDADD = $(LIBDIR) -lspandsp crc_tests_SOURCES = crc_tests.c crc_tests_LDADD = $(LIBDIR) -lspandsp dc_restore_tests_SOURCES = dc_restore_tests.c dc_restore_tests_LDADD = $(LIBDIR) -lspandsp dds_tests_SOURCES = dds_tests.c dds_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp dtmf_rx_tests_SOURCES = dtmf_rx_tests.c dtmf_rx_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp dtmf_tx_tests_SOURCES = dtmf_tx_tests.c dtmf_tx_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp echo_tests_SOURCES = echo_tests.c echo_monitor.cpp echo_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp fax_decode_SOURCES = fax_decode.c fax_decode_LDADD = $(LIBDIR) -lspandsp fax_tests_SOURCES = fax_tests.c fax_utils.c media_monitor.cpp fax_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp fsk_tests_SOURCES = fsk_tests.c fsk_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp g1050_tests_SOURCES = g1050_tests.c media_monitor.cpp g1050_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp g168_tests_SOURCES = g168_tests.c g168_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp g711_tests_SOURCES = g711_tests.c g711_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp g722_tests_SOURCES = g722_tests.c g722_tests_LDADD = $(LIBDIR) -lspandsp g726_tests_SOURCES = g726_tests.c g726_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp gsm0610_tests_SOURCES = gsm0610_tests.c gsm0610_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp hdlc_tests_SOURCES = hdlc_tests.c hdlc_tests_LDADD = $(LIBDIR) -lspandsp ima_adpcm_tests_SOURCES = ima_adpcm_tests.c ima_adpcm_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp image_translate_tests_SOURCES = image_translate_tests.c image_translate_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp line_model_tests_SOURCES = line_model_tests.c line_model_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp logging_tests_SOURCES = logging_tests.c logging_tests_LDADD = $(LIBDIR) -lspandsp lpc10_tests_SOURCES = lpc10_tests.c lpc10_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp make_g168_css_SOURCES = make_g168_css.c make_g168_css_LDADD = $(LIBDIR) -lspandsp math_fixed_tests_SOURCES = math_fixed_tests.c math_fixed_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp modem_echo_tests_SOURCES = modem_echo_tests.c echo_monitor.cpp modem_echo_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp modem_connect_tones_tests_SOURCES = modem_connect_tones_tests.c modem_connect_tones_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp noise_tests_SOURCES = noise_tests.c noise_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp oki_adpcm_tests_SOURCES = oki_adpcm_tests.c oki_adpcm_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp playout_tests_SOURCES = playout_tests.c media_monitor.cpp playout_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp plc_tests_SOURCES = plc_tests.c plc_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp power_meter_tests_SOURCES = power_meter_tests.c power_meter_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp queue_tests_SOURCES = queue_tests.c queue_tests_LDADD = $(LIBDIR) -lspandsp r2_mf_rx_tests_SOURCES = r2_mf_rx_tests.c r2_mf_rx_tests_LDADD = $(LIBDIR) -lspandsp r2_mf_tx_tests_SOURCES = r2_mf_tx_tests.c r2_mf_tx_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp rfc2198_sim_tests_SOURCES = rfc2198_sim_tests.c media_monitor.cpp rfc2198_sim_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp saturated_tests_SOURCES = saturated_tests.c saturated_tests_LDADD = $(LIBDIR) -lspandsp schedule_tests_SOURCES = schedule_tests.c schedule_tests_LDADD = $(LIBDIR) -lspandsp sig_tone_tests_SOURCES = sig_tone_tests.c sig_tone_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp super_tone_rx_tests_SOURCES = super_tone_rx_tests.c super_tone_rx_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp super_tone_tx_tests_SOURCES = super_tone_tx_tests.c super_tone_tx_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp swept_tone_tests_SOURCES = swept_tone_tests.c swept_tone_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp t31_tests_SOURCES = t31_tests.c fax_utils.c media_monitor.cpp t31_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp t35_tests_SOURCES = t35_tests.c t35_tests_LDADD = $(LIBDIR) -lspandsp t38_core_tests_SOURCES = t38_core_tests.c t38_core_tests_LDADD = $(LIBDIR) -lspandsp t38_decode_SOURCES = t38_decode.c fax_utils.c pcap_parse.c udptl.c t38_decode_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp -lpcap t38_gateway_tests_SOURCES = t38_gateway_tests.c fax_utils.c media_monitor.cpp t38_gateway_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp t38_gateway_to_terminal_tests_SOURCES = t38_gateway_to_terminal_tests.c fax_utils.c media_monitor.cpp t38_gateway_to_terminal_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp t38_non_ecm_buffer_tests_SOURCES = t38_non_ecm_buffer_tests.c t38_non_ecm_buffer_tests_LDADD = $(LIBDIR) -lspandsp t38_terminal_tests_SOURCES = t38_terminal_tests.c fax_utils.c media_monitor.cpp t38_terminal_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp t38_terminal_to_gateway_tests_SOURCES = t38_terminal_to_gateway_tests.c fax_utils.c media_monitor.cpp t38_terminal_to_gateway_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp t4_tests_SOURCES = t4_tests.c t4_tests_LDADD = $(LIBDIR) -lspandsp time_scale_tests_SOURCES = time_scale_tests.c time_scale_tests_LDADD = $(LIBDIR) -lspandsp timezone_tests_SOURCES = timezone_tests.c timezone_tests_LDADD = $(LIBDIR) -lspandsp tone_detect_tests_SOURCES = tone_detect_tests.c tone_detect_tests_LDADD = $(LIBDIR) -lspandsp tone_generate_tests_SOURCES = tone_generate_tests.c tone_generate_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp tsb85_tests_SOURCES = tsb85_tests.c fax_utils.c fax_tester.c tsb85_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp v17_tests_SOURCES = v17_tests.c line_model_monitor.cpp modem_monitor.cpp v17_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp v18_tests_SOURCES = v18_tests.c v18_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp v22bis_tests_SOURCES = v22bis_tests.c line_model_monitor.cpp modem_monitor.cpp v22bis_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp v27ter_tests_SOURCES = v27ter_tests.c line_model_monitor.cpp modem_monitor.cpp v27ter_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp v29_tests_SOURCES = v29_tests.c line_model_monitor.cpp modem_monitor.cpp v29_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp v42_tests_SOURCES = v42_tests.c v42_tests_LDADD = $(LIBDIR) -lspandsp v42bis_tests_SOURCES = v42bis_tests.c v42bis_tests_LDADD = $(LIBDIR) -lspandsp v8_tests_SOURCES = v8_tests.c v8_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp vector_float_tests_SOURCES = vector_float_tests.c vector_float_tests_LDADD = $(LIBDIR) -lspandsp vector_int_tests_SOURCES = vector_int_tests.c vector_int_tests_LDADD = $(LIBDIR) -lspandsp all: all-am .SUFFIXES: .SUFFIXES: .c .cpp .lo .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstPROGRAMS: @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list ademco_contactid_tests$(EXEEXT): $(ademco_contactid_tests_OBJECTS) $(ademco_contactid_tests_DEPENDENCIES) $(EXTRA_ademco_contactid_tests_DEPENDENCIES) @rm -f ademco_contactid_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ademco_contactid_tests_OBJECTS) $(ademco_contactid_tests_LDADD) $(LIBS) adsi_tests$(EXEEXT): $(adsi_tests_OBJECTS) $(adsi_tests_DEPENDENCIES) $(EXTRA_adsi_tests_DEPENDENCIES) @rm -f adsi_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(adsi_tests_OBJECTS) $(adsi_tests_LDADD) $(LIBS) async_tests$(EXEEXT): $(async_tests_OBJECTS) $(async_tests_DEPENDENCIES) $(EXTRA_async_tests_DEPENDENCIES) @rm -f async_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(async_tests_OBJECTS) $(async_tests_LDADD) $(LIBS) at_interpreter_tests$(EXEEXT): $(at_interpreter_tests_OBJECTS) $(at_interpreter_tests_DEPENDENCIES) $(EXTRA_at_interpreter_tests_DEPENDENCIES) @rm -f at_interpreter_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(at_interpreter_tests_OBJECTS) $(at_interpreter_tests_LDADD) $(LIBS) awgn_tests$(EXEEXT): $(awgn_tests_OBJECTS) $(awgn_tests_DEPENDENCIES) $(EXTRA_awgn_tests_DEPENDENCIES) @rm -f awgn_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(awgn_tests_OBJECTS) $(awgn_tests_LDADD) $(LIBS) bell_mf_rx_tests$(EXEEXT): $(bell_mf_rx_tests_OBJECTS) $(bell_mf_rx_tests_DEPENDENCIES) $(EXTRA_bell_mf_rx_tests_DEPENDENCIES) @rm -f bell_mf_rx_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bell_mf_rx_tests_OBJECTS) $(bell_mf_rx_tests_LDADD) $(LIBS) bell_mf_tx_tests$(EXEEXT): $(bell_mf_tx_tests_OBJECTS) $(bell_mf_tx_tests_DEPENDENCIES) $(EXTRA_bell_mf_tx_tests_DEPENDENCIES) @rm -f bell_mf_tx_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bell_mf_tx_tests_OBJECTS) $(bell_mf_tx_tests_LDADD) $(LIBS) bert_tests$(EXEEXT): $(bert_tests_OBJECTS) $(bert_tests_DEPENDENCIES) $(EXTRA_bert_tests_DEPENDENCIES) @rm -f bert_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bert_tests_OBJECTS) $(bert_tests_LDADD) $(LIBS) bit_operations_tests$(EXEEXT): $(bit_operations_tests_OBJECTS) $(bit_operations_tests_DEPENDENCIES) $(EXTRA_bit_operations_tests_DEPENDENCIES) @rm -f bit_operations_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bit_operations_tests_OBJECTS) $(bit_operations_tests_LDADD) $(LIBS) bitstream_tests$(EXEEXT): $(bitstream_tests_OBJECTS) $(bitstream_tests_DEPENDENCIES) $(EXTRA_bitstream_tests_DEPENDENCIES) @rm -f bitstream_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bitstream_tests_OBJECTS) $(bitstream_tests_LDADD) $(LIBS) complex_tests$(EXEEXT): $(complex_tests_OBJECTS) $(complex_tests_DEPENDENCIES) $(EXTRA_complex_tests_DEPENDENCIES) @rm -f complex_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(complex_tests_OBJECTS) $(complex_tests_LDADD) $(LIBS) complex_vector_float_tests$(EXEEXT): $(complex_vector_float_tests_OBJECTS) $(complex_vector_float_tests_DEPENDENCIES) $(EXTRA_complex_vector_float_tests_DEPENDENCIES) @rm -f complex_vector_float_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(complex_vector_float_tests_OBJECTS) $(complex_vector_float_tests_LDADD) $(LIBS) complex_vector_int_tests$(EXEEXT): $(complex_vector_int_tests_OBJECTS) $(complex_vector_int_tests_DEPENDENCIES) $(EXTRA_complex_vector_int_tests_DEPENDENCIES) @rm -f complex_vector_int_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(complex_vector_int_tests_OBJECTS) $(complex_vector_int_tests_LDADD) $(LIBS) crc_tests$(EXEEXT): $(crc_tests_OBJECTS) $(crc_tests_DEPENDENCIES) $(EXTRA_crc_tests_DEPENDENCIES) @rm -f crc_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(crc_tests_OBJECTS) $(crc_tests_LDADD) $(LIBS) dc_restore_tests$(EXEEXT): $(dc_restore_tests_OBJECTS) $(dc_restore_tests_DEPENDENCIES) $(EXTRA_dc_restore_tests_DEPENDENCIES) @rm -f dc_restore_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dc_restore_tests_OBJECTS) $(dc_restore_tests_LDADD) $(LIBS) dds_tests$(EXEEXT): $(dds_tests_OBJECTS) $(dds_tests_DEPENDENCIES) $(EXTRA_dds_tests_DEPENDENCIES) @rm -f dds_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dds_tests_OBJECTS) $(dds_tests_LDADD) $(LIBS) dtmf_rx_tests$(EXEEXT): $(dtmf_rx_tests_OBJECTS) $(dtmf_rx_tests_DEPENDENCIES) $(EXTRA_dtmf_rx_tests_DEPENDENCIES) @rm -f dtmf_rx_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dtmf_rx_tests_OBJECTS) $(dtmf_rx_tests_LDADD) $(LIBS) dtmf_tx_tests$(EXEEXT): $(dtmf_tx_tests_OBJECTS) $(dtmf_tx_tests_DEPENDENCIES) $(EXTRA_dtmf_tx_tests_DEPENDENCIES) @rm -f dtmf_tx_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dtmf_tx_tests_OBJECTS) $(dtmf_tx_tests_LDADD) $(LIBS) echo_tests$(EXEEXT): $(echo_tests_OBJECTS) $(echo_tests_DEPENDENCIES) $(EXTRA_echo_tests_DEPENDENCIES) @rm -f echo_tests$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(echo_tests_OBJECTS) $(echo_tests_LDADD) $(LIBS) fax_decode$(EXEEXT): $(fax_decode_OBJECTS) $(fax_decode_DEPENDENCIES) $(EXTRA_fax_decode_DEPENDENCIES) @rm -f fax_decode$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fax_decode_OBJECTS) $(fax_decode_LDADD) $(LIBS) fax_tests$(EXEEXT): $(fax_tests_OBJECTS) $(fax_tests_DEPENDENCIES) $(EXTRA_fax_tests_DEPENDENCIES) @rm -f fax_tests$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(fax_tests_OBJECTS) $(fax_tests_LDADD) $(LIBS) fsk_tests$(EXEEXT): $(fsk_tests_OBJECTS) $(fsk_tests_DEPENDENCIES) $(EXTRA_fsk_tests_DEPENDENCIES) @rm -f fsk_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fsk_tests_OBJECTS) $(fsk_tests_LDADD) $(LIBS) g1050_tests$(EXEEXT): $(g1050_tests_OBJECTS) $(g1050_tests_DEPENDENCIES) $(EXTRA_g1050_tests_DEPENDENCIES) @rm -f g1050_tests$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(g1050_tests_OBJECTS) $(g1050_tests_LDADD) $(LIBS) g168_tests$(EXEEXT): $(g168_tests_OBJECTS) $(g168_tests_DEPENDENCIES) $(EXTRA_g168_tests_DEPENDENCIES) @rm -f g168_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(g168_tests_OBJECTS) $(g168_tests_LDADD) $(LIBS) g711_tests$(EXEEXT): $(g711_tests_OBJECTS) $(g711_tests_DEPENDENCIES) $(EXTRA_g711_tests_DEPENDENCIES) @rm -f g711_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(g711_tests_OBJECTS) $(g711_tests_LDADD) $(LIBS) g722_tests$(EXEEXT): $(g722_tests_OBJECTS) $(g722_tests_DEPENDENCIES) $(EXTRA_g722_tests_DEPENDENCIES) @rm -f g722_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(g722_tests_OBJECTS) $(g722_tests_LDADD) $(LIBS) g726_tests$(EXEEXT): $(g726_tests_OBJECTS) $(g726_tests_DEPENDENCIES) $(EXTRA_g726_tests_DEPENDENCIES) @rm -f g726_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(g726_tests_OBJECTS) $(g726_tests_LDADD) $(LIBS) gsm0610_tests$(EXEEXT): $(gsm0610_tests_OBJECTS) $(gsm0610_tests_DEPENDENCIES) $(EXTRA_gsm0610_tests_DEPENDENCIES) @rm -f gsm0610_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gsm0610_tests_OBJECTS) $(gsm0610_tests_LDADD) $(LIBS) hdlc_tests$(EXEEXT): $(hdlc_tests_OBJECTS) $(hdlc_tests_DEPENDENCIES) $(EXTRA_hdlc_tests_DEPENDENCIES) @rm -f hdlc_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(hdlc_tests_OBJECTS) $(hdlc_tests_LDADD) $(LIBS) ima_adpcm_tests$(EXEEXT): $(ima_adpcm_tests_OBJECTS) $(ima_adpcm_tests_DEPENDENCIES) $(EXTRA_ima_adpcm_tests_DEPENDENCIES) @rm -f ima_adpcm_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ima_adpcm_tests_OBJECTS) $(ima_adpcm_tests_LDADD) $(LIBS) image_translate_tests$(EXEEXT): $(image_translate_tests_OBJECTS) $(image_translate_tests_DEPENDENCIES) $(EXTRA_image_translate_tests_DEPENDENCIES) @rm -f image_translate_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(image_translate_tests_OBJECTS) $(image_translate_tests_LDADD) $(LIBS) line_model_tests$(EXEEXT): $(line_model_tests_OBJECTS) $(line_model_tests_DEPENDENCIES) $(EXTRA_line_model_tests_DEPENDENCIES) @rm -f line_model_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(line_model_tests_OBJECTS) $(line_model_tests_LDADD) $(LIBS) logging_tests$(EXEEXT): $(logging_tests_OBJECTS) $(logging_tests_DEPENDENCIES) $(EXTRA_logging_tests_DEPENDENCIES) @rm -f logging_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(logging_tests_OBJECTS) $(logging_tests_LDADD) $(LIBS) lpc10_tests$(EXEEXT): $(lpc10_tests_OBJECTS) $(lpc10_tests_DEPENDENCIES) $(EXTRA_lpc10_tests_DEPENDENCIES) @rm -f lpc10_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lpc10_tests_OBJECTS) $(lpc10_tests_LDADD) $(LIBS) make_g168_css$(EXEEXT): $(make_g168_css_OBJECTS) $(make_g168_css_DEPENDENCIES) $(EXTRA_make_g168_css_DEPENDENCIES) @rm -f make_g168_css$(EXEEXT) $(AM_V_CCLD)$(LINK) $(make_g168_css_OBJECTS) $(make_g168_css_LDADD) $(LIBS) math_fixed_tests$(EXEEXT): $(math_fixed_tests_OBJECTS) $(math_fixed_tests_DEPENDENCIES) $(EXTRA_math_fixed_tests_DEPENDENCIES) @rm -f math_fixed_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(math_fixed_tests_OBJECTS) $(math_fixed_tests_LDADD) $(LIBS) modem_connect_tones_tests$(EXEEXT): $(modem_connect_tones_tests_OBJECTS) $(modem_connect_tones_tests_DEPENDENCIES) $(EXTRA_modem_connect_tones_tests_DEPENDENCIES) @rm -f modem_connect_tones_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(modem_connect_tones_tests_OBJECTS) $(modem_connect_tones_tests_LDADD) $(LIBS) modem_echo_tests$(EXEEXT): $(modem_echo_tests_OBJECTS) $(modem_echo_tests_DEPENDENCIES) $(EXTRA_modem_echo_tests_DEPENDENCIES) @rm -f modem_echo_tests$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(modem_echo_tests_OBJECTS) $(modem_echo_tests_LDADD) $(LIBS) noise_tests$(EXEEXT): $(noise_tests_OBJECTS) $(noise_tests_DEPENDENCIES) $(EXTRA_noise_tests_DEPENDENCIES) @rm -f noise_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(noise_tests_OBJECTS) $(noise_tests_LDADD) $(LIBS) oki_adpcm_tests$(EXEEXT): $(oki_adpcm_tests_OBJECTS) $(oki_adpcm_tests_DEPENDENCIES) $(EXTRA_oki_adpcm_tests_DEPENDENCIES) @rm -f oki_adpcm_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(oki_adpcm_tests_OBJECTS) $(oki_adpcm_tests_LDADD) $(LIBS) playout_tests$(EXEEXT): $(playout_tests_OBJECTS) $(playout_tests_DEPENDENCIES) $(EXTRA_playout_tests_DEPENDENCIES) @rm -f playout_tests$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(playout_tests_OBJECTS) $(playout_tests_LDADD) $(LIBS) plc_tests$(EXEEXT): $(plc_tests_OBJECTS) $(plc_tests_DEPENDENCIES) $(EXTRA_plc_tests_DEPENDENCIES) @rm -f plc_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(plc_tests_OBJECTS) $(plc_tests_LDADD) $(LIBS) power_meter_tests$(EXEEXT): $(power_meter_tests_OBJECTS) $(power_meter_tests_DEPENDENCIES) $(EXTRA_power_meter_tests_DEPENDENCIES) @rm -f power_meter_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(power_meter_tests_OBJECTS) $(power_meter_tests_LDADD) $(LIBS) queue_tests$(EXEEXT): $(queue_tests_OBJECTS) $(queue_tests_DEPENDENCIES) $(EXTRA_queue_tests_DEPENDENCIES) @rm -f queue_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(queue_tests_OBJECTS) $(queue_tests_LDADD) $(LIBS) r2_mf_rx_tests$(EXEEXT): $(r2_mf_rx_tests_OBJECTS) $(r2_mf_rx_tests_DEPENDENCIES) $(EXTRA_r2_mf_rx_tests_DEPENDENCIES) @rm -f r2_mf_rx_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(r2_mf_rx_tests_OBJECTS) $(r2_mf_rx_tests_LDADD) $(LIBS) r2_mf_tx_tests$(EXEEXT): $(r2_mf_tx_tests_OBJECTS) $(r2_mf_tx_tests_DEPENDENCIES) $(EXTRA_r2_mf_tx_tests_DEPENDENCIES) @rm -f r2_mf_tx_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(r2_mf_tx_tests_OBJECTS) $(r2_mf_tx_tests_LDADD) $(LIBS) rfc2198_sim_tests$(EXEEXT): $(rfc2198_sim_tests_OBJECTS) $(rfc2198_sim_tests_DEPENDENCIES) $(EXTRA_rfc2198_sim_tests_DEPENDENCIES) @rm -f rfc2198_sim_tests$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(rfc2198_sim_tests_OBJECTS) $(rfc2198_sim_tests_LDADD) $(LIBS) saturated_tests$(EXEEXT): $(saturated_tests_OBJECTS) $(saturated_tests_DEPENDENCIES) $(EXTRA_saturated_tests_DEPENDENCIES) @rm -f saturated_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(saturated_tests_OBJECTS) $(saturated_tests_LDADD) $(LIBS) schedule_tests$(EXEEXT): $(schedule_tests_OBJECTS) $(schedule_tests_DEPENDENCIES) $(EXTRA_schedule_tests_DEPENDENCIES) @rm -f schedule_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(schedule_tests_OBJECTS) $(schedule_tests_LDADD) $(LIBS) sig_tone_tests$(EXEEXT): $(sig_tone_tests_OBJECTS) $(sig_tone_tests_DEPENDENCIES) $(EXTRA_sig_tone_tests_DEPENDENCIES) @rm -f sig_tone_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sig_tone_tests_OBJECTS) $(sig_tone_tests_LDADD) $(LIBS) super_tone_rx_tests$(EXEEXT): $(super_tone_rx_tests_OBJECTS) $(super_tone_rx_tests_DEPENDENCIES) $(EXTRA_super_tone_rx_tests_DEPENDENCIES) @rm -f super_tone_rx_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(super_tone_rx_tests_OBJECTS) $(super_tone_rx_tests_LDADD) $(LIBS) super_tone_tx_tests$(EXEEXT): $(super_tone_tx_tests_OBJECTS) $(super_tone_tx_tests_DEPENDENCIES) $(EXTRA_super_tone_tx_tests_DEPENDENCIES) @rm -f super_tone_tx_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(super_tone_tx_tests_OBJECTS) $(super_tone_tx_tests_LDADD) $(LIBS) swept_tone_tests$(EXEEXT): $(swept_tone_tests_OBJECTS) $(swept_tone_tests_DEPENDENCIES) $(EXTRA_swept_tone_tests_DEPENDENCIES) @rm -f swept_tone_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(swept_tone_tests_OBJECTS) $(swept_tone_tests_LDADD) $(LIBS) t31_tests$(EXEEXT): $(t31_tests_OBJECTS) $(t31_tests_DEPENDENCIES) $(EXTRA_t31_tests_DEPENDENCIES) @rm -f t31_tests$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(t31_tests_OBJECTS) $(t31_tests_LDADD) $(LIBS) t35_tests$(EXEEXT): $(t35_tests_OBJECTS) $(t35_tests_DEPENDENCIES) $(EXTRA_t35_tests_DEPENDENCIES) @rm -f t35_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(t35_tests_OBJECTS) $(t35_tests_LDADD) $(LIBS) t38_core_tests$(EXEEXT): $(t38_core_tests_OBJECTS) $(t38_core_tests_DEPENDENCIES) $(EXTRA_t38_core_tests_DEPENDENCIES) @rm -f t38_core_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(t38_core_tests_OBJECTS) $(t38_core_tests_LDADD) $(LIBS) t38_decode$(EXEEXT): $(t38_decode_OBJECTS) $(t38_decode_DEPENDENCIES) $(EXTRA_t38_decode_DEPENDENCIES) @rm -f t38_decode$(EXEEXT) $(AM_V_CCLD)$(LINK) $(t38_decode_OBJECTS) $(t38_decode_LDADD) $(LIBS) t38_gateway_tests$(EXEEXT): $(t38_gateway_tests_OBJECTS) $(t38_gateway_tests_DEPENDENCIES) $(EXTRA_t38_gateway_tests_DEPENDENCIES) @rm -f t38_gateway_tests$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(t38_gateway_tests_OBJECTS) $(t38_gateway_tests_LDADD) $(LIBS) t38_gateway_to_terminal_tests$(EXEEXT): $(t38_gateway_to_terminal_tests_OBJECTS) $(t38_gateway_to_terminal_tests_DEPENDENCIES) $(EXTRA_t38_gateway_to_terminal_tests_DEPENDENCIES) @rm -f t38_gateway_to_terminal_tests$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(t38_gateway_to_terminal_tests_OBJECTS) $(t38_gateway_to_terminal_tests_LDADD) $(LIBS) t38_non_ecm_buffer_tests$(EXEEXT): $(t38_non_ecm_buffer_tests_OBJECTS) $(t38_non_ecm_buffer_tests_DEPENDENCIES) $(EXTRA_t38_non_ecm_buffer_tests_DEPENDENCIES) @rm -f t38_non_ecm_buffer_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(t38_non_ecm_buffer_tests_OBJECTS) $(t38_non_ecm_buffer_tests_LDADD) $(LIBS) t38_terminal_tests$(EXEEXT): $(t38_terminal_tests_OBJECTS) $(t38_terminal_tests_DEPENDENCIES) $(EXTRA_t38_terminal_tests_DEPENDENCIES) @rm -f t38_terminal_tests$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(t38_terminal_tests_OBJECTS) $(t38_terminal_tests_LDADD) $(LIBS) t38_terminal_to_gateway_tests$(EXEEXT): $(t38_terminal_to_gateway_tests_OBJECTS) $(t38_terminal_to_gateway_tests_DEPENDENCIES) $(EXTRA_t38_terminal_to_gateway_tests_DEPENDENCIES) @rm -f t38_terminal_to_gateway_tests$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(t38_terminal_to_gateway_tests_OBJECTS) $(t38_terminal_to_gateway_tests_LDADD) $(LIBS) t4_tests$(EXEEXT): $(t4_tests_OBJECTS) $(t4_tests_DEPENDENCIES) $(EXTRA_t4_tests_DEPENDENCIES) @rm -f t4_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(t4_tests_OBJECTS) $(t4_tests_LDADD) $(LIBS) time_scale_tests$(EXEEXT): $(time_scale_tests_OBJECTS) $(time_scale_tests_DEPENDENCIES) $(EXTRA_time_scale_tests_DEPENDENCIES) @rm -f time_scale_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(time_scale_tests_OBJECTS) $(time_scale_tests_LDADD) $(LIBS) timezone_tests$(EXEEXT): $(timezone_tests_OBJECTS) $(timezone_tests_DEPENDENCIES) $(EXTRA_timezone_tests_DEPENDENCIES) @rm -f timezone_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(timezone_tests_OBJECTS) $(timezone_tests_LDADD) $(LIBS) tone_detect_tests$(EXEEXT): $(tone_detect_tests_OBJECTS) $(tone_detect_tests_DEPENDENCIES) $(EXTRA_tone_detect_tests_DEPENDENCIES) @rm -f tone_detect_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tone_detect_tests_OBJECTS) $(tone_detect_tests_LDADD) $(LIBS) tone_generate_tests$(EXEEXT): $(tone_generate_tests_OBJECTS) $(tone_generate_tests_DEPENDENCIES) $(EXTRA_tone_generate_tests_DEPENDENCIES) @rm -f tone_generate_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tone_generate_tests_OBJECTS) $(tone_generate_tests_LDADD) $(LIBS) tsb85_tests$(EXEEXT): $(tsb85_tests_OBJECTS) $(tsb85_tests_DEPENDENCIES) $(EXTRA_tsb85_tests_DEPENDENCIES) @rm -f tsb85_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(tsb85_tests_OBJECTS) $(tsb85_tests_LDADD) $(LIBS) v17_tests$(EXEEXT): $(v17_tests_OBJECTS) $(v17_tests_DEPENDENCIES) $(EXTRA_v17_tests_DEPENDENCIES) @rm -f v17_tests$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(v17_tests_OBJECTS) $(v17_tests_LDADD) $(LIBS) v18_tests$(EXEEXT): $(v18_tests_OBJECTS) $(v18_tests_DEPENDENCIES) $(EXTRA_v18_tests_DEPENDENCIES) @rm -f v18_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(v18_tests_OBJECTS) $(v18_tests_LDADD) $(LIBS) v22bis_tests$(EXEEXT): $(v22bis_tests_OBJECTS) $(v22bis_tests_DEPENDENCIES) $(EXTRA_v22bis_tests_DEPENDENCIES) @rm -f v22bis_tests$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(v22bis_tests_OBJECTS) $(v22bis_tests_LDADD) $(LIBS) v27ter_tests$(EXEEXT): $(v27ter_tests_OBJECTS) $(v27ter_tests_DEPENDENCIES) $(EXTRA_v27ter_tests_DEPENDENCIES) @rm -f v27ter_tests$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(v27ter_tests_OBJECTS) $(v27ter_tests_LDADD) $(LIBS) v29_tests$(EXEEXT): $(v29_tests_OBJECTS) $(v29_tests_DEPENDENCIES) $(EXTRA_v29_tests_DEPENDENCIES) @rm -f v29_tests$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(v29_tests_OBJECTS) $(v29_tests_LDADD) $(LIBS) v42_tests$(EXEEXT): $(v42_tests_OBJECTS) $(v42_tests_DEPENDENCIES) $(EXTRA_v42_tests_DEPENDENCIES) @rm -f v42_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(v42_tests_OBJECTS) $(v42_tests_LDADD) $(LIBS) v42bis_tests$(EXEEXT): $(v42bis_tests_OBJECTS) $(v42bis_tests_DEPENDENCIES) $(EXTRA_v42bis_tests_DEPENDENCIES) @rm -f v42bis_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(v42bis_tests_OBJECTS) $(v42bis_tests_LDADD) $(LIBS) v8_tests$(EXEEXT): $(v8_tests_OBJECTS) $(v8_tests_DEPENDENCIES) $(EXTRA_v8_tests_DEPENDENCIES) @rm -f v8_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(v8_tests_OBJECTS) $(v8_tests_LDADD) $(LIBS) vector_float_tests$(EXEEXT): $(vector_float_tests_OBJECTS) $(vector_float_tests_DEPENDENCIES) $(EXTRA_vector_float_tests_DEPENDENCIES) @rm -f vector_float_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(vector_float_tests_OBJECTS) $(vector_float_tests_LDADD) $(LIBS) vector_int_tests$(EXEEXT): $(vector_int_tests_OBJECTS) $(vector_int_tests_DEPENDENCIES) $(EXTRA_vector_int_tests_DEPENDENCIES) @rm -f vector_int_tests$(EXEEXT) $(AM_V_CCLD)$(LINK) $(vector_int_tests_OBJECTS) $(vector_int_tests_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ademco_contactid_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adsi_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/async_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/at_interpreter_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/awgn_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bell_mf_rx_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bell_mf_tx_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bert_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bit_operations_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitstream_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/complex_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/complex_vector_float_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/complex_vector_int_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/crc_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dc_restore_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dds_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtmf_rx_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dtmf_tx_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/echo_monitor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/echo_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fax_decode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fax_tester.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fax_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fax_utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsk_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g1050_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g168_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g711_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g722_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/g726_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gsm0610_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hdlc_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ima_adpcm_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image_translate_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/line_model_monitor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/line_model_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/logging_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lpc10_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/make_g168_css.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/math_fixed_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/media_monitor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modem_connect_tones_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modem_echo_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modem_monitor.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/noise_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oki_adpcm_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pcap_parse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/playout_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plc_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/power_meter_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/queue_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r2_mf_rx_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/r2_mf_tx_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rfc2198_sim_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/saturated_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/schedule_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sig_tone_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/super_tone_rx_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/super_tone_tx_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swept_tone_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t31_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t35_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t38_core_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t38_decode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t38_gateway_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t38_gateway_to_terminal_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t38_non_ecm_buffer_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t38_terminal_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t38_terminal_to_gateway_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t4_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time_scale_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timezone_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tone_detect_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tone_generate_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tsb85_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/udptl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v17_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v18_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v22bis_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v27ter_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v29_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v42_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v42bis_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/v8_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector_float_tests.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector_int_tests.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< .cpp.o: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(DATA) $(HEADERS) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ ctags-am distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am # We need to create the CSS files for echo cancellation tests. sound_c1_8k.wav sound_c3_8k.wav: make_g168_css$(EXEEXT) ./make_g168_css$(EXEEXT) sox sound_c1.wav -r8000 sound_c1_8k.wav sox sound_c3.wav -r8000 sound_c3_8k.wav rm sound_c1.wav sound_c3.wav # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: spandsp-0.0.6/tests/dtmf_tx_tests.c0000664000175000017500000001324712101212477014311 00000000000000/* * SpanDSP - a series of DSP components for telephony * * dtmf_tx_tests.c - Test the DTMF generator. * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page dtmf_tx_tests_page DTMF generation tests \section dtmf_tx_tests_page_sec_1 What does it do? ???. \section dtmf_tx_tests_page_sec_2 How does it work? ???. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define OUTPUT_FILE_NAME "dtmf.wav" int main(int argc, char *argv[]) { dtmf_tx_state_t *gen; int16_t amp[16384]; int len; SNDFILE *outhandle; int add_digits; if ((outhandle = sf_open_telephony_write(OUTPUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } gen = dtmf_tx_init(NULL); len = dtmf_tx(gen, amp, 16384); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); if (dtmf_tx_put(gen, "123", -1)) { printf("Ooops\n"); exit(2); } len = dtmf_tx(gen, amp, 16384); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); if (dtmf_tx_put(gen, "456", -1)) { printf("Ooops\n"); exit(2); } len = dtmf_tx(gen, amp, 160); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); if (dtmf_tx_put(gen, "789", -1)) { printf("Ooops\n"); exit(2); } len = dtmf_tx(gen, amp, 160); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); if (dtmf_tx_put(gen, "*#", -1)) { printf("Ooops\n"); exit(2); } len = dtmf_tx(gen, amp, 160); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); add_digits = 1; do { len = dtmf_tx(gen, amp, 160); printf("Generated %d samples\n", len); if (len > 0) sf_writef_short(outhandle, amp, len); if (add_digits) { if (dtmf_tx_put(gen, "1234567890", -1)) { printf("Digit buffer full\n"); add_digits = 0; } } } while (len > 0); dtmf_tx_init(gen); len = dtmf_tx(gen, amp, 16384); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); if (dtmf_tx_put(gen, "123", -1)) { printf("Ooops\n"); exit(2); } len = dtmf_tx(gen, amp, 16384); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); if (dtmf_tx_put(gen, "456", -1)) { printf("Ooops\n"); exit(2); } len = dtmf_tx(gen, amp, 160); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); if (dtmf_tx_put(gen, "789", -1)) { printf("Ooops\n"); exit(2); } len = dtmf_tx(gen, amp, 160); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); if (dtmf_tx_put(gen, "0*#", -1)) { printf("Ooops\n"); exit(2); } len = dtmf_tx(gen, amp, 160); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); if (dtmf_tx_put(gen, "ABCD", -1)) { printf("Ooops\n"); exit(2); } len = dtmf_tx(gen, amp, 160); printf("Generated %d samples\n", len); sf_writef_short(outhandle, amp, len); /* Try modifying the level and length of the digits */ printf("Try different levels and timing\n"); dtmf_tx_set_level(gen, -20, 5); dtmf_tx_set_timing(gen, 100, 200); if (dtmf_tx_put(gen, "123", -1)) { printf("Ooops\n"); exit(2); } do { len = dtmf_tx(gen, amp, 160); printf("Generated %d samples\n", len); if (len > 0) sf_writef_short(outhandle, amp, len); } while (len > 0); printf("Restore normal levels and timing\n"); dtmf_tx_set_level(gen, -10, 0); dtmf_tx_set_timing(gen, 50, 55); if (dtmf_tx_put(gen, "A", -1)) { printf("Ooops\n"); exit(2); } add_digits = TRUE; do { len = dtmf_tx(gen, amp, 160); printf("Generated %d samples\n", len); if (len > 0) sf_writef_short(outhandle, amp, len); if (add_digits) { if (dtmf_tx_put(gen, "1234567890", -1)) { printf("Digit buffer full\n"); add_digits = FALSE; } } } while (len > 0); if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/hdlc_tests.c0000664000175000017500000006111711422612266013562 00000000000000/* * SpanDSP - a series of DSP components for telephony * * hdlc_tests.c * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page hdlc_tests_page HDLC tests \section hdlc_tests_page_sec_1 What does it do? The HDLC tests exercise the HDLC module, and verifies correct operation using both 16 and 32 bit CRCs. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include "spandsp.h" #include "spandsp/private/hdlc.h" int ref_len; uint8_t buf[1000]; int abort_reported; int frame_handled; int frame_failed; int frame_len_errors; int frame_data_errors; int underflow_reported; int framing_ok_reported; int framing_ok_reports; hdlc_rx_state_t rx; hdlc_tx_state_t tx; int frames_sent; int bytes_sent; uint64_t start; uint64_t end; /* Use a local random generator, so the results are consistent across platforms. We have hard coded correct results for a message sequence generated by this particular PRNG. */ static int my_rand(void) { static int rndnum = 1234567; return (rndnum = 1664525U*rndnum + 1013904223U) >> 8; } /*- End of function --------------------------------------------------------*/ static int cook_up_msg(uint8_t *buf) { int i; int len; /* Use medium length messages, with some randomised length variation. */ /* TODO: this doesn't exercise extremely short or long messages. */ len = (my_rand() & 0x3F) + 100; for (i = 0; i < len; i++) buf[i] = my_rand(); return len; } /*- End of function --------------------------------------------------------*/ static void frame_handler(void *user_data, const uint8_t *pkt, int len, int ok) { if (len < 0) { /* Special conditions */ printf("HDLC rx status is %s (%d)\n", signal_status_to_str(len), len); switch (len) { case SIG_STATUS_FRAMING_OK: framing_ok_reported = TRUE; framing_ok_reports++; break; case SIG_STATUS_ABORT: abort_reported = TRUE; break; } return; } if (ok) { if (len != ref_len) { printf("Len error - %d %d\n", len, ref_len); frame_len_errors++; return; } if (memcmp(pkt, buf, len)) { printf("Frame data error\n"); frame_data_errors++; return; } frame_handled = TRUE; } else { frame_failed = TRUE; } } /*- End of function --------------------------------------------------------*/ static void underflow_handler(void *user_data) { //printf("Underflow reported\n"); underflow_reported = TRUE; } /*- End of function --------------------------------------------------------*/ static void check_result(void) { hdlc_rx_stats_t rx_stats; hdlc_rx_get_stats(&rx, &rx_stats); printf("%lu bytes\n", rx_stats.bytes); printf("%lu good frames\n", rx_stats.good_frames); printf("%lu CRC errors\n", rx_stats.crc_errors); printf("%lu length errors\n", rx_stats.length_errors); printf("%lu aborts\n", rx_stats.aborts); printf("%d frame length errors\n", frame_len_errors); printf("%d frame data errors\n", frame_data_errors); printf("Test duration %" PRIu64 " ticks\n", end - start); if (rx_stats.bytes != bytes_sent || rx_stats.good_frames != frames_sent || rx_stats.crc_errors != 0 || rx_stats.length_errors != 0 || rx_stats.aborts != 0 || frame_len_errors != 0 || frame_data_errors != 0) { printf("Tests failed.\n"); exit(2); } printf("Test passed.\n\n"); } /*- End of function --------------------------------------------------------*/ static int test_hdlc_modes(void) { int i; int j; int len; int nextbyte; int progress; int progress_delay; uint8_t bufx[100]; /* Try sending HDLC messages with CRC-16 */ printf("Testing with CRC-16 (byte by byte)\n"); frame_len_errors = 0; frame_data_errors = 0; hdlc_tx_init(&tx, FALSE, 1, FALSE, underflow_handler, NULL); hdlc_rx_init(&rx, FALSE, FALSE, 5, frame_handler, NULL); underflow_reported = FALSE; start = rdtscll(); hdlc_tx_flags(&tx, 40); /* Push an initial message so we should NOT get an underflow after the preamble. */ ref_len = cook_up_msg(buf); hdlc_tx_frame(&tx, buf, ref_len); frame_handled = FALSE; frame_failed = FALSE; frames_sent = 0; bytes_sent = 0; for (i = 0; i < 1000000; i++) { nextbyte = hdlc_tx_get_byte(&tx); hdlc_rx_put_byte(&rx, nextbyte); if (underflow_reported) { underflow_reported = FALSE; nextbyte = hdlc_tx_get_byte(&tx); hdlc_rx_put_byte(&rx, nextbyte); frames_sent++; bytes_sent += ref_len; if (!frame_handled) { printf("Frame not received.\n"); return -1; } ref_len = cook_up_msg(buf); hdlc_tx_frame(&tx, buf, ref_len); frame_handled = FALSE; } } end = rdtscll(); check_result(); /* Now try sending HDLC messages with CRC-16 */ printf("Testing with CRC-16 (chunk by chunk)\n"); frame_len_errors = 0; frame_data_errors = 0; hdlc_tx_init(&tx, FALSE, 1, FALSE, underflow_handler, NULL); hdlc_rx_init(&rx, FALSE, FALSE, 5, frame_handler, NULL); underflow_reported = FALSE; start = rdtscll(); hdlc_tx_flags(&tx, 40); /* Push an initial message so we should NOT get an underflow after the preamble. */ ref_len = cook_up_msg(buf); hdlc_tx_frame(&tx, buf, ref_len); frame_handled = FALSE; frame_failed = FALSE; frames_sent = 0; bytes_sent = 0; for (i = 0; i < 10000; i++) { len = hdlc_tx_get(&tx, bufx, 100); hdlc_rx_put(&rx, bufx, len); if (underflow_reported) { underflow_reported = FALSE; len = hdlc_tx_get(&tx, bufx, 100); hdlc_rx_put(&rx, bufx, len); frames_sent++; bytes_sent += ref_len; if (!frame_handled) { printf("Frame not received.\n"); return -1; } ref_len = cook_up_msg(buf); hdlc_tx_frame(&tx, buf, ref_len); frame_handled = FALSE; } } end = rdtscll(); check_result(); /* Now try sending HDLC messages with CRC-16 bit by bit */ printf("Testing with CRC-16 (bit by bit)\n"); frame_len_errors = 0; frame_data_errors = 0; hdlc_tx_init(&tx, FALSE, 2, FALSE, underflow_handler, NULL); hdlc_rx_init(&rx, FALSE, FALSE, 5, frame_handler, NULL); underflow_reported = FALSE; start = rdtscll(); hdlc_tx_flags(&tx, 40); /* Don't push an initial message so we should get an underflow after the preamble. */ /* Lie for the first message, as there isn't really one */ frame_handled = TRUE; frame_failed = FALSE; frames_sent = 0; bytes_sent = 0; ref_len = 0; for (i = 0; i < 8*1000000; i++) { nextbyte = hdlc_tx_get_bit(&tx); hdlc_rx_put_bit(&rx, nextbyte); if (underflow_reported) { underflow_reported = FALSE; for (j = 0; j < 20; j++) { nextbyte = hdlc_tx_get_bit(&tx); hdlc_rx_put_bit(&rx, nextbyte); } if (ref_len) { frames_sent++; bytes_sent += ref_len; } if (!frame_handled) { printf("Frame not received.\n"); return -1; } ref_len = cook_up_msg(buf); hdlc_tx_frame(&tx, buf, ref_len); frame_handled = FALSE; } } end = rdtscll(); check_result(); /* Now try sending HDLC messages with CRC-32 */ printf("Testing with CRC-32 (byte by byte)\n"); frame_len_errors = 0; frame_data_errors = 0; hdlc_tx_init(&tx, TRUE, 1, FALSE, underflow_handler, NULL); hdlc_rx_init(&rx, TRUE, FALSE, 1, frame_handler, NULL); underflow_reported = FALSE; start = rdtscll(); hdlc_tx_flags(&tx, 40); /* Don't push an initial message so we should get an underflow after the preamble. */ /* Lie for the first message, as there isn't really one */ frame_handled = TRUE; frame_failed = FALSE; frames_sent = 0; bytes_sent = 0; ref_len = 0; for (i = 0; i < 1000000; i++) { nextbyte = hdlc_tx_get_byte(&tx); hdlc_rx_put_byte(&rx, nextbyte); if (underflow_reported) { underflow_reported = FALSE; nextbyte = hdlc_tx_get_byte(&tx); hdlc_rx_put_byte(&rx, nextbyte); if (ref_len) { frames_sent++; bytes_sent += ref_len; } if (!frame_handled) { printf("Frame not received.\n"); return -1; } ref_len = cook_up_msg(buf); hdlc_tx_frame(&tx, buf, ref_len); frame_handled = FALSE; } } end = rdtscll(); check_result(); /* Now try progressive mode with CRC-16 */ printf("Testing progressive mode with CRC-16 (byte by byte)\n"); frame_len_errors = 0; frame_data_errors = 0; hdlc_tx_init(&tx, TRUE, 1, TRUE, underflow_handler, NULL); hdlc_rx_init(&rx, TRUE, FALSE, 1, frame_handler, NULL); underflow_reported = FALSE; start = rdtscll(); hdlc_tx_flags(&tx, 40); /* Don't push an initial message so we should get an underflow after the preamble. */ /* Lie for the first message, as there isn't really one */ frame_handled = TRUE; frame_failed = FALSE; progress = 9999; progress_delay = 9999; frames_sent = 0; bytes_sent = 0; ref_len = 0; for (i = 0; i < 1000000; i++) { nextbyte = hdlc_tx_get_byte(&tx); hdlc_rx_put_byte(&rx, nextbyte); if (underflow_reported) { underflow_reported = FALSE; nextbyte = hdlc_tx_get_byte(&tx); hdlc_rx_put_byte(&rx, nextbyte); if (ref_len) { frames_sent++; bytes_sent += ref_len; } if (!frame_handled) { printf("Frame not received.\n"); return -1; } ref_len = cook_up_msg(buf); hdlc_tx_frame(&tx, buf, 10); progress = 10; progress_delay = 8; frame_handled = FALSE; } if (progress < ref_len && progress_delay-- <= 0) { if (hdlc_tx_frame(&tx, buf + progress, (progress + 10 <= ref_len) ? 10 : ref_len - progress) < 0) { printf("Failed to add progressively\n"); return -1; } progress += 10; progress_delay = 8; } } end = rdtscll(); check_result(); printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ static int test_hdlc_frame_length_error_handling(void) { int i; int j; int nextbyte; printf("Testing frame length error handling using CRC-16 (bit by bit)\n"); frame_len_errors = 0; frame_data_errors = 0; hdlc_tx_init(&tx, FALSE, 2, FALSE, underflow_handler, NULL); hdlc_rx_init(&rx, FALSE, TRUE, 5, frame_handler, NULL); hdlc_rx_set_max_frame_len(&rx, 100); underflow_reported = FALSE; framing_ok_reported = FALSE; framing_ok_reports = 0; hdlc_tx_flags(&tx, 10); /* Don't push an initial message so we should get an underflow after the preamble. */ /* Lie for the first message, as there isn't really one */ frame_handled = TRUE; frame_failed = FALSE; frames_sent = 0; bytes_sent = 0; ref_len = 0; for (i = 0; i < 8*1000000; i++) { nextbyte = hdlc_tx_get_bit(&tx); hdlc_rx_put_bit(&rx, nextbyte); if (framing_ok_reported) { printf("Framing OK reported at bit %d (%d)\n", i, framing_ok_reports); framing_ok_reported = FALSE; } if (underflow_reported) { underflow_reported = FALSE; for (j = 0; j < 20; j++) { nextbyte = hdlc_tx_get_bit(&tx); hdlc_rx_put_bit(&rx, nextbyte); if (framing_ok_reported) { printf("Framing OK reported at bit %d (%d) - %d\n", i, framing_ok_reports, frame_handled); framing_ok_reported = FALSE; } } if (ref_len) { frames_sent++; bytes_sent += ref_len; } if (!frame_handled) { /* We should get a failure when the length reaches 101 */ if (ref_len == 101) { printf("Tests passed.\n"); return 0; } if (frame_failed) printf("Frame failed.\n"); printf("Frame not received at length %d.\n", ref_len); return -1; } else { /* We should get a failure when the length reaches 101 */ if (ref_len > 100) { printf("Tests failed.\n"); return -1; } } ref_len++; hdlc_tx_frame(&tx, buf, ref_len); frame_handled = FALSE; } } /* We shouldn't reach here */ printf("Tests failed.\n"); return -1; } /*- End of function --------------------------------------------------------*/ static int test_hdlc_crc_error_handling(void) { int i; int j; int nextbyte; int corrupt; printf("Testing CRC error handling using CRC-16 (bit by bit)\n"); frame_len_errors = 0; frame_data_errors = 0; hdlc_tx_init(&tx, FALSE, 2, FALSE, underflow_handler, NULL); hdlc_rx_init(&rx, FALSE, TRUE, 5, frame_handler, NULL); underflow_reported = FALSE; framing_ok_reported = FALSE; framing_ok_reports = 0; hdlc_tx_flags(&tx, 10); /* Don't push an initial message so we should get an underflow after the preamble. */ /* Lie for the first message, as there isn't really one */ frame_handled = TRUE; frame_failed = FALSE; frames_sent = 0; bytes_sent = 0; ref_len = 100; corrupt = FALSE; for (i = 0; i < 8*1000000; i++) { nextbyte = hdlc_tx_get_bit(&tx); hdlc_rx_put_bit(&rx, nextbyte); if (framing_ok_reported) { printf("Framing OK reported at bit %d (%d)\n", i, framing_ok_reports); framing_ok_reported = FALSE; } if (underflow_reported) { underflow_reported = FALSE; for (j = 0; j < 20; j++) { nextbyte = hdlc_tx_get_bit(&tx); hdlc_rx_put_bit(&rx, nextbyte); if (framing_ok_reported) { printf("Framing OK reported at bit %d (%d) - %d\n", i, framing_ok_reports, frame_handled); framing_ok_reported = FALSE; } } if (ref_len) { frames_sent++; bytes_sent += ref_len; } if (!frame_handled) { if (!corrupt) { printf("Frame not received when it should be correct.\n"); return -1; } } else { if (corrupt) { printf("Frame received when it should be corrupt.\n"); return -1; } } ref_len = cook_up_msg(buf); hdlc_tx_frame(&tx, buf, ref_len); if ((corrupt = rand() & 1)) hdlc_tx_corrupt_frame(&tx); frame_handled = FALSE; } } printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ static int test_hdlc_abort_handling(void) { int i; int j; int nextbyte; int abort; printf("Testing abort handling using CRC-16 (bit by bit)\n"); frame_len_errors = 0; frame_data_errors = 0; hdlc_tx_init(&tx, FALSE, 2, FALSE, underflow_handler, NULL); hdlc_rx_init(&rx, FALSE, TRUE, 0, frame_handler, NULL); underflow_reported = FALSE; framing_ok_reported = FALSE; framing_ok_reports = 0; hdlc_tx_flags(&tx, 10); /* Don't push an initial message so we should get an underflow after the preamble. */ /* Lie for the first message, as there isn't really one */ frame_handled = TRUE; frame_failed = FALSE; frames_sent = 0; bytes_sent = 0; ref_len = 0; abort = FALSE; abort_reported = FALSE; for (i = 0; i < 8*1000000; i++) { nextbyte = hdlc_tx_get_bit(&tx); hdlc_rx_put_bit(&rx, nextbyte); if (framing_ok_reported) { printf("Framing OK reported at bit %d (%d)\n", i, framing_ok_reports); framing_ok_reported = FALSE; } if (underflow_reported) { underflow_reported = FALSE; for (j = 0; j < 20; j++) { nextbyte = hdlc_tx_get_bit(&tx); hdlc_rx_put_bit(&rx, nextbyte); if (framing_ok_reported) { printf("Framing OK reported at bit %d (%d) - %d\n", i, framing_ok_reports, frame_handled); framing_ok_reported = FALSE; } } if (ref_len) { frames_sent++; bytes_sent += ref_len; } if (abort) { if (abort && !abort_reported) { printf("Abort not received when sent\n"); return -1; } if (frame_handled) { if (frame_failed) printf("Frame failed.\n"); printf("Frame received when abort sent.\n"); return -1; } } else { if (abort_reported) { printf("Abort received when not sent\n"); return -1; } if (!frame_handled) { if (frame_failed) printf("Frame failed.\n"); printf("Frame not received.\n"); return -1; } } ref_len = cook_up_msg(buf); hdlc_tx_frame(&tx, buf, ref_len); if ((abort = rand() & 1)) hdlc_tx_abort(&tx); frame_handled = FALSE; abort_reported = FALSE; } } printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ #if 0 static int test_hdlc_octet_count_handling(void) { int i; int j; int nextbyte; printf("Testing the octet_counting handling using CRC-16 (bit by bit)\n"); frame_len_errors = 0; frame_data_errors = 0; hdlc_tx_init(&tx, FALSE, 2, FALSE, underflow_handler, NULL); hdlc_rx_init(&rx, FALSE, TRUE, 0, frame_handler, NULL); //hdlc_rx_set_max_frame_len(&rx, 50); hdlc_rx_set_octet_counting_report_interval(&rx, 16); underflow_reported = FALSE; framing_ok_reported = FALSE; framing_ok_reports = 0; hdlc_tx_flags(&tx, 10); /* Don't push an initial message so we should get an underflow after the preamble. */ /* Lie for the first message, as there isn't really one */ frame_handled = TRUE; frame_failed = FALSE; frames_sent = 0; bytes_sent = 0; ref_len = 0; for (i = 0; i < 8*1000000; i++) { nextbyte = hdlc_tx_get_bit(&tx); hdlc_rx_put_bit(&rx, nextbyte); if (framing_ok_reported) { printf("Framing OK reported at bit %d (%d)\n", i, framing_ok_reports); framing_ok_reported = FALSE; } if (underflow_reported) { underflow_reported = FALSE; for (j = 0; j < 20; j++) { nextbyte = hdlc_tx_get_bit(&tx); hdlc_rx_put_bit(&rx, nextbyte); if (framing_ok_reported) { printf("Framing OK reported at bit %d (%d) - %d\n", i, framing_ok_reports, frame_handled); framing_ok_reported = FALSE; } } if (ref_len) { frames_sent++; bytes_sent += ref_len; } if (!frame_handled) { if (frame_failed) printf("Frame failed.\n"); printf("Frame not received.\n"); return -1; } ref_len = cook_up_msg(buf); hdlc_tx_frame(&tx, buf, ref_len); hdlc_tx_abort(&tx); //hdlc_tx_corrupt_frame(&tx); frame_handled = FALSE; } } printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ #endif static void hdlc_tests(void) { printf("HDLC module tests\n"); if (test_hdlc_modes()) { printf("Tests failed\n"); exit(2); } if (test_hdlc_frame_length_error_handling()) { printf("Tests failed\n"); exit(2); } if (test_hdlc_crc_error_handling()) { printf("Tests failed\n"); exit(2); } if (test_hdlc_abort_handling()) { printf("Tests failed\n"); exit(2); } #if 0 if (test_hdlc_octet_count_handling()) { printf("Tests failed\n"); exit(2); } #endif printf("Tests passed.\n"); } /*- End of function --------------------------------------------------------*/ static void decode_handler(void *user_data, const uint8_t *pkt, int len, int ok) { int i; if (len < 0) { /* Special conditions */ printf("HDLC rx status is %s (%d)\n", signal_status_to_str(len), len); return; } if (ok) { printf("Good frame, len = %d\n", len); printf("HDLC: "); for (i = 0; i < len; i++) printf("%02X ", pkt[i]); printf("\n"); } else { printf("Bad frame, len = %d\n", len); } } /*- End of function --------------------------------------------------------*/ static void decode_bitstream(const char *in_file_name) { char buf[1024]; int bit; int num; hdlc_rx_state_t rx; FILE *in; if ((in = fopen(in_file_name, "r")) == NULL) { fprintf(stderr, "Failed to open '%s'\n", in_file_name); exit(2); } hdlc_rx_init(&rx, FALSE, TRUE, 2, decode_handler, NULL); while (fgets(buf, 1024, in)) { if (sscanf(buf, "Rx bit %d - %d", &num, &bit) == 2) { //printf("Rx bit %d - %d\n", num, bit); //printf("Rx bit %d\n", bit); hdlc_rx_put_bit(&rx, bit); } } fclose(in); } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int opt; const char *in_file_name; in_file_name = NULL; while ((opt = getopt(argc, argv, "d:")) != -1) { switch (opt) { case 'd': in_file_name = optarg; break; default: //usage(); exit(2); break; } } if (in_file_name) decode_bitstream(in_file_name); else hdlc_tests(); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/pcap_parse.c0000664000175000017500000002134312101216312013523 00000000000000/* * SpanDSP - a series of DSP components for telephony * * pcap_parse.c * * Written by Steve Underwood * * Copyright (C) 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * * Some code from SIPP (http://sf.net/projects/sipp) was used as a model * for how to work with PCAP files. That code was authored by Guillaume * TEISSIER from FTR&D 02/02/2006, and released under the GPL2 licence. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #if defined(HAVE_PCAP_H) #include #endif #include #include #if defined(__HPUX) || defined(__CYGWIN__) || defined(__FreeBSD__) #include #endif #include #if !defined(__CYGWIN__) #include #endif #include #include #include #include #include "udptl.h" #include "spandsp.h" #include "pcap_parse.h" #if defined(__HPUX) || defined(__DARWIN) || defined(__CYGWIN__) || defined(__FreeBSD__) struct iphdr { #ifdef _HPUX_LI unsigned int ihl:4; unsigned int version:4; #else unsigned int version:4; unsigned int ihl:4; #endif uint8_t tos; uint16_t tot_len; uint16_t id; uint16_t frag_off; uint8_t ttl; uint8_t protocol; uint16_t check; uint32_t saddr; uint32_t daddr; /*The options start here. */ }; #endif /* We define our own structures for Ethernet Header and IPv6 Header as they are not available on CYGWIN. * We only need the fields, which are necessary to determine the type of the next header. * we could also define our own structures for UDP and IPv4. We currently use the structures * made available by the platform, as we had no problems to get them on all supported platforms. */ typedef struct _ether_hdr { char ether_dst[6]; char ether_src[6]; uint16_t ether_type; } ether_hdr; typedef struct _linux_sll_hdr { uint16_t packet_type; uint16_t arphrd; uint16_t slink_length; uint8_t bytes[8]; uint16_t ether_type; } linux_sll_hdr; typedef struct _null_hdr { uint32_t pf_type; } null_hdr; #if !defined(__CYGWIN__) typedef struct _ipv6_hdr { char dontcare[6]; u_int8_t nxt_header; /* we only need the next header, so we can determine, if the next header is UDP or not */ char dontcare2[33]; } ipv6_hdr; #endif char errbuf[PCAP_ERRBUF_SIZE]; int pcap_scan_pkts(const char *file, uint32_t src_addr, uint16_t src_port, uint32_t dest_addr, uint16_t dest_port, pcap_timing_update_handler_t *timing_update_handler, pcap_packet_handler_t *packet_handler, void *user_data) { pcap_t *pcap; struct pcap_pkthdr *pkthdr; uint8_t *pktdata; const uint8_t *body; int body_len; int total_pkts; uint32_t pktlen; ether_hdr *ethhdr; linux_sll_hdr *sllhdr; null_hdr *nullhdr; struct iphdr *iphdr; #if !defined(__CYGWIN__) ipv6_hdr *ip6hdr; #endif struct udphdr *udphdr; int datalink; int packet_type; total_pkts = 0; if ((pcap = pcap_open_offline(file, errbuf)) == NULL) { fprintf(stderr, "Can't open PCAP file '%s'\n", file); return -1; } datalink = pcap_datalink(pcap); /* DLT_EN10MB seems to apply to all forms of ethernet, not just the 10MB kind. */ switch (datalink) { case DLT_EN10MB: printf("Datalink type ethernet\n"); break; case DLT_LINUX_SLL: printf("Datalink type cooked Linux socket\n"); break; case DLT_NULL: printf("Datalink type NULL\n"); break; default: fprintf(stderr, "Unsupported data link type %d\n", datalink); return -1; } pkthdr = NULL; pktdata = NULL; #if defined(HAVE_PCAP_NEXT_EX) while (pcap_next_ex(pcap, &pkthdr, (const uint8_t **) &pktdata) == 1) { #else if ((pkthdr = (struct pcap_pkthdr *) malloc(sizeof(*pkthdr))) == NULL) { fprintf(stderr, "Can't allocate memory for pcap pkthdr\n"); return -1; } while ((pktdata = (uint8_t *) pcap_next(pcap, pkthdr)) != NULL) { #endif switch (datalink) { case DLT_EN10MB: ethhdr = (ether_hdr *) pktdata; packet_type = ntohs(ethhdr->ether_type); #if !defined(__CYGWIN__) if (packet_type != 0x0800 /* IPv4 */ && packet_type != 0x86DD) /* IPv6 */ #else if (packet_type != 0x0800) /* IPv4 */ #endif { continue; } iphdr = (struct iphdr *) ((uint8_t *) ethhdr + sizeof(*ethhdr)); break; case DLT_LINUX_SLL: sllhdr = (linux_sll_hdr *) pktdata; packet_type = ntohs(sllhdr->ether_type); #if !defined(__CYGWIN__) if (packet_type != 0x0800 /* IPv4 */ && packet_type != 0x86DD) /* IPv6 */ #else if (packet_type != 0x0800) /* IPv4 */ #endif { continue; } iphdr = (struct iphdr *) ((uint8_t *) sllhdr + sizeof(*sllhdr)); break; case DLT_NULL: nullhdr = (null_hdr *) pktdata; if (nullhdr->pf_type != PF_INET && nullhdr->pf_type != PF_INET6) continue; iphdr = (struct iphdr *) ((uint8_t *) nullhdr + sizeof(*nullhdr)); break; default: continue; } #if 0 { int i; printf("--- %d -", pkthdr->caplen); for (i = 0; i < pkthdr->caplen; i++) printf(" %02x", pktdata[i]); printf("\n"); } #endif #if !defined(__CYGWIN__) if (iphdr && iphdr->version == 6) { /* ipv6 */ pktlen = (uint32_t) pkthdr->len - sizeof(*ethhdr) - sizeof(*ip6hdr); ip6hdr = (ipv6_hdr *) (void *) iphdr; if (ip6hdr->nxt_header != IPPROTO_UDP) continue; udphdr = (struct udphdr *) ((uint8_t *) ip6hdr + sizeof(*ip6hdr)); } else #endif { /* ipv4 */ if (iphdr->protocol != IPPROTO_UDP) continue; #if defined(__DARWIN) || defined(__CYGWIN__) || defined(__FreeBSD__) udphdr = (struct udphdr *) ((uint8_t *) iphdr + (iphdr->ihl << 2) + 4); pktlen = (uint32_t) ntohs(udphdr->uh_ulen); #elif defined ( __HPUX) udphdr = (struct udphdr *) ((uint8_t *) iphdr + (iphdr->ihl << 2)); pktlen = (uint32_t) pkthdr->len - sizeof(*ethhdr) - sizeof(*iphdr); #else udphdr = (struct udphdr *) ((uint8_t *) iphdr + (iphdr->ihl << 2)); pktlen = (uint32_t) ntohs(udphdr->len); #endif } timing_update_handler(user_data, &pkthdr->ts); if (src_addr && ntohl(iphdr->saddr) != src_addr) continue; #if defined(__DARWIN) || defined(__CYGWIN__) || defined(__FreeBSD__) if (src_port && ntohs(udphdr->uh_sport) != src_port) #else if (src_port && ntohs(udphdr->source) != src_port) #endif continue; if (dest_addr && ntohl(iphdr->daddr) != dest_addr) continue; #if defined(__DARWIN) || defined(__CYGWIN__) || defined(__FreeBSD__) if (dest_port && ntohs(udphdr->uh_dport) != dest_port) #else if (dest_port && ntohs(udphdr->dest) != dest_port) #endif continue; if (pkthdr->len != pkthdr->caplen) { fprintf(stderr, "Truncated packet - total len = %d, captured len = %d\n", pkthdr->len, pkthdr->caplen); exit(2); } body = (const uint8_t *) udphdr; body += sizeof(struct udphdr); body_len = pktlen - sizeof(struct udphdr); packet_handler(user_data, body, body_len); total_pkts++; } fprintf(stderr, "In pcap %s there were %d accepted packets\n", file, total_pkts); pcap_close(pcap); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/dc_restore_tests.c0000664000175000017500000000524112100563275014774 00000000000000/* * SpanDSP - a series of DSP components for telephony * * dc_restore_tests.c - Tests for the dc_restore functions. * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page dc_restore_tests_page DC restoration tests \section dc_restore_tests_page_sec_1 What does it do? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" int main (int argc, char *argv[]) { awgn_state_t noise_source; dc_restore_state_t dc_state; int i; int idum = 1234567; int16_t dirty; int estimate; int min; int max; int dc_offset; dc_offset = 5000; awgn_init_dbm0(&noise_source, idum, -10.0); dc_restore_init(&dc_state); for (i = 0; i < 100000; i++) { dirty = awgn(&noise_source) + dc_offset; dc_restore(&dc_state, dirty); if ((i % 1000) == 0) { printf("Sample %6d: %d (expect %d)\n", i, dc_restore_estimate(&dc_state), dc_offset); } } /* We should have settled by now. Look at the variation we get */ min = 99999; max = -99999; for (i = 0; i < 100000; i++) { dirty = awgn(&noise_source) + dc_offset; dc_restore(&dc_state, dirty); estimate = dc_restore_estimate(&dc_state); if (estimate < min) min = estimate; if (estimate > max) max = estimate; } printf("Spread of DC estimate for an offset of %d was %d to %d\n", dc_offset, min, max); if (min < dc_offset - 50 || max > dc_offset + 50) { printf("Test failed.\n"); exit(2); } printf("Test passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/line_model_monitor.cpp0000664000175000017500000003173612101216613015637 00000000000000/* * SpanDSP - a series of DSP components for telephony * * line_model_monitor.cpp - Model activity in a telephone line model, using the FLTK toolkit. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #if defined(HAVE_FL_FL_H) && defined(HAVE_FL_FL_CARTESIAN_H) #define __STDC_LIMIT_MACROS #include #include #include #include #include #include #include #if defined(HAVE_FFTW3_H) #include #else #include #endif #include #include #include #include #include #include #include "spandsp.h" #include "line_model_monitor.h" struct line_model_monitor_s { Fl_Double_Window *w; Fl_Audio_Meter *audio_meter; Fl_Group *c_spec; Fl_Group *c_right; Fl_Group *c_can; Fl_Group *c_line_model; Ca_Canvas *canvas_spec; Ca_X_Axis *spec_freq; Ca_Y_Axis *spec_amp; Ca_Line *spec_re; double spec_re_plot[2*512]; Ca_Canvas *canvas_can; Ca_X_Axis *can_x; Ca_Y_Axis *can_y; Ca_Line *can_re; double can_re_plot[512]; Ca_Canvas *canvas_line_model; Ca_X_Axis *line_model_x; Ca_Y_Axis *line_model_y; Ca_Line *line_model_re; double line_model_re_plot[512]; int in_ptr; #if defined(HAVE_FFTW3_H) double in[1024][2]; double out[1024][2]; #else fftw_complex in[1024]; fftw_complex out[1024]; #endif fftw_plan p; }; static int skip = 0; static struct line_model_monitor_s model; static struct line_model_monitor_s *s = &model; int line_model_monitor_can_update(const float *coeffs, int len) { int i; float min; float max; if (s->can_re) delete s->can_re; s->canvas_can->current(s->canvas_can); i = 0; min = coeffs[i]; max = coeffs[i]; for (i = 0; i < len; i++) { s->can_re_plot[2*i] = i; s->can_re_plot[2*i + 1] = coeffs[i]; if (min > coeffs[i]) min = coeffs[i]; if (max < coeffs[i]) max = coeffs[i]; } s->can_y->maximum((max == min) ? max + 0.2 : max); s->can_y->minimum(min); s->can_re = new Ca_Line(len, s->can_re_plot, 0, 0, FL_BLUE, CA_NO_POINT); if (++skip >= 100) { skip = 0; Fl::check(); } return 0; } /*- End of function --------------------------------------------------------*/ int line_model_monitor_line_model_update(const float *coeffs, int len) { int i; float min; float max; if (s->line_model_re) delete s->line_model_re; s->canvas_line_model->current(s->canvas_line_model); i = 0; min = coeffs[i]; max = coeffs[i]; for (i = 0; i < len; i++) { s->line_model_re_plot[2*i] = i; s->line_model_re_plot[2*i + 1] = coeffs[i]; if (min > coeffs[i]) min = coeffs[i]; if (max < coeffs[i]) max = coeffs[i]; } s->line_model_y->maximum((max == min) ? max + 0.2 : max); s->line_model_y->minimum(min); s->line_model_re = new Ca_Line(len, s->line_model_re_plot, 0, 0, FL_BLUE, CA_NO_POINT); if (++skip >= 100) { skip = 0; Fl::check(); } return 0; } /*- End of function --------------------------------------------------------*/ int line_model_monitor_line_spectrum_update(const int16_t amp[], int len) { int i; int x; for (i = 0; i < len; i++) s->audio_meter->sample(amp[i]/32768.0); if (s->in_ptr + len < 512) { /* Just add this fragment to the buffer. */ for (i = 0; i < len; i++) #if defined(HAVE_FFTW3_H) s->in[s->in_ptr + i][0] = amp[i]; #else s->in[s->in_ptr + i].re = amp[i]; #endif s->in_ptr += len; return 0; } if (len >= 512) { /* We have enough for a whole block. Use the last 512 samples we have. */ x = len - 512; for (i = 0; i < 512; i++) #if defined(HAVE_FFTW3_H) s->in[i][0] = amp[x + i]; #else s->in[i].re = amp[x + i]; #endif } else { /* We want the last 512 samples. */ x = 512 - len; for (i = 0; i < x; i++) #if defined(HAVE_FFTW3_H) s->in[i][0] = s->in[s->in_ptr - x + i][0]; #else s->in[i].re = s->in[s->in_ptr - x + i].re; #endif for (i = x; i < 512; i++) #if defined(HAVE_FFTW3_H) s->in[i][0] = amp[i - x]; #else s->in[i].re = amp[i - x]; #endif } s->in_ptr = 0; #if defined(HAVE_FFTW3_H) fftw_execute(s->p); #else fftw_one(s->p, s->in, s->out); #endif if (s->spec_re) delete s->spec_re; s->canvas_spec->current(s->canvas_spec); for (i = 0; i < 512; i++) { s->spec_re_plot[2*i] = i*4000.0/512.0; #if defined(HAVE_FFTW3_H) s->spec_re_plot[2*i + 1] = 10.0*log10((s->out[i][0]*s->out[i][0] + s->out[i][1]*s->out[i][1])/(256.0*32768*256.0*32768) + 1.0e-10) + 3.14; #else s->spec_re_plot[2*i + 1] = 10.0*log10((s->out[i].re*s->out[i].re + s->out[i].im*s->out[i].im)/(256.0*32768*256.0*32768) + 1.0e-10) + 3.14; #endif } s->spec_re = new Ca_Line(512, s->spec_re_plot, 0, 0, FL_BLUE, CA_NO_POINT); Fl::check(); return 0; } /*- End of function --------------------------------------------------------*/ int start_line_model_monitor(int len) { char buf[132 + 1]; float x; float y; int i; s->w = new Fl_Double_Window(850, 400, "Telephone line model monitor"); s->c_spec = new Fl_Group(0, 0, 380, 400); s->c_spec->box(FL_DOWN_BOX); s->c_spec->align(FL_ALIGN_TOP | FL_ALIGN_INSIDE); s->canvas_spec = new Ca_Canvas(60, 30, 300, 300, "Spectrum"); s->canvas_spec->box(FL_PLASTIC_DOWN_BOX); s->canvas_spec->color(7); s->canvas_spec->align(FL_ALIGN_TOP); s->canvas_spec->border(15); s->spec_freq = new Ca_X_Axis(65, 330, 290, 30, "Freq (Hz)"); s->spec_freq->align(FL_ALIGN_BOTTOM); s->spec_freq->minimum(0); s->spec_freq->maximum(4000); s->spec_freq->label_format("%g"); s->spec_freq->minor_grid_color(fl_gray_ramp(20)); s->spec_freq->major_grid_color(fl_gray_ramp(15)); s->spec_freq->label_grid_color(fl_gray_ramp(10)); s->spec_freq->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->spec_freq->minor_grid_style(FL_DOT); s->spec_freq->major_step(5); s->spec_freq->label_step(1); s->spec_freq->axis_color(FL_BLACK); s->spec_freq->axis_align(CA_BOTTOM | CA_LINE); s->spec_amp = new Ca_Y_Axis(20, 35, 40, 290, "Amp (dBmO)"); s->spec_amp->align(FL_ALIGN_LEFT); s->spec_amp->minimum(-80.0); s->spec_amp->maximum(10.0); s->spec_amp->minor_grid_color(fl_gray_ramp(20)); s->spec_amp->major_grid_color(fl_gray_ramp(15)); s->spec_amp->label_grid_color(fl_gray_ramp(10)); //s->spec_amp->grid_visible(CA_MINOR_TICK | CA_MAJOR_TICK | CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->spec_amp->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->spec_amp->minor_grid_style(FL_DOT); s->spec_amp->major_step(5); s->spec_amp->label_step(1); s->spec_amp->axis_color(FL_BLACK); s->spec_amp->current(); s->spec_re = NULL; s->c_spec->end(); s->c_right = new Fl_Group(440, 0, 465, 405); s->c_can = new Fl_Group(380, 0, 415, 200); s->c_can->box(FL_DOWN_BOX); s->c_can->align(FL_ALIGN_TOP | FL_ALIGN_INSIDE); s->c_can->current(); s->canvas_can = new Ca_Canvas(460, 35, 300, 100, "??? coefficients"); s->canvas_can->box(FL_PLASTIC_DOWN_BOX); s->canvas_can->color(7); s->canvas_can->align(FL_ALIGN_TOP); Fl_Group::current()->resizable(s->canvas_can); s->canvas_can->border(15); s->can_x = new Ca_X_Axis(465, 135, 290, 30, "Tap"); s->can_x->align(FL_ALIGN_BOTTOM); s->can_x->minimum(0.0); s->can_x->maximum((float) len); s->can_x->label_format("%g"); s->can_x->minor_grid_color(fl_gray_ramp(20)); s->can_x->major_grid_color(fl_gray_ramp(15)); s->can_x->label_grid_color(fl_gray_ramp(10)); s->can_x->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->can_x->minor_grid_style(FL_DOT); s->can_x->major_step(5); s->can_x->label_step(1); s->can_x->axis_align(CA_BOTTOM | CA_LINE); s->can_x->axis_color(FL_BLACK); s->can_x->current(); s->can_y = new Ca_Y_Axis(420, 40, 40, 90, "Amp"); s->can_y->align(FL_ALIGN_LEFT); s->can_y->minimum(-0.1); s->can_y->maximum(0.1); s->can_y->minor_grid_color(fl_gray_ramp(20)); s->can_y->major_grid_color(fl_gray_ramp(15)); s->can_y->label_grid_color(fl_gray_ramp(10)); s->can_y->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->can_y->minor_grid_style(FL_DOT); s->can_y->major_step(5); s->can_y->label_step(1); s->can_y->axis_color(FL_BLACK); s->can_y->current(); s->c_can->end(); s->can_re = NULL; s->c_line_model = new Fl_Group(380, 200, 415, 200); s->c_line_model->box(FL_DOWN_BOX); s->c_line_model->align(FL_ALIGN_TOP | FL_ALIGN_INSIDE); s->c_line_model->current(); s->canvas_line_model = new Ca_Canvas(460, 235, 300, 100, "Line impulse response model"); s->canvas_line_model->box(FL_PLASTIC_DOWN_BOX); s->canvas_line_model->color(7); s->canvas_line_model->align(FL_ALIGN_TOP); Fl_Group::current()->resizable(s->canvas_line_model); s->canvas_line_model->border(15); s->line_model_x = new Ca_X_Axis(465, 335, 290, 30, "Tap"); s->line_model_x->align(FL_ALIGN_BOTTOM); s->line_model_x->minimum(0.0); s->line_model_x->maximum((float) len); s->line_model_x->label_format("%g"); s->line_model_x->minor_grid_color(fl_gray_ramp(20)); s->line_model_x->major_grid_color(fl_gray_ramp(15)); s->line_model_x->label_grid_color(fl_gray_ramp(10)); s->line_model_x->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->line_model_x->minor_grid_style(FL_DOT); s->line_model_x->major_step(5); s->line_model_x->label_step(1); s->line_model_x->axis_align(CA_BOTTOM | CA_LINE); s->line_model_x->axis_color(FL_BLACK); s->line_model_x->current(); s->line_model_y = new Ca_Y_Axis(420, 240, 40, 90, "Amp"); s->line_model_y->align(FL_ALIGN_LEFT); s->line_model_y->minimum(-0.1); s->line_model_y->maximum(0.1); s->line_model_y->minor_grid_color(fl_gray_ramp(20)); s->line_model_y->major_grid_color(fl_gray_ramp(15)); s->line_model_y->label_grid_color(fl_gray_ramp(10)); s->line_model_y->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->line_model_y->minor_grid_style(FL_DOT); s->line_model_y->major_step(5); s->line_model_y->label_step(1); s->line_model_y->axis_color(FL_BLACK); s->line_model_y->current(); s->line_model_re = NULL; s->c_line_model->end(); s->audio_meter = new Fl_Audio_Meter(810, 40, 10, 250, ""); s->audio_meter->box(FL_PLASTIC_UP_BOX); s->audio_meter->type(FL_VERT_AUDIO_METER); s->c_right->end(); Fl_Group::current()->resizable(s->c_right); s->w->end(); s->w->show(); #if defined(HAVE_FFTW3_H) s->p = fftw_plan_dft_1d(1024, s->in, s->out, FFTW_BACKWARD, FFTW_ESTIMATE); for (i = 0; i < 1024; i++) { s->in[i][0] = 0.0; s->in[i][1] = 0.0; } #else s->p = fftw_create_plan(1024, FFTW_BACKWARD, FFTW_ESTIMATE); for (i = 0; i < 1024; i++) { s->in[i].re = 0.0; s->in[i].im = 0.0; } #endif s->in_ptr = 0; Fl::check(); return 0; } /*- End of function --------------------------------------------------------*/ void line_model_monitor_wait_to_end(void) { fd_set rfds; int res; struct timeval tv; fprintf(stderr, "Processing complete. Press the key to end\n"); do { usleep(100000); Fl::check(); FD_ZERO(&rfds); FD_SET(0, &rfds); tv.tv_usec = 100000; tv.tv_sec = 0; res = select(1, &rfds, NULL, NULL, &tv); } while (res <= 0); } /*- End of function --------------------------------------------------------*/ void line_model_monitor_update_display(void) { Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); } /*- End of function --------------------------------------------------------*/ #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/oki_adpcm_tests.c0000664000175000017500000002310412101216341014555 00000000000000/* * SpanDSP - a series of DSP components for telephony * * oki_adpcm_tests.c - Test the Oki (Dialogic) ADPCM encode and decode * software at 24kbps and 32kbps. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page oki_adpcm_tests_page OKI (Dialogic) ADPCM tests \section oki_adpcm_tests_page_sec_1 What does it do? To perform a general audio quality test, oki_adpcm_tests should be run. The test file ../test-data/local/short_nb_voice.wav will be compressed to the specified bit rate, decompressed, and the resulting audio stored in post_oki_adpcm.wav. A simple SNR test is automatically performed. Listening tests may be used for a more detailed evaluation of the degradation in quality caused by the compression. Both 32k bps and 24k bps compression may be tested. \section oki_adpcm_tests_page_sec_2 How is it used? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define IN_FILE_NAME "../test-data/local/short_nb_voice.wav" #define OUT_FILE_NAME "post_oki_adpcm.wav" #define HIST_LEN 1000 int main(int argc, char *argv[]) { int i; SNDFILE *inhandle; SNDFILE *outhandle; int frames; int dec_frames; int oki_bytes; int bit_rate; double pre_energy; double post_energy; double diff_energy; int16_t pre_amp[HIST_LEN]; int16_t post_amp[HIST_LEN]; uint8_t oki_data[HIST_LEN]; int16_t history[HIST_LEN]; int hist_in; int hist_out; oki_adpcm_state_t *oki_enc_state; oki_adpcm_state_t *oki_dec_state; oki_adpcm_state_t *oki_dec_state2; int xx; int total_pre_samples; int total_compressed_bytes; int total_post_samples; int successive_08_bytes; int successive_80_bytes; int encoded_fd; const char *encoded_file_name; const char *in_file_name; int log_encoded_data; int opt; bit_rate = 32000; encoded_file_name = NULL; in_file_name = IN_FILE_NAME; log_encoded_data = FALSE; while ((opt = getopt(argc, argv, "2d:i:l")) != -1) { switch (opt) { case '2': bit_rate = 24000; break; case 'd': encoded_file_name = optarg; break; case 'i': in_file_name = optarg; break; case 'l': log_encoded_data = TRUE; break; default: //usage(); exit(2); break; } } encoded_fd = -1; inhandle = NULL; oki_enc_state = NULL; if (encoded_file_name) { if ((encoded_fd = open(encoded_file_name, O_RDONLY)) < 0) { fprintf(stderr, " Cannot open encoded file '%s'\n", encoded_file_name); exit(2); } } else { if ((inhandle = sf_open_telephony_read(in_file_name, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", in_file_name); exit(2); } if ((oki_enc_state = oki_adpcm_init(NULL, bit_rate)) == NULL) { fprintf(stderr, " Cannot create encoder\n"); exit(2); } } if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME); exit(2); } if ((oki_dec_state = oki_adpcm_init(NULL, bit_rate)) == NULL) { fprintf(stderr, " Cannot create decoder\n"); exit(2); } if ((oki_dec_state2 = oki_adpcm_init(NULL, bit_rate)) == NULL) { fprintf(stderr, " Cannot create decoder\n"); exit(2); } hist_in = 0; if (bit_rate == 32000) hist_out = 0; else hist_out = HIST_LEN - 27; memset(history, 0, sizeof(history)); pre_energy = 0.0; post_energy = 0.0; diff_energy = 0.0; total_pre_samples = 0; total_compressed_bytes = 0; total_post_samples = 0; if (encoded_file_name) { /* Decode a file of OKI ADPCM code to a linear wave file */ while ((oki_bytes = read(encoded_fd, oki_data, 80)) > 0) { total_compressed_bytes += oki_bytes; dec_frames = oki_adpcm_decode(oki_dec_state, post_amp, oki_data, oki_bytes); total_post_samples += dec_frames; for (i = 0; i < dec_frames; i++) { post_energy += (double) post_amp[i] * (double) post_amp[i]; xx = post_amp[i] - history[hist_out++]; if (hist_out >= HIST_LEN) hist_out = 0; diff_energy += (double) xx * (double) xx; } sf_writef_short(outhandle, post_amp, dec_frames); } close(encoded_fd); } else { /* Perform a linear wave file -> OKI ADPCM -> linear wave file cycle. Along the way check the decoder resets on the sequence specified for this codec, and the gain and worst case sample distortion. */ successive_08_bytes = 0; successive_80_bytes = 0; while ((frames = sf_readf_short(inhandle, pre_amp, 159))) { total_pre_samples += frames; oki_bytes = oki_adpcm_encode(oki_enc_state, oki_data, pre_amp, frames); if (log_encoded_data) write(1, oki_data, oki_bytes); total_compressed_bytes += oki_bytes; /* Look for a condition which is defined as something which should cause a reset of the decoder (48 samples of 0, 8, 0, 8, etc.), and verify that it really does. Use a second decode, which we feed byte by byte, for this. */ for (i = 0; i < oki_bytes; i++) { oki_adpcm_decode(oki_dec_state2, post_amp, &oki_data[i], 1); if (oki_data[i] == 0x08) successive_08_bytes++; else successive_08_bytes = 0; if (oki_data[i] == 0x80) successive_80_bytes++; else successive_80_bytes = 0; if (successive_08_bytes == 24 || successive_80_bytes == 24) { if (oki_dec_state2->step_index != 0) { fprintf(stderr, "Decoder reset failure\n"); exit(2); } } } dec_frames = oki_adpcm_decode(oki_dec_state, post_amp, oki_data, oki_bytes); total_post_samples += dec_frames; for (i = 0; i < frames; i++) { history[hist_in++] = pre_amp[i]; if (hist_in >= HIST_LEN) hist_in = 0; pre_energy += (double) pre_amp[i] * (double) pre_amp[i]; } for (i = 0; i < dec_frames; i++) { post_energy += (double) post_amp[i] * (double) post_amp[i]; xx = post_amp[i] - history[hist_out++]; if (hist_out >= HIST_LEN) hist_out = 0; diff_energy += (double) xx * (double) xx; //post_amp[i] = xx; } sf_writef_short(outhandle, post_amp, dec_frames); } printf("Pre samples: %d\n", total_pre_samples); printf("Compressed bytes: %d\n", total_compressed_bytes); printf("Post samples: %d\n", total_post_samples); printf("Output energy is %f%% of input energy.\n", 100.0*post_energy/pre_energy); printf("Residual energy is %f%% of the total.\n", 100.0*diff_energy/post_energy); if (bit_rate == 32000) { if (fabs(1.0 - post_energy/pre_energy) > 0.01 || fabs(diff_energy/post_energy) > 0.01) { printf("Tests failed.\n"); exit(2); } } else { if (fabs(1.0 - post_energy/pre_energy) > 0.11 || fabs(diff_energy/post_energy) > 0.05) { printf("Tests failed.\n"); exit(2); } } oki_adpcm_release(oki_enc_state); if (sf_close_telephony(inhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", in_file_name); exit(2); } } oki_adpcm_release(oki_dec_state); oki_adpcm_release(oki_dec_state2); if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME); exit(2); } printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/udptl.c0000664000175000017500000004762312100554366012564 00000000000000//#define UDPTL_DEBUG /* * SpanDSP - a series of DSP components for telephony * * udptl.c - An implementation of the UDPTL protocol defined in T.38, * less the packet exchange part * * Written by Steve Underwood * * Copyright (C) 2005, 2009, 2012 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include "udptl.h" #define FALSE 0 #define TRUE (!FALSE) static int decode_length(const uint8_t *buf, int limit, int *len, int *pvalue) { if (*len >= limit) return -1; if ((buf[*len] & 0x80) == 0) { *pvalue = buf[(*len)++]; return 0; } if ((buf[*len] & 0x40) == 0) { if (*len >= limit - 1) return -1; *pvalue = (buf[(*len)++] & 0x3F) << 8; *pvalue |= buf[(*len)++]; return 0; } *pvalue = (buf[(*len)++] & 0x3F) << 14; /* Indicate we have a fragment */ return 1; } /*- End of function --------------------------------------------------------*/ static int decode_open_type(const uint8_t *buf, int limit, int *len, const uint8_t **p_object, int *p_num_octets) { int octet_cnt; int octet_idx; int stat; const uint8_t **pbuf; for (octet_idx = 0, *p_num_octets = 0; ; octet_idx += octet_cnt) { if ((stat = decode_length(buf, limit, len, &octet_cnt)) < 0) return -1; if (octet_cnt > 0) { *p_num_octets += octet_cnt; pbuf = &p_object[octet_idx]; /* Make sure the buffer contains at least the number of bits requested */ if ((*len + octet_cnt) > limit) return -1; *pbuf = &buf[*len]; *len += octet_cnt; } if (stat == 0) break; } return 0; } /*- End of function --------------------------------------------------------*/ static int encode_length(uint8_t *buf, int *len, int value) { int multiplier; if (value < 0x80) { /* 1 octet */ buf[(*len)++] = value; return value; } if (value < 0x4000) { /* 2 octets */ /* Set the first bit of the first octet */ buf[(*len)++] = ((0x8000 | value) >> 8) & 0xFF; buf[(*len)++] = value & 0xFF; return value; } /* Fragmentation */ multiplier = (value < 0x10000) ? (value >> 14) : 4; /* Set the first 2 bits of the octet */ buf[(*len)++] = 0xC0 | multiplier; return multiplier << 14; } /*- End of function --------------------------------------------------------*/ static int encode_open_type(uint8_t *buf, int *len, const uint8_t *data, int num_octets) { int enclen; int octet_idx; uint8_t zero_byte; /* If open type is of zero length, add a single zero byte (10.1) */ if (num_octets == 0) { zero_byte = 0; data = &zero_byte; num_octets = 1; } /* Encode the open type */ for (octet_idx = 0; ; num_octets -= enclen, octet_idx += enclen) { if ((enclen = encode_length(buf, len, num_octets)) < 0) return -1; if (enclen > 0) { memcpy(&buf[*len], &data[octet_idx], enclen); *len += enclen; } if (enclen >= num_octets) break; } return 0; } /*- End of function --------------------------------------------------------*/ int udptl_rx_packet(udptl_state_t *s, const uint8_t buf[], int len) { int stat; int stat2; int i; int j; int k; int l; int m; int x; int limit; int which; int ptr; int count; int total_count; int seq_no; const uint8_t *msg; const uint8_t *data; int msg_len; int repaired[16]; const uint8_t *bufs[16]; int lengths[16]; int span; int entries; ptr = 0; /* Decode seq_number */ if (ptr + 2 > len) return -1; seq_no = (buf[0] << 8) | buf[1]; ptr += 2; /* Break out the primary packet */ if ((stat = decode_open_type(buf, len, &ptr, &msg, &msg_len)) != 0) return -1; /* Decode error_recovery */ if (ptr + 1 > len) return -1; /* Our buffers cannot tolerate overlength packets */ if (msg_len > LOCAL_FAX_MAX_DATAGRAM) return -1; /* Update any missed slots in the buffer */ for (i = s->rx_seq_no; seq_no > i; i++) { x = i & UDPTL_BUF_MASK; s->rx[x].buf_len = -1; s->rx[x].fec_len[0] = 0; s->rx[x].fec_span = 0; s->rx[x].fec_entries = 0; } /* Save the new packet. Pure redundancy mode won't use this, but some systems will switch into FEC mode after sending some redundant packets. */ x = seq_no & UDPTL_BUF_MASK; memcpy(s->rx[x].buf, msg, msg_len); s->rx[x].buf_len = msg_len; s->rx[x].fec_len[0] = 0; s->rx[x].fec_span = 0; s->rx[x].fec_entries = 0; if ((buf[ptr++] & 0x80) == 0) { /* Secondary packet mode for error recovery */ /* We might have the packet we want, but we need to check through the redundant stuff, and verify the integrity of the UDPTL. This greatly reduces our chances of accepting garbage. */ total_count = 0; do { if ((stat2 = decode_length(buf, len, &ptr, &count)) < 0) return -1; for (i = 0; i < count; i++) { if ((stat = decode_open_type(buf, len, &ptr, &bufs[total_count + i], &lengths[total_count + i])) != 0) return -1; } total_count += count; } while (stat2 > 0); /* We should now be exactly at the end of the packet. If not, this is a fault. */ if (ptr != len) return -1; if (seq_no > s->rx_seq_no) { /* We received a later packet than we expected, so we need to check if we can fill in the gap from the secondary packets. */ /* Step through in reverse order, so we go oldest to newest */ for (i = total_count; i > 0; i--) { if (seq_no - i >= s->rx_seq_no) { /* This one wasn't seen before */ /* Process the secondary packet */ #if defined(UDPTL_DEBUG) fprintf(stderr, "Secondary %d, len %d\n", seq_no - i, lengths[i - 1]); #endif /* Save the new packet. Redundancy mode won't use this, but some systems will switch into FEC mode after sending some redundant packets, and this may then be important. */ x = (seq_no - i) & UDPTL_BUF_MASK; memcpy(s->rx[x].buf, bufs[i - 1], lengths[i - 1]); s->rx[x].buf_len = lengths[i - 1]; s->rx[x].fec_len[0] = 0; s->rx[x].fec_span = 0; s->rx[x].fec_entries = 0; if (s->rx_packet_handler(s->user_data, bufs[i - 1], lengths[i - 1], seq_no - i) < 0) fprintf(stderr, "Bad IFP\n"); } } } } else { /* FEC mode for error recovery */ /* Decode the FEC packets */ /* The span is defined as an unconstrained integer, but will never be more than a small value. */ if (ptr + 2 > len) return -1; if (buf[ptr++] != 1) return -1; span = buf[ptr++]; x = seq_no & UDPTL_BUF_MASK; s->rx[x].fec_span = span; memset(repaired, 0, sizeof(repaired)); repaired[x] = TRUE; /* The number of entries is defined as a length, but will only ever be a small value. Treat it as such. */ if (ptr + 1 > len) return -1; entries = buf[ptr++]; s->rx[x].fec_entries = entries; /* Decode the elements */ for (i = 0; i < entries; i++) { if ((stat = decode_open_type(buf, len, &ptr, &data, &s->rx[x].fec_len[i])) != 0) return -1; if (s->rx[x].fec_len[i] > LOCAL_FAX_MAX_DATAGRAM) return -1; /* Save the new FEC data */ memcpy(s->rx[x].fec[i], data, s->rx[x].fec_len[i]); #if 0 fprintf(stderr, "FEC: "); for (j = 0; j < s->rx[x].fec_len[i]; j++) fprintf(stderr, "%02X ", data[j]); fprintf(stderr, "\n"); #endif } /* We should now be exactly at the end of the packet. If not, this is a fault. */ if (ptr != len) return -1; /* See if we can reconstruct anything which is missing */ /* TODO: this does not comprehensively hunt back and repair everything that is possible */ for (l = x; l != ((x - (16 - span*entries)) & UDPTL_BUF_MASK); l = (l - 1) & UDPTL_BUF_MASK) { if (s->rx[l].fec_len[0] <= 0) continue; for (m = 0; m < s->rx[l].fec_entries; m++) { limit = (l + m) & UDPTL_BUF_MASK; for (which = -1, k = (limit - s->rx[l].fec_span*s->rx[l].fec_entries) & UDPTL_BUF_MASK; k != limit; k = (k + s->rx[l].fec_entries) & UDPTL_BUF_MASK) { if (s->rx[k].buf_len <= 0) which = (which == -1) ? k : -2; } if (which >= 0) { /* Repairable */ for (j = 0; j < s->rx[l].fec_len[m]; j++) { s->rx[which].buf[j] = s->rx[l].fec[m][j]; for (k = (limit - s->rx[l].fec_span*s->rx[l].fec_entries) & UDPTL_BUF_MASK; k != limit; k = (k + s->rx[l].fec_entries) & UDPTL_BUF_MASK) { s->rx[which].buf[j] ^= (s->rx[k].buf_len > j) ? s->rx[k].buf[j] : 0; } } s->rx[which].buf_len = s->rx[l].fec_len[m]; repaired[which] = TRUE; } } } /* Now play any new packets forwards in time */ for (l = (x + 1) & UDPTL_BUF_MASK, j = seq_no - UDPTL_BUF_MASK; l != x; l = (l + 1) & UDPTL_BUF_MASK, j++) { if (repaired[l]) { #if defined(UDPTL_DEBUG) fprintf(stderr, "Fixed packet %d, len %d\n", j, l); #endif if (s->rx_packet_handler(s->user_data, s->rx[l].buf, s->rx[l].buf_len, j) < 0) fprintf(stderr, "Bad IFP\n"); } } } /* If packets are received out of sequence, we may have already processed this packet from the error recovery information in a packet already received. */ if (seq_no >= s->rx_seq_no) { /* Decode the primary packet */ #if defined(UDPTL_DEBUG) fprintf(stderr, "Primary packet %d, len %d\n", seq_no, msg_len); #endif if (s->rx_packet_handler(s->user_data, msg, msg_len, seq_no) < 0) fprintf(stderr, "Bad IFP\n"); } s->rx_seq_no = (seq_no + 1) & 0xFFFF; return 0; } /*- End of function --------------------------------------------------------*/ int udptl_build_packet(udptl_state_t *s, uint8_t buf[], const uint8_t msg[], int msg_len) { uint8_t fec[LOCAL_FAX_MAX_DATAGRAM]; int i; int j; int seq; int entry; int entries; int span; int m; int len; int limit; int high_tide; int len_before_entries; int previous_len; /* UDPTL cannot cope with zero length messages, and our buffering for redundancy limits their maximum length. */ if (msg_len < 1 || msg_len > LOCAL_FAX_MAX_DATAGRAM) return -1; seq = s->tx_seq_no & 0xFFFF; /* Map the sequence number to an entry in the circular buffer */ entry = seq & UDPTL_BUF_MASK; /* We save the message in a circular buffer, for generating FEC or redundancy sets later on. */ s->tx[entry].buf_len = msg_len; memcpy(s->tx[entry].buf, msg, msg_len); /* Build the UDPTL packet */ len = 0; /* Encode the sequence number */ buf[len++] = (seq >> 8) & 0xFF; buf[len++] = seq & 0xFF; /* Encode the primary packet */ if (encode_open_type(buf, &len, msg, msg_len) < 0) return -1; /* Encode the appropriate type of error recovery information */ switch (s->error_correction_scheme) { case UDPTL_ERROR_CORRECTION_NONE: /* Encode the error recovery type */ buf[len++] = 0x00; /* The number of entries will always be zero, so it is pointless allowing for the fragmented case here. */ if (encode_length(buf, &len, 0) < 0) return -1; break; case UDPTL_ERROR_CORRECTION_REDUNDANCY: /* Encode the error recovery type */ buf[len++] = 0x00; if (s->tx_seq_no > s->error_correction_entries) entries = s->error_correction_entries; else entries = s->tx_seq_no; len_before_entries = len; /* The number of entries will always be small, so it is pointless allowing for the fragmented case here. */ if (encode_length(buf, &len, entries) < 0) return -1; /* Encode the elements */ for (m = 0; m < entries; m++) { previous_len = len; j = (entry - m - 1) & UDPTL_BUF_MASK; if (encode_open_type(buf, &len, s->tx[j].buf, s->tx[j].buf_len) < 0) return -1; /* If we have exceeded the far end's max datagram size, don't include this last chunk, and stop trying to add more. */ if (len > s->far_max_datagram_size) { len = previous_len; if (encode_length(buf, &len_before_entries, m) < 0) return -1; break; } } break; case UDPTL_ERROR_CORRECTION_FEC: span = s->error_correction_span; entries = s->error_correction_entries; if (seq < s->error_correction_span*s->error_correction_entries) { /* In the initial stages, wind up the FEC smoothly */ entries = seq/s->error_correction_span; if (seq < s->error_correction_span) span = 0; } /* Encode the error recovery type */ buf[len++] = 0x80; /* Span is defined as an inconstrained integer, which it dumb. It will only ever be a small value. Treat it as such. */ buf[len++] = 1; buf[len++] = span; /* The number of entries is defined as a length, but will only ever be a small value. Treat it as such. */ len_before_entries = len; buf[len++] = entries; for (m = 0; m < entries; m++) { previous_len = len; /* Make an XOR'ed entry the maximum length */ limit = (entry + m) & UDPTL_BUF_MASK; high_tide = 0; for (i = (limit - span*entries) & UDPTL_BUF_MASK; i != limit; i = (i + entries) & UDPTL_BUF_MASK) { if (high_tide < s->tx[i].buf_len) { for (j = 0; j < high_tide; j++) fec[j] ^= s->tx[i].buf[j]; for ( ; j < s->tx[i].buf_len; j++) fec[j] = s->tx[i].buf[j]; high_tide = s->tx[i].buf_len; } else { for (j = 0; j < s->tx[i].buf_len; j++) fec[j] ^= s->tx[i].buf[j]; } } if (encode_open_type(buf, &len, fec, high_tide) < 0) return -1; /* If we have exceeded the far end's max datagram size, don't include this last chunk, and stop trying to add more. */ if (len > s->far_max_datagram_size) { len = previous_len; buf[len_before_entries] = (uint8_t) m; break; } } break; } if (s->verbose) fprintf(stderr, "\n"); s->tx_seq_no++; return len; } /*- End of function --------------------------------------------------------*/ int udptl_set_error_correction(udptl_state_t *s, int ec_scheme, int span, int entries) { switch (ec_scheme) { case UDPTL_ERROR_CORRECTION_FEC: case UDPTL_ERROR_CORRECTION_REDUNDANCY: case UDPTL_ERROR_CORRECTION_NONE: s->error_correction_scheme = ec_scheme; break; case -1: /* Just don't change the scheme */ break; default: return -1; } if (span >= 0) s->error_correction_span = span; if (entries >= 0) s->error_correction_entries = entries; return 0; } /*- End of function --------------------------------------------------------*/ int udptl_get_error_correction(udptl_state_t *s, int *ec_scheme, int *span, int *entries) { if (ec_scheme) *ec_scheme = s->error_correction_scheme; if (span) *span = s->error_correction_span; if (entries) *entries = s->error_correction_entries; return 0; } /*- End of function --------------------------------------------------------*/ int udptl_set_local_max_datagram(udptl_state_t *s, int max_datagram) { s->local_max_datagram_size = max_datagram; return 0; } /*- End of function --------------------------------------------------------*/ int udptl_get_local_max_datagram(udptl_state_t *s) { return s->local_max_datagram_size; } /*- End of function --------------------------------------------------------*/ int udptl_set_far_max_datagram(udptl_state_t *s, int max_datagram) { s->far_max_datagram_size = max_datagram; return 0; } /*- End of function --------------------------------------------------------*/ int udptl_get_far_max_datagram(udptl_state_t *s) { return s->far_max_datagram_size; } /*- End of function --------------------------------------------------------*/ udptl_state_t *udptl_init(udptl_state_t *s, int ec_scheme, int span, int entries, udptl_rx_packet_handler_t rx_packet_handler, void *user_data) { int i; if (rx_packet_handler == NULL) return NULL; if (s == NULL) { if ((s = (udptl_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); s->error_correction_scheme = ec_scheme; s->error_correction_span = span; s->error_correction_entries = entries; s->far_max_datagram_size = LOCAL_FAX_MAX_DATAGRAM; s->local_max_datagram_size = LOCAL_FAX_MAX_DATAGRAM; memset(&s->rx, 0, sizeof(s->rx)); memset(&s->tx, 0, sizeof(s->tx)); for (i = 0; i <= UDPTL_BUF_MASK; i++) { s->rx[i].buf_len = -1; s->tx[i].buf_len = -1; } s->rx_packet_handler = rx_packet_handler; s->user_data = user_data; return s; } /*- End of function --------------------------------------------------------*/ int udptl_release(udptl_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/g168_tests.c0000664000175000017500000002700712101216475013332 00000000000000/* * SpanDSP - a series of DSP components for telephony * * g168tests.c - Tests of the "test equipment" (filters, etc.) specified * in G.168. This code is only for checking out the tools, * not for testing an echo cancellor. * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp/g168models.h" #include "spandsp-sim.h" #define FALSE 0 #define TRUE (!FALSE) typedef struct { const char *name; int max; int cur; float gain; SNDFILE *handle; int16_t signal[SAMPLE_RATE]; } signal_source_t; signal_source_t local_css; signal_source_t far_css; static void signal_load(signal_source_t *sig, const char *name) { sig->handle = sf_open_telephony_read(name, 1); sig->name = name; sig->max = sf_readf_short(sig->handle, sig->signal, SAMPLE_RATE); if (sig->max < 0) { fprintf(stderr, " Error reading sound file '%s'\n", sig->name); exit(2); } } /*- End of function --------------------------------------------------------*/ static void signal_free(signal_source_t *sig) { if (sf_close_telephony(sig->handle)) { fprintf(stderr, " Cannot close sound file '%s'\n", sig->name); exit(2); } } /*- End of function --------------------------------------------------------*/ static void signal_restart(signal_source_t *sig, float gain) { sig->cur = 0; sig->gain = powf(10.0f, gain/20.0f); } /*- End of function --------------------------------------------------------*/ static int16_t signal_amp(signal_source_t *sig) { int16_t tx; tx = sig->signal[sig->cur++]*sig->gain; if (sig->cur >= sig->max) sig->cur = 0; return tx; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int f; int i; int16_t amp[8000]; int16_t value; int signal; float power[10]; tone_gen_descriptor_t tone_desc; tone_gen_state_t tone_state; awgn_state_t noise_source; fir32_state_t line_model_d2; fir32_state_t line_model_d3; fir32_state_t line_model_d4; fir32_state_t line_model_d5; fir32_state_t line_model_d6; fir32_state_t line_model_d7; fir32_state_t line_model_d8; fir32_state_t line_model_d9; fir_float_state_t level_measurement_bp; signal_load(&local_css, "sound_c1_8k.wav"); signal_load(&far_css, "sound_c3_8k.wav"); fir32_create(&line_model_d2, line_model_d2_coeffs, sizeof(line_model_d2_coeffs)/sizeof(int32_t)); fir32_create(&line_model_d3, line_model_d3_coeffs, sizeof(line_model_d3_coeffs)/sizeof(int32_t)); fir32_create(&line_model_d4, line_model_d4_coeffs, sizeof(line_model_d4_coeffs)/sizeof(int32_t)); fir32_create(&line_model_d5, line_model_d5_coeffs, sizeof(line_model_d5_coeffs)/sizeof(int32_t)); fir32_create(&line_model_d6, line_model_d6_coeffs, sizeof(line_model_d6_coeffs)/sizeof(int32_t)); fir32_create(&line_model_d7, line_model_d7_coeffs, sizeof(line_model_d7_coeffs)/sizeof(int32_t)); fir32_create(&line_model_d8, line_model_d8_coeffs, sizeof(line_model_d8_coeffs)/sizeof(int32_t)); fir32_create(&line_model_d9, line_model_d9_coeffs, sizeof(line_model_d9_coeffs)/sizeof(int32_t)); fir_float_create(&level_measurement_bp, level_measurement_bp_coeffs, sizeof(level_measurement_bp_coeffs)/sizeof(float)); for (f = 10; f < 4000; f++) { tone_gen_descriptor_init(&tone_desc, f, -10, 0, 0, 1, 0, 0, 0, TRUE); tone_gen_init(&tone_state, &tone_desc); tone_gen(&tone_state, amp, 8000); for (i = 0; i < 10; i++) power[i] = 0.0f; for (i = 0; i < 800; i++) { signal = fir32(&line_model_d2, amp[i]); power[0] += ((signal*signal - power[0])/32.0f); signal = fir32(&line_model_d3, amp[i]); power[1] += ((signal*signal - power[1])/32.0f); signal = fir32(&line_model_d4, amp[i]); power[2] += ((signal*signal - power[2])/32.0f); signal = fir32(&line_model_d5, amp[i]); power[3] += ((signal*signal - power[3])/32.0f); signal = fir32(&line_model_d6, amp[i]); power[4] += ((signal*signal - power[4])/32.0f); signal = fir32(&line_model_d7, amp[i]); power[5] += ((signal*signal - power[5])/32.0f); signal = fir32(&line_model_d8, amp[i]); power[6] += ((signal*signal - power[6])/32.0f); signal = fir32(&line_model_d9, amp[i]); power[7] += ((signal*signal - power[7])/32.0f); signal = fir_float(&level_measurement_bp, amp[i]); power[8] += ((signal*signal - power[8])/32.0f); signal = amp[i]; power[9] += ((signal*signal - power[9])/32.0f); } printf("%d %f %f %f %f %f %f %f %f %f %f\n", f, sqrt(power[0])*LINE_MODEL_D2_GAIN, sqrt(power[1])*LINE_MODEL_D3_GAIN, sqrt(power[2])*LINE_MODEL_D4_GAIN, sqrt(power[3])*LINE_MODEL_D5_GAIN, sqrt(power[4])*LINE_MODEL_D6_GAIN, sqrt(power[5])*LINE_MODEL_D7_GAIN, sqrt(power[6])*LINE_MODEL_D8_GAIN, sqrt(power[7])*LINE_MODEL_D9_GAIN, sqrt(power[8]), sqrt(power[9])); } awgn_init_dbm0(&noise_source, 1234567, -20.0f); for (i = 0; i < 10; i++) power[i] = 0.0f; signal_restart(&local_css, 0.0f); signal_restart(&far_css, 0.0f); for (i = 0; i < SAMPLE_RATE; i++) { value = signal_amp(&local_css); //value = awgn(&noise_source); signal = fir32(&line_model_d2, value); power[0] += ((signal*signal - power[0])/32.0f); signal = fir32(&line_model_d3, value); power[1] += ((signal*signal - power[1])/32.0f); signal = fir32(&line_model_d4, value); power[2] += ((signal*signal - power[2])/32.0f); signal = fir32(&line_model_d5, value); power[3] += ((signal*signal - power[3])/32.0f); signal = fir32(&line_model_d6, value); power[4] += ((signal*signal - power[4])/32.0f); signal = fir32(&line_model_d7, value); power[5] += ((signal*signal - power[5])/32.0f); signal = fir32(&line_model_d8, value); power[6] += ((signal*signal - power[6])/32.0f); signal = fir32(&line_model_d9, value); power[7] += ((signal*signal - power[7])/32.0f); signal = fir_float(&level_measurement_bp, value); power[8] += ((signal*signal - power[8])/32.0f); signal = value; power[9] += ((signal*signal - power[9])/32.0f); } for (i = 0; i < 10; i++) power[i] = 0.0f; for (i = 0; i < SAMPLE_RATE; i++) { value = signal_amp(&local_css); //value = awgn(&noise_source); signal = fir32(&line_model_d2, value); power[0] += ((signal*signal - power[0])/32.0f); signal = fir32(&line_model_d3, value); power[1] += ((signal*signal - power[1])/32.0f); signal = fir32(&line_model_d4, value); power[2] += ((signal*signal - power[2])/32.0f); signal = fir32(&line_model_d5, value); power[3] += ((signal*signal - power[3])/32.0f); signal = fir32(&line_model_d6, value); power[4] += ((signal*signal - power[4])/32.0f); signal = fir32(&line_model_d7, value); power[5] += ((signal*signal - power[5])/32.0f); signal = fir32(&line_model_d8, value); power[6] += ((signal*signal - power[6])/32.0f); signal = fir32(&line_model_d9, value); power[7] += ((signal*signal - power[7])/32.0f); signal = fir_float(&level_measurement_bp, value); power[8] += ((signal*signal - power[8])/32.0f); signal = value; power[9] += ((signal*signal - power[9])/32.0f); } printf("%d %f %f %f %f %f %f %f %f %f %f\n", 0, sqrt(power[0])*LINE_MODEL_D2_GAIN, sqrt(power[1])*LINE_MODEL_D3_GAIN, sqrt(power[2])*LINE_MODEL_D4_GAIN, sqrt(power[3])*LINE_MODEL_D5_GAIN, sqrt(power[4])*LINE_MODEL_D6_GAIN, sqrt(power[5])*LINE_MODEL_D7_GAIN, sqrt(power[6])*LINE_MODEL_D8_GAIN, sqrt(power[7])*LINE_MODEL_D9_GAIN, sqrt(power[8]), sqrt(power[9])); printf("%d %f %f %f %f %f %f %f %f %f %f\n", 0, sqrt(power[0]), sqrt(power[1]), sqrt(power[2]), sqrt(power[3]), sqrt(power[4]), sqrt(power[5]), sqrt(power[6]), sqrt(power[7]), sqrt(power[8]), sqrt(power[9])); printf("%d %f %f %f %f %f %f %f %f %f %f\n", 0, sqrt(power[0])/sqrt(power[9]), sqrt(power[1])/sqrt(power[9]), sqrt(power[2])/sqrt(power[9]), sqrt(power[3])/sqrt(power[9]), sqrt(power[4])/sqrt(power[9]), sqrt(power[5])/sqrt(power[9]), sqrt(power[6])/sqrt(power[9]), sqrt(power[7])/sqrt(power[9]), sqrt(power[8]), sqrt(power[9])); printf("%d %f %f %f %f %f %f %f %f %f %f\n", 0, sqrt(power[0])*LINE_MODEL_D2_GAIN/sqrt(power[9]), sqrt(power[1])*LINE_MODEL_D3_GAIN/sqrt(power[9]), sqrt(power[2])*LINE_MODEL_D4_GAIN/sqrt(power[9]), sqrt(power[3])*LINE_MODEL_D5_GAIN/sqrt(power[9]), sqrt(power[4])*LINE_MODEL_D6_GAIN/sqrt(power[9]), sqrt(power[5])*LINE_MODEL_D7_GAIN/sqrt(power[9]), sqrt(power[6])*LINE_MODEL_D8_GAIN/sqrt(power[9]), sqrt(power[7])*LINE_MODEL_D9_GAIN/sqrt(power[9]), sqrt(power[8]), sqrt(power[9])); for (i = 0; i < (int) (sizeof(css_c1)/sizeof(css_c1[0])); i++) printf("%d\n", css_c1[i]); printf("\n"); for (i = 0; i < (int) (sizeof(css_c1)/sizeof(css_c3[0])); i++) printf("%d\n", css_c3[i]); signal_free(&local_css); signal_free(&far_css); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/echo_tests.c0000664000175000017500000014776212101212553013567 00000000000000/* * SpanDSP - a series of DSP components for telephony * * echo_tests.c * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * Based on a bit from here, a bit from there, eye of toad, * ear of bat, etc - plus, of course, my own 2 cents. * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page echo_can_tests_page Line echo cancellation for voice tests \section echo_can_tests_page_sec_1 What does it do? The echo cancellation tests test the echo cancellor against the G.168 spec. Not all the tests in G.168 are fully implemented at this time. \section echo_can_tests_page_sec_2 How does it work? \section echo_can_tests_page_sec_2 How do I use it? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #if defined(HAVE_FL_FL_H) && defined(HAVE_FL_FL_CARTESIAN_H) && defined(HAVE_FL_FL_AUDIO_METER_H) #define ENABLE_GUI #endif #include #include #include #include #include #include #include #define GEN_CONST #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp/g168models.h" #include "spandsp-sim.h" #if defined(ENABLE_GUI) #include "echo_monitor.h" #endif #if !defined(NULL) #define NULL (void *) 0 #endif #define TEST_EC_TAPS 256 #define RESIDUE_FILE_NAME "residue_sound.wav" /* The key signal names, as defined in G.168 +--------------+ +------------+ | | Sin | | Sgen -->--| Echoey |--->---| Echo |-->-- Sout | | | | | World | Rout | Canceller | --<--| |---<---| |--<-- Rin | | | | +--------------+ +------------+ Echoey world model. Munge means linear->PCM->linear distortion. +-------------------------+ | | Sin Sgen -->--|-->munge--->sum-->munge--|--->--- | +--> | | FIR | Rout --<--|--------+--------munge<--|---<--- | | +-------------------------+ */ typedef struct { const char *name; int max; int cur; float gain; SNDFILE *handle; int16_t signal[SAMPLE_RATE]; } signal_source_t; /* Level measurement device, specified in G.168 section 6.4.1.2.1 */ typedef struct { int type; fir_float_state_t *fir; float history[35*8]; int pos; float factor; float power; float peak; } level_measurement_device_t; typedef struct { int model_no; float erl; fir32_state_t impulse; float gain; int munging_codec; } channel_model_state_t; channel_model_state_t chan_model; signal_source_t local_css; signal_source_t far_css; awgn_state_t local_noise_source; awgn_state_t far_noise_source; SNDFILE *residue_handle; int16_t residue_sound[SAMPLE_RATE]; int residue_cur = 0; level_measurement_device_t *power_meter_1; level_measurement_device_t *power_meter_2; int line_model_no; int supp_line_model_no; int munger; level_measurement_device_t *rin_power_meter; /* Also known as Lrin */ level_measurement_device_t *rout_power_meter; level_measurement_device_t *sin_power_meter; level_measurement_device_t *sout_power_meter; /* Also known as Lret (pre NLP value is known as Lres) */ level_measurement_device_t *sgen_power_meter; #define RESULT_CHANNELS 7 SNDFILE *result_handle; int16_t result_sound[SAMPLE_RATE*RESULT_CHANNELS]; int result_cur; const char *test_name; int quiet; int use_gui; float erl; /* Dump estimated echo response */ static void dump_ec_state(echo_can_state_t *ctx) { int i; FILE *f; if ((f = fopen("echo_tests_state.txt", "wt")) == NULL) return; for (i = 0; i < TEST_EC_TAPS; i++) fprintf(f, "%f\n", (float) ctx->fir_taps16[0][i]/(1 << 15)); fclose(f); } /*- End of function --------------------------------------------------------*/ static inline void put_residue(int16_t amp) { int outframes; residue_sound[residue_cur++] = amp; if (residue_cur >= SAMPLE_RATE) { outframes = sf_writef_short(residue_handle, residue_sound, residue_cur); if (outframes != residue_cur) { fprintf(stderr, " Error writing residue sound\n"); exit(2); } residue_cur = 0; } } /*- End of function --------------------------------------------------------*/ static void signal_load(signal_source_t *sig, const char *name) { sig->handle = sf_open_telephony_read(name, 1); sig->name = name; sig->max = sf_readf_short(sig->handle, sig->signal, SAMPLE_RATE); if (sig->max < 0) { fprintf(stderr, " Error reading sound file '%s'\n", sig->name); exit(2); } } /*- End of function --------------------------------------------------------*/ static void signal_free(signal_source_t *sig) { if (sf_close_telephony(sig->handle)) { fprintf(stderr, " Cannot close sound file '%s'\n", sig->name); exit(2); } } /*- End of function --------------------------------------------------------*/ static void signal_restart(signal_source_t *sig, float gain) { sig->cur = 0; sig->gain = powf(10.0f, gain/20.0f); } /*- End of function --------------------------------------------------------*/ static int16_t signal_amp(signal_source_t *sig) { int16_t tx; tx = sig->signal[sig->cur++]*sig->gain; if (sig->cur >= sig->max) sig->cur = 0; return tx; } /*- End of function --------------------------------------------------------*/ static level_measurement_device_t *level_measurement_device_create(int type) { level_measurement_device_t *dev; int i; dev = (level_measurement_device_t *) malloc(sizeof(level_measurement_device_t)); dev->fir = (fir_float_state_t *) malloc(sizeof(fir_float_state_t)); fir_float_create(dev->fir, level_measurement_bp_coeffs, sizeof(level_measurement_bp_coeffs)/sizeof(float)); for (i = 0; i < 35*8; i++) dev->history[i] = 0.0f; dev->pos = 0; dev->factor = expf(-1.0f/((float) SAMPLE_RATE*0.035f)); dev->power = 0; dev->type = type; return dev; } /*- End of function --------------------------------------------------------*/ #if 0 static void level_measurement_device_reset(level_measurement_device_t *dev) { int i; for (i = 0; i < 35*8; i++) dev->history[i] = 0.0f; dev->pos = 0; dev->power = 0; dev->peak = 0.0f; } /*- End of function --------------------------------------------------------*/ static int level_measurement_device_release(level_measurement_device_t *s) { fir_float_free(s->fir); free(s->fir); free(s); return 0; } /*- End of function --------------------------------------------------------*/ #endif static float level_measurement_device_get_peak(level_measurement_device_t *dev) { return dev->peak; } /*- End of function --------------------------------------------------------*/ static float level_measurement_device_reset_peak(level_measurement_device_t *dev) { float power; power = dev->peak; dev->peak = -99.0f; return power; } /*- End of function --------------------------------------------------------*/ static float level_measurement_device(level_measurement_device_t *dev, int16_t amp) { float signal; float power; /* Level measurement device(s), specified in G.168 section 6.4.1.2.1 and 6.4.1.2.2 */ signal = fir_float(dev->fir, amp); signal *= signal; if (dev->type == 0) { /* Level measurement device, specified in G.168 section 6.4.1.2.1 - level measurement device. This version uses a single pole estimator.*/ dev->power = dev->power*dev->factor + signal*(1.0f - dev->factor); signal = sqrtf(dev->power); } else { /* Level measurement device, specified in G.168 section 6.4.1.2.2 - level measurement device for peaks. This version uses a sliding window estimator. */ dev->power += (signal - dev->history[dev->pos]); dev->history[dev->pos++] = signal; signal = sqrtf(dev->power/(35.8f*8.0f)); } if (signal <= 0.0f) return -99.0f; power = DBM0_MAX_POWER + 20.0f*log10f(signal/32767.0f + 1.0e-10f); if (power > dev->peak) dev->peak = power; return power; } /*- End of function --------------------------------------------------------*/ static void level_measurements_create(int type) { rin_power_meter = level_measurement_device_create(type); rout_power_meter = level_measurement_device_create(type); sin_power_meter = level_measurement_device_create(type); sout_power_meter = level_measurement_device_create(type); sgen_power_meter = level_measurement_device_create(type); } /*- End of function --------------------------------------------------------*/ static void level_measurements_update(int16_t rin, int16_t sin, int16_t rout, int16_t sout, int16_t sgen) { level_measurement_device(rin_power_meter, rin); level_measurement_device(rout_power_meter, rout); level_measurement_device(sin_power_meter, sin); level_measurement_device(sout_power_meter, sout); level_measurement_device(sgen_power_meter, sgen); } /*- End of function --------------------------------------------------------*/ static void level_measurements_reset_peaks(void) { level_measurement_device_reset_peak(rin_power_meter); level_measurement_device_reset_peak(rout_power_meter); level_measurement_device_reset_peak(sin_power_meter); level_measurement_device_reset_peak(sout_power_meter); level_measurement_device_reset_peak(sgen_power_meter); } /*- End of function --------------------------------------------------------*/ static void print_results(void) { if (!quiet) printf("test model ERL time Max Rin Max Rout Max Sgen Max Sin Max Sout\n"); printf("%-4s %-1d %-5.1f%6.2fs%9.2f%9.2f%9.2f%9.2f%9.2f\n", test_name, chan_model.model_no, 20.0f*log10f(-chan_model.erl + 1.0e-10f), 0.0f, //test_clock, level_measurement_device_get_peak(rin_power_meter), level_measurement_device_get_peak(rout_power_meter), level_measurement_device_get_peak(sgen_power_meter), level_measurement_device_get_peak(sin_power_meter), level_measurement_device_get_peak(sout_power_meter)); } /*- End of function --------------------------------------------------------*/ static int channel_model_create(channel_model_state_t *chan, int model, float erl, int codec) { static const int32_t line_model_clear_coeffs[] = { 32768 }; static const int32_t *line_models[] = { line_model_clear_coeffs, line_model_d2_coeffs, line_model_d3_coeffs, line_model_d4_coeffs, line_model_d5_coeffs, line_model_d6_coeffs, line_model_d7_coeffs, line_model_d8_coeffs, line_model_d9_coeffs }; static const int line_model_sizes[] = { sizeof(line_model_clear_coeffs)/sizeof(line_model_clear_coeffs[0]), sizeof(line_model_d2_coeffs)/sizeof(line_model_d2_coeffs[0]), sizeof(line_model_d3_coeffs)/sizeof(line_model_d3_coeffs[0]), sizeof(line_model_d4_coeffs)/sizeof(line_model_d4_coeffs[0]), sizeof(line_model_d5_coeffs)/sizeof(line_model_d5_coeffs[0]), sizeof(line_model_d6_coeffs)/sizeof(line_model_d6_coeffs[0]), sizeof(line_model_d7_coeffs)/sizeof(line_model_d7_coeffs[0]), sizeof(line_model_d8_coeffs)/sizeof(line_model_d8_coeffs[0]), sizeof(line_model_d9_coeffs)/sizeof(line_model_d9_coeffs[0]) }; static const float ki[] = { 3.05e-5f, LINE_MODEL_D2_GAIN, LINE_MODEL_D3_GAIN, LINE_MODEL_D4_GAIN, LINE_MODEL_D5_GAIN, LINE_MODEL_D6_GAIN, LINE_MODEL_D7_GAIN, LINE_MODEL_D8_GAIN, LINE_MODEL_D9_GAIN }; if (model < 0 || model >= (int) (sizeof(line_model_sizes)/sizeof(line_model_sizes[0]))) return -1; fir32_create(&chan->impulse, line_models[model], line_model_sizes[model]); chan->gain = 32768.0f*powf(10.0f, erl/20.0f)*ki[model]; chan->munging_codec = codec; chan->model_no = model; chan->erl = erl; return 0; } /*- End of function --------------------------------------------------------*/ static int16_t channel_model(channel_model_state_t *chan, int16_t rout, int16_t sgen) { int16_t echo; int16_t sin; /* Channel modelling is merely simulating the effects of A-law or u-law distortion and using one of the echo models from G.168. Simulating the codec is very important, as this is usually the limiting factor in how much echo reduction is achieved. */ /* The far end signal will have been through codec munging. */ switch (chan->munging_codec) { case G711_ALAW: sgen = alaw_to_linear(linear_to_alaw(sgen)); break; case G711_ULAW: sgen = ulaw_to_linear(linear_to_ulaw(sgen)); break; } /* The local tx signal will usually have gone through codec munging before it reached the line's analogue area, where the echo occurs. */ switch (chan->munging_codec) { case G711_ALAW: rout = alaw_to_linear(linear_to_alaw(rout)); break; case G711_ULAW: rout = ulaw_to_linear(linear_to_ulaw(rout)); break; } /* Now we need to model the echo. We only model a single analogue segment, as per the G.168 spec. However, there will generally be near end and far end analogue/echoey segments in the real world, unless an end is purely digital. */ echo = fir32(&chan->impulse, rout*chan->gain); sin = saturate(echo + sgen); /* This mixed echo and far end signal will have been through codec munging when it came back into the digital network. */ switch (chan->munging_codec) { case G711_ALAW: sin = alaw_to_linear(linear_to_alaw(sin)); break; case G711_ULAW: sin = ulaw_to_linear(linear_to_ulaw(sin)); break; } return sin; } /*- End of function --------------------------------------------------------*/ static void write_log_files(int16_t rout, int16_t sin) { #if 0 fprintf(flevel, "%f\t%f\t%f\t%f\n", LRin, LSin, LSout, LSgen); fprintf(fdump, "%d %d %d", ctx->tx, ctx->rx, ctx->clean); fprintf(fdump, " %d %d %d %d %d %d %d %d %d %d\n", ctx->clean_nlp, ctx->Ltx, ctx->Lrx, ctx->Lclean, (ctx->nonupdate_dwell > 0), ctx->adapt, ctx->Lclean_bg, ctx->Pstates, ctx->Lbgn_upper, ctx->Lbgn); #endif } /*- End of function --------------------------------------------------------*/ static int16_t silence(void) { return 0; } /*- End of function --------------------------------------------------------*/ static int16_t local_css_signal(void) { return signal_amp(&local_css); } /*- End of function --------------------------------------------------------*/ static int16_t far_css_signal(void) { return signal_amp(&far_css); } /*- End of function --------------------------------------------------------*/ static int16_t local_noise_signal(void) { return awgn(&local_noise_source); } /*- End of function --------------------------------------------------------*/ static int16_t far_noise_signal(void) { return awgn(&far_noise_source); } /*- End of function --------------------------------------------------------*/ #if 0 static int16_t local_hoth_noise_signal(void) { static float hoth_noise = 0.0; hoth_noise = hoth_noise*0.625 + awgn(&local_noise_source)*0.375; return (int16_t) hoth_noise; } /*- End of function --------------------------------------------------------*/ #endif static int16_t far_hoth_noise_signal(void) { static float hoth_noise = 0.0; hoth_noise = hoth_noise*0.625 + awgn(&far_noise_source)*0.375; return (int16_t) hoth_noise; } /*- End of function --------------------------------------------------------*/ static void run_test(echo_can_state_t *ctx, int16_t (*tx_source)(void), int16_t (*rx_source)(void), int period) { int i; int16_t rin; int16_t rout; int16_t sin; int16_t sout; int16_t sgen; int outframes; for (i = 0; i < period*SAMPLE_RATE/1000; i++) { rin = tx_source(); sgen = rx_source(); rout = echo_can_hpf_tx(ctx, rin); sin = channel_model(&chan_model, rout, sgen); sout = echo_can_update(ctx, rout, sin); level_measurements_update(rin, sin, rout, sout, sgen); //residue = 100.0f*pp1/pp2; //put_residue(residue); //put_residue(clean - rx); #if defined(ENABLE_GUI) if (use_gui) echo_can_monitor_can_update(ctx->fir_taps16[0], TEST_EC_TAPS); #endif result_sound[result_cur++] = rin; result_sound[result_cur++] = sgen; result_sound[result_cur++] = sin; result_sound[result_cur++] = rout; result_sound[result_cur++] = sout; result_sound[result_cur++] = sout - sgen; result_sound[result_cur++] = 0; // TODO: insert the EC's internal status here if (result_cur >= RESULT_CHANNELS*SAMPLE_RATE) { outframes = sf_writef_short(result_handle, result_sound, result_cur/RESULT_CHANNELS); if (outframes != result_cur/RESULT_CHANNELS) { fprintf(stderr, " Error writing result sound\n"); exit(2); } result_cur = 0; } } #if defined(ENABLE_GUI) if (use_gui) echo_can_monitor_can_update(ctx->fir_taps16[0], TEST_EC_TAPS); #endif if (result_cur >= 0) { outframes = sf_writef_short(result_handle, result_sound, result_cur/RESULT_CHANNELS); if (outframes != result_cur/RESULT_CHANNELS) { fprintf(stderr, " Error writing result sound\n"); exit(2); } result_cur = 0; } } /*- End of function --------------------------------------------------------*/ static void print_test_title(const char *title) { if (quiet == FALSE) printf(title); } /*- End of function --------------------------------------------------------*/ static int perform_test_sanity(void) { echo_can_state_t *ctx; int i; int16_t rx; int16_t tx; int16_t clean; int far_tx; //int16_t far_sound[SAMPLE_RATE]; int16_t result_sound[64000]; int result_cur; int outframes; //int local_cur; //int far_cur; //int32_t coeffs[200][128]; //int coeff_index; print_test_title("Performing basic sanity test\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); //local_cur = 0; //far_cur = 0; result_cur = 0; echo_can_flush(ctx); /* Converge the canceller */ signal_restart(&local_css, 0.0f); run_test(ctx, silence, silence, 200); run_test(ctx, local_css_signal, silence, 5000); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION | ECHO_CAN_USE_NLP | ECHO_CAN_USE_CNG); run_test(ctx, local_css_signal, silence, 5000); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION); for (i = 0; i < SAMPLE_RATE*10; i++) { tx = local_css_signal(); #if 0 if ((i/10000)%10 == 9) { /* Inject a burst of far sound */ if (far_cur >= far_max) { far_max = sf_readf_short(farhandle, far_sound, SAMPLE_RATE); if (far_max < 0) { fprintf(stderr, " Error reading far sound\n"); exit(2); } if (far_max == 0) break; far_cur = 0; } far_tx = far_sound[far_cur++]; } else { far_tx = 0; } #else //far_sound[0] = 0; far_tx = 0; #endif rx = channel_model(&chan_model, tx, far_tx); //rx += awgn(&far_noise_source); //tx += awgn(&far_noise_source); clean = echo_can_update(ctx, tx, rx); #if defined(XYZZY) if (i%SAMPLE_RATE == 0) { if (coeff_index < 200) { for (j = 0; j < ctx->taps; j++) coeffs[coeff_index][j] = ctx->fir_taps32[j]; coeff_index++; } } #endif result_sound[result_cur++] = tx; result_sound[result_cur++] = rx; result_sound[result_cur++] = clean - far_tx; //result_sound[result_cur++] = ctx->tx_power[2]; //result_sound[result_cur++] = ctx->tx_power[1]; ////result_sound[result_cur++] = (ctx->tx_power[1] > 64) ? SAMPLE_RATE : -SAMPLE_RATE; //result_sound[result_cur++] = ctx->tap_set*SAMPLE_RATE; //result_sound[result_cur++] = (ctx->nonupdate_dwell > 0) ? SAMPLE_RATE : -SAMPLE_RATE; //result_sound[result_cur++] = ctx->latest_correction >> 8; //result_sound[result_cur++] = level_measurement_device(tx)/(16.0*65536.0); //result_sound[result_cur++] = level_measurement_device(tx)/4096.0; ////result_sound[result_cur++] = (ctx->tx_power[1] > ctx->rx_power[0]) ? SAMPLE_RATE : -SAMPLE_RATE; //result_sound[result_cur++] = (ctx->tx_power[1] > ctx->rx_power[0]) ? SAMPLE_RATE : -SAMPLE_RATE; //result_sound[result_cur++] = (ctx->narrowband_score)*5; // ? SAMPLE_RATE : -SAMPLE_RATE; //result_sound[result_cur++] = ctx->tap_rotate_counter*10; ////result_sound[result_cur++] = ctx->vad; put_residue(clean - far_tx); if (result_cur >= RESULT_CHANNELS*SAMPLE_RATE) { outframes = sf_writef_short(result_handle, result_sound, result_cur/RESULT_CHANNELS); if (outframes != result_cur/RESULT_CHANNELS) { fprintf(stderr, " Error writing result sound\n"); exit(2); } result_cur = 0; } } if (result_cur > 0) { outframes = sf_writef_short(result_handle, result_sound, result_cur/RESULT_CHANNELS); if (outframes != result_cur/RESULT_CHANNELS) { fprintf(stderr, " Error writing result sound\n"); exit(2); } } #if defined(XYZZY) for (j = 0; j < ctx->taps; j++) { for (i = 0; i < coeff_index; i++) fprintf(stderr, "%d ", coeffs[i][j]); fprintf(stderr, "\n"); } #endif echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_2a(void) { echo_can_state_t *ctx; /* Test 2 - Convergence and steady state residual and returned echo level test */ /* Test 2A - Convergence and reconvergence test with NLP enabled */ print_test_title("Performing test 2A - Convergence and reconvergence test with NLP enabled\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); echo_can_flush(ctx); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION | ECHO_CAN_USE_NLP); /* Test 2A (a) - Convergence test with NLP enabled */ /* Converge the canceller. */ run_test(ctx, silence, silence, 200); signal_restart(&local_css, 0.0f); run_test(ctx, local_css_signal, silence, 1000); level_measurements_reset_peaks(); run_test(ctx, local_css_signal, silence, 9000); print_results(); if (level_measurement_device_get_peak(sout_power_meter) > -65.0f) printf("Test failed\n"); else printf("Test passed\n"); /* Test 2A (b) - Reconvergence test with NLP enabled */ /* Make an abrupt change of channel characteristic, to another of the channel echo models. */ if (channel_model_create(&chan_model, supp_line_model_no, erl, munger)) { fprintf(stderr, " Failed to create line model\n"); exit(2); } signal_restart(&local_css, 0.0f); run_test(ctx, local_css_signal, silence, 1000); level_measurements_reset_peaks(); run_test(ctx, local_css_signal, silence, 9000); print_results(); if (level_measurement_device_get_peak(sout_power_meter) > -65.0f) printf("Test failed\n"); else printf("Test passed\n"); echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_2b(void) { echo_can_state_t *ctx; /* Test 2 - Convergence and steady state residual and returned echo level test */ /* Test 2B - Convergence and reconverge with NLP disabled */ print_test_title("Performing test 2B - Convergence and reconverge with NLP disabled\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); echo_can_flush(ctx); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION); signal_restart(&local_css, 0.0f); /* Test 2B (a) - Convergence test with NLP disabled */ /* Converge the canceller */ run_test(ctx, silence, silence, 200); run_test(ctx, local_css_signal, silence, 1000); level_measurements_reset_peaks(); run_test(ctx, local_css_signal, silence, 9000); print_results(); level_measurements_reset_peaks(); run_test(ctx, local_css_signal, silence, 170000); print_results(); if (level_measurement_device_get_peak(sout_power_meter) > -65.0) printf("Test failed\n"); else printf("Test passed\n"); /* Test 2B (b) - Reconvergence test with NLP disabled */ /* Make an abrupt change of channel characteristic, to another of the channel echo models. */ if (channel_model_create(&chan_model, supp_line_model_no, erl, munger)) { fprintf(stderr, " Failed to create line model\n"); exit(2); } run_test(ctx, local_css_signal, silence, 1000); level_measurements_reset_peaks(); run_test(ctx, local_css_signal, silence, 9000); print_results(); level_measurements_reset_peaks(); run_test(ctx, local_css_signal, silence, 170000); print_results(); if (level_measurement_device_get_peak(sout_power_meter) > -65.0) printf("Test failed\n"); else printf("Test passed\n"); echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_2ca(void) { echo_can_state_t *ctx; /* Test 2 - Convergence and steady state residual and returned echo level test */ /* Test 2C(a) - Convergence with background noise present */ print_test_title("Performing test 2C(a) - Convergence with background noise present\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); awgn_init_dbm0(&far_noise_source, 7162534, -50.0f); echo_can_flush(ctx); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION); /* Converge a canceller */ signal_restart(&local_css, 0.0f); run_test(ctx, silence, silence, 200); awgn_init_dbm0(&far_noise_source, 7162534, -40.0f); run_test(ctx, local_css_signal, far_hoth_noise_signal, 5000); /* Now freeze adaption, and measure the echo. */ echo_can_adaption_mode(ctx, 0); level_measurements_reset_peaks(); run_test(ctx, local_css_signal, silence, 5000); print_results(); if (level_measurement_device_get_peak(sout_power_meter) > level_measurement_device_get_peak(sgen_power_meter)) printf("Test failed\n"); else printf("Test passed\n"); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION); echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_3a(void) { echo_can_state_t *ctx; /* Test 3 - Performance under double talk conditions */ /* Test 3A - Double talk test with low cancelled-end levels */ print_test_title("Performing test 3A - Double talk test with low cancelled-end levels\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); echo_can_flush(ctx); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION); run_test(ctx, silence, silence, 200); signal_restart(&local_css, 0.0f); signal_restart(&far_css, -20.0f); /* Apply double talk, with a weak far end signal */ run_test(ctx, local_css_signal, far_css_signal, 5000); /* Now freeze adaption. */ echo_can_adaption_mode(ctx, 0); run_test(ctx, local_css_signal, silence, 500); /* Now measure the echo */ level_measurements_reset_peaks(); run_test(ctx, local_css_signal, silence, 5000); print_results(); if (level_measurement_device_get_peak(sout_power_meter) > level_measurement_device_get_peak(sgen_power_meter)) printf("Test failed\n"); else printf("Test passed\n"); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION); echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_3ba(void) { echo_can_state_t *ctx; /* Test 3 - Performance under double talk conditions */ /* Test 3B(a) - Double talk stability test with high cancelled-end levels */ print_test_title("Performing test 3B(b) - Double talk stability test with high cancelled-end levels\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); echo_can_flush(ctx); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION); run_test(ctx, silence, silence, 200); signal_restart(&local_css, 0.0f); signal_restart(&far_css, 0.0f); /* Converge the canceller */ run_test(ctx, local_css_signal, silence, 5000); /* Apply double talk */ run_test(ctx, local_css_signal, far_css_signal, 5000); /* Now freeze adaption. */ echo_can_adaption_mode(ctx, 0); run_test(ctx, local_css_signal, far_css_signal, 1000); /* Turn off the double talk. */ run_test(ctx, local_css_signal, silence, 500); /* Now measure the echo */ level_measurements_reset_peaks(); run_test(ctx, local_css_signal, silence, 5000); print_results(); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION); echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_3bb(void) { echo_can_state_t *ctx; /* Test 3 - Performance under double talk conditions */ /* Test 3B(b) - Double talk stability test with low cancelled-end levels */ print_test_title("Performing test 3B(b) - Double talk stability test with low cancelled-end levels\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); echo_can_flush(ctx); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION); run_test(ctx, silence, silence, 200); signal_restart(&local_css, 0.0f); signal_restart(&far_css, -15.0f); /* Converge the canceller */ run_test(ctx, local_css_signal, silence, 5000); /* Apply double talk */ run_test(ctx, local_css_signal, far_css_signal, 5000); /* Now freeze adaption. */ echo_can_adaption_mode(ctx, 0); run_test(ctx, local_css_signal, silence, 1000); /* Turn off the double talk. */ run_test(ctx, local_css_signal, silence, 500); /* Now measure the echo */ level_measurements_reset_peaks(); run_test(ctx, local_css_signal, silence, 5000); print_results(); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION); echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_3c(void) { echo_can_state_t *ctx; /* Test 3 - Performance under double talk conditions */ /* Test 3C - Double talk test with simulated conversation */ print_test_title("Performing test 3C - Double talk test with simulated conversation\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); echo_can_flush(ctx); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION); run_test(ctx, silence, silence, 200); signal_restart(&local_css, 0.0f); signal_restart(&far_css, -15.0f); /* Apply double talk */ run_test(ctx, local_css_signal, far_css_signal, 5600); /* Stop the far signal, and measure the echo. */ level_measurements_reset_peaks(); run_test(ctx, local_css_signal, silence, 1400); print_results(); /* Continue measuring the resulting echo */ run_test(ctx, local_css_signal, silence, 5000); /* Reapply double talk */ signal_restart(&far_css, 0.0f); run_test(ctx, local_css_signal, far_css_signal, 5600); /* Now the far signal only */ run_test(ctx, silence, far_css_signal, 5600); echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_4(void) { echo_can_state_t *ctx; /* Test 4 - Leak rate test */ print_test_title("Performing test 4 - Leak rate test\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); echo_can_flush(ctx); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION); run_test(ctx, silence, silence, 200); /* Converge the canceller */ signal_restart(&local_css, 0.0f); run_test(ctx, local_css_signal, silence, 5000); /* Put 2 minutes of silence through it */ run_test(ctx, silence, silence, 120000); /* Now freeze it, and check if it is still well adapted. */ echo_can_adaption_mode(ctx, 0); level_measurements_reset_peaks(); run_test(ctx, local_css_signal, silence, 5000); print_results(); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION); echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_5(void) { echo_can_state_t *ctx; /* Test 5 - Infinite return loss convergence test */ print_test_title("Performing test 5 - Infinite return loss convergence test\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); echo_can_flush(ctx); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION); /* Converge the canceller */ signal_restart(&local_css, 0.0f); run_test(ctx, local_css_signal, silence, 5000); /* Now stop echoing, and see we don't do anything unpleasant as the echo path is open looped. */ run_test(ctx, local_css_signal, silence, 5000); print_results(); echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_6(void) { echo_can_state_t *ctx; int i; int j; int k; int16_t rx; int16_t tx; int16_t clean; tone_gen_descriptor_t tone_desc; tone_gen_state_t tone_state; int16_t local_sound[40000]; /* Test 6 - Non-divergence on narrow-band signals */ print_test_title("Performing test 6 - Non-divergence on narrow-band signals\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); echo_can_flush(ctx); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION); /* Converge the canceller */ signal_restart(&local_css, 0.0f); run_test(ctx, local_css_signal, silence, 5000); /* Now put 5s bursts of a list of tones through the converged canceller, and check that nothing unpleasant happens. */ for (k = 0; tones_6_4_2_7[k][0]; k++) { tone_gen_descriptor_init(&tone_desc, tones_6_4_2_7[k][0], -11, tones_6_4_2_7[k][1], -9, 1, 0, 0, 0, 1); tone_gen_init(&tone_state, &tone_desc); j = 0; for (i = 0; i < 5; i++) { tone_gen(&tone_state, local_sound, SAMPLE_RATE); for (j = 0; j < SAMPLE_RATE; j++) { tx = local_sound[j]; rx = channel_model(&chan_model, tx, 0); clean = echo_can_update(ctx, tx, rx); put_residue(clean); } #if defined(ENABLE_GUI) if (use_gui) { echo_can_monitor_can_update(ctx->fir_taps16[0], TEST_EC_TAPS); echo_can_monitor_update_display(); usleep(100000); } #endif } } #if defined(ENABLE_GUI) if (use_gui) echo_can_monitor_can_update(ctx->fir_taps16[0], TEST_EC_TAPS); #endif echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_7(void) { echo_can_state_t *ctx; int i; int j; int16_t rx; int16_t tx; int16_t clean; tone_gen_descriptor_t tone_desc; tone_gen_state_t tone_state; int16_t local_sound[40000]; /* Test 7 - Stability */ print_test_title("Performing test 7 - Stability\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); /* Put tones through an unconverged canceller, and check nothing unpleasant happens. */ echo_can_flush(ctx); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION); tone_gen_descriptor_init(&tone_desc, tones_6_4_2_7[0][0], -11, tones_6_4_2_7[0][1], -9, 1, 0, 0, 0, 1); tone_gen_init(&tone_state, &tone_desc); j = 0; for (i = 0; i < 120; i++) { tone_gen(&tone_state, local_sound, SAMPLE_RATE); for (j = 0; j < SAMPLE_RATE; j++) { tx = local_sound[j]; rx = channel_model(&chan_model, tx, 0); clean = echo_can_update(ctx, tx, rx); put_residue(clean); } #if defined(ENABLE_GUI) if (use_gui) { echo_can_monitor_can_update(ctx->fir_taps16[0], TEST_EC_TAPS); echo_can_monitor_update_display(); usleep(100000); } #endif } #if defined(ENABLE_GUI) if (use_gui) echo_can_monitor_can_update(ctx->fir_taps16[0], TEST_EC_TAPS); #endif echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_8(void) { echo_can_state_t *ctx; /* Test 8 - Non-convergence on No 5, 6, and 7 in-band signalling */ print_test_title("Performing test 8 - Non-convergence on No 5, 6, and 7 in-band signalling\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); fprintf(stderr, "Test 8 not yet implemented\n"); echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_9(void) { echo_can_state_t *ctx; awgn_state_t local_noise_source; awgn_state_t far_noise_source; /* Test 9 - Comfort noise test */ print_test_title("Performing test 9 - Comfort noise test\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); awgn_init_dbm0(&far_noise_source, 7162534, -50.0f); echo_can_flush(ctx); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION | ECHO_CAN_USE_NLP | ECHO_CAN_USE_CNG); /* Test 9 part 1 - matching */ /* Converge the canceller */ signal_restart(&local_css, 0.0f); run_test(ctx, local_css_signal, silence, 5000); echo_can_adaption_mode(ctx, ECHO_CAN_USE_ADAPTION | ECHO_CAN_USE_NLP | ECHO_CAN_USE_CNG); awgn_init_dbm0(&far_noise_source, 7162534, -45.0f); run_test(ctx, silence, far_noise_signal, 30000); awgn_init_dbm0(&local_noise_source, 1234567, -10.0f); run_test(ctx, local_noise_signal, far_noise_signal, 2000); /* Test 9 part 2 - adjust down */ awgn_init_dbm0(&far_noise_source, 7162534, -55.0f); run_test(ctx, silence, far_noise_signal, 10000); run_test(ctx, local_noise_signal, far_noise_signal, 2000); echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_10a(void) { echo_can_state_t *ctx; /* Test 10 - FAX test during call establishment phase */ /* Test 10A - Canceller operation on the calling station side */ print_test_title("Performing test 10A - Canceller operation on the calling station side\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); fprintf(stderr, "Test 10A not yet implemented\n"); echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_10b(void) { echo_can_state_t *ctx; /* Test 10 - FAX test during call establishment phase */ /* Test 10B - Canceller operation on the called station side */ print_test_title("Performing test 10B - Canceller operation on the called station side\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); fprintf(stderr, "Test 10B not yet implemented\n"); echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_10c(void) { echo_can_state_t *ctx; /* Test 10 - FAX test during call establishment phase */ /* Test 10C - Canceller operation on the calling station side during page transmission and page breaks (for further study) */ print_test_title("Performing test 10C - Canceller operation on the calling station side during page\n" "transmission and page breaks (for further study)\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); fprintf(stderr, "Test 10C not yet implemented\n"); echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_11(void) { echo_can_state_t *ctx; /* Test 11 - Tandem echo canceller test (for further study) */ print_test_title("Performing test 11 - Tandem echo canceller test (for further study)\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); fprintf(stderr, "Test 11 not yet implemented\n"); echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_12(void) { echo_can_state_t *ctx; /* Test 12 - Residual acoustic echo test (for further study) */ print_test_title("Performing test 12 - Residual acoustic echo test (for further study)\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); fprintf(stderr, "Test 12 not yet implemented\n"); echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_13(void) { echo_can_state_t *ctx; /* Test 13 - Performance with ITU-T low-bit rate coders in echo path (Optional, under study) */ print_test_title("Performing test 13 - Performance with ITU-T low-bit rate coders in echo path (Optional, under study)\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); fprintf(stderr, "Test 13 not yet implemented\n"); echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_14(void) { echo_can_state_t *ctx; /* Test 14 - Performance with V-series low-speed data modems */ print_test_title("Performing test 14 - Performance with V-series low-speed data modems\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); fprintf(stderr, "Test 14 not yet implemented\n"); echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_test_15(void) { echo_can_state_t *ctx; /* Test 15 - PCM offset test (Optional) */ print_test_title("Performing test 15 - PCM offset test (Optional)\n"); ctx = echo_can_init(TEST_EC_TAPS, 0); fprintf(stderr, "Test 15 not yet implemented\n"); echo_can_free(ctx); return 0; } /*- End of function --------------------------------------------------------*/ static int match_test_name(const char *name) { const struct { const char *name; int (*func)(void); } tests[] = { {"sanity", perform_test_sanity}, {"2a", perform_test_2a}, {"2b", perform_test_2b}, {"2ca", perform_test_2ca}, {"3a", perform_test_3a}, {"3ba", perform_test_3ba}, {"3bb", perform_test_3bb}, {"3c", perform_test_3c}, {"4", perform_test_4}, {"5", perform_test_5}, {"6", perform_test_6}, {"7", perform_test_7}, {"8", perform_test_8}, {"9", perform_test_9}, {"10a", perform_test_10a}, {"10b", perform_test_10b}, {"10c", perform_test_10c}, {"11", perform_test_11}, {"12", perform_test_12}, {"13", perform_test_13}, {"14", perform_test_14}, {"15", perform_test_15}, {NULL, NULL} }; int i; for (i = 0; tests[i].name; i++) { if (strcasecmp(name, tests[i].name) == 0) { test_name = name; tests[i].func(); return 0; } } printf("Unknown test name '%s' specified. The known test names are ", name); for (i = 0; tests[i].name; i++) { printf("%s", tests[i].name); if (tests[i + 1].name) printf(", "); } printf("\n"); return -1; } /*- End of function --------------------------------------------------------*/ static void simulate_ec(char *argv[], int two_channel_file, int mode) { echo_can_state_t *ctx; SNDFILE *txfile; SNDFILE *rxfile; SNDFILE *rxtxfile; SNDFILE *ecfile; int ntx; int nrx; int nec; int16_t buf[2]; int16_t rin; int16_t rout; int16_t sin; int16_t sout; mode |= ECHO_CAN_USE_ADAPTION; txfile = NULL; rxfile = NULL; rxtxfile = NULL; ecfile = NULL; if (two_channel_file) { txfile = sf_open_telephony_read(argv[0], 1); rxfile = sf_open_telephony_read(argv[1], 1); ecfile = sf_open_telephony_write(argv[2], 1); } else { rxtxfile = sf_open_telephony_read(argv[0], 2); ecfile = sf_open_telephony_write(argv[1], 1); } ctx = echo_can_init(TEST_EC_TAPS, 0); echo_can_adaption_mode(ctx, mode); do { if (two_channel_file) { if ((ntx = sf_readf_short(rxtxfile, buf, 1)) < 0) { fprintf(stderr, " Error reading tx sound file\n"); exit(2); } rin = buf[0]; sin = buf[1]; nrx = ntx; } else { if ((ntx = sf_readf_short(txfile, &rin, 1)) < 0) { fprintf(stderr, " Error reading tx sound file\n"); exit(2); } if ((nrx = sf_readf_short(rxfile, &sin, 1)) < 0) { fprintf(stderr, " Error reading rx sound file\n"); exit(2); } } rout = echo_can_hpf_tx(ctx, rin); sout = echo_can_update(ctx, rout, sin); if ((nec = sf_writef_short(ecfile, &sout, 1)) != 1) { fprintf(stderr, " Error writing ec sound file\n"); exit(2); } level_measurements_update(rin, sin, rout, sout, 0); write_log_files(rin, sin); #if defined(ENABLE_GUI) if (use_gui) echo_can_monitor_can_update(ctx->fir_taps16[0], TEST_EC_TAPS); #endif } while (ntx && nrx); dump_ec_state(ctx); echo_can_free(ctx); if (two_channel_file) { sf_close_telephony(rxtxfile); } else { sf_close_telephony(txfile); sf_close_telephony(rxfile); } sf_close_telephony(ecfile); } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int i; time_t now; int simulate; int cng; int hpf; int two_channel_file; int opt; int mode; /* Check which tests we should run */ if (argc < 2) fprintf(stderr, "Usage: echo tests [-g] [-m ] [-s] \n"); line_model_no = 0; supp_line_model_no = 0; cng = FALSE; hpf = FALSE; use_gui = FALSE; simulate = FALSE; munger = -1; two_channel_file = FALSE; erl = -12.0f; while ((opt = getopt(argc, argv, "2ace:ghm:M:su")) != -1) { switch (opt) { case '2': two_channel_file = TRUE; break; case 'a': munger = G711_ALAW; break; case 'c': cng = TRUE; break; case 'e': /* Allow for ERL being entered as x or -x */ erl = -fabs(atof(optarg)); break; case 'g': #if defined(ENABLE_GUI) use_gui = TRUE; #else fprintf(stderr, "Graphical monitoring not available\n"); exit(2); #endif break; case 'h': hpf = TRUE; break; case 'm': line_model_no = atoi(optarg); break; case 'M': supp_line_model_no = atoi(optarg); break; case 's': simulate = TRUE; break; case 'u': munger = G711_ULAW; break; default: //usage(); exit(2); break; } } argc -= optind; argv += optind; #if defined(ENABLE_GUI) if (use_gui) start_echo_can_monitor(TEST_EC_TAPS); #endif if (simulate) { /* Process a pair of transmitted and received audio files, and produce an echo cancelled audio file. */ if (argc < ((two_channel_file) ? 2 : 3)) { printf("not enough arguments for a simulation\n"); exit(2); } mode = ECHO_CAN_USE_NLP; mode |= ((cng) ? ECHO_CAN_USE_CNG : ECHO_CAN_USE_CLIP); if (hpf) { mode |= ECHO_CAN_USE_TX_HPF; mode |= ECHO_CAN_USE_RX_HPF; } simulate_ec(argv, two_channel_file, mode); } else { /* Run some G.168 tests */ #if defined(ENABLE_GUI) if (use_gui) echo_can_monitor_line_model_update(chan_model.impulse.coeffs, chan_model.impulse.taps); #endif signal_load(&local_css, "sound_c1_8k.wav"); signal_load(&far_css, "sound_c3_8k.wav"); if ((residue_handle = sf_open_telephony_write(RESIDUE_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Failed to open '%s'\n", RESIDUE_FILE_NAME); exit(2); } if (argc <= 0) { printf("No tests specified\n"); } else { time(&now); if ((result_handle = sf_open_telephony_write("echo_tests_result.wav", RESULT_CHANNELS)) == NULL) { fprintf(stderr, " Failed to open result file\n"); exit(2); } result_cur = 0; level_measurements_create(0); for (i = 0; i < argc; i++) { if (channel_model_create(&chan_model, line_model_no, erl, munger)) { fprintf(stderr, " Failed to create line model\n"); exit(2); } match_test_name(argv[i]); } if (sf_close_telephony(result_handle)) { fprintf(stderr, " Cannot close speech file '%s'\n", "result_sound.wav"); exit(2); } printf("Run time %lds\n", time(NULL) - now); } signal_free(&local_css); signal_free(&far_css); if (sf_close_telephony(residue_handle)) { fprintf(stderr, " Cannot close speech file '%s'\n", RESIDUE_FILE_NAME); exit(2); } } #if defined(ENABLE_GUI) if (use_gui) echo_can_monitor_wait_to_end(); #endif printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/dds_tests.c0000664000175000017500000001505212101212460013402 00000000000000/* * SpanDSP - a series of DSP components for telephony * * dds_tests.c * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page dds_tests_page Direct digital synthesis tests \section dds_tests_page_sec_1 What does it do? ???. \section dds_tests_page_sec_2 How does it work? ???. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include "spandsp.h" #include "spandsp-sim.h" #define OUTPUT_FILE_NAME "dds.wav" #define OUTPUT_FILE_NAME_COMPLEX "complex_dds.wav" #define SAMPLES_PER_CHUNK 8000 int main(int argc, char *argv[]) { int i; uint32_t phase; int32_t phase_inc; int outframes; complexf_t camp; int16_t buf[2*SAMPLES_PER_CHUNK]; SNDFILE *outhandle; power_meter_t meter; power_meter_t meter_i; power_meter_t meter_q; int scale; power_meter_init(&meter, 10); printf("Non-complex DDS tests.\n"); if ((outhandle = sf_open_telephony_write(OUTPUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } phase = 0; printf("Test with 123.456789Hz.\n"); phase_inc = dds_phase_rate(123.456789f); scale = dds_scaling_dbm0(-10.0f); for (i = 0; i < SAMPLES_PER_CHUNK; i++) { buf[i] = alaw_to_linear(linear_to_alaw((dds(&phase, phase_inc)*scale) >> 15)); power_meter_update(&meter, buf[i]); } outframes = sf_writef_short(outhandle, buf, SAMPLES_PER_CHUNK); if (outframes != SAMPLES_PER_CHUNK) { fprintf(stderr, " Error writing audio file\n"); exit(2); } printf("Level is %fdBOv/%fdBm0\n", power_meter_current_dbov(&meter), power_meter_current_dbm0(&meter)); if (fabs(power_meter_current_dbm0(&meter) + 10.0f) > 0.1f) { printf("Test failed.\n"); exit(2); } printf("Test with 12.3456789Hz.\n"); phase_inc = dds_phase_rate(12.3456789f); for (i = 0; i < SAMPLES_PER_CHUNK; i++) { buf[i] = alaw_to_linear(linear_to_alaw(dds(&phase, phase_inc))); power_meter_update(&meter, buf[i]); } outframes = sf_writef_short(outhandle, buf, SAMPLES_PER_CHUNK); if (outframes != SAMPLES_PER_CHUNK) { fprintf(stderr, " Error writing audio file\n"); exit(2); } printf("Level is %fdBOv/%fdBm0\n", power_meter_current_dbov(&meter), power_meter_current_dbm0(&meter)); /* Use a wider tolerance for this very low frequency - the power meter will ripple */ if (fabs(power_meter_current_dbov(&meter) + 3.02f) > 0.2f) { printf("Test failed.\n"); exit(2); } printf("Test with 2345.6789Hz.\n"); phase_inc = dds_phase_rate(2345.6789f); scale = dds_scaling_dbov(-10.0f); for (i = 0; i < SAMPLES_PER_CHUNK; i++) { buf[i] = alaw_to_linear(linear_to_alaw((dds(&phase, phase_inc)*scale) >> 15)); power_meter_update(&meter, buf[i]); } outframes = sf_writef_short(outhandle, buf, SAMPLES_PER_CHUNK); if (outframes != SAMPLES_PER_CHUNK) { fprintf(stderr, " Error writing audio file\n"); exit(2); } printf("Level is %fdBOv/%fdBm0\n", power_meter_current_dbov(&meter), power_meter_current_dbm0(&meter)); if (fabs(power_meter_current_dbov(&meter) + 10.0f) > 0.1f) { printf("Test failed.\n"); exit(2); } printf("Test with 3456.789Hz.\n"); phase_inc = dds_phase_rate(3456.789f); for (i = 0; i < SAMPLES_PER_CHUNK; i++) { buf[i] = alaw_to_linear(linear_to_alaw(dds(&phase, phase_inc))); power_meter_update(&meter, buf[i]); } outframes = sf_writef_short(outhandle, buf, SAMPLES_PER_CHUNK); if (outframes != SAMPLES_PER_CHUNK) { fprintf(stderr, " Error writing audio file\n"); exit(2); } printf("Level is %fdBOv/%fdBm0\n", power_meter_current_dbov(&meter), power_meter_current_dbm0(&meter)); if (fabs(power_meter_current_dbov(&meter) + 3.02f) > 0.05f) { printf("Test failed.\n"); exit(2); } if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } printf("Complex DDS tests,\n"); if ((outhandle = sf_open_telephony_write(OUTPUT_FILE_NAME_COMPLEX, 2)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUTPUT_FILE_NAME_COMPLEX); exit(2); } power_meter_init(&meter_i, 7); power_meter_init(&meter_q, 7); phase = 0; phase_inc = dds_phase_ratef(123.456789f); for (i = 0; i < SAMPLES_PER_CHUNK; i++) { camp = dds_complexf(&phase, phase_inc); buf[2*i] = camp.re*10000.0f; buf[2*i + 1] = camp.im*10000.0f; power_meter_update(&meter_i, buf[2*i]); power_meter_update(&meter_q, buf[2*i]); } outframes = sf_writef_short(outhandle, buf, SAMPLES_PER_CHUNK); if (outframes != SAMPLES_PER_CHUNK) { fprintf(stderr, " Error writing audio file\n"); exit(2); } printf("Level is %fdBOv/%fdBm0, %fdBOv/%fdBm0\n", power_meter_current_dbov(&meter_i), power_meter_current_dbm0(&meter_i), power_meter_current_dbov(&meter_q), power_meter_current_dbm0(&meter_q)); if (fabs(power_meter_current_dbov(&meter_i) + 13.42f) > 0.05f || fabs(power_meter_current_dbov(&meter_q) + 13.42f) > 0.05f) { printf("Test failed.\n"); exit(2); } if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME_COMPLEX); exit(2); } printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/r2_mf_rx_tests.c0000664000175000017500000004514212100557525014366 00000000000000/* * SpanDSP - a series of DSP components for telephony * * r2_mf_tests.c - Test the R2 MF detector against the spec., whatever the * spec. may be :) * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page r2_mf_tests_page R2 MF tone generation and detection tests \section r2_mf_tests_page_sec_1 What does it do? These tests are fashioned after those on the CM7291 test tape from Mitel. Those tests are for DTMF, rather than R2 MF, but make a fair starting point for a set of meaningful tests of R2 MF. These tests include conversion to and from A-law. It is assumed the distortion this produces is comparable to u-law, so it should be a fair test of performance in a real PSTN channel. */ /* Enable the following definition to enable direct probing into the FAX structures */ //#define WITH_SPANDSP_INTERNALS #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" /* R2 tone generation specs. * Power: -11.5dBm +- 1dB * Frequency: within +-4Hz * Mismatch between the start time of a pair of tones: <=1ms. * Mismatch between the end time of a pair of tones: <=1ms. */ /* Basic MFC/R2 tone detection specs: * Receiver response range: -5dBm to -35dBm * Difference in level for a pair of frequencies * Adjacent tones: <5dB * Non-adjacent tones: <7dB * Receiver not to detect a signal of 2 frequencies of level -5dB and * duration <7ms. * Receiver not to recognise a signal of 2 frequencies having a difference * in level >=20dB. * Max received signal frequency error: +-10Hz * The sum of the operate and release times of a 2 frequency signal not to * exceed 80ms (there are no individual specs for the operate and release * times). * Receiver not to release for signal interruptions <=7ms. * System malfunction due to signal interruptions >7ms (typically 20ms) is * prevented by further logic elements. */ #define MF_DURATION (68*8) #define MF_PAUSE (68*8) #define MF_CYCLE (MF_DURATION + MF_PAUSE) /*! MF tone generator descriptor for tests. */ typedef struct { float f1; /* First freq */ float f2; /* Second freq */ int8_t level1; /* Level of the first freq (dB) */ int8_t level2; /* Level of the second freq (dB) */ uint8_t on_time; /* Tone on time (ms) */ uint8_t off_time; /* Minimum post tone silence (ms) */ } mf_digit_tones_t; static const mf_digit_tones_t r2_mf_fwd_tones[] = { {1380.0, 1500.0, -11, -11, 1, 0}, {1380.0, 1620.0, -11, -11, 1, 0}, {1500.0, 1620.0, -11, -11, 1, 0}, {1380.0, 1740.0, -11, -11, 1, 0}, {1500.0, 1740.0, -11, -11, 1, 0}, {1620.0, 1740.0, -11, -11, 1, 0}, {1380.0, 1860.0, -11, -11, 1, 0}, {1500.0, 1860.0, -11, -11, 1, 0}, {1620.0, 1860.0, -11, -11, 1, 0}, {1740.0, 1860.0, -11, -11, 1, 0}, {1380.0, 1980.0, -11, -11, 1, 0}, {1500.0, 1980.0, -11, -11, 1, 0}, {1620.0, 1980.0, -11, -11, 1, 0}, {1740.0, 1980.0, -11, -11, 1, 0}, {1860.0, 1980.0, -11, -11, 1, 0}, {0.0, 0.0, 0, 0, 0, 0} }; static const mf_digit_tones_t r2_mf_back_tones[] = { {1140.0, 1020.0, -11, -11, 1, 0}, {1140.0, 900.0, -11, -11, 1, 0}, {1020.0, 900.0, -11, -11, 1, 0}, {1140.0, 780.0, -11, -11, 1, 0}, {1020.0, 780.0, -11, -11, 1, 0}, { 900.0, 780.0, -11, -11, 1, 0}, {1140.0, 660.0, -11, -11, 1, 0}, {1020.0, 660.0, -11, -11, 1, 0}, { 900.0, 660.0, -11, -11, 1, 0}, { 780.0, 660.0, -11, -11, 1, 0}, {1140.0, 540.0, -11, -11, 1, 0}, {1020.0, 540.0, -11, -11, 1, 0}, { 900.0, 540.0, -11, -11, 1, 0}, { 780.0, 540.0, -11, -11, 1, 0}, { 660.0, 540.0, -11, -11, 1, 0}, {0.0, 0.0, 0, 0, 0, 0} }; static tone_gen_descriptor_t my_mf_digit_tones[16]; static char r2_mf_tone_codes[] = "1234567890BCDEF"; int callback_ok; int callback_roll; static void my_mf_gen_init(float low_fudge, int low_level, float high_fudge, int high_level, int duration, int fwd) { const mf_digit_tones_t *tone; int i; for (i = 0; i < 15; i++) { if (fwd) tone = &r2_mf_fwd_tones[i]; else tone = &r2_mf_back_tones[i]; tone_gen_descriptor_init(&my_mf_digit_tones[i], tone->f1*(1.0 + low_fudge), low_level, tone->f2*(1.0 + high_fudge), high_level, duration, 0, 0, 0, FALSE); } } /*- End of function --------------------------------------------------------*/ static int my_mf_generate(int16_t amp[], char digit) { int len; char *cp; tone_gen_state_t tone; len = 0; if ((cp = strchr(r2_mf_tone_codes, digit))) { tone_gen_init(&tone, &my_mf_digit_tones[cp - r2_mf_tone_codes]); len += tone_gen(&tone, amp + len, 9999); } return len; } /*- End of function --------------------------------------------------------*/ static void codec_munge(int16_t amp[], int len) { int i; uint8_t alaw; for (i = 0; i < len; i++) { alaw = linear_to_alaw (amp[i]); amp[i] = alaw_to_linear (alaw); } } /*- End of function --------------------------------------------------------*/ static void digit_delivery(void *data, int digit, int level, int delay) { char ch; if (data != (void *) 0x12345678) { callback_ok = FALSE; return; } if ((callback_roll & 1)) ch = 0; else ch = r2_mf_tone_codes[callback_roll >> 1]; if (ch == digit) callback_ok = TRUE; else callback_ok = FALSE; if (r2_mf_tone_codes[callback_roll >> 1]) callback_roll++; else callback_ok = FALSE; } /*- End of function --------------------------------------------------------*/ static int test_a_tone_set(int fwd) { int i; int j; int len; int sample; const char *s; char digit; int actual; int nplus; int nminus; float rrb; float rcfo; int16_t amp[100000]; r2_mf_rx_state_t mf_state; awgn_state_t noise_source; r2_mf_rx_init(&mf_state, fwd, NULL, NULL); /* Test 1: Mitel's test 1 isn't really a test. Its a calibration step, which has no meaning here. */ printf ("Test 1: Calibration\n"); printf (" Passed\n"); /* Test 2: Decode check This is a sanity check, that all digits are reliably detected under ideal conditions. Each possible digit is repeated 10 times, with 68ms bursts. The level of each tone is about 6dB down from clip */ printf ("Test 2: Decode check\n"); my_mf_gen_init(0.0, -3, 0.0, -3, 68, fwd); s = r2_mf_tone_codes; while (*s) { digit = *s++; for (i = 0; i < 10; i++) { len = my_mf_generate(amp, digit); codec_munge (amp, len); r2_mf_rx(&mf_state, amp, len); actual = r2_mf_rx_get(&mf_state); if (actual != digit) { printf (" Sent '%c'\n", digit); printf (" Received 0x%X\n", actual); printf (" Failed\n"); exit (2); } } } printf (" Passed\n"); /* Test 3: Recognition bandwidth and channel centre frequency check. Use all digits. Each digit types requires four tests to complete the check. Each section contains 40 pulses of 68ms duration, with an amplitude of -20dB from clip per frequency. Four sections covering the tests for one tone (1 digit) are: a. H frequency at 0% deviation from center, L frequency at +0.1%. L frequency is then increments in +01.% steps up to +4%. The number of tone bursts is noted and designated N+. b. H frequency at 0% deviation, L frequency at -0.1%. L frequency is then incremental in -0.1% steps, up to -4%. The number of tone bursts is noted and designated N-. c. The test in (a) is repeated with the L frequency at 0% and the H frequency varied up to +4%. d. The test in (b) is repeated with the L frequency and 0% and the H frequency varied to -4%. Receiver Recognition Bandwidth (RRB) is calculated as follows: RRB% = (N+ + N-)/10 Receiver Center Frequency Offset (RCFO) is calculated as follows: RCFO% = X + (N+ - N-)/20 Note that this test doesn't test what it says it is testing at all, and the results are quite inaccurate, if not a downright lie! However, it follows the Mitel procedure, so how can it be bad? :) The spec calls for +-4 +-10Hz (ie +-14Hz) of bandwidth. */ printf ("Test 3: Recognition bandwidth and channel centre frequency check\n"); s = r2_mf_tone_codes; j = 0; while (*s) { digit = *s++; for (nplus = 0, i = 1; i <= 60; i++) { my_mf_gen_init((float) i/1000.0, -17, 0.0, -17, 68, fwd); len = my_mf_generate(amp, digit); codec_munge(amp, len); r2_mf_rx(&mf_state, amp, len); if (r2_mf_rx_get(&mf_state) == digit) nplus++; } for (nminus = 0, i = -1; i >= -60; i--) { my_mf_gen_init((float) i/1000.0, -17, 0.0, -17, 68, fwd); len = my_mf_generate(amp, digit); codec_munge(amp, len); r2_mf_rx(&mf_state, amp, len); if (r2_mf_rx_get(&mf_state) == digit) nminus++; } rrb = (float) (nplus + nminus)/10.0; rcfo = (float) (nplus - nminus)/10.0; printf (" %c (low) rrb = %5.2f%%, rcfo = %5.2f%%, max -ve = %5.2f, max +ve = %5.2f\n", digit, rrb, rcfo, (float) nminus/10.0, (float) nplus/10.0); if (rrb < rcfo + (2.0*100.0*14.0/r2_mf_fwd_tones[j].f1) || rrb >= 15.0 + rcfo) { printf (" Failed\n"); exit (2); } for (nplus = 0, i = 1; i <= 60; i++) { my_mf_gen_init(0.0, -17, (float) i/1000.0, -17, 68, fwd); len = my_mf_generate(amp, digit); codec_munge(amp, len); r2_mf_rx(&mf_state, amp, len); if (r2_mf_rx_get(&mf_state) == digit) nplus++; } for (nminus = 0, i = -1; i >= -60; i--) { my_mf_gen_init(0.0, -17, (float) i/1000.0, -17, 68, fwd); len = my_mf_generate(amp, digit); codec_munge(amp, len); r2_mf_rx(&mf_state, amp, len); if (r2_mf_rx_get(&mf_state) == digit) nminus++; } rrb = (float) (nplus + nminus)/10.0; rcfo = (float) (nplus - nminus)/10.0; printf (" %c (high) rrb = %5.2f%%, rcfo = %5.2f%%, max -ve = %5.2f, max +ve = %5.2f\n", digit, rrb, rcfo, (float) nminus/10.0, (float) nplus/10.0); if (rrb < rcfo + (2.0*100.0*14.0/r2_mf_fwd_tones[j].f2) || rrb >= 15.0 + rcfo) { printf (" Failed\n"); exit (2); } j++; } printf (" Passed\n"); /* Test 4: Acceptable amplitude ratio (twist). Twist all digits in both directions, and check the maximum twist we can accept. The way this is done is styled after the Mitel DTMF test, and has good and bad points. */ printf ("Test 4: Acceptable amplitude ratio (twist)\n"); s = r2_mf_tone_codes; while (*s) { digit = *s++; for (nplus = 0, i = -50; i >= -250; i--) { my_mf_gen_init(0.0, -5, 0.0, i/10, 68, fwd); len = my_mf_generate(amp, digit); codec_munge (amp, len); r2_mf_rx(&mf_state, amp, len); if (r2_mf_rx_get(&mf_state) == digit) nplus++; } printf (" %c normal twist = %.2fdB\n", digit, (float) nplus/10.0); if (nplus < 70) { printf (" Failed\n"); exit (2); } for (nminus = 0, i = -50; i >= -250; i--) { my_mf_gen_init(0.0, i/10, 0.0, -5, 68, fwd); len = my_mf_generate(amp, digit); codec_munge(amp, len); r2_mf_rx(&mf_state, amp, len); if (r2_mf_rx_get(&mf_state) == digit) nminus++; } printf (" %c reverse twist = %.2fdB\n", digit, (float) nminus/10.0); if (nminus < 70) { printf (" Failed\n"); exit (2); } } printf (" Passed\n"); /* Test 5: Dynamic range This test sends all possible digits, with gradually increasing amplitude. We determine the span over which we achieve reliable detection. */ printf ("Test 5: Dynamic range\n"); for (nplus = nminus = -1000, i = -50; i <= 3; i++) { s = r2_mf_tone_codes; while (*s) { digit = *s++; my_mf_gen_init(0.0, i, 0.0, i, 68, fwd); for (j = 0; j < 100; j++) { len = my_mf_generate(amp, digit); codec_munge(amp, len); r2_mf_rx(&mf_state, amp, len); if (r2_mf_rx_get(&mf_state) != digit) break; } if (j < 100) break; } if (j == 100) { if (nplus == -1000) nplus = i; } else { if (nplus != -1000 && nminus == -1000) nminus = i; } } printf (" Dynamic range = %ddB to %ddB\n", nplus, nminus - 1); if (nplus > -35 || nminus <= -5) { printf(" Failed\n"); exit(2); } printf (" Passed\n"); /* Test 6: Guard time This test sends all possible digits, with a gradually reducing duration. */ printf ("Test 6: Guard time\n"); for (i = 30; i < 62; i++) { s = r2_mf_tone_codes; j = 0; while (*s) { digit = *s++; my_mf_gen_init(0.0, -5, 0.0, -3, i, fwd); for (j = 0; j < 500; j++) { len = my_mf_generate(amp, digit); codec_munge(amp, len); r2_mf_rx(&mf_state, amp, len); if (r2_mf_rx_get(&mf_state) != digit) break; } if (j < 500) break; } if (j == 500) break; } printf (" Guard time = %dms\n", i); if (i > 61) { printf(" Failed\n"); exit(2); } printf (" Passed\n"); /* Test 7: Acceptable signal to noise ratio We send all possible digits at -6dBm from clip, mixed with AWGN. We gradually reduce the noise until we get clean detection. */ printf ("Test 7: Acceptable signal to noise ratio\n"); my_mf_gen_init(0.0, -3, 0.0, -3, 68, fwd); for (i = -3; i > -50; i--) { s = r2_mf_tone_codes; while (*s) { digit = *s++; awgn_init_dbm0(&noise_source, 1234567, (float) i); for (j = 0; j < 500; j++) { len = my_mf_generate(amp, digit); for (sample = 0; sample < len; sample++) amp[sample] = saturate(amp[sample] + awgn(&noise_source)); codec_munge(amp, len); r2_mf_rx(&mf_state, amp, len); if (r2_mf_rx_get(&mf_state) != digit) break; } if (j < 500) break; } if (j == 500) break; } printf(" Acceptable S/N ratio is %ddB\n", -3 - i); if (-3 - i > 26) { printf(" Failed\n"); exit(2); } printf(" Passed\n"); printf("Test 8: Callback digit delivery mode.\n"); callback_ok = FALSE; callback_roll = 0; r2_mf_rx_init(&mf_state, fwd, digit_delivery, (void *) 0x12345678); my_mf_gen_init(0.0, -3, 0.0, -3, 68, fwd); s = r2_mf_tone_codes; awgn_init_dbm0(&noise_source, 1234567, -40.0f); while (*s) { digit = *s++; len = my_mf_generate(amp, digit); for (sample = 0; sample < len; sample++) amp[sample] = saturate(amp[sample] + awgn(&noise_source)); codec_munge(amp, len); r2_mf_rx(&mf_state, amp, len); len = 160; memset(amp, '\0', len*sizeof(int16_t)); for (sample = 0; sample < len; sample++) amp[sample] = saturate(amp[sample] + awgn(&noise_source)); codec_munge(amp, len); r2_mf_rx(&mf_state, amp, len); } if (!callback_ok) { printf(" Failed\n"); exit (2); } printf(" Passed\n"); /* The remainder of the Mitel tape is the talk-off test. This is meaningless for R2 MF. However the decoder's tolerance of out of band noise is significant. */ /* TODO: add a OOB tolerance test. */ return 0; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { time_t now; time_t duration; now = time(NULL); printf("R2 forward tones\n"); test_a_tone_set(TRUE); printf("R2 backward tones\n"); test_a_tone_set(FALSE); duration = time(NULL) - now; printf ("Tests passed in %lds\n", duration); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/t38_non_ecm_buffer_tests.c0000664000175000017500000005025012101215657016307 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t38_non_ecm_buffer_tests.c - Tests for the T.38 non-ECM image data buffer module. * * Written by Steve Underwood * * Copyright (C) 2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page t38_non_ecm_buffer_tests_page T.38 non-ECM buffer tests \section t38_non_ecm_buffer_tests_page_sec_1 What does it do? These tests exercise the flow controlling non-ECM image data buffer module, used for T.38 gateways. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" /* A pattern of widening gaps between ones, until at 11 apart an EOL should be registered */ static const uint8_t spreader[] = { 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, 0x55, /* 1 apart */ 0x22, /* 2 and 3 apart */ 0x10, /* 4 apart */ 0x40, /* 5 apart */ 0x80, /* 6 apart */ 0x80, /* 7 apart */ 0x40, /* 8 apart */ 0x10, /* 9 apart */ 0x02, /* 10 apart */ 0x00, 0x25 /* 11 apart */ }; static int bit_no; static int xxx(t38_non_ecm_buffer_state_t *s, logging_state_t *l, int log_bits, int n, int expected) { int i; int j; int bit; t38_non_ecm_buffer_inject(s, &spreader[n], 1); if (expected >= 0) { for (i = 0; i < 128; i++) { bit = t38_non_ecm_buffer_get_bit((void *) s); if (log_bits) printf("Rx bit %d - %d\n", bit_no, bit); if (bit != expected) { printf("Tests failed - %d %d %d\n", bit_no, bit, expected); exit(2); } bit_no++; } } else { j = -1; for (i = 0; i < 256; i++) { bit = t38_non_ecm_buffer_get_bit((void *) s); if (log_bits) printf("Rx bit %d - %d\n", bit_no, bit); if (j < 0) { if (bit == 1) j = 18*8 - 5; } else { expected = (spreader[j >> 3] >> (7 - (j & 7))) & 1; if (bit != expected) { printf("Tests failed - %d %d %d\n", bit_no, bit, expected); exit(2); } j++; if (j >= 18*8) j = 0; } bit_no++; if (j == 17*8) return 0; } } return 0; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { t38_non_ecm_buffer_state_t buffer; logging_state_t logging; uint8_t buf[1024]; int bit; int n; int log_bits; int i; log_bits = (argc > 1); printf("T.38 non-ECM rate adapting buffer tests.\n"); span_log_init(&logging, SPAN_LOG_FLOW, NULL); span_log_set_protocol(&logging, "Buffer"); printf("1 - Impose no minimum for the bits per row\n"); t38_non_ecm_buffer_init(&buffer, TRUE, 0); n = 0; bit_no = 0; /* We should get ones until the buffers recognises an EOL */ printf(" We should get ones here\n"); for (i = 0; i < 17; i++) xxx(&buffer, &logging, log_bits, i, 1); printf(" We should change to zeros here\n"); xxx(&buffer, &logging, log_bits, i, 0); for (i = 0; i < 17; i++) xxx(&buffer, &logging, log_bits, i, 0); printf(" We should get the first row here\n"); xxx(&buffer, &logging, log_bits, i, -1); for (i = 0; i < 17; i++) xxx(&buffer, &logging, log_bits, i, 0); printf(" We should get the second row here\n"); xxx(&buffer, &logging, log_bits, i, -1); for (i = 0; i < 17; i++) xxx(&buffer, &logging, log_bits, i, 0); printf(" We should get the third row here\n"); xxx(&buffer, &logging, log_bits, i, -1); printf(" Done\n"); t38_non_ecm_buffer_report_input_status(&buffer, &logging); t38_non_ecm_buffer_report_output_status(&buffer, &logging); printf("2 - Impose no minimum for the bits per row, different alignment\n"); t38_non_ecm_buffer_init(&buffer, TRUE, 0); n = 0; memset(buf, 0, sizeof(buf)); /* The first one in this should be seen as the first EOL */ memset(buf + 10, 0x55, 10); /* EOL 2 */ buf[25] = 0x20; /* EOL 3 */ memset(buf + 30, 0x55, 10); /* EOL 4 */ buf[45] = 0x10; t38_non_ecm_buffer_inject(&buffer, buf, 50); t38_non_ecm_buffer_push(&buffer); for (;;) { bit = t38_non_ecm_buffer_get_bit((void *) &buffer); if (log_bits) printf("Rx bit %d - %d\n", n, bit); n++; if (bit == SIG_STATUS_END_OF_DATA) { if (n != 337) { printf("Tests failed\n"); exit(2); } break; } if (n >= 18 && n <= 96) { if (bit == (n & 1)) { printf("Tests failed\n"); exit(2); } } else if (n >= 178 && n <= 256) { if (bit == (n & 1)) { printf("Tests failed\n"); exit(2); } } else if (n == 139 || n == 300) { if (bit != 1) { printf("Tests failed\n"); exit(2); } } else { if (bit != 0) { printf("Tests failed\n"); exit(2); } } } t38_non_ecm_buffer_report_input_status(&buffer, &logging); t38_non_ecm_buffer_report_output_status(&buffer, &logging); printf("3 - Demand a fairly high minimum for the bits per row\n"); t38_non_ecm_buffer_init(&buffer, TRUE, 400); n = 0; memset(buf, 0, sizeof(buf)); /* The first one in this should be seen as the first EOL */ memset(buf + 10, 0x55, 10); /* EOL 2 */ buf[25] = 0x08; /* EOL 3 */ memset(buf + 30, 0x55, 10); /* EOL 4 */ buf[45] = 0x04; t38_non_ecm_buffer_inject(&buffer, buf, 50); t38_non_ecm_buffer_push(&buffer); for (;;) { bit = t38_non_ecm_buffer_get_bit((void *) &buffer); if (log_bits) printf("Rx bit %d - %d\n", n, bit); n++; if (bit == SIG_STATUS_END_OF_DATA) { if (n != 1273) { printf("Tests failed\n"); exit(2); } break; } if (n >= 18 && n <= 96) { if (bit == (n & 1)) { printf("Tests failed\n"); exit(2); } } else if (n >= 834 && n <= 912) { if (bit == (n & 1)) { printf("Tests failed\n"); exit(2); } } else if (n == 429 || n == 1238) { if (bit != 1) { printf("Tests failed\n"); exit(2); } } else { if (bit != 0) { printf("Tests failed\n"); exit(2); } } } t38_non_ecm_buffer_report_input_status(&buffer, &logging); t38_non_ecm_buffer_report_output_status(&buffer, &logging); printf("4 - Take some time to get to the first row of the image, output ahead\n"); t38_non_ecm_buffer_init(&buffer, TRUE, 400); n = 0; /* Get some initial bits from an empty buffer. These should be ones */ for (i = 0; i < 1000; i++) { bit = t38_non_ecm_buffer_get_bit((void *) &buffer); if (log_bits) printf("Rx bit %d - %d\n", n++, bit); if (bit != 1) { printf("Tests failed\n"); exit(2); } } printf(" Initial ones OK\n"); /* Now put some zeros into the buffer, but no EOL. We should continue getting ones out. */ memset(buf, 0, sizeof(buf)); t38_non_ecm_buffer_inject(&buffer, buf, 20); for (i = 0; i < 1000; i++) { bit = t38_non_ecm_buffer_get_bit((void *) &buffer); if (log_bits) printf("Rx bit %d - %d\n", n++, bit); if (bit != 1) { printf("Tests failed\n"); exit(2); } } printf(" Continuing initial ones OK\n"); /* Now add a one, to make an EOL. We should see the zeros come out. */ buf[0] = 0x01; t38_non_ecm_buffer_inject(&buffer, buf, 1); for (i = 0; i < 1000; i++) { bit = t38_non_ecm_buffer_get_bit((void *) &buffer); if (log_bits) printf("Rx bit %d - %d\n", n++, bit); if (bit != 0) { printf("Tests failed\n"); exit(2); } } printf(" First EOL caused zeros to output OK\n"); /* Now add another line. We should see the first line come out. This means just the 23rd bit from now will be a one. */ buf[0] = 0x00; buf[4] = 0x01; t38_non_ecm_buffer_inject(&buffer, buf, 5); for (i = 0; i < 1000; i++) { bit = t38_non_ecm_buffer_get_bit((void *) &buffer); if (log_bits) printf("Rx bit %d - %d\n", n++, bit); if ((i == 23 && bit == 0) || (i != 23 && bit != 0)) { printf("Tests failed (%d)\n", i); exit(2); } } printf(" Second EOL caused the first row to output OK\n"); /* Now inject an RTC - 6 EOLs */ memset(buf, 0, sizeof(buf)); /* T.4 1D style */ for (i = 10; i < 19; i += 3) { buf[i] = 0x00; buf[i + 1] = 0x10; buf[i + 2] = 0x01; } /* T.4 2D style */ buf[25 + 0] = 0x00; buf[25 + 1] = 0x18; buf[25 + 2] = 0x00; buf[25 + 3] = 0xC0; buf[25 + 4] = 0x06; buf[25 + 5] = 0x00; buf[25 + 6] = 0x30; buf[25 + 7] = 0x01; buf[25 + 8] = 0x80; buf[25 + 9] = 0x0C; t38_non_ecm_buffer_inject(&buffer, buf, 50); t38_non_ecm_buffer_push(&buffer); for (i = 0; i < 1000; i++) { bit = t38_non_ecm_buffer_get_bit((void *) &buffer); if (log_bits) printf("Rx bit %d - %d\n", n++, bit); if (i == 7 || i == 400 + 11 + 0*12 || i == 400 + 11 + 1*12 || i == 400 + 11 + 2*12 || i == 400 + 11 + 3*12 || i == 400 + 11 + 4*12 || i == 400 + 11 + 5*12 || i == 400 + 11 + 60 + 400 + 4 + 0*13 || i == 400 + 11 + 60 + 400 + 4 + 0*13 + 1 || i == 400 + 11 + 60 + 400 + 4 + 1*13 || i == 400 + 11 + 60 + 400 + 4 + 1*13 + 1 || i == 400 + 11 + 60 + 400 + 4 + 2*13 || i == 400 + 11 + 60 + 400 + 4 + 2*13 + 1 || i == 400 + 11 + 60 + 400 + 4 + 3*13 || i == 400 + 11 + 60 + 400 + 4 + 3*13 + 1 || i == 400 + 11 + 60 + 400 + 4 + 4*13 || i == 400 + 11 + 60 + 400 + 4 + 4*13 + 1 || i == 400 + 11 + 60 + 400 + 4 + 5*13 || i == 400 + 11 + 60 + 400 + 4 + 5*13 + 1) { if (bit == 0) { printf("Tests failed (%d)\n", i); exit(2); } } else { if (bit == 1) { printf("Tests failed (%d)\n", i); exit(2); } } } printf(" RTC output OK\n"); t38_non_ecm_buffer_report_input_status(&buffer, &logging); t38_non_ecm_buffer_report_output_status(&buffer, &logging); printf("5 - Take some time to get to the first row of the image, output behind\n"); t38_non_ecm_buffer_init(&buffer, TRUE, 400); n = 0; /* Inject some ones. */ memset(buf, 0xFF, 100); t38_non_ecm_buffer_inject(&buffer, buf, 100); /* Inject some zeros */ memset(buf, 0, sizeof(buf)); t38_non_ecm_buffer_inject(&buffer, buf, 100); for (i = 0; i < 1000; i++) { bit = t38_non_ecm_buffer_get_bit((void *) &buffer); if (log_bits) printf("Rx bit %d - %d\n", n++, bit); if (bit != 1) { printf("Tests failed\n"); exit(2); } } printf(" Initial ones OK\n"); /* Now add a one, to make an EOL. We should see the zeros come out. */ buf[0] = 0x01; t38_non_ecm_buffer_inject(&buffer, buf, 1); for (i = 0; i < 1000; i++) { bit = t38_non_ecm_buffer_get_bit((void *) &buffer); if (log_bits) printf("Rx bit %d - %d\n", n++, bit); if (bit != 0) { printf("Tests failed\n"); exit(2); } } printf(" First EOL caused zeros to output OK\n"); /* Now add another line. We should see the first line come out. This means just the 23rd bit from now will be a one. */ buf[0] = 0x00; buf[4] = 0x01; t38_non_ecm_buffer_inject(&buffer, buf, 5); for (i = 0; i < 1000; i++) { bit = t38_non_ecm_buffer_get_bit((void *) &buffer); if (log_bits) printf("Rx bit %d - %d\n", n++, bit); if ((i == 23 && bit == 0) || (i != 23 && bit != 0)) { printf("Tests failed (%d)\n", i); exit(2); } } printf(" Second EOL caused the first row to output OK\n"); /* Now inject an RTC - 6 EOLs */ memset(buf, 0, sizeof(buf)); /* T.4 1D style */ for (i = 10; i < 19; i += 3) { buf[i] = 0x00; buf[i + 1] = 0x10; buf[i + 2] = 0x01; } /* T.4 2D style */ buf[25 + 0] = 0x00; buf[25 + 1] = 0x18; buf[25 + 2] = 0x00; buf[25 + 3] = 0xC0; buf[25 + 4] = 0x06; buf[25 + 5] = 0x00; buf[25 + 6] = 0x30; buf[25 + 7] = 0x01; buf[25 + 8] = 0x80; buf[25 + 9] = 0x0C; t38_non_ecm_buffer_inject(&buffer, buf, 50); t38_non_ecm_buffer_push(&buffer); for (i = 0; i < 1000; i++) { bit = t38_non_ecm_buffer_get_bit((void *) &buffer); if (log_bits) printf("Rx bit %d - %d\n", n++, bit); if (i == 7 || i == 400 + 11 + 0*12 || i == 400 + 11 + 1*12 || i == 400 + 11 + 2*12 || i == 400 + 11 + 3*12 || i == 400 + 11 + 4*12 || i == 400 + 11 + 5*12 || i == 400 + 11 + 60 + 400 + 4 + 0*13 || i == 400 + 11 + 60 + 400 + 4 + 0*13 + 1 || i == 400 + 11 + 60 + 400 + 4 + 1*13 || i == 400 + 11 + 60 + 400 + 4 + 1*13 + 1 || i == 400 + 11 + 60 + 400 + 4 + 2*13 || i == 400 + 11 + 60 + 400 + 4 + 2*13 + 1 || i == 400 + 11 + 60 + 400 + 4 + 3*13 || i == 400 + 11 + 60 + 400 + 4 + 3*13 + 1 || i == 400 + 11 + 60 + 400 + 4 + 4*13 || i == 400 + 11 + 60 + 400 + 4 + 4*13 + 1 || i == 400 + 11 + 60 + 400 + 4 + 5*13 || i == 400 + 11 + 60 + 400 + 4 + 5*13 + 1) { if (bit == 0) { printf("Tests failed (%d)\n", i); exit(2); } } else { if (bit == 1) { printf("Tests failed (%d)\n", i); exit(2); } } } printf(" RTC output OK\n"); t38_non_ecm_buffer_report_input_status(&buffer, &logging); t38_non_ecm_buffer_report_output_status(&buffer, &logging); printf("6 - TCF without leading ones\n"); t38_non_ecm_buffer_init(&buffer, FALSE, 400); n = 0; /* Get some initial bits from an empty buffer. These should be ones */ for (i = 0; i < 1000; i++) { bit = t38_non_ecm_buffer_get_bit((void *) &buffer); if (log_bits) printf("Rx bit %d - %d\n", n++, bit); if (bit != 1) { printf("Tests failed\n"); exit(2); } } printf(" Initial ones from an empty TCF buffer OK\n"); /* Now send some TCF through, and see that it comes out */ memset(buf, 0x00, sizeof(buf)); t38_non_ecm_buffer_inject(&buffer, buf, 500); t38_non_ecm_buffer_push(&buffer); for (i = 0; i < 500*8; i++) { bit = t38_non_ecm_buffer_get_bit((void *) &buffer); if (log_bits) printf("Rx bit %d - %d\n", n++, bit); if (bit != 0) { printf("Tests failed\n"); exit(2); } } printf(" Passthrough of TCF OK\n"); /* Check the right number of bits was buffered */ bit = t38_non_ecm_buffer_get_bit((void *) &buffer); if (log_bits) printf("Rx bit %d - %d\n", n++, bit); if (bit != SIG_STATUS_END_OF_DATA) { printf("Tests failed\n"); exit(2); } printf(" End of data seen OK\n"); t38_non_ecm_buffer_report_input_status(&buffer, &logging); t38_non_ecm_buffer_report_output_status(&buffer, &logging); printf("7 - TCF with leading ones\n"); t38_non_ecm_buffer_init(&buffer, FALSE, 400); n = 0; /* Get some initial bits from an empty buffer. These should be ones */ for (i = 0; i < 1000; i++) { bit = t38_non_ecm_buffer_get_bit((void *) &buffer); if (log_bits) printf("Rx bit %d - %d\n", n++, bit); if (bit != 1) { printf("Tests failed\n"); exit(2); } } printf(" Initial ones from an empty TCF buffer OK\n"); /* Now send some initial ones, and see that we continue to get all ones as the stuffing. */ memset(buf, 0xFF, 500); t38_non_ecm_buffer_inject(&buffer, buf, 500); for (i = 0; i < 500*8; i++) { bit = t38_non_ecm_buffer_get_bit((void *) &buffer); if (log_bits) printf("Rx bit %d - %d\n", n++, bit); if (bit != 1) { printf("Tests failed\n"); exit(2); } } printf(" Sustaining ones OK\n"); /* Now send some initial ones, and some TCF through, and see that only the TCF comes out */ memset(buf, 0x00, sizeof(buf)); memset(buf, 0xFF, 100); /* End the ones mid byte */ buf[100] = 0xF0; t38_non_ecm_buffer_inject(&buffer, buf, 500); t38_non_ecm_buffer_push(&buffer); for (i = 0; i < 400*8; i++) { bit = t38_non_ecm_buffer_get_bit((void *) &buffer); if (log_bits) printf("Rx bit %d - %d\n", n++, bit); if ((i < 4 && bit == 0) || (i >= 4 && bit != 0)) { printf("Tests failed\n"); exit(2); } } printf(" Passthrough of TCF OK\n"); /* Check the right number of bits was buffered */ bit = t38_non_ecm_buffer_get_bit((void *) &buffer); if (log_bits) printf("Rx bit %d - %d\n", n++, bit); if (bit != SIG_STATUS_END_OF_DATA) { printf("Tests failed\n"); exit(2); } printf(" End of data seen OK\n"); t38_non_ecm_buffer_report_input_status(&buffer, &logging); t38_non_ecm_buffer_report_output_status(&buffer, &logging); printf("Tests passed\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/complex_tests.c0000664000175000017500000000426611422612266014321 00000000000000/* * SpanDSP - a series of DSP components for telephony * * complex.c * * Written by Steve Underwood * * Copyright (C) 2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page complex_tests_page Complex arithmetic tests \section complex_tests_page_sec_1 What does it do? \section complex_tests_page_sec_2 How is it used? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include "spandsp.h" int main(int argc, char *argv[]) { complexf_t fa; complexf_t fb; complexf_t fz; complexi16_t i16a; complexi16_t i16b; complexi16_t i16z; #if 0 complexi32_t i32a; complexi32_t i32b; complexi32_t i32z; #endif fa = complex_setf(0.5f, 0.25f); fb = complex_setf(0.25f, 0.5f); fz = complex_mulf(&fa, &fb); printf("(%f, %f) * (%f, %f) => (%f, %f)\n", fa.re, fa.im, fb.re, fb.im, fz.re, fz.im); i16a = complex_seti16(16383, 8191); i16b = complex_seti16(8191, 16383); i16z = complex_mul_q1_15(&i16a, &i16b); printf("(%f, %f) * (%f, %f) => (%f, %f)\n", i16a.re/32768.0, i16a.im/32768.0, i16b.re/32768.0, i16b.im/32768.0, i16z.re/32768.0, i16z.im/32768.0); printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/adsi_tests.c0000664000175000017500000007642412101212343013562 00000000000000/* * SpanDSP - a series of DSP components for telephony * * adsi_tests.c - tests for analogue display service handling. * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page adsi_tests_page ADSI tests \section adsi_tests_page_sec_1 What does it do? These tests exercise the ADSI module, for all supported standards. A transmit and a receive instance of the ADSI module are connected together. A quantity of messages is passed between these instances, and checked for accuracy at the receiver. Since the FSK modems used for this are exercised fully by other tests, these tests do not include line modelling. \section adsi_tests_page_sec_2 How does it work? */ /* Enable the following definition to enable direct probing into the FAX structures */ //#define WITH_SPANDSP_INTERNALS #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define OUTPUT_FILE_NAME "adsi.wav" #define BLOCK_LEN 160 #define MITEL_DIR "../test-data/mitel/" #define BELLCORE_DIR "../test-data/bellcore/" const char *bellcore_files[] = { MITEL_DIR "mitel-cm7291-talkoff.wav", BELLCORE_DIR "tr-tsy-00763-1.wav", BELLCORE_DIR "tr-tsy-00763-2.wav", BELLCORE_DIR "tr-tsy-00763-3.wav", BELLCORE_DIR "tr-tsy-00763-4.wav", BELLCORE_DIR "tr-tsy-00763-5.wav", BELLCORE_DIR "tr-tsy-00763-6.wav", "" }; char *decode_test_file = NULL; int errors = 0; int basic_testing = FALSE; adsi_rx_state_t *rx_adsi; adsi_tx_state_t *tx_adsi; int current_standard = 0; int good_message_received; int log_audio = FALSE; SNDFILE *outhandle = NULL; int short_preamble = FALSE; static int adsi_create_message(adsi_tx_state_t *s, uint8_t *msg) { const char *t; int len; static int cycle = 0; len = 0; switch (current_standard) { case ADSI_STANDARD_CLASS: if (cycle > 3) cycle = 0; switch (cycle) { case 0: len = adsi_add_field(s, msg, -1, CLASS_MDMF_CALLERID, NULL, 0); /* Date and time as MMDDHHMM */ len = adsi_add_field(s, msg, len, MCLASS_DATETIME, (uint8_t *) "10011750", 8); len = adsi_add_field(s, msg, len, MCLASS_CALLER_NUMBER, (uint8_t *) "12345678", 8); len = adsi_add_field(s, msg, len, MCLASS_DIALED_NUMBER, (uint8_t *) "87654321", 8); len = adsi_add_field(s, msg, len, MCLASS_CALLER_NAME, (uint8_t *) "Chan Dai Man", 15); break; case 1: len = adsi_add_field(s, msg, -1, CLASS_SDMF_MSG_WAITING, NULL, 0); /* Active */ len = adsi_add_field(s, msg, len, 0, (uint8_t *) "\x42", 1); len = adsi_add_field(s, msg, len, 0, (uint8_t *) "\x42", 1); len = adsi_add_field(s, msg, len, 0, (uint8_t *) "\x42", 1); break; case 2: len = adsi_add_field(s, msg, -1, CLASS_SDMF_MSG_WAITING, NULL, 0); /* Inactive */ len = adsi_add_field(s, msg, len, 0, (uint8_t *) "\x6F", 1); len = adsi_add_field(s, msg, len, 0, (uint8_t *) "\x6F", 1); len = adsi_add_field(s, msg, len, 0, (uint8_t *) "\x6F", 1); break; case 3: len = adsi_add_field(s, msg, -1, CLASS_SDMF_CALLERID, NULL, 0); /* Date and time as MMDDHHMM */ len = adsi_add_field(s, msg, len, 0, (uint8_t *) "10011750", 8); len = adsi_add_field(s, msg, len, 0, (uint8_t *) "6095551212", 10); break; } break; case ADSI_STANDARD_CLIP: if (cycle > 4) cycle = 0; switch (cycle) { case 0: len = adsi_add_field(s, msg, -1, CLIP_MDMF_CALLERID, NULL, 0); len = adsi_add_field(s, msg, len, CLIP_CALLTYPE, (uint8_t *) "\x81", 1); /* Date and time as MMDDHHMM */ len = adsi_add_field(s, msg, len, CLIP_DATETIME, (uint8_t *) "10011750", 8); len = adsi_add_field(s, msg, len, CLIP_DIALED_NUMBER, (uint8_t *) "12345678", 8); len = adsi_add_field(s, msg, len, CLIP_CALLER_NUMBER, (uint8_t *) "87654321", 8); len = adsi_add_field(s, msg, len, CLIP_CALLER_NAME, (uint8_t *) "Chan Dai Man", 15); break; case 1: len = adsi_add_field(s, msg, -1, CLIP_MDMF_MSG_WAITING, NULL, 0); /* Inactive */ len = adsi_add_field(s, msg, len, CLIP_VISUAL_INDICATOR, (uint8_t *) "\x00", 1); break; case 2: len = adsi_add_field(s, msg, -1, CLIP_MDMF_MSG_WAITING, NULL, 0); /* Active */ len = adsi_add_field(s, msg, len, CLIP_VISUAL_INDICATOR, (uint8_t *) "\xFF", 1); len = adsi_add_field(s, msg, len, CLIP_NUM_MSG, (uint8_t *) "\x05", 1); break; case 3: len = adsi_add_field(s, msg, -1, CLIP_MDMF_SMS, NULL, 0); /* Active */ len = adsi_add_field(s, msg, len, CLIP_DISPLAY_INFO, (uint8_t *) "\x00" "ABC", 4); break; case 4: len = adsi_add_field(s, msg, -1, CLIP_MDMF_CALLERID, NULL, 0); len = adsi_add_field(s, msg, len, CLIP_NUM_MSG, (uint8_t *) "\x03", 1); break; } break; case ADSI_STANDARD_ACLIP: if (cycle > 0) cycle = 0; switch (cycle) { case 0: len = adsi_add_field(s, msg, -1, ACLIP_MDMF_CALLERID, NULL, 0); /* Date and time as MMDDHHMM */ len = adsi_add_field(s, msg, len, ACLIP_DATETIME, (uint8_t *) "10011750", 8); len = adsi_add_field(s, msg, len, ACLIP_DIALED_NUMBER, (uint8_t *) "12345678", 8); len = adsi_add_field(s, msg, len, ACLIP_CALLER_NUMBER, (uint8_t *) "87654321", 8); len = adsi_add_field(s, msg, len, ACLIP_CALLER_NAME, (uint8_t *) "Chan Dai Man", 15); break; } break; case ADSI_STANDARD_JCLIP: len = adsi_add_field(s, msg, -1, JCLIP_MDMF_CALLERID, NULL, 0); len = adsi_add_field(s, msg, len, JCLIP_CALLER_NUMBER, (uint8_t *) "12345678", 8); len = adsi_add_field(s, msg, len, JCLIP_CALLER_NUM_DES, (uint8_t *) "215", 3); len = adsi_add_field(s, msg, len, JCLIP_DIALED_NUMBER, (uint8_t *) "87654321", 8); len = adsi_add_field(s, msg, len, JCLIP_DIALED_NUM_DES, (uint8_t *) "215", 3); break; case ADSI_STANDARD_CLIP_DTMF: if (cycle > 4) cycle = 0; switch (cycle) { case 0: len = adsi_add_field(s, msg, -1, CLIP_DTMF_C_TERMINATED, NULL, 0); len = adsi_add_field(s, msg, len, CLIP_DTMF_C_CALLER_NUMBER, (uint8_t *) "12345678", 8); len = adsi_add_field(s, msg, len, CLIP_DTMF_C_ABSENCE, (uint8_t *) "10", 2); len = adsi_add_field(s, msg, len, CLIP_DTMF_C_REDIRECT_NUMBER, (uint8_t *) "87654321", 8); break; case 1: len = adsi_add_field(s, msg, -1, CLIP_DTMF_HASH_TERMINATED, NULL, 0); len = adsi_add_field(s, msg, len, CLIP_DTMF_HASH_CALLER_NUMBER, (uint8_t *) "12345678", 8); break; case 2: len = adsi_add_field(s, msg, -1, CLIP_DTMF_HASH_TERMINATED, NULL, 0); len = adsi_add_field(s, msg, len, CLIP_DTMF_HASH_ABSENCE, (uint8_t *) "1", 1); break; case 3: /* Test the DC format, used in Taiwan and Kuwait */ len = adsi_add_field(s, msg, -1, CLIP_DTMF_HASH_TERMINATED, NULL, 0); len = adsi_add_field(s, msg, len, CLIP_DTMF_HASH_ABSENCE, (uint8_t *) "12345678", 8); break; case 4: /* Test the # format, with no header */ len = adsi_add_field(s, msg, -1, CLIP_DTMF_HASH_TERMINATED, NULL, 0); len = adsi_add_field(s, msg, len, CLIP_DTMF_HASH_UNSPECIFIED, (uint8_t *) "12345678", 8); break; } break; case ADSI_STANDARD_TDD: t = "The quick Brown Fox Jumps Over The Lazy dog 0123456789!@#$%^&*()"; len = adsi_add_field(s, msg, -1, 0, (uint8_t *) t, strlen(t)); break; } cycle++; return len; } /*- End of function --------------------------------------------------------*/ static void put_adsi_msg(void *user_data, const uint8_t *msg, int len) { int i; int l; uint8_t field_type; const uint8_t *field_body; int field_len; int message_type; uint8_t body[256]; printf("Good message received (%d bytes)\n", len); good_message_received = TRUE; for (i = 0; i < len; i++) { printf("%02x ", msg[i]); if ((i & 0xF) == 0xF) printf("\n"); } printf("\n"); l = -1; message_type = -1; printf("Message breakdown\n"); do { l = adsi_next_field(rx_adsi, msg, len, l, &field_type, &field_body, &field_len); if (l > 0) { if (field_body) { memcpy(body, field_body, field_len); body[field_len] = '\0'; printf("Field type 0x%x, len %d, '%s' - ", field_type, field_len, body); switch (current_standard) { case ADSI_STANDARD_CLASS: switch (message_type) { case CLASS_SDMF_CALLERID: break; case CLASS_MDMF_CALLERID: switch (field_type) { case MCLASS_DATETIME: printf("Date and time (MMDDHHMM)"); break; case MCLASS_CALLER_NUMBER: printf("Caller's number"); break; case MCLASS_DIALED_NUMBER: printf("Dialed number"); break; case MCLASS_ABSENCE1: printf("Caller's number absent: 'O' or 'P'"); break; case MCLASS_REDIRECT: printf("Call forward: universal ('0'), on busy ('1'), or on unanswered ('2')"); break; case MCLASS_QUALIFIER: printf("Long distance: 'L'"); break; case MCLASS_CALLER_NAME: printf("Caller's name"); break; case MCLASS_ABSENCE2: printf("Caller's name absent: 'O' or 'P'"); break; } break; case CLASS_SDMF_MSG_WAITING: break; case CLASS_MDMF_MSG_WAITING: switch (field_type) { case MCLASS_VISUAL_INDICATOR: printf("Message waiting/not waiting"); break; } break; } break; case ADSI_STANDARD_CLIP: switch (message_type) { case CLIP_MDMF_CALLERID: case CLIP_MDMF_MSG_WAITING: case CLIP_MDMF_CHARGE_INFO: case CLIP_MDMF_SMS: switch (field_type) { case CLIP_DATETIME: printf("Date and time (MMDDHHMM)"); break; case CLIP_CALLER_NUMBER: printf("Caller's number"); break; case CLIP_DIALED_NUMBER: printf("Dialed number"); break; case CLIP_ABSENCE1: printf("Caller's number absent"); break; case CLIP_CALLER_NAME: printf("Caller's name"); break; case CLIP_ABSENCE2: printf("Caller's name absent"); break; case CLIP_VISUAL_INDICATOR: printf("Visual indicator"); break; case CLIP_MESSAGE_ID: printf("Message ID"); break; case CLIP_CALLTYPE: printf("Voice call, ring-back-when-free call, or msg waiting call"); break; case CLIP_NUM_MSG: printf("Number of messages"); break; #if 0 case CLIP_REDIR_NUMBER: printf("Redirecting number"); break; #endif case CLIP_CHARGE: printf("Charge"); break; case CLIP_DURATION: printf("Duration of the call"); break; case CLIP_ADD_CHARGE: printf("Additional charge"); break; case CLIP_DISPLAY_INFO: printf("Display information"); break; case CLIP_SERVICE_INFO: printf("Service information"); break; } break; } break; case ADSI_STANDARD_ACLIP: switch (message_type) { case ACLIP_SDMF_CALLERID: break; case ACLIP_MDMF_CALLERID: switch (field_type) { case ACLIP_DATETIME: printf("Date and time (MMDDHHMM)"); break; case ACLIP_CALLER_NUMBER: printf("Caller's number"); break; case ACLIP_DIALED_NUMBER: printf("Dialed number"); break; case ACLIP_NUMBER_ABSENCE: printf("Caller's number absent: 'O' or 'P'"); break; case ACLIP_REDIRECT: printf("Call forward: universal, on busy, or on unanswered"); break; case ACLIP_QUALIFIER: printf("Long distance call: 'L'"); break; case ACLIP_CALLER_NAME: printf("Caller's name"); break; case ACLIP_NAME_ABSENCE: printf("Caller's name absent: 'O' or 'P'"); break; } break; } break; case ADSI_STANDARD_JCLIP: switch (message_type) { case JCLIP_MDMF_CALLERID: switch (field_type) { case JCLIP_CALLER_NUMBER: printf("Caller's number"); break; case JCLIP_CALLER_NUM_DES: printf("Caller's number data extension signal"); break; case JCLIP_DIALED_NUMBER: printf("Dialed number"); break; case JCLIP_DIALED_NUM_DES: printf("Dialed number data extension signal"); break; case JCLIP_ABSENCE: printf("Caller's number absent: 'C', 'O', 'P' or 'S'"); break; } break; } break; case ADSI_STANDARD_CLIP_DTMF: switch (message_type) { case CLIP_DTMF_HASH_TERMINATED: switch (field_type) { case CLIP_DTMF_HASH_CALLER_NUMBER: printf("Caller's number"); break; case CLIP_DTMF_HASH_ABSENCE: printf("Caller's number absent: private (1), overseas (2) or not available (3)"); break; case CLIP_DTMF_HASH_UNSPECIFIED: printf("Unspecified"); break; } break; case CLIP_DTMF_C_TERMINATED: switch (field_type) { case CLIP_DTMF_C_CALLER_NUMBER: printf("Caller's number"); break; case CLIP_DTMF_C_REDIRECT_NUMBER: printf("Redirect number"); break; case CLIP_DTMF_C_ABSENCE: printf("Caller's number absent"); break; } break; } break; case ADSI_STANDARD_TDD: if (basic_testing) { if (len != 59 || memcmp(msg, "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG 0123456789#$*()", 59)) { printf("\n"); printf("String error\n"); exit(2); } } break; } } else { printf("Message type 0x%x - ", field_type); message_type = field_type; switch (current_standard) { case ADSI_STANDARD_CLASS: switch (message_type) { case CLASS_SDMF_CALLERID: printf("Single data message caller ID"); break; case CLASS_MDMF_CALLERID: printf("Multiple data message caller ID"); break; case CLASS_SDMF_MSG_WAITING: printf("Single data message message waiting"); break; case CLASS_MDMF_MSG_WAITING: printf("Multiple data message message waiting"); break; default: printf("Unknown"); break; } break; case ADSI_STANDARD_CLIP: switch (message_type) { case CLIP_MDMF_CALLERID: printf("Multiple data message caller ID"); break; case CLIP_MDMF_MSG_WAITING: printf("Multiple data message message waiting"); break; case CLIP_MDMF_CHARGE_INFO: printf("Multiple data message charge info"); break; case CLIP_MDMF_SMS: printf("Multiple data message SMS"); break; default: printf("Unknown"); break; } break; case ADSI_STANDARD_ACLIP: switch (message_type) { case ACLIP_SDMF_CALLERID: printf("Single data message caller ID frame"); break; case ACLIP_MDMF_CALLERID: printf("Multiple data message caller ID frame"); break; default: printf("Unknown"); break; } break; case ADSI_STANDARD_JCLIP: switch (message_type) { case JCLIP_MDMF_CALLERID: printf("Multiple data message caller ID frame"); break; default: printf("Unknown"); break; } break; case ADSI_STANDARD_CLIP_DTMF: switch (message_type) { case CLIP_DTMF_HASH_TERMINATED: printf("# terminated"); break; case CLIP_DTMF_C_TERMINATED: printf("C terminated"); break; default: printf("Unknown"); break; } break; case ADSI_STANDARD_TDD: printf("Unknown"); break; } } printf("\n"); } } while (l > 0); if (l < -1) { /* This message appears corrupt */ printf("Bad message contents\n"); exit(2); } printf("\n"); } /*- End of function --------------------------------------------------------*/ static void tdd_character_set_tests(void) { #if 0 char *s; int ch; int xx; int yy; /* This part tests internal static routines in the ADSI module. It can only be run with a modified version of the ADSI module, which makes the routines visible. */ /* Check the character encode/decode cycle */ tx_adsi = adsi_tx_init(NULL, ADSI_STANDARD_TDD); rx_adsi = adsi_rx_init(NULL, ADSI_STANDARD_TDD, put_adsi_msg, NULL); s = "The quick Brown Fox Jumps Over The Lazy dog 0123456789!@#$%^&*()"; while ((ch = *s++)) { xx = adsi_encode_baudot(tx_adsi, ch); if ((xx & 0x3E0)) { yy = adsi_decode_baudot(rx_adsi, (xx >> 5) & 0x1F); if (yy) printf("%c", yy); } yy = adsi_decode_baudot(rx_adsi, xx & 0x1F); if (yy) printf("%c", yy); } adsi_tx_free(tx_adsi); adsi_rx_free(rx_adsi); printf("\n"); #endif } /*- End of function --------------------------------------------------------*/ static void basic_tests(int standard) { int16_t amp[BLOCK_LEN]; uint8_t adsi_msg[256 + 42]; int outframes; int len; int adsi_msg_len; int push; int i; basic_testing = TRUE; printf("Testing %s\n", adsi_standard_to_str(standard)); tx_adsi = adsi_tx_init(NULL, standard); if (short_preamble) adsi_tx_set_preamble(tx_adsi, 50, 20, 5, -1); rx_adsi = adsi_rx_init(NULL, standard, put_adsi_msg, NULL); /* Fake an OK condition for the first message test */ good_message_received = TRUE; push = 0; for (i = 0; i < 100000; i++) { if (push == 0) { if ((len = adsi_tx(tx_adsi, amp, BLOCK_LEN)) == 0) push = 10; } else { len = 0; /* Push a little silence through, to flush things out */ if (--push == 0) { if (!good_message_received) { printf("No message received %s (%d)\n", adsi_standard_to_str(standard), i); exit(2); } good_message_received = FALSE; adsi_msg_len = adsi_create_message(tx_adsi, adsi_msg); adsi_msg_len = adsi_tx_put_message(tx_adsi, adsi_msg, adsi_msg_len); } } if (len < BLOCK_LEN) { memset(&[len], 0, sizeof(int16_t)*(BLOCK_LEN - len)); len = BLOCK_LEN; } if (log_audio) { outframes = sf_writef_short(outhandle, amp, len); if (outframes != len) { fprintf(stderr, " Error writing audio file\n"); exit(2); } } adsi_rx(rx_adsi, amp, len); } adsi_rx_free(rx_adsi); adsi_tx_free(tx_adsi); basic_testing = FALSE; } /*- End of function --------------------------------------------------------*/ static void mitel_cm7291_side_2_and_bellcore_tests(int standard) { int j; int16_t amp[BLOCK_LEN]; SNDFILE *inhandle; int frames; /* The remainder of the Mitel tape is the talk-off test */ /* Here we use the Bellcore test tapes (much tougher), in six files - 1 from each side of the original 3 cassette tapes */ printf("Talk-off tests for %s\n", adsi_standard_to_str(standard)); rx_adsi = adsi_rx_init(NULL, standard, put_adsi_msg, NULL); for (j = 0; bellcore_files[j][0]; j++) { printf("Testing with %s\n", bellcore_files[j]); if ((inhandle = sf_open_telephony_read(bellcore_files[j], 1)) == NULL) { printf(" Cannot open speech file '%s'\n", bellcore_files[j]); exit(2); } while ((frames = sf_readf_short(inhandle, amp, BLOCK_LEN))) { adsi_rx(rx_adsi, amp, frames); } if (sf_close_telephony(inhandle)) { printf(" Cannot close speech file '%s'\n", bellcore_files[j]); exit(2); } } adsi_rx_free(rx_adsi); if (j > 470) { printf(" Failed\n"); exit(2); } printf(" Passed\n"); } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int16_t amp[BLOCK_LEN]; SNDFILE *inhandle; int len; int test_standard; int first_standard; int last_standard; int opt; int enable_basic_tests; int enable_talkoff_tests; log_audio = FALSE; decode_test_file = NULL; test_standard = -1; short_preamble = FALSE; enable_basic_tests = TRUE; enable_talkoff_tests = FALSE; while ((opt = getopt(argc, argv, "bd:lps:t")) != -1) { switch (opt) { case 'b': enable_basic_tests = TRUE; enable_talkoff_tests = FALSE; break; case 'd': decode_test_file = optarg; break; case 'l': log_audio = TRUE; break; case 'p': short_preamble = TRUE; break; case 's': if (strcasecmp("CLASS", optarg) == 0) test_standard = ADSI_STANDARD_CLASS; else if (strcasecmp("CLIP", optarg) == 0) test_standard = ADSI_STANDARD_CLIP; else if (strcasecmp("A-CLIP", optarg) == 0) test_standard = ADSI_STANDARD_ACLIP; else if (strcasecmp("J-CLIP", optarg) == 0) test_standard = ADSI_STANDARD_JCLIP; else if (strcasecmp("CLIP-DTMF", optarg) == 0) test_standard = ADSI_STANDARD_CLIP_DTMF; else if (strcasecmp("TDD", optarg) == 0) test_standard = ADSI_STANDARD_TDD; else test_standard = atoi(optarg); break; case 't': enable_basic_tests = FALSE; enable_talkoff_tests = TRUE; break; default: //usage(); exit(2); break; } } outhandle = NULL; tdd_character_set_tests(); if (decode_test_file) { /* We will decode the audio from a file. */ if ((inhandle = sf_open_telephony_read(decode_test_file, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", decode_test_file); exit(2); } if (test_standard < 0) current_standard = ADSI_STANDARD_CLASS; else current_standard = test_standard; rx_adsi = adsi_rx_init(NULL, current_standard, put_adsi_msg, NULL); #if 0 span_log_set_level(rx_adsi.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(rx_adsi.logging, "ADSI"); #endif for (;;) { len = sf_readf_short(inhandle, amp, BLOCK_LEN); if (len == 0) break; adsi_rx(rx_adsi, amp, len); } if (sf_close_telephony(inhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", decode_test_file); exit(2); } adsi_rx_free(rx_adsi); } else { if (log_audio) { if ((outhandle = sf_open_telephony_write(OUTPUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } } /* Go through all the standards */ /* This assumes standard 0 is NULL, and TDD is the last in the list */ if (test_standard < 0) { first_standard = ADSI_STANDARD_CLASS; last_standard = ADSI_STANDARD_TDD; } else { first_standard = last_standard = test_standard; } for (current_standard = first_standard; current_standard <= last_standard; current_standard++) { if (enable_basic_tests) basic_tests(current_standard); if (enable_talkoff_tests) mitel_cm7291_side_2_and_bellcore_tests(current_standard); } if (log_audio) { if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } } printf("Tests passed.\n"); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/gsm0610_tests.c0000664000175000017500000004433312101216545013741 00000000000000/* * SpanDSP - a series of DSP components for telephony * * gsm0610_tests.c - Test the GSM 06.10 FR codec. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page gsm0610_tests_page GSM 06.10 full rate codec tests \section gsm0610_tests_page_sec_1 What does it do? Two sets of tests are performed: - The tests defined in the GSM 06.10 specification, using the test data files supplied with the specification. - A generally audio quality test, consisting of compressing and decompressing a speeech file for audible comparison. \section gsm0610_tests_page_sec_2 How is it used? To perform the tests in the GSM 06.10 specification you need to obtain the test data files from the specification. These are copyright material, and so cannot be distributed with this test software. They can, however, be freely downloaded from the ETSI web site. The files, containing test vectors, which are supplied with the GSM 06.10 specification, should be copied to etsitests/gsm0610/unpacked so the files are arranged in the following directories. ./fr_A: Seq01-A.cod Seq01-A.inp Seq01-A.out Seq02-A.cod Seq02-A.inp Seq02-A.out Seq03-A.cod Seq03-A.inp Seq03-A.out Seq04-A.cod Seq04-A.inp Seq04-A.out Seq05-A.out ./fr_L: Seq01.cod Seq01.inp Seq01.out Seq02.cod Seq02.inp Seq02.out Seq03.cod Seq03.inp Seq03.out Seq04.cod Seq04.inp Seq04.out Seq05.cod Seq05.out ./fr_U: Seq01-U.cod Seq01-U.inp Seq01-U.out Seq02-U.cod Seq02-U.inp Seq02-U.out Seq03-U.cod Seq03-U.inp Seq03-U.out Seq04-U.cod Seq04-U.inp Seq04-U.out Seq05-U.out ./fr_homing_A: Homing01_A.out Seq01H_A.cod Seq01H_A.inp Seq01H_A.out Seq02H_A.cod Seq02H_A.inp Seq02H_A.out Seq03H_A.cod Seq03H_A.inp Seq03H_A.out Seq04H_A.cod Seq04H_A.inp Seq04H_A.out Seq05H_A.out Seq06H_A.cod Seq06H_A.inp ./fr_homing_L: Homing01.cod Homing01.out Seq01h.cod Seq01h.inp Seq01h.out Seq02h.cod Seq02h.inp Seq02h.out Seq03h.cod Seq03h.inp Seq03h.out Seq04h.cod Seq04h.inp Seq04h.out Seq05h.cod Seq05h.out Seq06h.cod Seq06h.inp ./fr_homing_U: Homing01_U.out Seq01H_U.cod Seq01H_U.inp Seq01H_U.out Seq02H_U.cod Seq02H_U.inp Seq02H_U.out Seq03H_U.cod Seq03H_U.inp Seq03H_U.out Seq04H_U.cod Seq04H_U.inp Seq04H_U.out Seq05H_U.out Seq06H_U.cod Seq06H_U.inp ./fr_sync_A: Seqsync_A.inp Sync000_A.cod --to-- Sync159_A.cod ./fr_sync_L: Bitsync.inp Seqsync.inp Sync000.cod --to-- Sync159.cod ./fr_sync_U: Seqsync_U.inp Sync000_U.cod --to-- Sync159_U.cod This is different from the directory structure in which they are supplied. Also, the files names are a little different. The supplied names are messy, and inconsistent across the sets. The names required by these tests just clean up these inconsistencies. Note that you will need a Windows machine to unpack some of the supplied files. To perform a general audio quality test, gsm0610_tests should be run. The file ../test-data/local/short_nb_voice.wav will be compressed to GSM 06.10 data, decompressed, and the resulting audio stored in post_gsm0610.wav. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define BLOCK_LEN 160 #define TESTDATA_DIR "../test-data/etsi/gsm0610/unpacked/fr_" #define IN_FILE_NAME "../test-data/local/short_nb_voice.wav" #define OUT_FILE_NAME "post_gsm0610.wav" #define HIST_LEN 1000 uint8_t law_in_vector[1000000]; int16_t in_vector[1000000]; uint16_t code_vector_buf[1000000]; uint8_t code_vector[1000000]; uint8_t ref_code_vector[1000000]; uint8_t decoder_code_vector[1000000]; uint8_t law_out_vector[1000000]; int16_t out_vector[1000000]; int16_t ref_out_vector[1000000]; uint8_t ref_law_out_vector[1000000]; int vector_len; static int get_test_vector(int full, int disk, const char *name) { char buf[500]; int in; int len; int i; if (full) { sprintf(buf, "%s%c/%s.inp", TESTDATA_DIR, 'L', name); if ((in = open(buf, O_RDONLY)) < 0) { fprintf(stderr, "Cannot open %s\n", buf); exit(2); } len = read(in, in_vector, 1000000); close(in); len /= sizeof(int16_t); vector_len = len; } sprintf(buf, "%s%c/%s.out", TESTDATA_DIR, 'L', name); if ((in = open(buf, O_RDONLY)) < 0) { fprintf(stderr, "Cannot open %s\n", buf); exit(2); } len = read(in, ref_out_vector, 1000000); close(in); len /= sizeof(int16_t); if (full) { if (len != vector_len) { fprintf(stderr, "Input and reference vector lengths do not match - %d %d\n", vector_len, len); exit(2); } } else { vector_len = len; } sprintf(buf, "%s%c/%s.cod", TESTDATA_DIR, 'L', name); if ((in = open(buf, O_RDONLY)) < 0) { fprintf(stderr, "Cannot open %s\n", buf); exit(2); } len = read(in, code_vector_buf, 1000000); close(in); len /= sizeof(int16_t); for (i = 0; i < len; i++) { ref_code_vector[i] = code_vector_buf[i]; decoder_code_vector[i] = code_vector_buf[i]; } if (len*BLOCK_LEN != vector_len*76) { fprintf(stderr, "Input and code vector lengths do not match - %d %d\n", vector_len, len); exit(2); } return len; } /*- End of function --------------------------------------------------------*/ static int get_law_test_vector(int full, int law, const char *name) { char buf[500]; int in; int len; int i; int law_uc; law_uc = toupper(law); if (full) { sprintf(buf, "%s%c/%s-%c.inp", TESTDATA_DIR, law_uc, name, law_uc); if ((in = open(buf, O_RDONLY)) < 0) { fprintf(stderr, "Cannot open %s\n", buf); exit(2); } len = read(in, law_in_vector, 1000000); close(in); vector_len = len; sprintf(buf, "%s%c/%s-%c.cod", TESTDATA_DIR, law_uc, name, law_uc); if ((in = open(buf, O_RDONLY)) < 0) { fprintf(stderr, "Cannot open %s\n", buf); exit(2); } len = read(in, code_vector_buf, 1000000); close(in); len /= sizeof(int16_t); for (i = 0; i < len; i++) ref_code_vector[i] = code_vector_buf[i]; if (len*BLOCK_LEN != vector_len*76) { fprintf(stderr, "Input and code vector lengths do not match - %d %d\n", vector_len, len); exit(2); } } sprintf(buf, "%s%c/%s-%c.out", TESTDATA_DIR, law_uc, name, law_uc); if ((in = open(buf, O_RDONLY)) < 0) { fprintf(stderr, "Cannot open %s\n", buf); exit(2); } len = read(in, ref_law_out_vector, 1000000); close(in); if (full) { if (len != vector_len) { fprintf(stderr, "Input and reference vector lengths do not match - %d %d\n", vector_len, len); exit(2); } } else { vector_len = len; } sprintf(buf, "%s%c/%s.cod", TESTDATA_DIR, 'L', name); if ((in = open(buf, O_RDONLY)) < 0) { fprintf(stderr, "Cannot open %s\n", buf); exit(2); } len = read(in, code_vector_buf, 1000000); close(in); len /= sizeof(int16_t); for (i = 0; i < len; i++) decoder_code_vector[i] = code_vector_buf[i]; return len; } /*- End of function --------------------------------------------------------*/ static int perform_linear_test(int full, int disk, const char *name) { gsm0610_state_t *gsm0610_enc_state; gsm0610_state_t *gsm0610_dec_state; int i; int xxx; int mismatches; printf("Performing linear test '%s' from disk %d\n", name, disk); get_test_vector(full, disk, name); if (full) { if ((gsm0610_enc_state = gsm0610_init(NULL, GSM0610_PACKING_NONE)) == NULL) { fprintf(stderr, " Cannot create encoder\n"); exit(2); } xxx = gsm0610_encode(gsm0610_enc_state, code_vector, in_vector, vector_len); printf("Check code vector of length %d\n", xxx); for (i = 0, mismatches = 0; i < xxx; i++) { if (code_vector[i] != ref_code_vector[i]) { printf("%8d/%3d: %6d %6d\n", i/76, i%76, code_vector[i], ref_code_vector[i]); mismatches++; } } gsm0610_release(gsm0610_enc_state); if (mismatches) { printf("Test failed: %d of %d samples mismatch\n", mismatches, xxx); exit(2); } printf("Test passed\n"); } if ((gsm0610_dec_state = gsm0610_init(NULL, GSM0610_PACKING_NONE)) == NULL) { fprintf(stderr, " Cannot create decoder\n"); exit(2); } xxx = gsm0610_decode(gsm0610_dec_state, out_vector, decoder_code_vector, vector_len); printf("Check output vector of length %d\n", vector_len); for (i = 0, mismatches = 0; i < vector_len; i++) { if (out_vector[i] != ref_out_vector[i]) { printf("%8d: %6d %6d\n", i, out_vector[i], ref_out_vector[i]); mismatches++; } } if (mismatches) { printf("Test failed: %d of %d samples mismatch\n", mismatches, vector_len); exit(2); } gsm0610_release(gsm0610_dec_state); printf("Test passed\n"); return 0; } /*- End of function --------------------------------------------------------*/ static int perform_law_test(int full, int law, const char *name) { gsm0610_state_t *gsm0610_enc_state; gsm0610_state_t *gsm0610_dec_state; int i; int xxx; int mismatches; if (law == 'a') printf("Performing A-law test '%s'\n", name); else printf("Performing u-law test '%s'\n", name); get_law_test_vector(full, law, name); if (full) { if ((gsm0610_enc_state = gsm0610_init(NULL, GSM0610_PACKING_NONE)) == NULL) { fprintf(stderr, " Cannot create encoder\n"); exit(2); } if (law == 'a') { for (i = 0; i < vector_len; i++) in_vector[i] = alaw_to_linear(law_in_vector[i]); } else { for (i = 0; i < vector_len; i++) in_vector[i] = ulaw_to_linear(law_in_vector[i]); } xxx = gsm0610_encode(gsm0610_enc_state, code_vector, in_vector, vector_len); printf("Check code vector of length %d\n", xxx); for (i = 0, mismatches = 0; i < xxx; i++) { if (code_vector[i] != ref_code_vector[i]) { printf("%8d/%3d: %6d %6d %6d\n", i/76, i%76, code_vector[i], ref_code_vector[i], decoder_code_vector[i]); mismatches++; } } if (mismatches) { printf("Test failed: %d of %d samples mismatch\n", mismatches, xxx); exit(2); } printf("Test passed\n"); gsm0610_release(gsm0610_enc_state); } if ((gsm0610_dec_state = gsm0610_init(NULL, GSM0610_PACKING_NONE)) == NULL) { fprintf(stderr, " Cannot create decoder\n"); exit(2); } xxx = gsm0610_decode(gsm0610_dec_state, out_vector, decoder_code_vector, vector_len); if (law == 'a') { for (i = 0; i < vector_len; i++) law_out_vector[i] = linear_to_alaw(out_vector[i]); } else { for (i = 0; i < vector_len; i++) law_out_vector[i] = linear_to_ulaw(out_vector[i]); } printf("Check output vector of length %d\n", vector_len); for (i = 0, mismatches = 0; i < vector_len; i++) { if (law_out_vector[i] != ref_law_out_vector[i]) { printf("%8d: %6d %6d\n", i, law_out_vector[i], ref_law_out_vector[i]); mismatches++; } } if (mismatches) { printf("Test failed: %d of %d samples mismatch\n", mismatches, vector_len); exit(2); } gsm0610_release(gsm0610_dec_state); printf("Test passed\n"); return 0; } /*- End of function --------------------------------------------------------*/ static int repack_gsm0610_voip_to_wav49(uint8_t c[], const uint8_t d[]) { gsm0610_frame_t frame[2]; int n; n = gsm0610_unpack_voip(&frame[0], d); gsm0610_unpack_voip(&frame[1], d + n); n = gsm0610_pack_wav49(c, frame); return n; } /*- End of function --------------------------------------------------------*/ static int repack_gsm0610_wav49_to_voip(uint8_t d[], const uint8_t c[]) { gsm0610_frame_t frame[2]; int n[2]; gsm0610_unpack_wav49(frame, c); n[0] = gsm0610_pack_voip(d, &frame[0]); n[1] = gsm0610_pack_voip(d + n[0], &frame[1]); return n[0] + n[1]; } /*- End of function --------------------------------------------------------*/ static int perform_pack_unpack_test(void) { uint8_t a[66]; uint8_t b[66]; uint8_t c[66]; int i; int j; printf("Performing packing/unpacking tests (not part of the ETSI conformance tests).\n"); /* Try trans-packing a lot of random data looking for before/after mismatch. */ for (j = 0; j < 1000; j++) { for (i = 0; i < 65; i++) a[i] = rand(); repack_gsm0610_wav49_to_voip(b, a); repack_gsm0610_voip_to_wav49(c, b); if (memcmp(a, c, 65)) { printf("Test failed: data mismatch\n"); exit(2); } for (i = 0; i < 66; i++) a[i] = rand(); /* Insert the magic code */ a[0] = (a[0] & 0xF) | 0xD0; a[33] = (a[33] & 0xF) | 0xD0; repack_gsm0610_voip_to_wav49(b, a); repack_gsm0610_wav49_to_voip(c, b); //for (i = 0; i < 66; i++) // printf("%2d: 0x%02X 0x%02X\n", i, a[i], c[i]); if (memcmp(a, c, 66)) { printf("Test failed: data mismatch\n"); exit(2); } } printf("Test passed\n"); return 0; } /*- End of function --------------------------------------------------------*/ static void etsi_compliance_tests(void) { perform_linear_test(TRUE, 1, "Seq01"); perform_linear_test(TRUE, 1, "Seq02"); perform_linear_test(TRUE, 1, "Seq03"); perform_linear_test(TRUE, 1, "Seq04"); perform_linear_test(FALSE, 1, "Seq05"); perform_law_test(TRUE, 'a', "Seq01"); perform_law_test(TRUE, 'a', "Seq02"); perform_law_test(TRUE, 'a', "Seq03"); perform_law_test(TRUE, 'a', "Seq04"); perform_law_test(FALSE, 'a', "Seq05"); perform_law_test(TRUE, 'u', "Seq01"); perform_law_test(TRUE, 'u', "Seq02"); perform_law_test(TRUE, 'u', "Seq03"); perform_law_test(TRUE, 'u', "Seq04"); perform_law_test(FALSE, 'u', "Seq05"); /* This is not actually an ETSI test */ perform_pack_unpack_test(); printf("Tests passed.\n"); } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { SNDFILE *inhandle; SNDFILE *outhandle; int frames; int bytes; int16_t pre_amp[HIST_LEN]; int16_t post_amp[HIST_LEN]; uint8_t gsm0610_data[HIST_LEN]; gsm0610_state_t *gsm0610_enc_state; gsm0610_state_t *gsm0610_dec_state; int opt; int etsitests; int packing; etsitests = TRUE; packing = GSM0610_PACKING_NONE; while ((opt = getopt(argc, argv, "lp:")) != -1) { switch (opt) { case 'l': etsitests = FALSE; break; case 'p': packing = atoi(optarg); break; default: //usage(); exit(2); } } if (etsitests) { etsi_compliance_tests(); } else { if ((inhandle = sf_open_telephony_read(IN_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", IN_FILE_NAME); exit(2); } if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME); exit(2); } if ((gsm0610_enc_state = gsm0610_init(NULL, packing)) == NULL) { fprintf(stderr, " Cannot create encoder\n"); exit(2); } if ((gsm0610_dec_state = gsm0610_init(NULL, packing)) == NULL) { fprintf(stderr, " Cannot create decoder\n"); exit(2); } while ((frames = sf_readf_short(inhandle, pre_amp, 2*BLOCK_LEN))) { bytes = gsm0610_encode(gsm0610_enc_state, gsm0610_data, pre_amp, frames); gsm0610_decode(gsm0610_dec_state, post_amp, gsm0610_data, bytes); sf_writef_short(outhandle, post_amp, frames); } if (sf_close_telephony(inhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", IN_FILE_NAME); exit(2); } if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME); exit(2); } gsm0610_release(gsm0610_enc_state); gsm0610_release(gsm0610_dec_state); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/queue_tests.c0000664000175000017500000004714012101216200013753 00000000000000/* * SpanDSP - a series of DSP components for telephony * * queue_tests.c * * Written by Steve Underwood * * Copyright (C) 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* THIS IS A WORK IN PROGRESS. IT IS NOT FINISHED. */ /*! \page queue_tests_page Queue tests \section queue_tests_page_sec_1 What does it do? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #define BUF_LEN 10000 #define MSG_LEN 17 pthread_t thread[2]; queue_state_t *queue; volatile int put_oks; volatile int put_misses; volatile int got_oks; volatile int got_misses; int total_in; int total_out; static void tests_failed(void) { printf("Tests failed\n"); exit(2); } /*- End of function --------------------------------------------------------*/ static void display_queue_pointers(void) { printf("Pointers %d %d %d\n", queue->iptr, queue->optr, queue->len); } /*- End of function --------------------------------------------------------*/ static void *run_stream_write(void *arg) { uint8_t buf[MSG_LEN]; int i; int next; printf("Write thread\n"); next = 0; for (i = 0; i < MSG_LEN; i++) buf[i] = next; next = (next + 1) & 0xFF; put_oks = 0; put_misses = 0; for (;;) { if (queue_write(queue, buf, MSG_LEN) == MSG_LEN) { for (i = 0; i < MSG_LEN; i++) buf[i] = next; next = (next + 1) & 0xFF; put_oks++; if (put_oks%1000000 == 0) printf("%d puts, %d misses\n", put_oks, put_misses); } else { sched_yield(); put_misses++; } } return NULL; } /*- End of function --------------------------------------------------------*/ static void *run_stream_read(void *arg) { uint8_t buf[MSG_LEN]; int i; int len; int next; printf("Read thread\n"); next = 0; got_oks = 0; got_misses = 0; for (;;) { if ((len = queue_read(queue, buf, MSG_LEN)) >= 0) { if (len != MSG_LEN) { printf("AHH! - len %d\n", len); tests_failed(); } for (i = 0; i < len; i++) { if (buf[i] != next) { printf("AHH! - 0x%X 0x%X\n", buf[i], next); tests_failed(); } } next = (next + 1) & 0xFF; got_oks++; if (got_oks%1000000 == 0) printf("%d gots, %d misses\n", got_oks, got_misses); } else { sched_yield(); got_misses++; } } return NULL; } /*- End of function --------------------------------------------------------*/ static void threaded_stream_tests(void) { pthread_attr_t attr; if ((queue = queue_init(NULL, BUF_LEN, QUEUE_READ_ATOMIC | QUEUE_WRITE_ATOMIC)) == NULL) { printf("Failed to create the queue\n"); tests_failed(); } pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); if (pthread_create(&thread[0], &attr, run_stream_write, NULL)) { printf("Failed to create thread\n"); tests_failed(); } if (pthread_create(&thread[1], &attr, run_stream_read, NULL)) { printf("Failed to create thread\n"); tests_failed(); } for (;;) { sleep(5); printf("Main thread - %d %d\n", put_oks, got_oks); } queue_free(queue); } /*- End of function --------------------------------------------------------*/ static void *run_message_write(void *arg) { uint8_t buf[MSG_LEN]; int i; int next; printf("Write thread\n"); next = 0; for (i = 0; i < MSG_LEN; i++) buf[i] = next; next = (next + 1) & 0xFF; put_oks = 0; put_misses = 0; for (;;) { if (queue_write_msg(queue, buf, MSG_LEN) == MSG_LEN) { for (i = 0; i < MSG_LEN; i++) buf[i] = next; next = (next + 1) & 0xFF; put_oks++; if (put_oks%1000000 == 0) printf("%d puts, %d misses\n", put_oks, put_misses); } else { sched_yield(); put_misses++; } } return NULL; } /*- End of function --------------------------------------------------------*/ static void *run_message_read(void *arg) { uint8_t buf[1024]; int i; int len; int next; printf("Read thread\n"); next = 0; got_oks = 0; got_misses = 0; for (;;) { if ((len = queue_read_msg(queue, buf, 1024)) >= 0) { if (len != MSG_LEN) { printf("AHH! - len %d\n", len); tests_failed(); } for (i = 0; i < len; i++) { if (buf[i] != next) { printf("AHH! - 0x%X 0x%X\n", buf[i], next); tests_failed(); } } next = (next + 1) & 0xFF; got_oks++; if (got_oks%1000000 == 0) printf("%d gots, %d misses\n", got_oks, got_misses); } else { sched_yield(); got_misses++; } } return NULL; } /*- End of function --------------------------------------------------------*/ static void threaded_message_tests(void) { pthread_attr_t attr; if ((queue = queue_init(NULL, BUF_LEN, QUEUE_READ_ATOMIC | QUEUE_WRITE_ATOMIC)) == NULL) { printf("Failed to create the queue\n"); tests_failed(); } pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); if (pthread_create(&thread[0], &attr, run_message_write, NULL)) { printf("Failed to create thread\n"); tests_failed(); } if (pthread_create(&thread[1], &attr, run_message_read, NULL)) { printf("Failed to create thread\n"); tests_failed(); } for (;;) { sleep(5); printf("Main thread - %d %d\n", put_oks, got_oks); } queue_free(queue); } /*- End of function --------------------------------------------------------*/ static void check_contents(int total_in, int total_out) { if (queue_contents(queue) != (total_in - total_out)) { printf("Contents = %d (%d)\n", queue_contents(queue), (total_in - total_out)); display_queue_pointers(); tests_failed(); } if (queue_free_space(queue) != BUF_LEN - (total_in - total_out)) { printf("Free space = %d (%d)\n", queue_free_space(queue), BUF_LEN - (total_in - total_out)); display_queue_pointers(); tests_failed(); } } /*- End of function --------------------------------------------------------*/ static int monitored_queue_write(const uint8_t buf[], int len) { int lenx; lenx = queue_write(queue, buf, len); if (lenx >= 0) total_in += lenx; check_contents(total_in, total_out); return lenx; } /*- End of function --------------------------------------------------------*/ static int monitored_queue_write_byte(const uint8_t buf) { int res; if ((res = queue_write_byte(queue, buf)) >= 0) total_in++; check_contents(total_in, total_out); return res; } /*- End of function --------------------------------------------------------*/ static int monitored_queue_read(uint8_t buf[], int len) { int lenx; lenx = queue_read(queue, buf, len); if (lenx >= 0) total_out += lenx; check_contents(total_in, total_out); return lenx; } /*- End of function --------------------------------------------------------*/ static int monitored_queue_read_byte(void) { int res; if ((res = queue_read_byte(queue)) >= 0) total_out++; check_contents(total_in, total_out); return res; } /*- End of function --------------------------------------------------------*/ static void functional_stream_tests(void) { uint8_t buf[MSG_LEN]; int i; int res; total_in = 0; total_out = 0; for (i = 0; i < MSG_LEN; i++) buf[i] = i; if ((queue = queue_init(NULL, BUF_LEN, QUEUE_READ_ATOMIC | QUEUE_WRITE_ATOMIC)) == NULL) { printf("Failed to create the queue\n"); tests_failed(); } check_contents(total_in, total_out); /* Half fill the buffer, and check we can get out what we put in. */ for (i = 1; i < 5000; i++) { if (monitored_queue_write_byte(i & 0xFF) != 1) { printf("Byte by byte full at %d/%d\n", i, BUF_LEN); tests_failed(); } } for (i = 1; i < 5001; i++) { if ((res = monitored_queue_read_byte()) != (i & 0xFF)) break; } printf("Byte by byte read breaks at %d (expected %d) - %d\n", i, 5000, res); if (i != 5000) tests_failed(); /* Now completely fill the buffer, and we should roll around the end. Check we can get out what we put in. */ for (i = 1; i < 20000; i++) { if (monitored_queue_write_byte(i & 0xFF) != 1) break; } printf("Byte by byte full at %d (expected %d)\n", i, 10001); if (i != 10001) tests_failed(); for (i = 1; i < 20000; i++) { if ((res = monitored_queue_read_byte()) != (i & 0xFF)) break; } printf("Byte by byte read breaks at %d (expected %d) - %d\n", i, 10001, res); if (i != 10001) tests_failed(); /* Fill the buffer, checking the contents grow correctly */ for (i = 1; i < 1000; i++) { if (monitored_queue_write(buf, MSG_LEN) != MSG_LEN) break; } printf("Full at chunk %d (expected %d)\n", i, BUF_LEN/MSG_LEN + 1); if (i != BUF_LEN/MSG_LEN + 1) tests_failed(); if (monitored_queue_write(buf, 5) == 5) { printf("Write of 5 succeeded\n"); tests_failed(); } if (monitored_queue_write(buf, 4) != 4) { printf("Write of 4 failed\n"); tests_failed(); } /* Now full. Empty a little, and refill around the end */ if (monitored_queue_read(buf, MSG_LEN) != MSG_LEN) { printf("Read failed\n"); tests_failed(); } if (monitored_queue_write(buf, MSG_LEN) != MSG_LEN) { printf("Write failed\n"); tests_failed(); } /* Empty completely, checking the contents shrink correctly */ for (;;) { if (monitored_queue_read(buf, MSG_LEN) != MSG_LEN) break; } if (monitored_queue_read(buf, 4) != 4) { printf("Read failed\n"); tests_failed(); } /* Nudge around the buffer */ for (i = 1; i < 588; i++) { if (monitored_queue_write(buf, MSG_LEN) != MSG_LEN) { printf("Write failed\n"); tests_failed(); } if (monitored_queue_read(buf, MSG_LEN) != MSG_LEN) { printf("Read failed\n"); tests_failed(); } } /* Fill the buffer, checking the contents grow correctly */ for (i = 1; i < 1000; i++) { if (monitored_queue_write(buf, MSG_LEN) != MSG_LEN) break; } printf("Full at chunk %d (expected %d)\n", i, BUF_LEN/MSG_LEN + 1); if (i != BUF_LEN/MSG_LEN + 1) tests_failed(); display_queue_pointers(); if (monitored_queue_read(buf, MSG_LEN) != MSG_LEN) { printf("Read failed\n"); tests_failed(); } if (monitored_queue_write(buf, MSG_LEN) != MSG_LEN) { printf("Write failed\n"); tests_failed(); } display_queue_pointers(); for (i = 1; i < 5000; i++) { if (monitored_queue_read(buf, MSG_LEN) != MSG_LEN) { printf("Read failed\n"); tests_failed(); } if (monitored_queue_write(buf, MSG_LEN) != MSG_LEN) { printf("Write failed\n"); tests_failed(); } } display_queue_pointers(); if (monitored_queue_write(buf, 5) == 5) { printf("Write of 5 succeeded\n"); tests_failed(); } if (monitored_queue_write(buf, 4) != 4) { printf("Write of 4 failed\n"); tests_failed(); } display_queue_pointers(); for (i = 1; i < 5000; i++) { if (monitored_queue_read(buf, MSG_LEN) != MSG_LEN) { printf("Read failed\n"); tests_failed(); } if (monitored_queue_write(buf, MSG_LEN) != MSG_LEN) { printf("Write failed\n"); tests_failed(); } } display_queue_pointers(); queue_free(queue); } /*- End of function --------------------------------------------------------*/ static int monitored_queue_write_msg(const uint8_t buf[], int len) { int lenx; lenx = queue_write_msg(queue, buf, len); if (lenx >= 0) total_in += lenx + sizeof(uint16_t); check_contents(total_in, total_out); return lenx; } /*- End of function --------------------------------------------------------*/ static int monitored_queue_read_msg(uint8_t buf[], int len) { int lenx; lenx = queue_read_msg(queue, buf, len); if (lenx >= 0) total_out += lenx + sizeof(uint16_t); check_contents(total_in, total_out); return lenx; } /*- End of function --------------------------------------------------------*/ static void functional_message_tests(void) { uint8_t buf[MSG_LEN]; int i; int len; total_in = 0; total_out = 0; for (i = 0; i < MSG_LEN; i++) buf[i] = i; if ((queue = queue_init(NULL, BUF_LEN, QUEUE_READ_ATOMIC | QUEUE_WRITE_ATOMIC)) == NULL) { printf("Failed to create the queue\n"); tests_failed(); } check_contents(total_in, total_out); /* Fill the buffer, checking the contents grow correctly */ for (i = 1; i < 1000; i++) { if (monitored_queue_write_msg(buf, MSG_LEN) != MSG_LEN) break; } printf("Full at chunk %d (expected %lu)\n", i, (unsigned long int) BUF_LEN/(MSG_LEN + sizeof(uint16_t)) + 1); if (i != BUF_LEN/(MSG_LEN + sizeof(uint16_t)) + 1) tests_failed(); if ((len = monitored_queue_write_msg(buf, 5)) == 5) { printf("Write of 5 succeeded\n"); tests_failed(); } if ((len = monitored_queue_write_msg(buf, 4)) != 4) { printf("Write of 4 failed\n"); tests_failed(); } /* Now full. Empty a little, and refill around the end */ if ((len = monitored_queue_read_msg(buf, MSG_LEN)) != MSG_LEN) { printf("Read failed - %d\n", len); tests_failed(); } if ((len = monitored_queue_write_msg(buf, MSG_LEN)) != MSG_LEN) { printf("Write failed - %d\n", len); tests_failed(); } /* Empty completely, checking the contents shrink correctly */ for (;;) { if ((len = monitored_queue_read_msg(buf, MSG_LEN)) != MSG_LEN) break; } if (len != 4) { printf("Read failed - %d\n", len); tests_failed(); } /* We should now have one MSG_LEN message in the buffer */ /* Nudge around the buffer */ for (i = 1; i < 527; i++) { if ((len = monitored_queue_write_msg(buf, MSG_LEN)) != MSG_LEN) { printf("Write failed - %d\n", len); tests_failed(); } if ((len = monitored_queue_read_msg(buf, MSG_LEN)) != MSG_LEN) { printf("Read failed - %d\n", len); tests_failed(); } } /* Fill the buffer, checking the contents grow correctly */ for (i = 1; i < 1000; i++) { if ((len = monitored_queue_write_msg(buf, MSG_LEN)) != MSG_LEN) break; } printf("Free space = %d (%d)\n", queue_free_space(queue), BUF_LEN - (total_in - total_out)); display_queue_pointers(); printf("Full at chunk %d (expected %lu)\n", i, (unsigned long int) BUF_LEN/(MSG_LEN + sizeof(uint16_t))); if (i != BUF_LEN/(MSG_LEN + sizeof(uint16_t))) tests_failed(); display_queue_pointers(); if ((len = monitored_queue_read_msg(buf, MSG_LEN)) != MSG_LEN) { printf("Read failed - %d\n", len); tests_failed(); } if ((len = monitored_queue_write_msg(buf, MSG_LEN)) != MSG_LEN) { printf("Write failed - %d\n", len); tests_failed(); } display_queue_pointers(); for (i = 1; i < 5000; i++) { if ((len = monitored_queue_read_msg(buf, MSG_LEN)) != MSG_LEN) { printf("Read failed - %d\n", len); tests_failed(); } if ((len = monitored_queue_write_msg(buf, MSG_LEN)) != MSG_LEN) { printf("Write failed - %d\n", len); tests_failed(); } } display_queue_pointers(); if ((len = monitored_queue_write_msg(buf, 5)) == 5) { printf("Write of 5 succeeded\n"); tests_failed(); } if ((len = monitored_queue_write_msg(buf, 4)) != 4) { printf("Write of 4 failed\n"); tests_failed(); } display_queue_pointers(); for (i = 1; i < 5000; i++) { if (i == 527) { if ((len = monitored_queue_read_msg(buf, MSG_LEN)) != 4) { printf("Read failed - %d\n", len); tests_failed(); } } if ((len = monitored_queue_read_msg(buf, MSG_LEN)) != MSG_LEN) { printf("Read failed - %d\n", len); tests_failed(); } if ((len = monitored_queue_write_msg(buf, MSG_LEN)) != MSG_LEN) { printf("Write failed - %d\n", len); tests_failed(); } } display_queue_pointers(); queue_free(queue); } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int threaded_messages; int threaded_streams; int opt; threaded_messages = FALSE; threaded_streams = FALSE; while ((opt = getopt(argc, argv, "ms")) != -1) { switch (opt) { case 'm': threaded_messages = TRUE; break; case 's': threaded_streams = TRUE; break; } } /* Test the basic functionality of the queueing code in stream and message modes */ printf("Stream mode functional tests\n"); functional_stream_tests(); printf("Message mode functional tests\n"); functional_message_tests(); /* Run separate write and read threads for a while, to verify there are no locking issues. */ if (threaded_streams) { printf("Stream mode threaded tests\n"); threaded_stream_tests(); } if (threaded_messages) { printf("Message mode threaded tests\n"); threaded_message_tests(); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/tone_generate_tests.c0000664000175000017500000001624512101213565015463 00000000000000/* * SpanDSP - a series of DSP components for telephony * * tone_generate_tests.c * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page tone_generate_tests_page Tone generation tests \section tone_generate_tests_page_sec_1 What does it do? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define OUTPUT_FILE_NAME "tone_generate.wav" int main(int argc, char *argv[]) { tone_gen_descriptor_t tone_desc; tone_gen_state_t tone_state; int i; int16_t amp[16384]; int len; SNDFILE *outhandle; if ((outhandle = sf_open_telephony_write(OUTPUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } /* Try a tone pair */ tone_gen_descriptor_init(&tone_desc, 440, -10, 620, -15, 100, 200, 300, 400, FALSE); tone_gen_init(&tone_state, &tone_desc); for (i = 0; i < 1000; i++) { len = tone_gen(&tone_state, amp, 160); printf("Generated %d samples\n", len); if (len <= 0) break; sf_writef_short(outhandle, amp, len); } /* Try a different tone pair */ tone_gen_descriptor_init(&tone_desc, 350, -10, 440, -15, 400, 300, 200, 100, TRUE); tone_gen_init(&tone_state, &tone_desc); for (i = 0; i < 1000; i++) { len = tone_gen(&tone_state, amp, 160); printf("Generated %d samples\n", len); if (len <= 0) break; sf_writef_short(outhandle, amp, len); } /* Try a different tone pair */ tone_gen_descriptor_init(&tone_desc, 400, -10, 450, -10, 100, 200, 300, 400, TRUE); tone_gen_init(&tone_state, &tone_desc); for (i = 0; i < 1000; i++) { len = tone_gen(&tone_state, amp, 160); printf("Generated %d samples\n", len); if (len <= 0) break; sf_writef_short(outhandle, amp, len); } /* Try a single tone */ tone_gen_descriptor_init(&tone_desc, 400, -10, 0, 0, 100, 200, 300, 400, TRUE); tone_gen_init(&tone_state, &tone_desc); for (i = 0; i < 1000; i++) { len = tone_gen(&tone_state, amp, 160); printf("Generated %d samples\n", len); if (len <= 0) break; sf_writef_short(outhandle, amp, len); } /* Try a single non-repeating tone */ tone_gen_descriptor_init(&tone_desc, 820, -10, 0, 0, 2000, 0, 0, 0, FALSE); tone_gen_init(&tone_state, &tone_desc); for (i = 0; i < 1000; i++) { len = tone_gen(&tone_state, amp, 160); printf("Generated %d samples\n", len); if (len <= 0) break; sf_writef_short(outhandle, amp, len); } /* Try a single non-repeating tone at 0dBm0 */ tone_gen_descriptor_init(&tone_desc, 820, 0, 0, 0, 2000, 0, 0, 0, FALSE); tone_gen_init(&tone_state, &tone_desc); for (i = 0; i < 1000; i++) { len = tone_gen(&tone_state, amp, 160); printf("Generated %d samples\n", len); if (len <= 0) break; sf_writef_short(outhandle, amp, len); } /* Try an AM modulated tone at a modest modulation level (25%) */ tone_gen_descriptor_init(&tone_desc, 425, -10, -50, 25, 100, 200, 300, 400, TRUE); tone_gen_init(&tone_state, &tone_desc); for (i = 0; i < 1000; i++) { len = tone_gen(&tone_state, amp, 160); printf("Generated %d samples\n", len); if (len <= 0) break; sf_writef_short(outhandle, amp, len); } /* Try an AM modulated tone at maximum modulation level (100%) */ tone_gen_descriptor_init(&tone_desc, 425, -10, -50, 100, 100, 200, 300, 400, TRUE); tone_gen_init(&tone_state, &tone_desc); for (i = 0; i < 1000; i++) { len = tone_gen(&tone_state, amp, 160); printf("Generated %d samples\n", len); if (len <= 0) break; sf_writef_short(outhandle, amp, len); } if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME); exit (2); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/fax_tester.c0000664000175000017500000006057412343630625013602 00000000000000/* * SpanDSP - a series of DSP components for telephony * * fax_tester.c * * Written by Steve Underwood * * Copyright (C) 2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #if defined(HAVE_TGMATH_H) #include #endif #if defined(HAVE_MATH_H) #include #endif #include "floating_fudge.h" #include #include #include #include #if defined(HAVE_LIBXML_XMLMEMORY_H) #include #endif #if defined(HAVE_LIBXML_PARSER_H) #include #endif #if defined(HAVE_LIBXML_XINCLUDE_H) #include #endif //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "fax_tester.h" #define HDLC_FRAMING_OK_THRESHOLD 5 static void timer_update(faxtester_state_t *s, int len) { s->timer += len; if (s->timer > s->timeout) { s->timeout = 0x7FFFFFFFFFFFFFFFLL; if (s->front_end_step_timeout_handler) s->front_end_step_timeout_handler(s, s->front_end_step_timeout_user_data); } } /*- End of function --------------------------------------------------------*/ static void front_end_step_complete(faxtester_state_t *s) { if (s->front_end_step_complete_handler) s->front_end_step_complete_handler(s, s->front_end_step_complete_user_data); } /*- End of function --------------------------------------------------------*/ void faxtester_send_hdlc_flags(faxtester_state_t *s, int flags) { hdlc_tx_flags(&s->modems.hdlc_tx, flags); } /*- End of function --------------------------------------------------------*/ void faxtester_send_hdlc_msg(faxtester_state_t *s, const uint8_t *msg, int len, int crc_ok) { hdlc_tx_frame(&s->modems.hdlc_tx, msg, len); if (!crc_ok) hdlc_tx_corrupt_frame(&s->modems.hdlc_tx); } /*- End of function --------------------------------------------------------*/ static void hdlc_underflow_handler(void *user_data) { faxtester_state_t *s; uint8_t buf[400]; s = (faxtester_state_t *) user_data; if (s->image_buffer) { /* We are sending an ECM image */ if (s->image_ptr < s->image_len) { buf[0] = 0xFF; buf[1] = 0x03; buf[2] = 0x06; buf[3] = s->image_ptr/s->ecm_frame_size; memcpy(buf + 4, &s->image_buffer[s->image_ptr], s->ecm_frame_size); hdlc_tx_frame(&s->modems.hdlc_tx, buf, 4 + s->ecm_frame_size); if (s->corrupt_crc >= 0 && s->corrupt_crc == s->image_ptr/s->ecm_frame_size) hdlc_tx_corrupt_frame(&s->modems.hdlc_tx); s->image_ptr += s->ecm_frame_size; return; } else { /* The actual image is over. We are sending the final RCP frames. */ if (s->image_bit_ptr > 2) { s->image_bit_ptr--; buf[0] = 0xFF; buf[1] = 0x03; buf[2] = 0x86; hdlc_tx_frame(&s->modems.hdlc_tx, buf, 3); return; } else { /* All done. */ s->image_buffer = NULL; } } } front_end_step_complete(s); } /*- End of function --------------------------------------------------------*/ static void modem_tx_status(void *user_data, int status) { faxtester_state_t *s; s = (faxtester_state_t *) user_data; printf("Tx status is %s (%d)\n", signal_status_to_str(status), status); switch (status) { case SIG_STATUS_SHUTDOWN_COMPLETE: front_end_step_complete(s); break; } } /*- End of function --------------------------------------------------------*/ static void tone_detected(void *user_data, int tone, int level, int delay) { faxtester_state_t *s; s = (faxtester_state_t *) user_data; span_log(&s->logging, SPAN_LOG_FLOW, "%s (%d) declared (%ddBm0)\n", modem_connect_tone_to_str(tone), tone, level); if (tone != MODEM_CONNECT_TONES_NONE) { s->tone_on_time = s->timer; } else { span_log(&s->logging, SPAN_LOG_FLOW, "Tone was on for %fs\n", (float) (s->timer - s->tone_on_time)/SAMPLE_RATE + 0.55); } s->tone_state = tone; if (tone == MODEM_CONNECT_TONES_NONE) front_end_step_complete(s); } /*- End of function --------------------------------------------------------*/ static int non_ecm_get_bit(void *user_data) { faxtester_state_t *s; int bit; s = (faxtester_state_t *) user_data; if (s->image_bit_ptr == 0) { if (s->image_ptr >= s->image_len) { s->image_buffer = NULL; return SIG_STATUS_END_OF_DATA; } s->image_bit_ptr = 8; s->image_ptr++; } s->image_bit_ptr--; bit = (s->image_buffer[s->image_ptr] >> (7 - s->image_bit_ptr)) & 0x01; //printf("Rx bit - %d\n", bit); return bit; } /*- End of function --------------------------------------------------------*/ void faxtester_set_non_ecm_image_buffer(faxtester_state_t *s, const uint8_t *buf, int len) { s->image_ptr = 0; s->image_bit_ptr = 8; s->image_len = len; s->image_buffer = buf; } /*- End of function --------------------------------------------------------*/ void faxtester_set_ecm_image_buffer(faxtester_state_t *s, const uint8_t *buf, int len, int block, int frame_size, int crc_hit) { int start; start = 256*frame_size*block; if (len > start + 256*frame_size) len = start + 256*frame_size; s->ecm_frame_size = frame_size; s->image_ptr = start; s->image_bit_ptr = 8; s->image_len = len; s->image_buffer = buf; s->corrupt_crc = crc_hit; /* Send the first frame */ hdlc_underflow_handler(s); } /*- End of function --------------------------------------------------------*/ static void non_ecm_rx_status(void *user_data, int status) { faxtester_state_t *s; s = (faxtester_state_t *) user_data; span_log(&s->logging, SPAN_LOG_FLOW, "Non-ECM carrier status is %s (%d)\n", signal_status_to_str(status), status); switch (status) { case SIG_STATUS_TRAINING_FAILED: s->modems.rx_trained = FALSE; break; case SIG_STATUS_TRAINING_SUCCEEDED: /* The modem is now trained */ s->modems.rx_trained = TRUE; break; case SIG_STATUS_CARRIER_UP: s->modems.rx_signal_present = TRUE; break; case SIG_STATUS_CARRIER_DOWN: if (s->modems.rx_trained) { if (s->real_time_frame_handler) s->real_time_frame_handler(s, s->real_time_frame_user_data, TRUE, NULL, 0); } s->modems.rx_signal_present = FALSE; s->modems.rx_trained = FALSE; break; } } /*- End of function --------------------------------------------------------*/ static void non_ecm_put_bit(void *user_data, int bit) { if (bit < 0) { non_ecm_rx_status(user_data, bit); return; } } /*- End of function --------------------------------------------------------*/ static void hdlc_rx_status(void *user_data, int status) { faxtester_state_t *s; s = (faxtester_state_t *) user_data; span_log(&s->logging, SPAN_LOG_FLOW, "HDLC carrier status is %s (%d)\n", signal_status_to_str(status), status); switch (status) { case SIG_STATUS_TRAINING_FAILED: s->modems.rx_trained = FALSE; break; case SIG_STATUS_TRAINING_SUCCEEDED: /* The modem is now trained */ s->modems.rx_trained = TRUE; break; case SIG_STATUS_CARRIER_UP: s->modems.rx_signal_present = TRUE; break; case SIG_STATUS_CARRIER_DOWN: s->modems.rx_signal_present = FALSE; s->modems.rx_trained = FALSE; break; } } /*- End of function --------------------------------------------------------*/ static void hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok) { faxtester_state_t *s; if (len < 0) { hdlc_rx_status(user_data, len); return; } s = (faxtester_state_t *) user_data; if (s->real_time_frame_handler) s->real_time_frame_handler(s, s->real_time_frame_user_data, TRUE, msg, len); } /*- End of function --------------------------------------------------------*/ static int v17_v21_rx(void *user_data, const int16_t amp[], int len) { faxtester_state_t *t; fax_modems_state_t *s; t = (faxtester_state_t *) user_data; s = &t->modems; v17_rx(&s->fast_modems.v17_rx, amp, len); fsk_rx(&s->v21_rx, amp, len); if (s->rx_trained) { /* The fast modem has trained, so we no longer need to run the slow one in parallel. */ span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.17 + V.21 to V.17 (%.2fdBm0)\n", v17_rx_signal_power(&s->fast_modems.v17_rx)); s->rx_handler = (span_rx_handler_t *) &v17_rx; s->rx_user_data = &s->fast_modems.v17_rx; } return 0; } /*- End of function --------------------------------------------------------*/ static int v27ter_v21_rx(void *user_data, const int16_t amp[], int len) { faxtester_state_t *t; fax_modems_state_t *s; t = (faxtester_state_t *) user_data; s = &t->modems; v27ter_rx(&s->fast_modems.v27ter_rx, amp, len); fsk_rx(&s->v21_rx, amp, len); if (s->rx_trained) { /* The fast modem has trained, so we no longer need to run the slow one in parallel. */ span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.27ter + V.21 to V.27ter (%.2fdBm0)\n", v27ter_rx_signal_power(&s->fast_modems.v27ter_rx)); s->rx_handler = (span_rx_handler_t *) &v27ter_rx; s->rx_user_data = &s->fast_modems.v27ter_rx; } return 0; } /*- End of function --------------------------------------------------------*/ static int v29_v21_rx(void *user_data, const int16_t amp[], int len) { faxtester_state_t *t; fax_modems_state_t *s; t = (faxtester_state_t *) user_data; s = &t->modems; v29_rx(&s->fast_modems.v29_rx, amp, len); fsk_rx(&s->v21_rx, amp, len); if (s->rx_trained) { /* The fast modem has trained, so we no longer need to run the slow one in parallel. */ span_log(&t->logging, SPAN_LOG_FLOW, "Switching from V.29 + V.21 to V.29 (%.2fdBm0)\n", v29_rx_signal_power(&s->fast_modems.v29_rx)); s->rx_handler = (span_rx_handler_t *) &v29_rx; s->rx_user_data = &s->fast_modems.v29_rx; } return 0; } /*- End of function --------------------------------------------------------*/ int faxtester_rx(faxtester_state_t *s, int16_t *amp, int len) { int i; for (i = 0; i < len; i++) amp[i] = dc_restore(&s->modems.dc_restore, amp[i]); s->modems.rx_handler(s->modems.rx_user_data, amp, len); timer_update(s, len); if (s->wait_for_silence) { if (!s->modems.rx_signal_present) { s->wait_for_silence = FALSE; front_end_step_complete(s); } } return 0; } /*- End of function --------------------------------------------------------*/ int faxtester_tx(faxtester_state_t *s, int16_t *amp, int max_len) { int len; len = 0; if (s->transmit) { while ((len += s->modems.tx_handler(s->modems.tx_user_data, amp + len, max_len - len)) < max_len) { /* Allow for a change of tx handler within a block */ front_end_step_complete(s); if (!s->transmit) { if (s->modems.transmit_on_idle) { /* Pad to the requested length with silence */ memset(amp + len, 0, (max_len - len)*sizeof(int16_t)); len = max_len; } break; } } } else { if (s->modems.transmit_on_idle) { /* Pad to the requested length with silence */ memset(amp, 0, max_len*sizeof(int16_t)); len = max_len; } } return len; } /*- End of function --------------------------------------------------------*/ void faxtest_set_rx_silence(faxtester_state_t *s) { s->wait_for_silence = TRUE; } /*- End of function --------------------------------------------------------*/ void faxtester_set_rx_type(void *user_data, int type, int bit_rate, int short_train, int use_hdlc) { faxtester_state_t *s; put_bit_func_t put_bit_func; void *put_bit_user_data; fax_modems_state_t *t; int tone; s = (faxtester_state_t *) user_data; t = &s->modems; span_log(&s->logging, SPAN_LOG_FLOW, "Set rx type %d\n", type); if (s->current_rx_type == type) return; s->current_rx_type = type; if (use_hdlc) { put_bit_func = (put_bit_func_t) hdlc_rx_put_bit; put_bit_user_data = (void *) &t->hdlc_rx; hdlc_rx_init(&t->hdlc_rx, FALSE, FALSE, HDLC_FRAMING_OK_THRESHOLD, hdlc_accept, s); } else { put_bit_func = non_ecm_put_bit; put_bit_user_data = (void *) s; } switch (type) { case T30_MODEM_CED: case T30_MODEM_CNG: if (type == T30_MODEM_CED) tone = MODEM_CONNECT_TONES_FAX_CED; else tone = MODEM_CONNECT_TONES_FAX_CNG; modem_connect_tones_rx_init(&t->connect_rx, tone, tone_detected, (void *) s); t->rx_handler = (span_rx_handler_t *) &modem_connect_tones_rx; t->rx_user_data = &t->connect_rx; s->tone_state = MODEM_CONNECT_TONES_NONE; break; case T30_MODEM_V21: if (s->flush_handler) s->flush_handler(s, s->flush_user_data, 3); fsk_rx_init(&t->v21_rx, &preset_fsk_specs[FSK_V21CH2], FSK_FRAME_MODE_SYNC, (put_bit_func_t) hdlc_rx_put_bit, put_bit_user_data); fsk_rx_signal_cutoff(&t->v21_rx, -45.5); t->rx_handler = (span_rx_handler_t *) &fsk_rx; t->rx_user_data = &t->v21_rx; break; case T30_MODEM_V27TER: v27ter_rx_restart(&t->fast_modems.v27ter_rx, bit_rate, FALSE); v27ter_rx_set_put_bit(&t->fast_modems.v27ter_rx, put_bit_func, put_bit_user_data); t->rx_handler = (span_rx_handler_t *) &v27ter_v21_rx; t->rx_user_data = s; break; case T30_MODEM_V29: v29_rx_restart(&t->fast_modems.v29_rx, bit_rate, FALSE); v29_rx_set_put_bit(&t->fast_modems.v29_rx, put_bit_func, put_bit_user_data); t->rx_handler = (span_rx_handler_t *) &v29_v21_rx; t->rx_user_data = s; break; case T30_MODEM_V17: v17_rx_restart(&t->fast_modems.v17_rx, bit_rate, short_train); v17_rx_set_put_bit(&t->fast_modems.v17_rx, put_bit_func, put_bit_user_data); t->rx_handler = (span_rx_handler_t *) &v17_v21_rx; t->rx_user_data = s; break; case T30_MODEM_DONE: span_log(&s->logging, SPAN_LOG_FLOW, "FAX exchange complete\n"); default: t->rx_handler = (span_rx_handler_t *) &span_dummy_rx; t->rx_user_data = s; break; } } /*- End of function --------------------------------------------------------*/ void faxtester_set_tx_type(void *user_data, int type, int bit_rate, int short_train, int use_hdlc) { faxtester_state_t *s; get_bit_func_t get_bit_func; void *get_bit_user_data; fax_modems_state_t *t; int tone; s = (faxtester_state_t *) user_data; t = &s->modems; span_log(&s->logging, SPAN_LOG_FLOW, "Set tx type %d\n", type); if (s->current_tx_type == type) return; if (use_hdlc) { get_bit_func = (get_bit_func_t) hdlc_tx_get_bit; get_bit_user_data = (void *) &t->hdlc_tx; } else { get_bit_func = non_ecm_get_bit; get_bit_user_data = (void *) s; } switch (type) { case T30_MODEM_PAUSE: silence_gen_alter(&t->silence_gen, ms_to_samples(short_train)); t->tx_handler = (span_tx_handler_t *) &silence_gen; t->tx_user_data = &t->silence_gen; s->transmit = TRUE; break; case T30_MODEM_CED: case T30_MODEM_CNG: if (type == T30_MODEM_CED) tone = MODEM_CONNECT_TONES_FAX_CED; else tone = MODEM_CONNECT_TONES_FAX_CNG; modem_connect_tones_tx_init(&t->connect_tx, tone); t->tx_handler = (span_tx_handler_t *) &modem_connect_tones_tx; t->tx_user_data = &t->connect_tx; s->transmit = TRUE; break; case T30_MODEM_V21: fsk_tx_init(&t->v21_tx, &preset_fsk_specs[FSK_V21CH2], get_bit_func, get_bit_user_data); fsk_tx_set_modem_status_handler(&t->v21_tx, modem_tx_status, (void *) s); t->tx_handler = (span_tx_handler_t *) &fsk_tx; t->tx_user_data = &t->v21_tx; s->transmit = TRUE; break; case T30_MODEM_V27TER: v27ter_tx_restart(&t->fast_modems.v27ter_tx, bit_rate, t->use_tep); v27ter_tx_set_get_bit(&t->fast_modems.v27ter_tx, get_bit_func, get_bit_user_data); v27ter_tx_set_modem_status_handler(&t->fast_modems.v27ter_tx, modem_tx_status, (void *) s); t->tx_handler = (span_tx_handler_t *) &v27ter_tx; t->tx_user_data = &t->fast_modems.v27ter_tx; /* For any fast modem, set 200ms of preamble flags */ hdlc_tx_flags(&t->hdlc_tx, bit_rate/(8*5)); s->transmit = TRUE; break; case T30_MODEM_V29: v29_tx_restart(&t->fast_modems.v29_tx, bit_rate, t->use_tep); v29_tx_set_get_bit(&t->fast_modems.v29_tx, get_bit_func, get_bit_user_data); v29_tx_set_modem_status_handler(&t->fast_modems.v29_tx, modem_tx_status, (void *) s); t->tx_handler = (span_tx_handler_t *) &v29_tx; t->tx_user_data = &t->fast_modems.v29_tx; /* For any fast modem, set 200ms of preamble flags */ hdlc_tx_flags(&t->hdlc_tx, bit_rate/(8*5)); s->transmit = TRUE; break; case T30_MODEM_V17: v17_tx_restart(&t->fast_modems.v17_tx, bit_rate, t->use_tep, short_train); v17_tx_set_get_bit(&t->fast_modems.v17_tx, get_bit_func, get_bit_user_data); v17_tx_set_modem_status_handler(&t->fast_modems.v17_tx, modem_tx_status, (void *) s); t->tx_handler = (span_tx_handler_t *) &v17_tx; t->tx_user_data = &t->fast_modems.v17_tx; /* For any fast modem, set 200ms of preamble flags */ hdlc_tx_flags(&t->hdlc_tx, bit_rate/(8*5)); s->transmit = TRUE; break; case T30_MODEM_DONE: span_log(&s->logging, SPAN_LOG_FLOW, "FAX exchange complete\n"); /* Fall through */ default: silence_gen_alter(&t->silence_gen, 0); t->tx_handler = (span_tx_handler_t *) &silence_gen; t->tx_user_data = &t->silence_gen; s->transmit = FALSE; break; } s->current_tx_type = type; } /*- End of function --------------------------------------------------------*/ void faxtester_set_timeout(faxtester_state_t *s, int timeout) { if (timeout >= 0) s->timeout = s->timer + timeout*SAMPLE_RATE/1000; else s->timeout = 0x7FFFFFFFFFFFFFFFLL; } /*- End of function --------------------------------------------------------*/ void faxtester_set_transmit_on_idle(faxtester_state_t *s, int transmit_on_idle) { s->modems.transmit_on_idle = transmit_on_idle; } /*- End of function --------------------------------------------------------*/ void faxtester_set_tep_mode(faxtester_state_t *s, int use_tep) { s->modems.use_tep = use_tep; } /*- End of function --------------------------------------------------------*/ void faxtester_set_real_time_frame_handler(faxtester_state_t *s, faxtester_real_time_frame_handler_t handler, void *user_data) { s->real_time_frame_handler = handler; s->real_time_frame_user_data = user_data; } /*- End of function --------------------------------------------------------*/ void faxtester_set_front_end_step_complete_handler(faxtester_state_t *s, faxtester_front_end_step_complete_handler_t handler, void *user_data) { s->front_end_step_complete_handler = handler; s->front_end_step_complete_user_data = user_data; } /*- End of function --------------------------------------------------------*/ void faxtester_set_front_end_step_timeout_handler(faxtester_state_t *s, faxtester_front_end_step_complete_handler_t handler, void *user_data) { s->front_end_step_timeout_handler = handler; s->front_end_step_timeout_user_data = user_data; } /*- End of function --------------------------------------------------------*/ static void faxtester_fax_modems_init(fax_modems_state_t *s, int use_tep, void *user_data) { s->use_tep = use_tep; hdlc_rx_init(&s->hdlc_rx, FALSE, FALSE, HDLC_FRAMING_OK_THRESHOLD, hdlc_accept, user_data); hdlc_tx_init(&s->hdlc_tx, FALSE, 2, FALSE, hdlc_underflow_handler, user_data); fsk_rx_init(&s->v21_rx, &preset_fsk_specs[FSK_V21CH2], FSK_FRAME_MODE_SYNC, (put_bit_func_t) hdlc_rx_put_bit, &s->hdlc_rx); fsk_rx_signal_cutoff(&s->v21_rx, -45.5); fsk_tx_init(&s->v21_tx, &preset_fsk_specs[FSK_V21CH2], (get_bit_func_t) hdlc_tx_get_bit, &s->hdlc_tx); fsk_tx_set_modem_status_handler(&s->v21_tx, modem_tx_status, user_data); v17_rx_init(&s->fast_modems.v17_rx, 14400, non_ecm_put_bit, user_data); v17_tx_init(&s->fast_modems.v17_tx, 14400, s->use_tep, non_ecm_get_bit, user_data); v17_tx_set_modem_status_handler(&s->fast_modems.v17_tx, modem_tx_status, user_data); v29_rx_init(&s->fast_modems.v29_rx, 9600, non_ecm_put_bit, user_data); v29_rx_signal_cutoff(&s->fast_modems.v29_rx, -45.5); v29_tx_init(&s->fast_modems.v29_tx, 9600, s->use_tep, non_ecm_get_bit, user_data); v29_tx_set_modem_status_handler(&s->fast_modems.v29_tx, modem_tx_status, user_data); v27ter_rx_init(&s->fast_modems.v27ter_rx, 4800, non_ecm_put_bit, user_data); v27ter_tx_init(&s->fast_modems.v27ter_tx, 4800, s->use_tep, non_ecm_get_bit, user_data); v27ter_tx_set_modem_status_handler(&s->fast_modems.v27ter_tx, modem_tx_status, user_data); silence_gen_init(&s->silence_gen, 0); modem_connect_tones_tx_init(&s->connect_tx, MODEM_CONNECT_TONES_FAX_CNG); modem_connect_tones_rx_init(&s->connect_rx, MODEM_CONNECT_TONES_FAX_CNG, tone_detected, user_data); dc_restore_init(&s->dc_restore); s->rx_signal_present = FALSE; s->rx_handler = (span_rx_handler_t *) &span_dummy_rx; s->rx_user_data = NULL; s->tx_handler = (span_tx_handler_t *) &silence_gen; s->tx_user_data = &s->silence_gen; } /*- End of function --------------------------------------------------------*/ faxtester_state_t *faxtester_init(faxtester_state_t *s, int calling_party) { if (s == NULL) { if ((s = (faxtester_state_t *) malloc(sizeof(*s))) == NULL) return NULL; } memset(s, 0, sizeof(*s)); span_log_init(&s->logging, SPAN_LOG_NONE, NULL); span_log_set_protocol(&s->logging, "TST"); faxtester_fax_modems_init(&s->modems, FALSE, s); faxtester_set_timeout(s, -1); faxtester_set_tx_type(s, T30_MODEM_NONE, 0, FALSE, FALSE); return s; } /*- End of function --------------------------------------------------------*/ int faxtester_release(faxtester_state_t *s) { return 0; } /*- End of function --------------------------------------------------------*/ int faxtester_free(faxtester_state_t *s) { free(s); return 0; } /*- End of function --------------------------------------------------------*/ void faxtester_set_flush_handler(faxtester_state_t *s, faxtester_flush_handler_t handler, void *user_data) { s->flush_handler = handler; s->flush_user_data = user_data; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/modem_monitor.h0000664000175000017500000000464111422612267014303 00000000000000/* * SpanDSP - a series of DSP components for telephony * * constel.h - Display QAM constellations, using the FLTK toolkit. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page constel_page Modem performance monitoring \section constel_page_sec_1 What does it do? This code controls a GUI window, which provides monitoring of the internal status of a modem. It shows, graphically: - the constellation, for PSK, QAM and other similar modulations. - the equalizer status, for modems with adaptive equalizers. - the carrier frequency. - the symbol timing correction. \section constel_page_sec_2 How does it work? This code uses the FLTK cross platform GUI toolkit. It works on X11 and Windows platforms. In addition to the basic FLTK toolkit, fltk_cartesian is also required. */ #if !defined(_MODEM_MONITOR_H_) #define _MODEM_MONITOR_H_ struct qam_monitor_s; typedef struct qam_monitor_s qam_monitor_t; #if defined(__cplusplus) extern "C" { #endif qam_monitor_t *qam_monitor_init(float constel_width, const char *tag); int qam_monitor_clear_constel(qam_monitor_t *s); int qam_monitor_update_constel(qam_monitor_t *s, const complexf_t *pt); int qam_monitor_update_equalizer(qam_monitor_t *s, const complexf_t *coeffs, int len); int qam_monitor_update_int_equalizer(qam_monitor_t *s, const complexi16_t *coeffs, int len); int qam_monitor_update_symbol_tracking(qam_monitor_t *s, float total_correction); int qam_monitor_update_carrier_tracking(qam_monitor_t *s, float carrier); int qam_monitor_update_audio_level(qam_monitor_t *s, const int16_t amp[], int len); void qam_wait_to_end(qam_monitor_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/super_tone_tx_tests.c0000664000175000017500000002134412350611110015530 00000000000000/* * SpanDSP - a series of DSP components for telephony * * super_tone_generate_tests.c * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page super_tone_tx_tests_page Supervisory tone generation tests \section super_tone_tx_tests_page_sec_1 What does it do? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #include #include #include #include #if defined(HAVE_LIBXML_XMLMEMORY_H) #include #endif #if defined(HAVE_LIBXML_PARSER_H) #include #endif #if defined(HAVE_LIBXML_XINCLUDE_H) #include #endif //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define OUT_FILE_NAME "super_tone.wav" SNDFILE *outhandle; super_tone_tx_step_t *tone_tree = NULL; #if defined(HAVE_LIBXML2) static void play_tones(super_tone_tx_state_t *tone, int max_samples) { int16_t amp[8000]; int len; int outframes; int i; int total_length; i = 500; total_length = 0; do { len = super_tone_tx(tone, amp, 160); outframes = sf_writef_short(outhandle, amp, len); if (outframes != len) { fprintf(stderr, " Error writing audio file\n"); exit(2); } total_length += len; } while (len > 0 && --i > 0); printf("Tone length = %d samples (%dms)\n", total_length, total_length/8); } /*- End of function --------------------------------------------------------*/ static int parse_tone(super_tone_tx_step_t **tree, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { xmlChar *x; float f1; float f2; float f_tol; float l1; float l2; float length; float length_tol; int cycles; super_tone_tx_step_t *treep; cur = cur->xmlChildrenNode; while (cur) { if (xmlStrcmp(cur->name, (const xmlChar *) "step") == 0) { printf("Step - "); /* Set some defaults */ f1 = 0.0; f2 = 0.0; f_tol = 1.0; l1 = -11.0; l2 = -11.0; length = 0.0; length_tol = 10.0; cycles = 1; if ((x = xmlGetProp(cur, (const xmlChar *) "freq"))) { sscanf((char *) x, "%f [%f%%]", &f1, &f_tol); sscanf((char *) x, "%f+%f [%f%%]", &f1, &f2, &f_tol); printf("Frequency=%.2f+%.2f [%.2f%%]", f1, f2, f_tol); xmlFree(x); } if ((x = xmlGetProp(cur, (const xmlChar *) "level"))) { if (sscanf((char *) x, "%f+%f", &l1, &l2) < 2) l2 = l1; printf("Level=%.2f+%.2f", l1, l2); xmlFree(x); } if ((x = xmlGetProp(cur, (const xmlChar *) "length"))) { sscanf((char *) x, "%f [%f%%]", &length, &length_tol); printf("Length=%.2f [%.2f%%]", length, length_tol); xmlFree(x); } if ((x = xmlGetProp(cur, (const xmlChar *) "recognition-length"))) { printf("Recognition length='%s'", x); xmlFree(x); } if ((x = xmlGetProp(cur, (const xmlChar *) "cycles"))) { if (strcasecmp((char *) x, "endless") == 0) cycles = 0; else cycles = atoi((char *) x); printf("Cycles=%d ", cycles); xmlFree(x); } if ((x = xmlGetProp(cur, (const xmlChar *) "recorded-announcement"))) { printf("Recorded announcement='%s'", x); xmlFree(x); } printf("\n"); treep = super_tone_tx_make_step(NULL, f1, l1, f2, l2, length*1000.0 + 0.5, cycles); *tree = treep; tree = &treep->next; parse_tone(&treep->nest, doc, ns, cur); } /*endif*/ cur = cur->next; } /*endwhile*/ return 0; } /*- End of function --------------------------------------------------------*/ static void parse_tone_set(xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { super_tone_tx_state_t tone; printf("Parsing tone set\n"); cur = cur->xmlChildrenNode; while (cur) { if (strcmp((char *) cur->name + strlen((char *) cur->name) - 5, "-tone") == 0) { printf("Hit %s\n", cur->name); tone_tree = NULL; parse_tone(&tone_tree, doc, ns, cur); super_tone_tx_init(&tone, tone_tree); //printf("Len %p %p %d %d\n", (void *) tone.levels[0], (void *) tone_tree, tone_tree->length, tone_tree->tone); play_tones(&tone, 99999999); super_tone_tx_free_tone(tone_tree); } /*endif*/ cur = cur->next; } /*endwhile*/ } /*- End of function --------------------------------------------------------*/ static void get_tone_set(const char *tone_file, const char *set_id) { xmlParserCtxtPtr ctxt; xmlDocPtr doc; xmlNsPtr ns; xmlNodePtr cur; xmlChar *x; ns = NULL; xmlKeepBlanksDefault(0); xmlCleanupParser(); if ((ctxt = xmlNewParserCtxt()) == NULL) { fprintf(stderr, "Failed to allocate parser context\n"); printf("Test failed\n"); exit(2); } /* parse the file, activating the DTD validation option */ if ((doc = xmlCtxtReadFile(ctxt, tone_file, NULL, XML_PARSE_XINCLUDE | XML_PARSE_DTDVALID)) == NULL) { fprintf(stderr, "Failed to read the XML document\n"); printf("Test failed\n"); exit(2); } if (ctxt->valid == 0) { fprintf(stderr, "Failed to validate the XML document\n"); xmlFreeDoc(doc); xmlFreeParserCtxt(ctxt); printf("Test failed\n"); exit(2); } xmlFreeParserCtxt(ctxt); /* Check the document is of the right kind */ if ((cur = xmlDocGetRootElement(doc)) == NULL) { fprintf(stderr, "Empty document\n"); xmlFreeDoc(doc); exit(2); } /*endif*/ if (xmlStrcmp(cur->name, (const xmlChar *) "global-tones")) { fprintf(stderr, "Document of the wrong type, root node != global-tones"); xmlFreeDoc(doc); exit(2); } /*endif*/ cur = cur->xmlChildrenNode; while (cur && xmlIsBlankNode(cur)) cur = cur->next; /*endwhile*/ if (cur == NULL) exit(2); /*endif*/ while (cur) { if (xmlStrcmp(cur->name, (const xmlChar *) "tone-set") == 0) { if ((x = xmlGetProp(cur, (const xmlChar *) "uncode"))) { if (strcmp((char *) x, set_id) == 0) parse_tone_set(doc, ns, cur); /*endif*/ xmlFree(x); } /*endif*/ } /*endif*/ cur = cur->next; } /*endwhile*/ xmlFreeDoc(doc); } /*- End of function --------------------------------------------------------*/ #endif int main(int argc, char *argv[]) { if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", OUT_FILE_NAME); exit(2); } #if defined(HAVE_LIBXML2) get_tone_set("../spandsp/global-tones.xml", (argc > 1) ? argv[1] : "hk"); #endif if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME); exit(2); } printf("Done\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/tsb85_tests.sh0000775000175000017500000000515112350635040014000 00000000000000#!/bin/sh # # spandsp fax tests # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 2.1, # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. run_tsb85_test() { rm -f fax_tests_1.tif echo ./tsb85_tests ${TEST} ./tsb85_tests ${TEST} 2>xyzzy2 RETVAL=$? if [ $RETVAL != 0 ] then echo tsb85_tests ${TEST} failed! exit $RETVAL fi } for TEST in MRGN01 MRGN02 MRGN03 MRGN04 MRGN05 MRGN06a MRGN06b MRGN07 MRGN08 do run_tsb85_test done for TEST in MRGN09 MRGN10 MRGN11 MRGN12 MRGN13 MRGN14 MRGN15 MRGN16 MRGN17 do run_tsb85_test done for TEST in ORGC01 ORGC02 ORGC03 do run_tsb85_test done for TEST in OREN01 OREN02 OREN03 OREN04 OREN05 OREN06 OREN07 OREN08 OREN09 OREN10 do run_tsb85_test done for TEST in MRGX01 MRGX02 MRGX03 MRGX04 MRGX05 MRGX06 MRGX07 MRGX08 do run_tsb85_test done for TEST in MRGX09 MRGX10 MRGX11 MRGX12 MRGX13 MRGX14 MRGX15 do run_tsb85_test done for TEST in MTGP01 MTGP02 OTGP03 do run_tsb85_test done for TEST in MTGN01 MTGN02 MTGN03 MTGN04 MTGN05 MTGN06 MTGN07 MTGN08 MTGN09 MTGN10 do run_tsb85_test done for TEST in MTGN11 MTGN12 MTGN13 MTGN14 MTGN15 MTGN16 MTGN17 MTGN18 MTGN19 MTGN20 do run_tsb85_test done for TEST in MTGN21 MTGN22 MTGN23 MTGN24 MTGN25 MTGN26 MTGN27 MTGN28 do run_tsb85_test done for TEST in OTGC01 OTGC02 OTGC03 OTGC04 OTGC05 OTGC06 OTGC07 OTGC08 do run_tsb85_test done for TEST in OTGC09-01 OTGC09-02 OTGC09-03 OTGC09-04 OTGC09-05 OTGC09-06 OTGC09-07 OTGC09-08 OTGC09-09 OTGC09-10 OTGC09-11 OTGC09-12 do run_tsb85_test done for TEST in OTGC10 OTGC11 do run_tsb85_test done for TEST in OTEN01 OTEN02 OTEN03 OTEN04 OTEN05 OTEN06 do run_tsb85_test done for TEST in MTGX01 MTGX02 MTGX03 MTGX04 MTGX05 MTGX06 MTGX07 MTGX08 do run_tsb85_test done for TEST in MTGX09 MTGX10 MTGX11 MTGX12 MTGX13 MTGX14 MTGX15 MTGX16 do run_tsb85_test done for TEST in MTGX17 MTGX18 MTGX19 MTGX20 MTGX21 MTGX22 MTGX23 do run_tsb85_test done for TEST in MRGP01 MRGP02 MRGP03 MRGP04 MRGP05 MRGP06 MRGP07 MRGP08 do run_tsb85_test done for TEST in ORGP09 ORGP10 do run_tsb85_test done spandsp-0.0.6/tests/complex_vector_float_tests.c0000664000175000017500000000755011422612266017067 00000000000000/* * SpanDSP - a series of DSP components for telephony * * complex_vector_float_tests.c * * Written by Steve Underwood * * Copyright (C) 2006,2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include "spandsp.h" static void cvec_mulf_dumb(complexf_t z[], const complexf_t x[], const complexf_t y[], int n) { int i; for (i = 0; i < n; i++) { z[i].re = x[i].re*y[i].re - x[i].im*y[i].im; z[i].im = x[i].re*y[i].im + x[i].im*y[i].re; } } /*- End of function --------------------------------------------------------*/ static int test_cvec_mulf(void) { int i; complexf_t x[100]; complexf_t y[100]; complexf_t za[100]; complexf_t zb[100]; complexf_t ratio; for (i = 0; i < 99; i++) { x[i].re = rand(); x[i].im = rand(); y[i].re = rand(); y[i].im = rand(); } cvec_mulf(za, x, y, 99); cvec_mulf_dumb(zb, x, y, 99); for (i = 0; i < 99; i++) printf("(%f,%f) (%f,%f) (%f,%f)\n", za[i].re, za[i].im, x[i].re, x[i].im, y[i].re, y[i].im); for (i = 0; i < 99; i++) { ratio.re = za[i].re/zb[i].re; ratio.im = za[i].im/zb[i].im; if ((ratio.re < 0.9999 || ratio.re > 1.0001) || (ratio.im < 0.9999 || ratio.im > 1.0001)) { printf("cvec_mulf() - (%f,%f) (%f,%f)\n", za[i].re, za[i].im, zb[i].re, zb[i].im); printf("Tests failed\n"); exit(2); } } return 0; } /*- End of function --------------------------------------------------------*/ static complexf_t cvec_dot_prodf_dumb(const complexf_t x[], const complexf_t y[], int n) { int i; complexf_t z; complexf_t z1; z = complex_setf(0.0f, 0.0f); for (i = 0; i < n; i++) { z1 = complex_mulf(&x[i], &y[i]); z = complex_addf(&z, &z1); } return z; } /*- End of function --------------------------------------------------------*/ static int test_cvec_dot_prodf(void) { int i; complexf_t x[100]; complexf_t y[100]; complexf_t zsa; complexf_t zsb; complexf_t ratio; for (i = 0; i < 99; i++) { x[i].re = rand(); x[i].im = rand(); y[i].re = rand(); y[i].im = rand(); } for (i = 1; i < 99; i++) { zsa = cvec_dot_prodf(x, y, i); zsb = cvec_dot_prodf_dumb(x, y, i); ratio.re = zsa.re/zsb.re; ratio.im = zsa.im/zsb.im; if ((ratio.re < 0.9999 || ratio.re > 1.0001) || (ratio.im < 0.9999 || ratio.im > 1.0001)) { printf("cvec_dot_prodf() - (%f,%f) (%f,%f)\n", zsa.re, zsa.im, zsb.re, zsb.im); printf("Tests failed\n"); exit(2); } } return 0; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { test_cvec_mulf(); test_cvec_dot_prodf(); printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/dtmf_rx_tests.c0000664000175000017500000007564712101212477014323 00000000000000/* * SpanDSP - a series of DSP components for telephony * * dtmf_rx_tests.c - Test the DTMF detector against the spec., whatever the spec. * may be :) * * Written by Steve Underwood * * Copyright (C) 2001, 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * These tests include conversion to and from A-law. I assume the * distortion this produces is comparable to u-law, so it should be * a fair test. * * These tests mirror those on the CM7291 test tape from Mitel. * Many of these tests are highly questionable, but they are a * well accepted industry standard. * * However standard these tests might be, Mitel appears to have stopped * selling copies of their tape. * * For the talk-off test the Bellcore tapes may be used. However, they are * copyright material, so the test data files produced from the Bellcore * tapes cannot be distributed as a part of this package. * */ /*! \page dtmf_rx_tests_page DTMF receiver tests \section dtmf_rx_tests_page_sec_1 What does it do? The DTMF detection test suite performs similar tests to the Mitel test tape, traditionally used for testing DTMF receivers. Mitel seem to have discontinued this product, but all it not lost. The first side of the Mitel tape consists of a number of tone and tone+noise based tests. The test suite synthesizes equivalent test data. Being digitally generated, this data is rather more predictable than the test data on the nasty old stretchy cassette tapes which Mitel sold. The second side of the Mitel tape contains fragments of real speech from real phone calls captured from the North American telephone network. These are considered troublesome for DTMF detectors. A good detector is expected to achieve a reasonably low number of false detections on this data. Fresh clean copies of this seem to be unobtainable. However, Bellcore produce a much more aggressive set of three cassette tapes. All six side (about 30 minutes each) are filled with much tougher fragments of real speech from the North American telephone network. If you can do well in this test, nobody cares about your results against the Mitel test tape. A fresh set of tapes was purchased for these tests, and digitised, producing 6 wave files of 16 bit signed PCM data, sampled at 8kHz. They were transcribed using a speed adjustable cassette player. The test tone at the start of the tapes is pretty accurate, and the new tapes should not have had much opportunity to stretch. It is believed these transcriptions are about as good as the source material permits. PLEASE NOTE These transcriptions may be freely used by anyone who has a legitimate copy of the original tapes. However, if you don't have a legitimate copy of those tapes, you also have no right to use this data. The original tapes are the copyright material of BellCore, and they charge over US$200 for a set. I doubt they sell enough copies to consider this much of a business. However, it is their data, and it is their right to do as they wish with it. Currently I see no indication they wish to give it away for free. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" /* Basic DTMF specs: * * Minimum tone on = 40ms * Minimum tone off = 50ms * Maximum digit rate = 10 per second * Normal twist <= 8dB accepted * Reverse twist <= 4dB accepted * S/N >= 15dB will detect OK * Attenuation <= 26dB will detect OK * Frequency tolerance +- 1.5% will detect, +-3.5% will reject */ #define DEFAULT_DTMF_TX_LEVEL -10 #define DEFAULT_DTMF_TX_ON_TIME 50 #define DEFAULT_DTMF_TX_OFF_TIME 50 #define SAMPLES_PER_CHUNK 160 #define ALL_POSSIBLE_DIGITS "123A456B789C*0#D" #define MITEL_DIR "../test-data/mitel/" #define BELLCORE_DIR "../test-data/bellcore/" const char *bellcore_files[] = { MITEL_DIR "mitel-cm7291-talkoff.wav", BELLCORE_DIR "tr-tsy-00763-1.wav", BELLCORE_DIR "tr-tsy-00763-2.wav", BELLCORE_DIR "tr-tsy-00763-3.wav", BELLCORE_DIR "tr-tsy-00763-4.wav", BELLCORE_DIR "tr-tsy-00763-5.wav", BELLCORE_DIR "tr-tsy-00763-6.wav", "" }; static tone_gen_descriptor_t my_dtmf_digit_tones[16]; float dtmf_row[] = { 697.0f, 770.0f, 852.0f, 941.0f }; float dtmf_col[] = { 1209.0f, 1336.0f, 1477.0f, 1633.0f }; char dtmf_positions[] = "123A" "456B" "789C" "*0#D"; int callback_hit; int callback_ok; int callback_roll; int step; int max_forward_twist; int max_reverse_twist; int use_dialtone_filter = FALSE; char *decode_test_file = NULL; static int16_t amp[1000000]; static int16_t amp2[1000000]; codec_munge_state_t *munge = NULL; static void my_dtmf_gen_init(float low_fudge, int low_level, float high_fudge, int high_level, int duration, int gap) { int row; int col; for (row = 0; row < 4; row++) { for (col = 0; col < 4; col++) { tone_gen_descriptor_init(&my_dtmf_digit_tones[row*4 + col], dtmf_row[row]*(1.0f + low_fudge), low_level, dtmf_col[col]*(1.0f + high_fudge), high_level, duration, gap, 0, 0, FALSE); } } } /*- End of function --------------------------------------------------------*/ static int my_dtmf_generate(int16_t amp[], const char *digits) { int len; char *cp; tone_gen_state_t tone; len = 0; while (*digits) { cp = strchr(dtmf_positions, *digits); if (cp) { tone_gen_init(&tone, &my_dtmf_digit_tones[cp - dtmf_positions]); len += tone_gen(&tone, amp + len, 1000); } digits++; } return len; } /*- End of function --------------------------------------------------------*/ static void digit_delivery(void *data, const char *digits, int len) { int i; int seg; const char *s = ALL_POSSIBLE_DIGITS; const char *t; callback_hit = TRUE; if (data == (void *) 0x12345678) { t = s + callback_roll; seg = 16 - callback_roll; for (i = 0; i < len; i += seg, seg = 16) { if (i + seg > len) seg = len - i; if (memcmp(digits + i, t, seg)) { callback_ok = FALSE; printf("Fail at %d %d\n", i, seg); break; } t = s; callback_roll = (callback_roll + seg)%16; } } else { callback_ok = FALSE; } } /*- End of function --------------------------------------------------------*/ static void digit_status(void *data, int signal, int level, int delay) { const char *s = ALL_POSSIBLE_DIGITS; int len; static int last_step = 0; static int first = TRUE; //printf("Digit status %d %d %d\n", signal, level, delay); callback_hit = TRUE; len = step - last_step; if (data == (void *) 0x12345678) { if (len < 320 || len > 480) { if (first) { /* At the beginning the apparent duration is expected to be wrong */ first = FALSE; } else { printf("Failed for signal %s length %d at %d\n", (callback_roll & 1) ? "on" : "off", len, step); callback_ok = FALSE; } } if (callback_roll & 1) { if (signal != 0) { printf("Failed for signal 0x%X instead of 0\n", signal); callback_ok = FALSE; } } else { if (signal != s[callback_roll >> 1]) { printf("Failed for signal 0x%X instead of 0x%X\n", signal, s[callback_roll >> 1]); callback_ok = FALSE; } if (level < DEFAULT_DTMF_TX_LEVEL + 3 - 1 || level > DEFAULT_DTMF_TX_LEVEL + 3 + 1) { printf("Failed for level %d instead of %d\n", level, DEFAULT_DTMF_TX_LEVEL + 3); callback_ok = FALSE; } } if (++callback_roll >= 32) callback_roll = 0; } else { callback_ok = FALSE; } last_step = step; } /*- End of function --------------------------------------------------------*/ static void mitel_cm7291_side_1_tests(void) { int i; int j; int len; int sample; const char *s; char digit[2]; char buf[128 + 1]; int actual; int nplus; int nminus; float rrb; float rcfo; dtmf_rx_state_t *dtmf_state; awgn_state_t noise_source; logging_state_t *logging; dtmf_state = dtmf_rx_init(NULL, NULL, NULL); if (use_dialtone_filter || max_forward_twist >= 0 || max_reverse_twist >= 0) dtmf_rx_parms(dtmf_state, use_dialtone_filter, max_forward_twist, max_reverse_twist, -99); logging = dtmf_rx_get_logging_state(dtmf_state); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "DTMF-rx"); /* Test 1: Mitel's test 1 isn't really a test. Its a calibration step, which has no meaning here. */ printf("Test 1: Calibration\n"); printf(" Passed\n"); /* Test 2: Decode check This is a sanity check, that all digits are reliably detected under ideal conditions. Each possible digit repeated 10 times, with 50ms bursts. The level of each tone is about 6dB down from clip. 6dB down actually causes trouble with G.726, so we use 7dB down. */ printf("Test 2: Decode check\n"); my_dtmf_gen_init(0.0f, -4, 0.0f, -4, 50, 50); s = ALL_POSSIBLE_DIGITS; digit[1] = '\0'; while (*s) { digit[0] = *s++; for (i = 0; i < 10; i++) { len = my_dtmf_generate(amp, digit); codec_munge(munge, amp, len); dtmf_rx(dtmf_state, amp, len); actual = dtmf_rx_get(dtmf_state, buf, 128); if (actual != 1 || buf[0] != digit[0]) { printf(" Sent '%s'\n", digit); printf(" Received '%s'\n", buf); printf(" Failed\n"); exit(2); } } } printf(" Passed\n"); /* Test 3: Recognition bandwidth and channel centre frequency check. Use only the diagonal pairs of tones (digits 1, 5, 9 and D). Each tone pair requires four test to complete the check, making 16 sections overall. Each section contains 40 pulses of 50ms duration, with an amplitude of -20dB from clip per frequency. Four sections covering the tests for one tone (1 digit) are: a. H frequency at 0% deviation from center, L frequency at +0.1%. L frequency is then increments in +01.% steps up to +4%. The number of tone bursts is noted and designated N+. b. H frequency at 0% deviation, L frequency at -0.1%. L frequency is then incremental in -0.1% steps, up to -4%. The number of tone bursts is noted and designated N-. c. The test in (a) is repeated with the L frequency at 0% and the H frequency varied up to +4%. d. The test in (b) is repeated with the L frequency and 0% and the H frequency varied to -4%. Receiver Recognition Bandwidth (RRB) is calculated as follows: RRB% = (N+ + N-)/10 Receiver Center Frequency Offset (RCFO) is calculated as follows: RCFO% = X + (N+ - N-)/20 Note that this test doesn't test what it says it is testing at all, and the results are quite inaccurate, if not a downright lie! However, it follows the Mitel procedure, so how can it be bad? :) */ printf("Test 3: Recognition bandwidth and channel centre frequency check\n"); s = "159D"; digit[1] = '\0'; while (*s) { digit[0] = *s++; for (nplus = 0, i = 1; i <= 60; i++) { my_dtmf_gen_init((float) i/1000.0f, -17, 0.0f, -17, 50, 50); len = my_dtmf_generate(amp, digit); codec_munge(munge, amp, len); dtmf_rx(dtmf_state, amp, len); nplus += dtmf_rx_get(dtmf_state, buf, 128); } for (nminus = 0, i = -1; i >= -60; i--) { my_dtmf_gen_init((float) i/1000.0f, -17, 0.0f, -17, 50, 50); len = my_dtmf_generate(amp, digit); codec_munge(munge, amp, len); dtmf_rx(dtmf_state, amp, len); nminus += dtmf_rx_get(dtmf_state, buf, 128); } rrb = (float) (nplus + nminus)/10.0f; rcfo = (float) (nplus - nminus)/10.0f; printf(" %c (low) rrb = %5.2f%%, rcfo = %5.2f%%, max -ve = %5.2f, max +ve = %5.2f\n", digit[0], rrb, rcfo, (float) nminus/10.0f, (float) nplus/10.0f); if (rrb < 3.0f + rcfo || rrb >= 15.0f + rcfo) { printf(" Failed\n"); exit(2); } for (nplus = 0, i = 1; i <= 60; i++) { my_dtmf_gen_init(0.0f, -17, (float) i/1000.0f, -17, 50, 50); len = my_dtmf_generate(amp, digit); codec_munge(munge, amp, len); dtmf_rx(dtmf_state, amp, len); nplus += dtmf_rx_get(dtmf_state, buf, 128); } for (nminus = 0, i = -1; i >= -60; i--) { my_dtmf_gen_init(0.0f, -17, (float) i/1000.0f, -17, 50, 50); len = my_dtmf_generate(amp, digit); codec_munge(munge, amp, len); dtmf_rx(dtmf_state, amp, len); nminus += dtmf_rx_get(dtmf_state, buf, 128); } rrb = (float) (nplus + nminus)/10.0f; rcfo = (float) (nplus - nminus)/10.0f; printf(" %c (high) rrb = %5.2f%%, rcfo = %5.2f%%, max -ve = %5.2f, max +ve = %5.2f\n", digit[0], rrb, rcfo, (float) nminus/10.0f, (float) nplus/10.0f); if (rrb < 3.0f + rcfo || rrb >= 15.0f + rcfo) { printf(" Failed\n"); exit(2); } } printf(" Passed\n"); /* Test 4: Acceptable amplitude ratio (twist). Use only the diagonal pairs of tones (digits 1, 5, 9 and D). There are eight sections to the test. Each section contains 200 pulses with a 50ms duration for each pulse. Initially the amplitude of both tones is 6dB down from clip. The two sections to test one tone pair are: a. Standard Twist: H tone amplitude is maintained at -6dB from clip, L tone amplitude is attenuated gradually until the amplitude ratio L/H is -20dB. Note the number of responses from the receiver. b. Reverse Twist: L tone amplitude is maintained at -6dB from clip, H tone amplitude is attenuated gradually until the amplitude ratio is 20dB. Note the number of responses from the receiver. All tone bursts are of 50ms duration. The Acceptable Amplitude Ratio in dB is equal to the number of responses registered in (a) or (b), divided by 10. TODO: This is supposed to work in 1/10dB steps, but here I used 1dB steps, as the current tone generator has its amplitude set in 1dB steps. */ printf("Test 4: Acceptable amplitude ratio (twist)\n"); s = "159D"; digit[1] = '\0'; while (*s) { digit[0] = *s++; for (nplus = 0, i = -30; i >= -230; i--) { my_dtmf_gen_init(0.0f, -3, 0.0f, i/10, 50, 50); len = my_dtmf_generate(amp, digit); codec_munge(munge, amp, len); dtmf_rx(dtmf_state, amp, len); nplus += dtmf_rx_get(dtmf_state, buf, 128); } printf(" %c normal twist = %.2fdB\n", digit[0], (float) nplus/10.0); if (nplus < 80) { printf(" Failed\n"); exit(2); } for (nminus = 0, i = -30; i >= -230; i--) { my_dtmf_gen_init(0.0f, i/10, 0.0f, -3, 50, 50); len = my_dtmf_generate(amp, digit); codec_munge(munge, amp, len); dtmf_rx(dtmf_state, amp, len); nminus += dtmf_rx_get(dtmf_state, buf, 128); } printf(" %c reverse twist = %.2fdB\n", digit[0], (float) nminus/10.0); if (nminus < 40) { printf(" Failed\n"); exit(2); } } printf(" Passed\n"); /* Test 5: Dynamic range This test utilizes tone pair L1 H1 (digit 1). Thirty-five tone pair pulses are transmitted, with both frequencies stating at -6dB from clip. The amplitude of each is gradually attenuated by -35dB at a rate of 1dB per pulse. The Dynamic Range in dB is equal to the number of responses from the receiver during the test. Well not really, but that is the Mitel test. Lets sweep a bit further, and see what the real range is */ printf("Test 5: Dynamic range\n"); for (nplus = 0, i = +3; i >= -50; i--) { my_dtmf_gen_init(0.0f, i, 0.0f, i, 50, 50); len = my_dtmf_generate(amp, "1"); codec_munge(munge, amp, len); dtmf_rx(dtmf_state, amp, len); nplus += dtmf_rx_get(dtmf_state, buf, 128); } printf(" Dynamic range = %ddB\n", nplus); /* We ought to set some pass/fail condition, even if Mitel did not. If we don't, regression testing is weakened. */ if (nplus < 35) { printf(" Failed\n"); exit(2); } printf(" Passed\n"); /* Test 6: Guard time This test utilizes tone pair L1 H1 (digit 1). Four hundred pulses are transmitted at an amplitude of -6dB from clip per frequency. Pulse duration starts at 49ms and is gradually reduced to 10ms. Guard time in ms is equal to (500 - number of responses)/10. That is the Mitel test, and we will follow it. Its totally bogus, though. Just what the heck is a pass or fail here? */ printf("Test 6: Guard time\n"); for (nplus = 0, i = 490; i >= 100; i--) { my_dtmf_gen_init(0.0f, -3, 0.0f, -3, i/10, 50); len = my_dtmf_generate(amp, "1"); codec_munge(munge, amp, len); dtmf_rx(dtmf_state, amp, len); nplus += dtmf_rx_get(dtmf_state, buf, 128); } printf(" Guard time = %dms\n", (500 - nplus)/10); printf(" Passed\n"); /* Test 7: Acceptable signal to noise ratio This test utilizes tone pair L1 H1, transmitted on a noise background. The test consists of three sections in which the tone pair is transmitted 1000 times at an amplitude -6dB from clip per frequency, but with a different white noise level for each section. The first level is -24dBV, the second -18dBV and the third -12dBV.. The acceptable signal to noise ratio is the lowest ratio of signal to noise in the test where the receiver responds to all 1000 pulses. Well, that is the Mitel test, but it doesn't tell you what the decoder can really do. Lets do a more comprehensive test */ printf("Test 7: Acceptable signal to noise ratio\n"); my_dtmf_gen_init(0.0f, -4, 0.0f, -4, 50, 50); for (j = -13; j > -50; j--) { awgn_init_dbm0(&noise_source, 1234567, (float) j); for (i = 0; i < 1000; i++) { len = my_dtmf_generate(amp, "1"); // TODO: Clip for (sample = 0; sample < len; sample++) amp[sample] = saturate(amp[sample] + awgn(&noise_source)); codec_munge(munge, amp, len); dtmf_rx(dtmf_state, amp, len); if (dtmf_rx_get(dtmf_state, buf, 128) != 1) break; } if (i == 1000) break; } printf(" Acceptable S/N ratio is %ddB\n", -4 - j); if (-4 - j > 26) { printf(" Failed\n"); exit(2); } printf(" Passed\n"); } /*- End of function --------------------------------------------------------*/ static void mitel_cm7291_side_2_and_bellcore_tests(void) { int i; int j; int len; int hits; int hit_types[256]; char buf[128 + 1]; SNDFILE *inhandle; int frames; dtmf_rx_state_t *dtmf_state; logging_state_t *logging; dtmf_state = dtmf_rx_init(NULL, NULL, NULL); if (use_dialtone_filter || max_forward_twist >= 0 || max_reverse_twist >= 0) dtmf_rx_parms(dtmf_state, use_dialtone_filter, max_forward_twist, max_reverse_twist, -99); logging = dtmf_rx_get_logging_state(dtmf_state); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "DTMF-rx"); /* The remainder of the Mitel tape is the talk-off test */ /* Here we use the Bellcore test tapes (much tougher), in six files - 1 from each side of the original 3 cassette tapes */ /* Bellcore say you should get no more than 470 false detections with a good receiver. Dialogic claim 20. Of course, we can do better than that, eh? */ printf("Test 8: Talk-off test\n"); memset(hit_types, '\0', sizeof(hit_types)); for (j = 0; bellcore_files[j][0]; j++) { if ((inhandle = sf_open_telephony_read(bellcore_files[j], 1)) == NULL) { printf(" Cannot open speech file '%s'\n", bellcore_files[j]); exit(2); } hits = 0; while ((frames = sf_readf_short(inhandle, amp, SAMPLE_RATE))) { dtmf_rx(dtmf_state, amp, frames); len = dtmf_rx_get(dtmf_state, buf, 128); if (len > 0) { for (i = 0; i < len; i++) hit_types[(int) buf[i]]++; hits += len; } } if (sf_close_telephony(inhandle)) { printf(" Cannot close speech file '%s'\n", bellcore_files[j]); exit(2); } printf(" File %d gave %d false hits.\n", j + 1, hits); } for (i = 0, j = 0; i < 256; i++) { if (hit_types[i]) { printf(" Digit %c had %d false hits\n", i, hit_types[i]); j += hit_types[i]; } } printf(" %d hits in total\n", j); if (j > 470) { printf(" Failed\n"); exit(2); } printf(" Passed\n"); } /*- End of function --------------------------------------------------------*/ static void dial_tone_tolerance_tests(void) { int i; int j; int len; int sample; char buf[128 + 1]; dtmf_rx_state_t *dtmf_state; tone_gen_descriptor_t dial_tone_desc; tone_gen_state_t dial_tone; logging_state_t *logging; dtmf_state = dtmf_rx_init(NULL, NULL, NULL); if (use_dialtone_filter || max_forward_twist >= 0 || max_reverse_twist >= 0) dtmf_rx_parms(dtmf_state, use_dialtone_filter, max_forward_twist, max_reverse_twist, -99); logging = dtmf_rx_get_logging_state(dtmf_state); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "DTMF-rx"); /* Test dial tone tolerance */ printf("Test: Dial tone tolerance.\n"); my_dtmf_gen_init(0.0f, -15, 0.0f, -15, DEFAULT_DTMF_TX_ON_TIME, DEFAULT_DTMF_TX_OFF_TIME); for (j = -30; j < -3; j++) { tone_gen_descriptor_init(&dial_tone_desc, 350, j, 440, j, 1, 0, 0, 0, TRUE); tone_gen_init(&dial_tone, &dial_tone_desc); for (i = 0; i < 10; i++) { len = my_dtmf_generate(amp, ALL_POSSIBLE_DIGITS); tone_gen(&dial_tone, amp2, len); for (sample = 0; sample < len; sample++) amp[sample] = saturate(amp[sample] + amp2[sample]); codec_munge(munge, amp, len); dtmf_rx(dtmf_state, amp, len); if (dtmf_rx_get(dtmf_state, buf, 128) != strlen(ALL_POSSIBLE_DIGITS)) break; } if (i != 10) break; } printf(" Acceptable signal to dial tone ratio is %ddB\n", -15 - j); if ((use_dialtone_filter && (-15 - j) > -12) || (!use_dialtone_filter && (-15 - j) > 10)) { printf(" Failed\n"); exit(2); } printf(" Passed\n"); } /*- End of function --------------------------------------------------------*/ static void callback_function_tests(void) { int i; int j; int len; int sample; dtmf_rx_state_t *dtmf_state; logging_state_t *logging; /* Test the callback mode for delivering detected digits */ printf("Test: Callback digit delivery mode.\n"); callback_hit = FALSE; callback_ok = TRUE; callback_roll = 0; dtmf_state = dtmf_rx_init(NULL, digit_delivery, (void *) 0x12345678); if (use_dialtone_filter || max_forward_twist >= 0 || max_reverse_twist >= 0) dtmf_rx_parms(dtmf_state, use_dialtone_filter, max_forward_twist, max_reverse_twist, -99); logging = dtmf_rx_get_logging_state(dtmf_state); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "DTMF-rx"); my_dtmf_gen_init(0.0f, DEFAULT_DTMF_TX_LEVEL, 0.0f, DEFAULT_DTMF_TX_LEVEL, DEFAULT_DTMF_TX_ON_TIME, DEFAULT_DTMF_TX_OFF_TIME); for (i = 1; i < 10; i++) { len = 0; for (j = 0; j < i; j++) len += my_dtmf_generate(amp + len, ALL_POSSIBLE_DIGITS); dtmf_rx(dtmf_state, amp, len); if (!callback_hit || !callback_ok) break; } if (!callback_hit || !callback_ok) { printf(" Failed\n"); exit(2); } printf(" Passed\n"); /* Test the realtime callback mode for reporting detected digits */ printf("Test: Realtime callback digit delivery mode.\n"); callback_hit = FALSE; callback_ok = TRUE; callback_roll = 0; dtmf_rx_init(dtmf_state, NULL, NULL); dtmf_rx_set_realtime_callback(dtmf_state, digit_status, (void *) 0x12345678); if (use_dialtone_filter || max_forward_twist >= 0 || max_reverse_twist >= 0) dtmf_rx_parms(dtmf_state, use_dialtone_filter, max_forward_twist, max_reverse_twist, -99); logging = dtmf_rx_get_logging_state(dtmf_state); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "DTMF-rx"); my_dtmf_gen_init(0.0f, DEFAULT_DTMF_TX_LEVEL, 0.0f, DEFAULT_DTMF_TX_LEVEL, DEFAULT_DTMF_TX_ON_TIME, DEFAULT_DTMF_TX_OFF_TIME); step = 0; for (i = 1; i < 10; i++) { len = 0; for (j = 0; j < i; j++) len += my_dtmf_generate(amp + len, ALL_POSSIBLE_DIGITS); for (sample = 0, j = SAMPLES_PER_CHUNK; sample < len; sample += SAMPLES_PER_CHUNK, j = ((len - sample) >= SAMPLES_PER_CHUNK) ? SAMPLES_PER_CHUNK : (len - sample)) { dtmf_rx(dtmf_state, &[sample], j); if (!callback_ok) break; step += j; } if (!callback_hit || !callback_ok) break; } if (!callback_hit || !callback_ok) { printf(" Failed\n"); exit(2); } } /*- End of function --------------------------------------------------------*/ static void decode_test(const char *test_file) { int16_t amp[SAMPLES_PER_CHUNK]; SNDFILE *inhandle; dtmf_rx_state_t *dtmf_state; char buf[128 + 1]; int actual; int samples; int total; logging_state_t *logging; dtmf_state = dtmf_rx_init(NULL, NULL, NULL); if (use_dialtone_filter || max_forward_twist >= 0 || max_reverse_twist >= 0) dtmf_rx_parms(dtmf_state, use_dialtone_filter, max_forward_twist, max_reverse_twist, -99); logging = dtmf_rx_get_logging_state(dtmf_state); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "DTMF-rx"); /* We will decode the audio from a file. */ if ((inhandle = sf_open_telephony_read(decode_test_file, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", decode_test_file); exit(2); } total = 0; while ((samples = sf_readf_short(inhandle, amp, SAMPLES_PER_CHUNK)) > 0) { codec_munge(munge, amp, samples); dtmf_rx(dtmf_state, amp, samples); //printf("Status 0x%X\n", dtmf_rx_status(dtmf_state)); if ((actual = dtmf_rx_get(dtmf_state, buf, 128)) > 0) printf("Received '%s'\n", buf); total += actual; } printf("%d digits received\n", total); } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int duration; time_t now; int channel_codec; int opt; use_dialtone_filter = FALSE; channel_codec = MUNGE_CODEC_NONE; decode_test_file = NULL; max_forward_twist = -1; max_reverse_twist = -1; while ((opt = getopt(argc, argv, "c:d:F:fR:")) != -1) { switch (opt) { case 'c': channel_codec = atoi(optarg); break; case 'd': decode_test_file = optarg; break; case 'F': max_forward_twist = atoi(optarg); break; case 'f': use_dialtone_filter = TRUE; break; case 'R': max_reverse_twist = atoi(optarg); break; default: //usage(); exit(2); break; } } munge = codec_munge_init(channel_codec, 0); if (decode_test_file) { decode_test(decode_test_file); } else { time(&now); mitel_cm7291_side_1_tests(); mitel_cm7291_side_2_and_bellcore_tests(); dial_tone_tolerance_tests(); callback_function_tests(); printf(" Passed\n"); duration = time(NULL) - now; printf("Tests passed in %ds\n", duration); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/media_monitor.cpp0000664000175000017500000002170611422612267014615 00000000000000/* * SpanDSP - a series of DSP components for telephony * * media_monitor.cpp - Display IP streaming media status, using the FLTK toolkit. * * Written by Steve Underwood * * Copyright (C) 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #if defined(HAVE_FL_FL_H) && defined(HAVE_FL_FL_CARTESIAN_H) #define __STDC_LIMIT_MACROS #include #include #include #include #include #include #include #include #include #include #include #include #include "spandsp.h" #include "media_monitor.h" struct line_model_monitor_s { Fl_Double_Window *w; Fl_Group *c_right; Fl_Group *c_sent; Fl_Group *c_received; Ca_Canvas *canvas_sent; Ca_X_Axis *sent_x; Ca_Y_Axis *sent_y; Ca_Line *sent_re; double sent_re_plot[1000]; double sent_re_plot_min; double sent_re_plot_max; Ca_Canvas *canvas_received; Ca_X_Axis *received_x; Ca_Y_Axis *received_y; Ca_Line *received_delays; double received_delays_plot[4000]; double received_delays_plot_max; int min_diff; int max_diff; int highest_seq_no_seen; }; static int skip = 0; static struct line_model_monitor_s media; static struct line_model_monitor_s *s = &media; void media_monitor_rx(int seq_no, double departure_time, double arrival_time) { double fdiff; int diff; int i; if (s->received_delays) delete s->received_delays; s->canvas_received->current(s->canvas_received); fdiff = (arrival_time - departure_time)*1000.0; diff = (int) fdiff; if (diff < 0) diff = 0; else if (diff > 1999) diff = 1999; s->received_delays_plot[2*diff + 1]++; if (s->received_delays_plot[2*diff + 1] > s->received_delays_plot_max) { s->received_delays_plot_max = s->received_delays_plot[2*diff + 1]; s->received_y->maximum(s->received_delays_plot_max); } if (diff > s->max_diff) { s->max_diff = diff; s->received_x->maximum((double) s->max_diff); } if (diff < s->min_diff) { s->min_diff = diff - 1; s->received_x->minimum((double) s->min_diff); } s->received_delays = new Ca_Line(2000, s->received_delays_plot, 0, 0, FL_BLUE, CA_NO_POINT); if (s->sent_re) delete s->sent_re; s->canvas_sent->current(s->canvas_sent); if (seq_no > s->highest_seq_no_seen + 1) { for (i = s->highest_seq_no_seen + 1; i < seq_no; i++) s->sent_re_plot[2*(i%500) + 1] = 0.0; } s->sent_re_plot[2*(seq_no%500) + 1] = fdiff; if (fdiff > s->sent_re_plot_max) { s->sent_re_plot_max = fdiff; s->sent_y->maximum(s->sent_re_plot_max); } if (fdiff < s->sent_re_plot_min) { s->sent_re_plot_min = fdiff - 1.0; s->sent_y->minimum(s->sent_re_plot_min); } s->sent_re = new Ca_Line(500, s->sent_re_plot, 0, 0, FL_BLUE, CA_NO_POINT); if (seq_no > s->highest_seq_no_seen) s->highest_seq_no_seen = seq_no; if (++skip >= 100) { skip = 0; Fl::check(); } } /*- End of function --------------------------------------------------------*/ int start_media_monitor(void) { char buf[132 + 1]; float x; float y; int i; int len; len = 128; s->w = new Fl_Double_Window(465, 400, "IP streaming media monitor"); s->c_right = new Fl_Group(0, 0, 465, 405); s->c_sent = new Fl_Group(0, 0, 465, 200); s->c_sent->box(FL_DOWN_BOX); s->c_sent->align(FL_ALIGN_TOP | FL_ALIGN_INSIDE); s->c_sent->current(); s->canvas_sent = new Ca_Canvas(110, 35, 300, 100, "Packet delays"); s->canvas_sent->box(FL_PLASTIC_DOWN_BOX); s->canvas_sent->color(7); s->canvas_sent->align(FL_ALIGN_TOP); Fl_Group::current()->resizable(s->canvas_sent); s->canvas_sent->border(15); s->sent_x = new Ca_X_Axis(115, 135, 290, 30, "Packet"); s->sent_x->align(FL_ALIGN_BOTTOM); s->sent_x->minimum(0.0); s->sent_x->maximum(500.0); s->sent_x->label_format("%g"); s->sent_x->minor_grid_color(fl_gray_ramp(20)); s->sent_x->major_grid_color(fl_gray_ramp(15)); s->sent_x->label_grid_color(fl_gray_ramp(10)); s->sent_x->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->sent_x->minor_grid_style(FL_DOT); s->sent_x->major_step(5); s->sent_x->label_step(1); s->sent_x->axis_align(CA_BOTTOM | CA_LINE); s->sent_x->axis_color(FL_BLACK); s->sent_x->current(); s->sent_y = new Ca_Y_Axis(60, 40, 50, 90, "Delay\n(ms)"); s->sent_y->align(FL_ALIGN_LEFT); s->sent_y->minimum(0.0); s->sent_y->maximum(2000.0); s->sent_y->minor_grid_color(fl_gray_ramp(20)); s->sent_y->major_grid_color(fl_gray_ramp(15)); s->sent_y->label_grid_color(fl_gray_ramp(10)); s->sent_y->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->sent_y->minor_grid_style(FL_DOT); s->sent_y->major_step(5); s->sent_y->label_step(1); s->sent_y->axis_color(FL_BLACK); s->sent_y->current(); s->c_sent->end(); s->c_received = new Fl_Group(0, 200, 465, 200); s->c_received->box(FL_DOWN_BOX); s->c_received->align(FL_ALIGN_TOP | FL_ALIGN_INSIDE); s->c_received->current(); s->canvas_received = new Ca_Canvas(110, 235, 300, 100, "Delay spread"); s->canvas_received->box(FL_PLASTIC_DOWN_BOX); s->canvas_received->color(7); s->canvas_received->align(FL_ALIGN_TOP); Fl_Group::current()->resizable(s->canvas_received); s->canvas_received->border(15); s->received_x = new Ca_X_Axis(115, 335, 290, 30, "Delay (ms)"); s->received_x->align(FL_ALIGN_BOTTOM); s->received_x->minimum(0.0); s->received_x->maximum(2000.0); s->received_x->label_format("%g"); s->received_x->minor_grid_color(fl_gray_ramp(20)); s->received_x->major_grid_color(fl_gray_ramp(15)); s->received_x->label_grid_color(fl_gray_ramp(10)); s->received_x->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->received_x->minor_grid_style(FL_DOT); s->received_x->major_step(5); s->received_x->label_step(1); s->received_x->axis_align(CA_BOTTOM | CA_LINE); s->received_x->axis_color(FL_BLACK); s->received_x->current(); s->received_y = new Ca_Y_Axis(60, 240, 50, 90, "Freq"); s->received_y->align(FL_ALIGN_LEFT); s->received_y->minimum(0.0); s->received_y->maximum(50.0); s->received_y->minor_grid_color(fl_gray_ramp(20)); s->received_y->major_grid_color(fl_gray_ramp(15)); s->received_y->label_grid_color(fl_gray_ramp(10)); s->received_y->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->received_y->minor_grid_style(FL_DOT); s->received_y->major_step(5); s->received_y->label_step(1); s->received_y->axis_color(FL_BLACK); s->received_y->current(); for (i = 0; i < 2000; i++) s->received_delays_plot[2*i] = i; s->received_delays_plot_max = 0.0; s->min_diff = 2000; s->max_diff = 0; s->received_delays = NULL; s->highest_seq_no_seen = -1; for (i = 0; i < 500; i++) s->sent_re_plot[2*i] = i; s->sent_re_plot_min = 99999.0; s->sent_re_plot_max = 0.0; s->sent_re = NULL; s->c_received->end(); s->c_right->end(); Fl_Group::current()->resizable(s->c_right); s->w->end(); s->w->show(); Fl::check(); return 0; } /*- End of function --------------------------------------------------------*/ void media_monitor_wait_to_end(void) { fd_set rfds; int res; struct timeval tv; fprintf(stderr, "Processing complete. Press the key to end\n"); do { usleep(100000); Fl::check(); FD_ZERO(&rfds); FD_SET(0, &rfds); tv.tv_usec = 100000; tv.tv_sec = 0; res = select(1, &rfds, NULL, NULL, &tv); } while (res <= 0); } /*- End of function --------------------------------------------------------*/ void media_monitor_update_display(void) { Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); Fl::check(); } /*- End of function --------------------------------------------------------*/ #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/sig_tone_tests.c0000664000175000017500000004760212101216001014440 00000000000000/* * SpanDSP - a series of DSP components for telephony * * sig_tone_tests.c * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page sig_tone_tests_page The 2280/2400/2600Hz signalling tone Rx/Tx tests \section sig_tone_tests_sec_1 What does it do? ???. \section sig_tone_tests_sec_2 How does it work? ???. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define OUT_FILE_NAME "sig_tone.wav" #define SAMPLES_PER_CHUNK 160 #define MITEL_DIR "../test-data/mitel/" #define BELLCORE_DIR "../test-data/bellcore/" const char *bellcore_files[] = { MITEL_DIR "mitel-cm7291-talkoff.wav", BELLCORE_DIR "tr-tsy-00763-1.wav", BELLCORE_DIR "tr-tsy-00763-2.wav", BELLCORE_DIR "tr-tsy-00763-3.wav", BELLCORE_DIR "tr-tsy-00763-4.wav", BELLCORE_DIR "tr-tsy-00763-5.wav", BELLCORE_DIR "tr-tsy-00763-6.wav", "" }; typedef struct { double freq; double min_level; double max_level; } template_t; static int number_of_tones = 1; static int sampleno = 0; static int tone_1_present = 0; static int tone_2_present = 0; static int tx_section = 0; static int dial_pulses = 0; static int rx_handler_callbacks = 0; static int tx_handler_callbacks = 0; static int use_gui = FALSE; static void plot_frequency_response(void) { FILE *gnucmd; if ((gnucmd = popen("gnuplot", "w")) == NULL) { exit(2); } fprintf(gnucmd, "set autoscale\n"); fprintf(gnucmd, "unset log\n"); fprintf(gnucmd, "unset label\n"); fprintf(gnucmd, "set xtic auto\n"); fprintf(gnucmd, "set ytic auto\n"); fprintf(gnucmd, "set title 'Notch filter frequency response'\n"); fprintf(gnucmd, "set xlabel 'Frequency (Hz)'\n"); fprintf(gnucmd, "set ylabel 'Gain (dB)'\n"); fprintf(gnucmd, "plot 'sig_tone_notch' using 1:3 title 'min' with lines," "'sig_tone_notch' using 1:6 title 'actual' with lines," "'sig_tone_notch' using 1:9 title 'max' with lines\n"); fflush(gnucmd); getchar(); if (pclose(gnucmd) == -1) { exit(2); } } /*- End of function --------------------------------------------------------*/ static void tx_handler(void *user_data, int what, int level, int duration) { sig_tone_tx_state_t *s; int tone; int time; static const int pattern_1_tone[][2] = { {33, SIG_TONE_1_PRESENT}, {67, 0}, {33, SIG_TONE_1_PRESENT}, {67, 0}, {33, SIG_TONE_1_PRESENT}, {67, 0}, {33, SIG_TONE_1_PRESENT}, {67, 0}, {33, SIG_TONE_1_PRESENT}, {67, 0}, {33, SIG_TONE_1_PRESENT}, {67, 0}, {33, SIG_TONE_1_PRESENT}, {67, 0}, {33, SIG_TONE_1_PRESENT}, {67, 0}, {33, SIG_TONE_1_PRESENT}, {67, 0}, {600, SIG_TONE_1_PRESENT}, {0, 0} }; static const int pattern_2_tones[][2] = { #if 0 {33, SIG_TONE_1_PRESENT}, {67, 0}, {33, SIG_TONE_1_PRESENT}, {67, 0}, {33, SIG_TONE_1_PRESENT}, {67, 0}, {33, SIG_TONE_1_PRESENT}, {67, 0}, {33, SIG_TONE_1_PRESENT}, {67, 0}, {33, SIG_TONE_1_PRESENT}, {67, 0}, {33, SIG_TONE_1_PRESENT}, {67, 0}, {33, SIG_TONE_1_PRESENT}, {67, 0}, {33, SIG_TONE_1_PRESENT}, {67, 0}, #endif {100, SIG_TONE_1_PRESENT}, {100, SIG_TONE_1_PRESENT | SIG_TONE_2_PRESENT}, {100, SIG_TONE_2_PRESENT}, #if 0 {100, 0}, {100, SIG_TONE_2_PRESENT}, {100, SIG_TONE_1_PRESENT | SIG_TONE_2_PRESENT}, {100, SIG_TONE_1_PRESENT}, #endif {0, 0} }; s = (sig_tone_tx_state_t *) user_data; tx_handler_callbacks++; //printf("What - %d, duration - %d\n", what, duration); if ((what & SIG_TONE_TX_UPDATE_REQUEST)) { /* The sig tone transmit side wants to know what to do next */ printf("Tx: update request\n"); if (number_of_tones == 1) { time = pattern_1_tone[tx_section][0]; tone = pattern_1_tone[tx_section][1]; } else { time = pattern_2_tones[tx_section][0]; tone = pattern_2_tones[tx_section][1]; } if (time) { printf("Tx: [%04x] %s %s for %d samples (%dms)\n", tone, (tone & SIG_TONE_1_PRESENT) ? "on " : "off", (tone & SIG_TONE_2_PRESENT) ? "on " : "off", ms_to_samples(time), time); sig_tone_tx_set_mode(s, tone, ms_to_samples(time)); tx_section++; } else { printf("End of sequence\n"); } } /*endif*/ } /*- End of function --------------------------------------------------------*/ static void rx_handler(void *user_data, int what, int level, int duration) { float ms; int x; rx_handler_callbacks++; ms = 1000.0f*(float) duration/(float) SAMPLE_RATE; printf("Rx: [%04x]", what); x = what & SIG_TONE_1_PRESENT; if ((what & SIG_TONE_1_CHANGE)) { printf(" %s", (x) ? "on " : "off"); if (x == tone_1_present) exit(2); tone_1_present = x; } else { printf(" ---"); if (x != tone_1_present) exit(2); } /*endif*/ x = what & SIG_TONE_2_PRESENT; if ((what & SIG_TONE_2_CHANGE)) { printf(" %s", (x) ? "on " : "off"); if (x == tone_2_present) exit(2); tone_2_present = x; } else { if (x != tone_2_present) exit(2); printf(" ---"); } /*endif*/ printf(" after %d samples (%.3fms)\n", duration, ms); } /*- End of function --------------------------------------------------------*/ static void map_frequency_response(sig_tone_rx_state_t *s, template_t template[]) { int16_t buf[SAMPLES_PER_CHUNK]; int i; int len; double sumin; double sumout; swept_tone_state_t *swept; double freq; double gain; int template_entry; FILE *file; /* Things like noise don't highlight the frequency response of the high Q notch very well. We use a slowly swept frequency to check it. */ printf("Frequency response test\n"); sig_tone_rx_set_mode(s, SIG_TONE_RX_PASSTHROUGH | SIG_TONE_RX_FILTER_TONE, 0); swept = swept_tone_init(NULL, 200.0f, 3900.0f, -10.0f, 120*SAMPLE_RATE, 0); template_entry = 0; file = fopen("sig_tone_notch", "wb"); for (;;) { if ((len = swept_tone(swept, buf, SAMPLES_PER_CHUNK)) <= 0) break; /*endif*/ sumin = 0.0; for (i = 0; i < len; i++) sumin += (double) buf[i]*(double) buf[i]; /*endfor*/ sig_tone_rx(s, buf, len); sumout = 0.0; for (i = 0; i < len; i++) sumout += (double) buf[i]*(double) buf[i]; /*endfor*/ freq = swept_tone_current_frequency(swept); gain = (sumin != 0.0) ? 10.0*log10(sumout/sumin + 1.0e-10) : 0.0; printf("%7.1f Hz %.3f dBm0 < %.3f dBm0 < %.3f dBm0\n", freq, template[template_entry].min_level, gain, template[template_entry].max_level); if (file) { fprintf(file, "%7.1f Hz %.3f dBm0 < %.3f dBm0 < %.3f dBm0\n", freq, template[template_entry].min_level, gain, template[template_entry].max_level); } /*endif*/ if (gain < template[template_entry].min_level || gain > template[template_entry].max_level) { printf("Expected: %.3f dBm0 to %.3f dBm0\n", template[template_entry].min_level, template[template_entry].max_level); printf(" Failed\n"); exit(2); } /*endif*/ if (freq > template[template_entry].freq) template_entry++; } /*endfor*/ swept_tone_free(swept); if (file) { fclose(file); if (use_gui) plot_frequency_response(); /*endif*/ } /*endif*/ printf(" Passed\n"); } /*- End of function --------------------------------------------------------*/ static void speech_immunity_tests(sig_tone_rx_state_t *s) { int j; int total_hits; SNDFILE *inhandle; int16_t amp[SAMPLE_RATE]; int frames; printf("Speech immunity test\n"); total_hits = 0; for (j = 0; bellcore_files[j][0]; j++) { /* Push some silence through, so we should be in the tone off state */ vec_zeroi16(amp, SAMPLE_RATE); sig_tone_rx(s, amp, SAMPLE_RATE); rx_handler_callbacks = 0; if ((inhandle = sf_open_telephony_read(bellcore_files[j], 1)) == NULL) { printf(" Cannot open speech file '%s'\n", bellcore_files[j]); exit(2); } /*endif*/ while ((frames = sf_readf_short(inhandle, amp, SAMPLE_RATE))) { sig_tone_rx(s, amp, frames); } /*endwhile*/ if (sf_close_telephony(inhandle)) { printf(" Cannot close speech file '%s'\n", bellcore_files[j]); exit(2); } /*endif*/ printf(" File %d gave %d false hits.\n", j + 1, rx_handler_callbacks); total_hits += rx_handler_callbacks; } /*endfor*/ printf(" %d hits in total\n", total_hits); if (total_hits > 0) { printf(" Failed\n"); exit(2); } /*endif*/ printf(" Passed\n"); } /*- End of function --------------------------------------------------------*/ static void level_and_ratio_tests(sig_tone_rx_state_t *s, double pitch[2]) { awgn_state_t noise_source; int32_t phase_rate[2]; uint32_t phase[2]; int16_t gain; int16_t amp[SAMPLE_RATE]; int i; int j; int k; int l; float noise_level; float tone_level; power_meter_t noise_meter; power_meter_t tone_meter; int16_t noise; int16_t tone; printf("Acceptable level and ratio test - %.2f Hz + %.2f Hz\n", pitch[0], pitch[1]); for (l = 0; l < 2; l++) { phase[l] = 0; phase_rate[l] = (pitch[l] != 0.0) ? dds_phase_rate(pitch[l]) : 0; } for (k = -25; k > -60; k--) { noise_level = k; awgn_init_dbm0(&noise_source, 1234567, noise_level); tone_level = noise_level; /* Push some silence through, so we should be in the tone off state */ vec_zeroi16(amp, SAMPLE_RATE); sig_tone_rx(s, amp, SAMPLE_RATE); power_meter_init(&noise_meter, 6); power_meter_init(&tone_meter, 6); for (j = 0; j < 20; j++) { rx_handler_callbacks = 0; gain = dds_scaling_dbm0(tone_level); for (i = 0; i < SAMPLES_PER_CHUNK; i++) { noise = awgn(&noise_source); tone = dds_mod(&phase[0], phase_rate[0], gain, 0); if (phase_rate[1]) tone += dds_mod(&phase[1], phase_rate[1], gain, 0); power_meter_update(&noise_meter, noise); power_meter_update(&tone_meter, tone); amp[i] = noise + tone; } /*endfor*/ sig_tone_rx(s, amp, SAMPLES_PER_CHUNK); if (rx_handler_callbacks) { printf("Hit at tone = %.2fdBm0, noise = %.2fdBm0\n", tone_level, noise_level); printf("Measured tone = %.2fdBm0, noise = %.2fdBm0\n", power_meter_current_dbm0(&tone_meter), power_meter_current_dbm0(&noise_meter)); if (rx_handler_callbacks != 1) printf("Callbacks = %d\n", rx_handler_callbacks); } /*endif*/ tone_level += 1.0f; } /*endfor*/ } /*endfor*/ printf(" Passed\n"); } /*- End of function --------------------------------------------------------*/ static void sequence_tests(sig_tone_tx_state_t *tx_state, sig_tone_rx_state_t *rx_state, codec_munge_state_t *munge) { int i; awgn_state_t noise_source; SNDFILE *outhandle; int16_t amp[SAMPLES_PER_CHUNK]; int16_t out_amp[2*SAMPLES_PER_CHUNK]; int outframes; int rx_samples; int tx_samples; printf("Signalling sequence test\n"); tx_section = 0; if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME, 2)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME); exit(2); } /*endif*/ awgn_init_dbm0(&noise_source, 1234567, -20.0f); sig_tone_tx_set_mode(tx_state, SIG_TONE_1_PRESENT | SIG_TONE_2_PRESENT | SIG_TONE_TX_PASSTHROUGH, 0); sig_tone_rx_set_mode(rx_state, SIG_TONE_RX_PASSTHROUGH, 0); for (sampleno = 0; sampleno < 4000; sampleno += SAMPLES_PER_CHUNK) { if (sampleno == 800) { /* 100ms seize */ printf("Tx: [0000] off off for %d samples (%dms)\n", ms_to_samples(100), 100); dial_pulses = 0; sig_tone_tx_set_mode(tx_state, 0, ms_to_samples(100)); } /*endif*/ for (i = 0; i < SAMPLES_PER_CHUNK; i++) amp[i] = awgn(&noise_source); /*endfor*/ tx_samples = sig_tone_tx(tx_state, amp, SAMPLES_PER_CHUNK); for (i = 0; i < tx_samples; i++) out_amp[2*i] = amp[i]; /*endfor*/ codec_munge(munge, amp, tx_samples); rx_samples = sig_tone_rx(rx_state, amp, tx_samples); for (i = 0; i < rx_samples; i++) out_amp[2*i + 1] = amp[i]; /*endfor*/ outframes = sf_writef_short(outhandle, out_amp, rx_samples); if (outframes != rx_samples) { fprintf(stderr, " Error writing audio file\n"); exit(2); } /*endif*/ } /*endfor*/ if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME); exit(2); } /*endif*/ } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int type; sig_tone_tx_state_t tx_state; sig_tone_rx_state_t rx_state; codec_munge_state_t *munge; double fc[2]; int i; template_t template[10]; int opt; use_gui = FALSE; while ((opt = getopt(argc, argv, "g")) != -1) { switch (opt) { case 'g': use_gui = TRUE; break; default: //usage(); exit(2); break; } } for (type = 1; type <= 3; type++) { sampleno = 0; tone_1_present = 0; tone_2_present = 0; munge = NULL; for (i = 0; i < 10; i++) { template[i].freq = 0.0; template[i].min_level = 0.0; template[i].max_level = 0.0; } fc[0] = fc[1] = 0.0; switch (type) { case 1: printf("2280Hz tests.\n"); munge = codec_munge_init(MUNGE_CODEC_ALAW, 0); sig_tone_tx_init(&tx_state, SIG_TONE_2280HZ, tx_handler, &tx_state); sig_tone_rx_init(&rx_state, SIG_TONE_2280HZ, rx_handler, &rx_state); number_of_tones = 1; fc[0] = 2280.0; /* From BTNR 181 2.3.3.1 */ template[0].freq = 1150.0; template[0].min_level = -0.2; template[0].max_level = 0.0; template[1].freq = 1880.0; template[1].min_level = -0.5; template[1].max_level = 0.0; template[2].freq = 2080.0; template[2].min_level = -5.0; template[2].max_level = 0.0; template[3].freq = 2280.0 - 20.0; template[3].min_level = -99.0; template[3].max_level = 0.0; template[4].freq = 2280.0 + 20.0; template[4].min_level = -99.0; template[4].max_level = -30.0; template[5].freq = 2480.0; template[5].min_level = -99.0; template[5].max_level = 0.0; template[6].freq = 2680.0; template[6].min_level = -5.0; template[6].max_level = 0.0; template[7].freq = 4000.0; template[7].min_level = -0.5; template[7].max_level = 0.0; break; case 2: printf("2600Hz tests.\n"); munge = codec_munge_init(MUNGE_CODEC_ULAW, 0); sig_tone_tx_init(&tx_state, SIG_TONE_2600HZ, tx_handler, &tx_state); sig_tone_rx_init(&rx_state, SIG_TONE_2600HZ, rx_handler, &rx_state); number_of_tones = 1; fc[0] = 2600.0; template[0].freq = 2600.0 - 200.0; template[0].min_level = -1.0; template[0].max_level = 0.0; template[1].freq = 2600.0 - 20.0; template[1].min_level = -99.0; template[1].max_level = 0.0; template[2].freq = 2600.0 + 20.0; template[2].min_level = -99.0; template[2].max_level = -30.0; template[3].freq = 2600.0 + 200.0; template[3].min_level = -99.0; template[3].max_level = 0.0; template[4].freq = 4000.0; template[4].min_level = -1.0; template[4].max_level = 0.0; break; case 3: printf("2400Hz/2600Hz tests.\n"); munge = codec_munge_init(MUNGE_CODEC_ULAW, 0); sig_tone_tx_init(&tx_state, SIG_TONE_2400HZ_2600HZ, tx_handler, &tx_state); sig_tone_rx_init(&rx_state, SIG_TONE_2400HZ_2600HZ, rx_handler, &rx_state); number_of_tones = 2; fc[0] = 2400.0; fc[1] = 2600.0; template[0].freq = 2400.0 - 200.0; template[0].min_level = -1.0; template[0].max_level = 0.0; template[1].freq = 2400.0 - 20.0; template[1].min_level = -99.0; template[1].max_level = 0.0; template[2].freq = 2400.0 + 20.0; template[2].min_level = -99.0; template[2].max_level = -30.0; template[3].freq = 2600.0 - 20.0; template[3].min_level = -99.0; template[3].max_level = 0.0; template[4].freq = 2600.0 + 20.0; template[4].min_level = -99.0; template[4].max_level = -30.0; template[5].freq = 2600.0 + 200.0; template[5].min_level = -99.0; template[5].max_level = 0.0; template[6].freq = 4000.0; template[6].min_level = -1.0; template[6].max_level = 0.0; break; } /*endswitch*/ map_frequency_response(&rx_state, template); speech_immunity_tests(&rx_state); level_and_ratio_tests(&rx_state, fc); sequence_tests(&tx_state, &rx_state, munge); } /*endfor*/ printf("Tests completed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/v17_tests.c0000664000175000017500000004672512101213400013253 00000000000000//#define ADD_MAINS_INTERFERENCE /* * SpanDSP - a series of DSP components for telephony * * v17_tests.c * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page v17_tests_page V.17 modem tests \section v17_tests_page_sec_1 What does it do? These tests test one way paths, as V.17 is a half-duplex modem. They allow either: - A V.17 transmit modem to feed a V.17 receive modem through a telephone line model. BER testing is then used to evaluate performance under various line conditions. This is effective for testing the basic performance of the receive modem. It is also the only test mode provided for evaluating the transmit modem. - A V.17 receive modem is used to decode V.17 audio, stored in a audio file. This is good way to evaluate performance with audio recorded from other models of modem, and with real world problematic telephone lines. If the appropriate GUI environment exists, the tests are built such that a visual display of modem status is maintained. \section v17_tests_page_sec_2 How is it used? */ /* Enable the following definition to enable direct probing into the FAX structures */ #define WITH_SPANDSP_INTERNALS #if defined(HAVE_CONFIG_H) #include "config.h" #endif #if defined(HAVE_FL_FL_H) && defined(HAVE_FL_FL_CARTESIAN_H) && defined(HAVE_FL_FL_AUDIO_METER_H) #define ENABLE_GUI #endif #include #include #include #include #include #include #include #if defined(HAVE_FENV_H) #define __USE_GNU #include #endif //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #if defined(ENABLE_GUI) #include "modem_monitor.h" #include "line_model_monitor.h" #endif #define BLOCK_LEN 160 #define OUT_FILE_NAME "v17.wav" char *decode_test_file = NULL; int use_gui = FALSE; int symbol_no = 0; int rx_bits = 0; int tx_bits = 0; int test_bps; bert_state_t bert; one_way_line_model_state_t *line_model; #if defined(ENABLE_GUI) qam_monitor_t *qam_monitor; #endif bert_results_t latest_results; static void reporter(void *user_data, int reason, bert_results_t *results) { switch (reason) { case BERT_REPORT_REGULAR: fprintf(stderr, "BERT report regular - %d bits, %d bad bits, %d resyncs\n", results->total_bits, results->bad_bits, results->resyncs); memcpy(&latest_results, results, sizeof(latest_results)); break; default: fprintf(stderr, "BERT report %s\n", bert_event_to_str(reason)); break; } } /*- End of function --------------------------------------------------------*/ static void v17_rx_status(void *user_data, int status) { v17_rx_state_t *s; int i; int len; #if defined(SPANDSP_USE_FIXED_POINTx) complexi16_t *coeffs; #else complexf_t *coeffs; #endif printf("V.17 rx status is %s (%d)\n", signal_status_to_str(status), status); s = (v17_rx_state_t *) user_data; switch (status) { case SIG_STATUS_TRAINING_SUCCEEDED: len = v17_rx_equalizer_state(s, &coeffs); printf("Equalizer:\n"); for (i = 0; i < len; i++) #if defined(SPANDSP_USE_FIXED_POINTx) printf("%3d (%15.5f, %15.5f)\n", i, coeffs[i].re/4096.0f, coeffs[i].im/4096.0f); #else printf("%3d (%15.5f, %15.5f) -> %15.5f\n", i, coeffs[i].re, coeffs[i].im, powerf(&coeffs[i])); #endif break; } } /*- End of function --------------------------------------------------------*/ static void v17putbit(void *user_data, int bit) { if (bit < 0) { v17_rx_status(user_data, bit); return; } if (decode_test_file) printf("Rx bit %d - %d\n", rx_bits++, bit); else bert_put_bit(&bert, bit); } /*- End of function --------------------------------------------------------*/ static void v17_tx_status(void *user_data, int status) { printf("V.17 tx status is %s (%d)\n", signal_status_to_str(status), status); } /*- End of function --------------------------------------------------------*/ static int v17getbit(void *user_data) { return bert_get_bit(&bert); } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINTx) static void qam_report(void *user_data, const complexi16_t *constel, const complexi16_t *target, int symbol) #else static void qam_report(void *user_data, const complexf_t *constel, const complexf_t *target, int symbol) #endif { int i; int len; #if defined(SPANDSP_USE_FIXED_POINTx) complexi16_t *coeffs; complexf_t constel_point; #else complexf_t *coeffs; #endif float fpower; v17_rx_state_t *rx; static float smooth_power = 0.0f; static int update_interval = 100; rx = (v17_rx_state_t *) user_data; if (constel) { fpower = (constel->re - target->re)*(constel->re - target->re) + (constel->im - target->im)*(constel->im - target->im); #if defined(SPANDSP_USE_FIXED_POINTx) fpower /= 4096.0*4096.0; #endif smooth_power = 0.95f*smooth_power + 0.05f*fpower; #if defined(ENABLE_GUI) if (use_gui) { #if defined(SPANDSP_USE_FIXED_POINTx) constel_point.re = constel->re/4096.0; constel_point.im = constel->im/4096.0; qam_monitor_update_constel(qam_monitor, &constel_point); #else qam_monitor_update_constel(qam_monitor, constel); #endif qam_monitor_update_carrier_tracking(qam_monitor, v17_rx_carrier_frequency(rx)); qam_monitor_update_symbol_tracking(qam_monitor, v17_rx_symbol_timing_correction(rx)); } #endif printf("%8d [%8.4f, %8.4f] [%8.4f, %8.4f] %2x %8.4f %8.4f %9.4f %7.3f %7.4f\n", symbol_no, #if defined(SPANDSP_USE_FIXED_POINTx) constel->re/4096.0, constel->im/4096.0, target->re/4096.0, target->im/4096.0, #else constel->re, constel->im, target->re, target->im, #endif symbol, fpower, smooth_power, v17_rx_carrier_frequency(rx), v17_rx_signal_power(rx), v17_rx_symbol_timing_correction(rx)); printf("Carrier %d %f %f\n", symbol_no, v17_rx_carrier_frequency(rx), v17_rx_symbol_timing_correction(rx)); symbol_no++; if (--update_interval <= 0) { len = v17_rx_equalizer_state(rx, &coeffs); printf("Equalizer A:\n"); for (i = 0; i < len; i++) #if defined(SPANDSP_USE_FIXED_POINTx) printf("%3d (%15.5f, %15.5f)\n", i, coeffs[i].re/4096.0f, coeffs[i].im/4096.0f); #else printf("%3d (%15.5f, %15.5f) -> %15.5f\n", i, coeffs[i].re, coeffs[i].im, powerf(&coeffs[i])); #endif #if defined(ENABLE_GUI) if (use_gui) { #if defined(SPANDSP_USE_FIXED_POINTx) qam_monitor_update_int_equalizer(qam_monitor, coeffs, len); #else qam_monitor_update_equalizer(qam_monitor, coeffs, len); #endif } #endif update_interval = 100; } } } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_FENV_H) static void sigfpe_handler(int sig_num, siginfo_t *info, void *data) { switch (sig_num) { case SIGFPE: switch (info->si_code) { case FPE_INTDIV: fprintf(stderr, "integer divide by zero at %p\n", info->si_addr); break; case FPE_INTOVF: fprintf(stderr, "integer overflow at %p\n", info->si_addr); break; case FPE_FLTDIV: fprintf(stderr, "FP divide by zero at %p\n", info->si_addr); break; case FPE_FLTOVF: fprintf(stderr, "FP overflow at %p\n", info->si_addr); break; case FPE_FLTUND: fprintf(stderr, "FP underflow at %p\n", info->si_addr); break; case FPE_FLTRES: fprintf(stderr, "FP inexact result at %p\n", info->si_addr); break; case FPE_FLTINV: fprintf(stderr, "FP invalid operation at %p\n", info->si_addr); break; case FPE_FLTSUB: fprintf(stderr, "subscript out of range at %p\n", info->si_addr); break; } break; default: fprintf(stderr, "Unexpected signal %d\n", sig_num); break; } exit(2); } /*- End of function --------------------------------------------------------*/ static void fpe_trap_setup(void) { struct sigaction trap; sigemptyset(&trap.sa_mask); trap.sa_flags = SA_SIGINFO; trap.sa_sigaction = sigfpe_handler; sigaction(SIGFPE, &trap, NULL); //feenableexcept(FE_DIVBYZERO | FE_INEXACT | FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW); //feenableexcept(FE_ALL_EXCEPT); feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); } /*- End of function --------------------------------------------------------*/ #endif int main(int argc, char *argv[]) { v17_rx_state_t *rx; v17_tx_state_t *tx; bert_results_t bert_results; int16_t gen_amp[BLOCK_LEN]; int16_t amp[BLOCK_LEN]; SNDFILE *inhandle; SNDFILE *outhandle; int outframes; int samples; int tep; int block_no; int noise_level; int signal_level; int bits_per_test; int line_model_no; int log_audio; int channel_codec; int rbs_pattern; int opt; logging_state_t *logging; channel_codec = MUNGE_CODEC_NONE; rbs_pattern = 0; test_bps = 14400; tep = FALSE; line_model_no = 0; decode_test_file = NULL; use_gui = FALSE; noise_level = -70; signal_level = -13; bits_per_test = 50000; log_audio = FALSE; while ((opt = getopt(argc, argv, "b:B:c:d:glm:n:r:s:t")) != -1) { switch (opt) { case 'b': test_bps = atoi(optarg); if (test_bps != 14400 && test_bps != 12000 && test_bps != 9600 && test_bps != 7200 && test_bps != 4800) { /* 4800 is an extension of V.17, to provide full coverage of the V.32bis modes */ fprintf(stderr, "Invalid bit rate specified\n"); exit(2); } break; case 'B': bits_per_test = atoi(optarg); break; case 'c': channel_codec = atoi(optarg); break; case 'd': decode_test_file = optarg; break; case 'g': #if defined(ENABLE_GUI) use_gui = TRUE; #else fprintf(stderr, "Graphical monitoring not available\n"); exit(2); #endif break; case 'l': log_audio = TRUE; break; case 'm': line_model_no = atoi(optarg); break; case 'n': noise_level = atoi(optarg); break; case 'r': rbs_pattern = atoi(optarg); break; case 's': signal_level = atoi(optarg); break; case 't': tep = TRUE; break; default: //usage(); exit(2); break; } } inhandle = NULL; outhandle = NULL; #if defined(HAVE_FENV_H) fpe_trap_setup(); #endif if (log_audio) { if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME); exit(2); } } if (decode_test_file) { /* We will decode the audio from a file. */ tx = NULL; if ((inhandle = sf_open_telephony_read(decode_test_file, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", decode_test_file); exit(2); } } else { /* We will generate V.17 audio, and add some noise to it. */ tx = v17_tx_init(NULL, test_bps, tep, v17getbit, NULL); logging = v17_tx_get_logging_state(tx); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "V.17-tx"); v17_tx_power(tx, signal_level); v17_tx_set_modem_status_handler(tx, v17_tx_status, (void *) tx); #if defined(WITH_SPANDSP_INTERNALS) /* Move the carrier off a bit */ tx->carrier_phase_rate = dds_phase_ratef(1792.0f); tx->carrier_phase = 0x40000000; #endif bert_init(&bert, bits_per_test, BERT_PATTERN_ITU_O152_11, test_bps, 20); bert_set_report(&bert, 10000, reporter, NULL); if ((line_model = one_way_line_model_init(line_model_no, (float) noise_level, channel_codec, rbs_pattern)) == NULL) { fprintf(stderr, " Failed to create line model\n"); exit(2); } one_way_line_model_set_dc(line_model, 0.0f); #if defined(ADD_MAINS_INTERFERENCE) one_way_line_model_set_mains_pickup(line_model, 50, -40.0f); #endif } rx = v17_rx_init(NULL, test_bps, v17putbit, NULL); logging = v17_rx_get_logging_state(rx); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "V.17-rx"); v17_rx_set_modem_status_handler(rx, v17_rx_status, (void *) rx); v17_rx_set_qam_report_handler(rx, qam_report, (void *) rx); #if defined(ENABLE_GUI) if (use_gui) { qam_monitor = qam_monitor_init(10.0f, NULL); if (!decode_test_file) { start_line_model_monitor(129); line_model_monitor_line_model_update(line_model->near_filter, line_model->near_filter_len); } } #endif memset(&latest_results, 0, sizeof(latest_results)); for (block_no = 0; block_no < 100000000; block_no++) { if (decode_test_file) { samples = sf_readf_short(inhandle, amp, BLOCK_LEN); #if defined(ENABLE_GUI) if (use_gui) qam_monitor_update_audio_level(qam_monitor, amp, samples); #endif if (samples == 0) break; } else { samples = v17_tx(tx, gen_amp, BLOCK_LEN); #if defined(ENABLE_GUI) if (use_gui) qam_monitor_update_audio_level(qam_monitor, gen_amp, samples); #endif if (samples == 0) { printf("Restarting on zero output\n"); /* Push a little silence through, to ensure all the data bits get out of the buffers */ vec_zeroi16(amp, BLOCK_LEN); v17_rx(rx, amp, BLOCK_LEN); /* Note that we might get a few bad bits as the carrier shuts down. */ bert_result(&bert, &bert_results); fprintf(stderr, "Final result %ddBm0/%ddBm0, %d bits, %d bad bits, %d resyncs\n", signal_level, noise_level, bert_results.total_bits, bert_results.bad_bits, bert_results.resyncs); fprintf(stderr, "Last report %ddBm0/%ddBm0, %d bits, %d bad bits, %d resyncs\n", signal_level, noise_level, latest_results.total_bits, latest_results.bad_bits, latest_results.resyncs); /* See if bit errors are appearing yet. Also check we are getting enough bits out of the receiver. The last regular report should be error free, though the final report will generally contain bits errors as the carrier was dying. The total number of bits out of the receiver should be at least the number we sent. Also, since BERT sync should have occurred rapidly at the start of transmission, the last report should have occurred at not much less than the total number of bits we sent. */ if (bert_results.total_bits < bits_per_test || latest_results.total_bits < bits_per_test - 100 || latest_results.bad_bits != 0) { break; } memset(&latest_results, 0, sizeof(latest_results)); #if defined(WITH_SPANDSP_INTERNALS) signal_level--; /* Bump the receiver AGC gain by 1dB, to compensate for the above */ rx->agc_scaling_save *= 1.122f; #endif v17_tx_restart(tx, test_bps, tep, TRUE); v17_tx_power(tx, signal_level); v17_rx_restart(rx, test_bps, TRUE); //rx.eq_put_step = rand()%(192*10/3); bert_init(&bert, bits_per_test, BERT_PATTERN_ITU_O152_11, test_bps, 20); bert_set_report(&bert, 10000, reporter, NULL); one_way_line_model_release(line_model); if ((line_model = one_way_line_model_init(line_model_no, (float) noise_level, channel_codec, 0)) == NULL) { fprintf(stderr, " Failed to create line model\n"); exit(2); } } if (log_audio) { outframes = sf_writef_short(outhandle, gen_amp, samples); if (outframes != samples) { fprintf(stderr, " Error writing audio file\n"); exit(2); } } one_way_line_model(line_model, amp, gen_amp, samples); } #if defined(ENABLE_GUI) if (use_gui && !decode_test_file) line_model_monitor_line_spectrum_update(amp, samples); #endif v17_rx(rx, amp, samples); } if (!decode_test_file) { bert_result(&bert, &bert_results); fprintf(stderr, "At completion:\n"); fprintf(stderr, "Final result %ddBm0/%ddBm0, %d bits, %d bad bits, %d resyncs\n", signal_level, noise_level, bert_results.total_bits, bert_results.bad_bits, bert_results.resyncs); fprintf(stderr, "Last report %ddBm0/%ddBm0, %d bits, %d bad bits, %d resyncs\n", signal_level, noise_level, latest_results.total_bits, latest_results.bad_bits, latest_results.resyncs); one_way_line_model_release(line_model); if (signal_level > -43) { printf("Tests failed.\n"); exit(2); } printf("Tests passed.\n"); } #if defined(ENABLE_GUI) if (use_gui) qam_wait_to_end(qam_monitor); #endif if (decode_test_file) { if (sf_close_telephony(inhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", decode_test_file); exit(2); } } if (log_audio) { if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME); exit(2); } } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/playout_tests.c0000664000175000017500000002504712101216253014336 00000000000000/* * SpanDSP - a series of DSP components for telephony * * playout_tests.c * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page playout_tests_page Playout (jitter buffering) tests \section playout_tests_page_sec_1 What does it do? These tests simulate timing jitter and packet loss in an audio stream, and see how well the playout module copes. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include "spandsp.h" #include "spandsp/private/time_scale.h" #include "spandsp-sim.h" #define INPUT_FILE_NAME "playout_in.wav" #define OUTPUT_FILE_NAME "playout_out.wav" #define BLOCK_LEN 160 static void dynamic_buffer_tests(void) { playout_state_t *s; playout_frame_t frame; playout_frame_t *p; plc_state_t plc; time_scale_state_t ts; int16_t *amp; int16_t fill[BLOCK_LEN]; int16_t buf[20*BLOCK_LEN]; int16_t out[10*BLOCK_LEN]; timestamp_t time_stamp; timestamp_t next_actual_receive; timestamp_t next_scheduled_receive; int near_far_time_offset; int rng; int i; int j; int ret; int len; int inframes; int outframes; SNDFILE *inhandle; SNDFILE *outhandle; if ((inhandle = sf_open_telephony_read(INPUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Failed to open audio file '%s'\n", INPUT_FILE_NAME); exit(2); } if ((outhandle = sf_open_telephony_write(OUTPUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Failed to create audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } near_far_time_offset = 54321; time_stamp = 12345; next_actual_receive = time_stamp + near_far_time_offset; next_scheduled_receive = 0; for (i = 0; i < BLOCK_LEN; i++) fill[i] = 32767; if ((s = playout_init(2*BLOCK_LEN, 15*BLOCK_LEN)) == NULL) return; plc_init(&plc); time_scale_init(&ts, SAMPLE_RATE, 1.0); for (i = 0; i < 1000000; i++) { if (i >= next_actual_receive) { amp = malloc(BLOCK_LEN*sizeof(int16_t)); inframes = sf_readf_short(inhandle, amp, BLOCK_LEN); if (inframes < BLOCK_LEN) break; ret = playout_put(s, amp, PLAYOUT_TYPE_SPEECH, inframes, time_stamp, next_actual_receive); #if 0 switch (ret) { case PLAYOUT_OK: printf("<< Record\n"); break; case PLAYOUT_ERROR: printf("<< Error\n"); break; default: printf("<< Eh?\n"); break; } #endif rng = rand() & 0xFF; if (i < 100000) rng = (rng*rng) >> 7; else if (i < 200000) rng = (rng*rng) >> 6; else if (i < 300000) rng = (rng*rng) >> 5; else if (i < 400000) rng = (rng*rng) >> 7; time_stamp += BLOCK_LEN; next_actual_receive = time_stamp + near_far_time_offset + rng; } if (i >= next_scheduled_receive) { do { ret = playout_get(s, &frame, next_scheduled_receive); if (ret == PLAYOUT_DROP) printf(">> Drop %d\n", next_scheduled_receive); } while (ret == PLAYOUT_DROP); switch (ret) { case PLAYOUT_OK: printf(">> Play %d\n", next_scheduled_receive); plc_rx(&plc, frame.data, frame.sender_len); len = time_scale(&ts, out, ((int16_t *) frame.data), frame.sender_len); printf("len = %d\n", len); for (j = 0; j < len; j++) { buf[2*j] = out[j]; buf[2*j + 1] = 10*playout_current_length(s); } outframes = sf_writef_short(outhandle, buf, len); if (outframes != len) { fprintf(stderr, " Error writing out sound\n"); exit(2); } free(frame.data); next_scheduled_receive += BLOCK_LEN; break; case PLAYOUT_FILLIN: printf(">> Fill %d\n", next_scheduled_receive); plc_fillin(&plc, fill, BLOCK_LEN); time_scale_rate(&ts, 0.5); len = time_scale(&ts, out, fill, BLOCK_LEN); time_scale_rate(&ts, 1.0); printf("len = %d\n", len); for (j = 0; j < len; j++) { buf[2*j] = out[j]; buf[2*j + 1] = 10*playout_current_length(s); } outframes = sf_writef_short(outhandle, buf, len); if (outframes != len) { fprintf(stderr, " Error writing out sound\n"); exit(2); } next_scheduled_receive += BLOCK_LEN; break; case PLAYOUT_DROP: printf(">> Drop %d\n", next_scheduled_receive); break; case PLAYOUT_NOFRAME: printf(">> No frame %d %d %d %d\n", next_scheduled_receive, playout_next_due(s), s->last_speech_sender_stamp, s->last_speech_sender_len); next_scheduled_receive += BLOCK_LEN; break; case PLAYOUT_EMPTY: printf(">> Empty %d\n", next_scheduled_receive); next_scheduled_receive += BLOCK_LEN; break; case PLAYOUT_ERROR: printf(">> Error %d\n", next_scheduled_receive); next_scheduled_receive += BLOCK_LEN; break; default: printf(">> Eh? %d\n", next_scheduled_receive); break; } } } if (sf_close_telephony(inhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", INPUT_FILE_NAME); exit(2); } if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } printf("%10" PRId32 " %10" PRId32 " %10d\n", s->state_just_in_time, s->state_late, playout_current_length(s)); /* Clear everything from the queue */ while ((p = playout_get_unconditional(s))) /*free(p->data)*/; /* Now free the context itself */ playout_free(s); } /*- End of function --------------------------------------------------------*/ static void static_buffer_tests(void) { playout_state_t *s; playout_frame_t frame; playout_frame_t *p; int type; uint8_t fr[BLOCK_LEN]; timestamp_t next_scheduled_send; int transit_time; timestamp_t next_actual_receive; timestamp_t next_scheduled_receive; int len; int i; int ret; next_scheduled_send = 0; transit_time = 320; next_actual_receive = next_scheduled_send + transit_time; next_scheduled_receive = 960; memset(fr, 0, sizeof(fr)); type = PLAYOUT_TYPE_SPEECH; len = BLOCK_LEN; if ((s = playout_init(2*BLOCK_LEN, 2*BLOCK_LEN)) == NULL) return; for (i = 0; i < 1000000; i++) { if (i >= next_actual_receive) { ret = playout_put(s, fr, type, len, next_scheduled_send, next_actual_receive); switch (ret) { case PLAYOUT_OK: printf("<< Record\n"); break; case PLAYOUT_ERROR: printf("<< Error\n"); break; default: printf("<< Eh?\n"); break; } next_scheduled_send += BLOCK_LEN; ret = rand() & 0xFF; ret = (ret*ret) >> 7; transit_time = 320 + ret; next_actual_receive = next_scheduled_send + transit_time; } if (i >= next_scheduled_receive) { do { ret = playout_get(s, &frame, next_scheduled_receive); } while (ret == PLAYOUT_DROP); switch (ret) { case PLAYOUT_OK: printf(">> Play\n"); next_scheduled_receive += BLOCK_LEN; break; case PLAYOUT_FILLIN: printf(">> Fill\n"); next_scheduled_receive += BLOCK_LEN; break; case PLAYOUT_DROP: printf(">> Drop\n"); break; case PLAYOUT_NOFRAME: printf(">> No frame\n"); next_scheduled_receive += BLOCK_LEN; break; case PLAYOUT_EMPTY: printf(">> Empty\n"); next_scheduled_receive += BLOCK_LEN; break; case PLAYOUT_ERROR: printf(">> Error\n"); next_scheduled_receive += BLOCK_LEN; break; default: printf(">> Eh?\n"); break; } } } /* Clear everything from the queue */ while ((p = playout_get_unconditional(s))) /*free(p->data)*/; /* Now free the context itself */ playout_free(s); } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { printf("Dynamic buffering tests\n"); dynamic_buffer_tests(); printf("Static buffering tests\n"); static_buffer_tests(); } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/async_tests.c0000664000175000017500000001643511422612266013770 00000000000000/* * SpanDSP - a series of DSP components for telephony * * async_tests.c - Tests for asynchronous serial processing. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page async_tests_page Asynchronous bit stream tests \section async_tests_page_sec_1 What does it do? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" async_rx_state_t rx_async; async_tx_state_t tx_async; int full_len; uint8_t old_buf[1000]; uint8_t new_buf[1000]; volatile int tx_async_chars; volatile int rx_async_chars; volatile int rx_async_char_mask; int v14_test_async_tx_get_bit(void *user_data); int v14_test_async_tx_get_bit(void *user_data) { async_tx_state_t *s; int bit; static int destuff = 0; /* Special routine to test V.14 rate adaption, by randomly skipping stop bits. */ s = (async_tx_state_t *) user_data; if (s->bitpos == 0) { /* Start bit */ bit = 0; s->byte_in_progress = s->get_byte(s->user_data); s->parity_bit = 0; s->bitpos++; } else if (s->bitpos <= s->data_bits) { bit = s->byte_in_progress & 1; s->byte_in_progress >>= 1; s->parity_bit ^= bit; s->bitpos++; if (!s->parity && s->bitpos == s->data_bits + 1) { /* Drop the stop bit on every fourth character for V.14 simulation*/ if ((++destuff & 3) == 0) s->bitpos = 0; } } else if (s->parity && s->bitpos == s->data_bits + 1) { if (s->parity == ASYNC_PARITY_ODD) s->parity_bit ^= 1; bit = s->parity_bit; s->bitpos++; /* Drop the stop bit on every fourth character for V.14 simulation */ if ((++destuff & 3) == 0) s->bitpos = 0; } else { /* Stop bit(s) */ bit = 1; s->bitpos++; if (s->bitpos > s->data_bits + s->stop_bits) s->bitpos = 0; } return bit; } /*- End of function --------------------------------------------------------*/ static int test_get_async_byte(void *user_data) { int byte; byte = tx_async_chars & 0xFF; tx_async_chars++; return byte; } /*- End of function --------------------------------------------------------*/ static void test_put_async_byte(void *user_data, int byte) { if ((rx_async_chars & rx_async_char_mask) != byte) printf("Received byte is 0x%X (expected 0x%X)\n", byte, rx_async_chars); rx_async_chars++; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int bit; printf("Test with async 8N1\n"); async_tx_init(&tx_async, 8, ASYNC_PARITY_NONE, 1, FALSE, test_get_async_byte, NULL); async_rx_init(&rx_async, 8, ASYNC_PARITY_NONE, 1, FALSE, test_put_async_byte, NULL); tx_async_chars = 0; rx_async_chars = 0; rx_async_char_mask = 0xFF; while (rx_async_chars < 1000) { bit = async_tx_get_bit(&tx_async); async_rx_put_bit(&rx_async, bit); } printf("Chars=%d/%d, PE=%d, FE=%d\n", tx_async_chars, rx_async_chars, rx_async.parity_errors, rx_async.framing_errors); if (tx_async_chars != rx_async_chars || rx_async.parity_errors || rx_async.framing_errors) { printf("Test failed.\n"); exit(2); } printf("Test with async 7E1\n"); async_tx_init(&tx_async, 7, ASYNC_PARITY_EVEN, 1, FALSE, test_get_async_byte, NULL); async_rx_init(&rx_async, 7, ASYNC_PARITY_EVEN, 1, FALSE, test_put_async_byte, NULL); tx_async_chars = 0; rx_async_chars = 0; rx_async_char_mask = 0x7F; while (rx_async_chars < 1000) { bit = async_tx_get_bit(&tx_async); async_rx_put_bit(&rx_async, bit); } printf("Chars=%d/%d, PE=%d, FE=%d\n", tx_async_chars, rx_async_chars, rx_async.parity_errors, rx_async.framing_errors); if (tx_async_chars != rx_async_chars || rx_async.parity_errors || rx_async.framing_errors) { printf("Test failed.\n"); exit(2); } printf("Test with async 8O1\n"); async_tx_init(&tx_async, 8, ASYNC_PARITY_ODD, 1, FALSE, test_get_async_byte, NULL); async_rx_init(&rx_async, 8, ASYNC_PARITY_ODD, 1, FALSE, test_put_async_byte, NULL); tx_async_chars = 0; rx_async_chars = 0; rx_async_char_mask = 0xFF; while (rx_async_chars < 1000) { bit = async_tx_get_bit(&tx_async); async_rx_put_bit(&rx_async, bit); } printf("Chars=%d/%d, PE=%d, FE=%d\n", tx_async_chars, rx_async_chars, rx_async.parity_errors, rx_async.framing_errors); if (tx_async_chars != rx_async_chars || rx_async.parity_errors || rx_async.framing_errors) { printf("Test failed.\n"); exit(2); } printf("Test with async 8O1 and V.14\n"); async_tx_init(&tx_async, 8, ASYNC_PARITY_ODD, 1, TRUE, test_get_async_byte, NULL); async_rx_init(&rx_async, 8, ASYNC_PARITY_ODD, 1, TRUE, test_put_async_byte, NULL); tx_async_chars = 0; rx_async_chars = 0; rx_async_char_mask = 0xFF; while (rx_async_chars < 1000) { bit = v14_test_async_tx_get_bit(&tx_async); async_rx_put_bit(&rx_async, bit); } printf("Chars=%d/%d, PE=%d, FE=%d\n", tx_async_chars, rx_async_chars, rx_async.parity_errors, rx_async.framing_errors); if (tx_async_chars != rx_async_chars + 1 || rx_async.parity_errors || rx_async.framing_errors) { printf("Test failed.\n"); exit(2); } printf("Test with async 5N2\n"); async_tx_init(&tx_async, 5, ASYNC_PARITY_NONE, 2, FALSE, test_get_async_byte, NULL); async_rx_init(&rx_async, 5, ASYNC_PARITY_NONE, 2, FALSE, test_put_async_byte, NULL); tx_async_chars = 0; rx_async_chars = 0; rx_async_char_mask = 0x1F; while (rx_async_chars < 1000) { bit = async_tx_get_bit(&tx_async); async_rx_put_bit(&rx_async, bit); } printf("Chars=%d/%d, PE=%d, FE=%d\n", tx_async_chars, rx_async_chars, rx_async.parity_errors, rx_async.framing_errors); if (tx_async_chars != rx_async_chars || rx_async.parity_errors || rx_async.framing_errors) { printf("Test failed.\n"); exit(2); } printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/line_model_tests.c0000664000175000017500000002572612101216571014757 00000000000000/* * SpanDSP - a series of DSP components for telephony * * line_model_tests.c - Tests for the telephone line model. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page line_model_tests_page Telephony line model tests \section line_model_tests_page_sec_1 What does it do? ???. \section line_model_tests_page_sec_2 How does it work? ???. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #if !defined(NULL) #define NULL (void *) 0 #endif #define BLOCK_LEN 160 #define OUT_FILE_COMPLEXIFY "complexify.wav" #define IN_FILE_NAME1 "line_model_test_in1.wav" #define IN_FILE_NAME2 "line_model_test_in2.wav" #define OUT_FILE_NAME1 "line_model_one_way_test_out.wav" #define OUT_FILE_NAME2 "line_model_two_way_test_out.wav" int channel_codec; int rbs_pattern; static void complexify_tests(void) { complexify_state_t *s; complexf_t cc; int16_t amp; int i; SNDFILE *outhandle; int outframes; int16_t out[40000]; awgn_state_t noise1; if ((outhandle = sf_open_telephony_write(OUT_FILE_COMPLEXIFY, 2)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_COMPLEXIFY); exit(2); } awgn_init_dbm0(&noise1, 1234567, -10.0f); s = complexify_init(); for (i = 0; i < 20000; i++) { amp = awgn(&noise1); cc = complexify(s, amp); out[2*i] = cc.re; out[2*i + 1] = cc.im; } outframes = sf_writef_short(outhandle, out, 20000); if (outframes != 20000) { fprintf(stderr, " Error writing audio file\n"); exit(2); } if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_COMPLEXIFY); exit(2); } } /*- End of function --------------------------------------------------------*/ static void test_one_way_model(int line_model_no, int speech_test) { one_way_line_model_state_t *model; int16_t input1[BLOCK_LEN]; int16_t output1[BLOCK_LEN]; int16_t amp[2*BLOCK_LEN]; SNDFILE *inhandle1; SNDFILE *outhandle; int outframes; int samples; int i; int j; awgn_state_t noise1; if ((model = one_way_line_model_init(line_model_no, -50, channel_codec, rbs_pattern)) == NULL) { fprintf(stderr, " Failed to create line model\n"); exit(2); } awgn_init_dbm0(&noise1, 1234567, -10.0f); if (speech_test) { if ((inhandle1 = sf_open_telephony_read(IN_FILE_NAME1, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", IN_FILE_NAME1); exit(2); } } else { inhandle1 = NULL; } if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME1, 1)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME1); exit(2); } for (i = 0; i < 10000; i++) { if (speech_test) { samples = sf_readf_short(inhandle1, input1, BLOCK_LEN); if (samples == 0) break; } else { for (j = 0; j < BLOCK_LEN; j++) input1[j] = awgn(&noise1); samples = BLOCK_LEN; } for (j = 0; j < samples; j++) { one_way_line_model(model, &output1[j], &input1[j], 1); amp[j] = output1[j]; } outframes = sf_writef_short(outhandle, amp, samples); if (outframes != samples) { fprintf(stderr, " Error writing audio file\n"); exit(2); } } if (speech_test) { if (sf_close_telephony(inhandle1)) { fprintf(stderr, " Cannot close audio file '%s'\n", IN_FILE_NAME1); exit(2); } } if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME1); exit(2); } one_way_line_model_release(model); } /*- End of function --------------------------------------------------------*/ static void test_both_ways_model(int line_model_no, int speech_test) { both_ways_line_model_state_t *model; int16_t input1[BLOCK_LEN]; int16_t input2[BLOCK_LEN]; int16_t output1[BLOCK_LEN]; int16_t output2[BLOCK_LEN]; int16_t amp[2*BLOCK_LEN]; SNDFILE *inhandle1; SNDFILE *inhandle2; SNDFILE *outhandle; int outframes; int samples; int i; int j; awgn_state_t noise1; awgn_state_t noise2; if ((model = both_ways_line_model_init(line_model_no, -50, -15.0f, -15.0f, line_model_no + 1, -35, -15.0f, -15.0f, channel_codec, rbs_pattern)) == NULL) { fprintf(stderr, " Failed to create line model\n"); exit(2); } awgn_init_dbm0(&noise1, 1234567, -10.0f); awgn_init_dbm0(&noise2, 1234567, -10.0f); if (speech_test) { if ((inhandle1 = sf_open_telephony_read(IN_FILE_NAME1, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", IN_FILE_NAME1); exit(2); } if ((inhandle2 = sf_open_telephony_read(IN_FILE_NAME2, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", IN_FILE_NAME2); exit(2); } } else { inhandle1 = inhandle2 = NULL; } if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME2, 2)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME2); exit(2); } for (i = 0; i < 10000; i++) { if (speech_test) { samples = sf_readf_short(inhandle1, input1, BLOCK_LEN); if (samples == 0) break; samples = sf_readf_short(inhandle2, input2, samples); if (samples == 0) break; } else { for (j = 0; j < BLOCK_LEN; j++) { input1[j] = awgn(&noise1); input2[j] = awgn(&noise2); } samples = BLOCK_LEN; } for (j = 0; j < samples; j++) { both_ways_line_model(model, &output1[j], &input1[j], &output2[j], &input2[j], 1); amp[2*j] = output1[j]; amp[2*j + 1] = output2[j]; } outframes = sf_writef_short(outhandle, amp, samples); if (outframes != samples) { fprintf(stderr, " Error writing audio file\n"); exit(2); } } if (speech_test) { if (sf_close_telephony(inhandle1)) { fprintf(stderr, " Cannot close audio file '%s'\n", IN_FILE_NAME1); exit(2); } if (sf_close_telephony(inhandle2)) { fprintf(stderr, " Cannot close audio file '%s'\n", IN_FILE_NAME2); exit(2); } } if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME2); exit(2); } both_ways_line_model_release(model); } /*- End of function --------------------------------------------------------*/ static void test_line_filter(int line_model_no) { float out; double sumin; double sumout; double gain; int i; int j; int p; int ptr; int len; swept_tone_state_t *s; float filter[129]; int16_t buf[BLOCK_LEN]; s = swept_tone_init(NULL, 200.0f, 3900.0f, -10.0f, 120*SAMPLE_RATE, 0); for (j = 0; j < 129; j++) filter[j] = 0.0f; ptr = 0; for (;;) { if ((len = swept_tone(s, buf, BLOCK_LEN)) <= 0) break; sumin = 0.0; sumout = 0.0; for (i = 0; i < len; i++) { /* Add the sample in the filter buffer */ p = ptr; filter[p] = buf[i]; if (++p == 129) p = 0; ptr = p; /* Apply the filter */ out = 0.0f; for (j = 0; j < 129; j++) { out += line_models[line_model_no][128 - j]*filter[p]; if (++p >= 129) p = 0; } sumin += buf[i]*buf[i]; sumout += out*out; } /*endfor*/ gain = (sumin != 0.0) ? 10.0*log10(sumout/sumin + 1.0e-10) : 0.0; printf("%7.1f %f\n", swept_tone_current_frequency(s), gain); } /*endfor*/ swept_tone_free(s); } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int line_model_no; int speech_test; int opt; channel_codec = MUNGE_CODEC_NONE; line_model_no = 0; rbs_pattern = 0; speech_test = FALSE; while ((opt = getopt(argc, argv, "c:m:r:s:")) != -1) { switch (opt) { case 'c': channel_codec = atoi(optarg); break; case 'm': line_model_no = atoi(optarg); break; case 'r': rbs_pattern = atoi(optarg); break; case 's': speech_test = atoi(optarg); break; default: //usage(); exit(2); } } complexify_tests(); test_one_way_model(line_model_no, speech_test); test_both_ways_model(line_model_no, speech_test); test_line_filter(line_model_no); } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/crc_tests.c0000664000175000017500000000700611422612266013414 00000000000000/* * SpanDSP - a series of DSP components for telephony * * crc_tests.c * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page crc_tests_page CRC tests \section crc_tests_page_sec_1 What does it do? The CRC tests exercise the ITU-16 and ITU-32 CRC module, and verifies correct operation. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include "spandsp.h" int ref_len; uint8_t buf[1000]; /* Use a local random generator, so the results are consistent across platforms. We have hard coded correct results for a message sequence generated by this particular PRNG. */ static int my_rand(void) { static int rndnum = 1234567; return (rndnum = 1664525U*rndnum + 1013904223U) >> 8; } /*- End of function --------------------------------------------------------*/ static int cook_up_msg(uint8_t *buf) { int i; int len; /* Use medium length messages, with some randomised length variation. */ /* TODO: this doesn't exercise extremely short or long messages. */ len = (my_rand() & 0x3F) + 100; for (i = 0; i < len; i++) buf[i] = my_rand(); return len; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int i; int j; int len; uint16_t crc16a; uint16_t crc16b; printf("CRC module tests\n"); /* TODO: This doesn't check every function in the module */ /* Try a few random messages through the CRC logic. */ printf("Testing the CRC-16 routines\n"); for (i = 0; i < 100; i++) { ref_len = cook_up_msg(buf); len = crc_itu16_append(buf, ref_len); if (!crc_itu16_check(buf, len)) { printf("CRC-16 failure\n"); exit(2); } } printf("Test passed.\n\n"); printf("Testing the CRC-16 byte by byte and bit by bit routines\n"); for (i = 0; i < 100; i++) { ref_len = cook_up_msg(buf); crc16a = 0xFFFF; crc16a = crc_itu16_calc(buf, ref_len, crc16a); crc16b = 0xFFFF; for (j = 0; j < ref_len; j++) crc16b = crc_itu16_bits(buf[j], 8, crc16b); if (crc16a != crc16b) { printf("CRC-16 failure\n"); exit(2); } } printf("Test passed.\n\n"); printf("Testing the CRC-32 routines\n"); for (i = 0; i < 100; i++) { ref_len = cook_up_msg(buf); len = crc_itu32_append(buf, ref_len); if (!crc_itu32_check(buf, len)) { printf("CRC-32 failure\n"); exit(2); } } printf("Test passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/t38_decode.c0000664000175000017500000004126212101215545013340 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t38_decode.c * * Written by Steve Underwood * * Copyright (C) 2010 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /* Enable the following definition to enable direct probing into the FAX structures */ //#define WITH_SPANDSP_INTERNALS #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #include #if !defined(_WIN32) #include #endif //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "udptl.h" #include "spandsp.h" #include "spandsp-sim.h" #include "fax_utils.h" #include "pcap_parse.h" #define INPUT_FILE_NAME "t38.pcap" #define INPUT_TIFF_FILE_NAME "../test-data/itu/fax/itutests.tif" #define OUTPUT_TIFF_FILE_NAME "t38pcap.tif" #define OUTPUT_WAVE_FILE_NAME "t38_decode2.wav" #define SAMPLES_PER_CHUNK 160 static t38_core_state_t *t38_core; static t38_terminal_state_t *t38_terminal_state; static t38_gateway_state_t *t38_gateway_state; static fax_state_t *fax_state; static struct timeval now; static SNDFILE *wave_handle; static int log_audio; static int use_transmit_on_idle; static int done = FALSE; static int started = FALSE; static int64_t current = 0; static int phase_b_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; i = (int) (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase B", i); printf("%c: Phase B handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result)); fax_log_rx_parameters(s, tag); return T30_ERR_OK; } /*- End of function --------------------------------------------------------*/ static int phase_d_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; i = (int) (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase D", i); printf("%c: Phase D handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result)); fax_log_page_transfer_statistics(s, tag); fax_log_tx_parameters(s, tag); fax_log_rx_parameters(s, tag); return T30_ERR_OK; } /*- End of function --------------------------------------------------------*/ static void phase_e_handler(t30_state_t *s, void *user_data, int result) { int i; t30_stats_t t; char tag[20]; i = (int) (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase E", i); printf("%c: Phase E handler on channel %c - (%d) %s\n", i, i, result, t30_completion_code_to_str(result)); fax_log_final_transfer_statistics(s, tag); fax_log_tx_parameters(s, tag); fax_log_rx_parameters(s, tag); t30_get_transfer_statistics(s, &t); } /*- End of function --------------------------------------------------------*/ static int tx_packet_handler(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count) { return 0; } /*- End of function --------------------------------------------------------*/ static int t38_terminal_timing_update(void *user_data, struct timeval *ts) { t30_state_t *t30; logging_state_t *logging; int samples; int partial; int64_t when; int64_t diff; memcpy(&now, ts, sizeof(now)); when = ts->tv_sec*1000000LL + ts->tv_usec; if (current == 0) { if (started) current = when; return 0; } diff = when - current; samples = diff/125LL; while (samples > 0) { partial = (samples > SAMPLES_PER_CHUNK) ? SAMPLES_PER_CHUNK : samples; //fprintf(stderr, "Update time by %d samples\n", partial); logging = t38_terminal_get_logging_state(t38_terminal_state); span_log_bump_samples(logging, partial); logging = t38_core_get_logging_state(t38_core); span_log_bump_samples(logging, partial); t30 = t38_terminal_get_t30_state(t38_terminal_state); logging = t30_get_logging_state(t30); span_log_bump_samples(logging, partial); t38_terminal_send_timeout(t38_terminal_state, partial); current = when; samples -= partial; } return 0; } /*- End of function --------------------------------------------------------*/ static int t38_gateway_timing_update(void *user_data, struct timeval *ts) { t30_state_t *t30; logging_state_t *logging; int samples; int partial; int64_t when; int64_t diff; int16_t t38_amp[SAMPLES_PER_CHUNK]; int16_t t30_amp[SAMPLES_PER_CHUNK]; int16_t out_amp[2*SAMPLES_PER_CHUNK]; int t38_len; int t30_len; int outframes; int i; memcpy(&now, ts, sizeof(now)); when = ts->tv_sec*1000000LL + ts->tv_usec; if (current == 0) { if (started) current = when; return 0; } diff = when - current; samples = diff/125LL; while (samples > 0) { partial = (samples > SAMPLES_PER_CHUNK) ? SAMPLES_PER_CHUNK : samples; //fprintf(stderr, "Update time by %d samples\n", partial); logging = t38_gateway_get_logging_state(t38_gateway_state); span_log_bump_samples(logging, partial); logging = t38_core_get_logging_state(t38_core); span_log_bump_samples(logging, partial); logging = fax_get_logging_state(fax_state); span_log_bump_samples(logging, partial); t30 = fax_get_t30_state(fax_state); logging = t30_get_logging_state(t30); span_log_bump_samples(logging, partial); memset(out_amp, 0, sizeof(out_amp)); t30_len = fax_tx(fax_state, t30_amp, partial); if (!use_transmit_on_idle) { /* The receive side always expects a full block of samples, but the transmit side may not be sending any when it doesn't need to. We may need to pad with some silence. */ if (t30_len < partial) { memset(t30_amp + t30_len, 0, sizeof(int16_t)*(partial - t30_len)); t30_len = partial; } } if (log_audio) { for (i = 0; i < t30_len; i++) out_amp[2*i + 1] = t30_amp[i]; } if (t38_gateway_rx(t38_gateway_state, t30_amp, t30_len)) break; t38_len = t38_gateway_tx(t38_gateway_state, t38_amp, partial); if (!use_transmit_on_idle) { if (t38_len < partial) { memset(t38_amp + t38_len, 0, sizeof(int16_t)*(partial - t38_len)); t38_len = partial; } } if (log_audio) { for (i = 0; i < t38_len; i++) out_amp[2*i] = t38_amp[i]; } if (fax_rx(fax_state, t38_amp, partial)) break; if (log_audio) { outframes = sf_writef_short(wave_handle, out_amp, partial); if (outframes != partial) break; } if (done) break; current = when; samples -= partial; } return 0; } /*- End of function --------------------------------------------------------*/ static int ifp_handler(void *user_data, const uint8_t msg[], int len, int seq_no) { int i; started = TRUE; printf("%5d >>> ", seq_no); for (i = 0; i < len; i++) printf("%02X ", msg[i]); printf("\n"); t38_core_rx_ifp_packet(t38_core, msg, len, seq_no); return 0; } /*- End of function --------------------------------------------------------*/ static int process_packet(void *user_data, const uint8_t *pkt, int len) { static udptl_state_t *state = NULL; if (state == NULL) state = udptl_init(NULL, UDPTL_ERROR_CORRECTION_REDUNDANCY, 3, 3, ifp_handler, NULL); udptl_rx_packet(state, pkt, len); return 0; } /*- End of function --------------------------------------------------------*/ static uint32_t parse_inet_addr(const char *s) { int i; uint32_t a; uint32_t b; uint32_t c; uint32_t d; a = 0; b = 0; c = 0; d = 0; i = sscanf(s, "%" PRIu32 ".%" PRIu32 ".%" PRIu32 ".%" PRIu32, &a, &b, &c, &d); switch (i) { case 4: c = (c << 8) | d; case 3: b = (b << 16) | c; case 2: a = (a << 24) | b; } return a; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { t30_state_t *t30; logging_state_t *logging; const char *input_file_name; int t38_version; int caller; int use_ecm; int use_tep; int options; int supported_modems; int fill_removal; int opt; int t38_terminal_operation; uint32_t src_addr; uint16_t src_port; uint32_t dest_addr; uint16_t dest_port; caller = FALSE; use_ecm = FALSE; t38_version = 0; options = 0; input_file_name = INPUT_FILE_NAME; fill_removal = FALSE; use_tep = FALSE; use_transmit_on_idle = TRUE; supported_modems = T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17; t38_terminal_operation = TRUE; log_audio = FALSE; src_addr = 0; src_port = 0; dest_addr = 0; dest_port = 0; while ((opt = getopt(argc, argv, "cD:d:eFGi:lm:oS:s:tv:")) != -1) { switch (opt) { case 'c': caller = TRUE; break; case 'D': dest_addr = parse_inet_addr(optarg); break; case 'd': dest_port = atoi(optarg); break; case 'e': use_ecm = TRUE; break; case 'F': fill_removal = TRUE; break; case 'G': t38_terminal_operation = FALSE; break; case 'i': input_file_name = optarg; break; case 'l': log_audio = TRUE; break; case 'm': supported_modems = atoi(optarg); break; case 'o': options = atoi(optarg); break; case 'S': src_addr = parse_inet_addr(optarg); break; case 's': src_port = atoi(optarg); break; case 't': use_tep = TRUE; break; case 'v': t38_version = atoi(optarg); break; default: //usage(); exit(2); break; } } printf("Using T.38 version %d\n", t38_version); if (t38_terminal_operation) { if ((t38_terminal_state = t38_terminal_init(NULL, caller, tx_packet_handler, NULL)) == NULL) { fprintf(stderr, "Cannot start the T.38 channel\n"); exit(2); } t30 = t38_terminal_get_t30_state(t38_terminal_state); t38_core = t38_terminal_get_t38_core_state(t38_terminal_state); t38_set_t38_version(t38_core, t38_version); t38_terminal_set_config(t38_terminal_state, options); t38_terminal_set_tep_mode(t38_terminal_state, use_tep); t38_terminal_set_fill_bit_removal(t38_terminal_state, fill_removal); logging = t38_terminal_get_logging_state(t38_terminal_state); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38"); logging = t38_core_get_logging_state(t38_core); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38"); logging = t30_get_logging_state(t30); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38"); t30_set_supported_modems(t30, supported_modems); t30_set_tx_ident(t30, "11111111"); t30_set_tx_nsf(t30, (const uint8_t *) "\x50\x00\x00\x00Spandsp\x00", 12); if (caller) t30_set_tx_file(t30, INPUT_TIFF_FILE_NAME, -1, -1); else t30_set_rx_file(t30, OUTPUT_TIFF_FILE_NAME, -1); t30_set_phase_b_handler(t30, phase_b_handler, (void *) (intptr_t) 'A'); t30_set_phase_d_handler(t30, phase_d_handler, (void *) (intptr_t) 'A'); t30_set_phase_e_handler(t30, phase_e_handler, (void *) (intptr_t) 'A'); t30_set_ecm_capability(t30, use_ecm); t30_set_supported_compressions(t30, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION | T30_SUPPORT_T85_COMPRESSION); if (pcap_scan_pkts(input_file_name, src_addr, src_port, dest_addr, dest_port, t38_terminal_timing_update, process_packet, NULL)) exit(2); /* Push the time along, to flush out any remaining activity from the application. */ now.tv_sec += 60; t38_terminal_timing_update(NULL, &now); } else { wave_handle = NULL; if (log_audio) { if ((wave_handle = sf_open_telephony_write(OUTPUT_WAVE_FILE_NAME, 2)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUTPUT_WAVE_FILE_NAME); exit(2); } } if ((t38_gateway_state = t38_gateway_init(NULL, tx_packet_handler, NULL)) == NULL) { fprintf(stderr, "Cannot start the T.38 channel\n"); exit(2); } t38_core = t38_gateway_get_t38_core_state(t38_gateway_state); t38_gateway_set_transmit_on_idle(t38_gateway_state, use_transmit_on_idle); t38_set_t38_version(t38_core, t38_version); t38_gateway_set_ecm_capability(t38_gateway_state, use_ecm); logging = t38_gateway_get_logging_state(t38_gateway_state); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38"); logging = t38_core_get_logging_state(t38_core); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38"); if ((fax_state = fax_init(NULL, caller)) == NULL) { fprintf(stderr, "Cannot start FAX\n"); exit(2); } t30 = fax_get_t30_state(fax_state); fax_set_transmit_on_idle(fax_state, use_transmit_on_idle); fax_set_tep_mode(fax_state, use_tep); t30_set_supported_modems(t30, supported_modems); t30_set_tx_ident(t30, "22222222"); t30_set_tx_nsf(t30, (const uint8_t *) "\x50\x00\x00\x00Spandsp\x00", 12); if (caller) t30_set_tx_file(t30, INPUT_TIFF_FILE_NAME, -1, -1); else t30_set_rx_file(t30, OUTPUT_TIFF_FILE_NAME, -1); t30_set_phase_b_handler(t30, phase_b_handler, (void *) (intptr_t) 'B'); t30_set_phase_d_handler(t30, phase_d_handler, (void *) (intptr_t) 'B'); t30_set_phase_e_handler(t30, phase_e_handler, (void *) (intptr_t) 'B'); t30_set_ecm_capability(t30, use_ecm); t30_set_supported_compressions(t30, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION); logging = fax_get_logging_state(fax_state); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "FAX "); logging = t30_get_logging_state(t30); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "FAX "); if (pcap_scan_pkts(input_file_name, src_addr, src_port, dest_addr, dest_port, t38_gateway_timing_update, process_packet, NULL)) exit(2); /* Push the time along, to flush out any remaining activity from the application. */ now.tv_sec += 60; t38_gateway_timing_update(NULL, &now); fax_release(fax_state); t38_gateway_release(t38_gateway_state); if (log_audio) { if (sf_close_telephony(wave_handle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_WAVE_FILE_NAME); exit(2); } } } } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/t35_tests.c0000664000175000017500000000666412101217166013264 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t35_tests.c - Tests for T.35. * * Written by Steve Underwood * * Copyright (C) 2012 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page t35_tests_page T.35 tests \section t35_tests_page_sec_1 What does it do? */ /* Enable the following definition to enable direct probing into the structures */ //#define WITH_SPANDSP_INTERNALS #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" int main(int argc, char *argv[]) { int i; int j; uint8_t msg[50]; const char *vendor; const char *country; const char *model; const char *real_country; int first_hit; printf("Sweep through all the possible countries\n"); for (i = 0; i < 256; i++) { country = t35_country_code_to_str(i, 0); real_country = t35_real_country_code_to_str(i, 0); if (country || real_country) { printf("%3d '%s' %d '%s'\n", i, (country) ? country : "???", t35_real_country_code(i, 0), (real_country) ? real_country : "???"); } } printf("\nSweep through all the possible vendors within each country\n"); for (i = 0; i < 256; i++) { msg[0] = i; msg[1] = '\x00'; msg[2] = '\x00'; first_hit = TRUE; for (j = 0; j < 65536; j++) { msg[1] = (j >> 8) & 0xFF; msg[2] = j & 0xFF; if ((vendor = t35_vendor_to_str(msg, 3))) { if (first_hit) { if ((real_country = t35_real_country_code_to_str(i, 0))) printf("%s\n", real_country); else printf("???\n"); first_hit = FALSE; } printf(" 0x%02x 0x%02x 0x%02x '%s'\n", msg[0], msg[1], msg[2], vendor); } } } printf("\nTry a decode of a full NSF string\n"); t35_decode((uint8_t *) "\x00\x00\x0E\x00\x00\x00\x96\x0F\x01\x02\x00\x10\x05\x02\x95\xC8\x08\x01\x49\x02\x41\x53\x54\x47", 13, &country, &vendor, &model); printf("Decoded as %s %s %s\n", (country) ? country : "???", (vendor) ? vendor : "???", (model) ? model : "???"); printf("Tests passed\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/t38_gateway_tests.c0000664000175000017500000005357012101215025014776 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t38_gateway_tests.c - Tests for the T.38 FoIP gateway module. * * Written by Steve Underwood * * Copyright (C) 2005, 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page t38_gateway_tests_page T.38 gateway tests \section t38_gateway_tests_page_sec_1 What does it do? These tests exercise the path FAX machine <-> T.38 gateway <-> T.38 gateway <-> FAX machine */ /* Enable the following definition to enable direct probing into the FAX structures */ //#define WITH_SPANDSP_INTERNALS #if defined(HAVE_CONFIG_H) #include #endif #if defined(HAVE_FL_FL_H) && defined(HAVE_FL_FL_CARTESIAN_H) && defined(HAVE_FL_FL_AUDIO_METER_H) #define ENABLE_GUI #endif #include #include #include #include #include #include #include #if !defined(_WIN32) #include #endif //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #if defined(ENABLE_GUI) #include "media_monitor.h" #endif #include "fax_utils.h" #define SAMPLES_PER_CHUNK 160 #define INPUT_FILE_NAME "../test-data/itu/fax/itutests.tif" #define OUTPUT_FILE_NAME "t38.tif" #define OUTPUT_FILE_NAME_WAVE "t38_gateway.wav" fax_state_t *fax_state_a; t38_gateway_state_t *t38_state_a; t38_gateway_state_t *t38_state_b; fax_state_t *fax_state_b; g1050_state_t *path_a_to_b; g1050_state_t *path_b_to_a; double when = 0.0; int done[2] = {FALSE, FALSE}; int succeeded[2] = {FALSE, FALSE}; int simulate_incrementing_repeats = FALSE; static int phase_b_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; i = (int) (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase B", i); printf("%c: Phase B handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result)); fax_log_rx_parameters(s, tag); return T30_ERR_OK; } /*- End of function --------------------------------------------------------*/ static int phase_d_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; i = (int) (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase D", i); printf("%c: Phase D handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result)); fax_log_page_transfer_statistics(s, tag); fax_log_tx_parameters(s, tag); fax_log_rx_parameters(s, tag); return T30_ERR_OK; } /*- End of function --------------------------------------------------------*/ static void phase_e_handler(t30_state_t *s, void *user_data, int result) { int i; t30_stats_t t; char tag[20]; i = (int) (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase E", i); printf("%c: Phase E handler on channel %c - (%d) %s\n", i, i, result, t30_completion_code_to_str(result)); fax_log_final_transfer_statistics(s, tag); fax_log_tx_parameters(s, tag); fax_log_rx_parameters(s, tag); t30_get_transfer_statistics(s, &t); succeeded[i - 'A'] = (result == T30_ERR_OK) && (t.pages_tx == 12 || t.pages_rx == 12); done[i - 'A'] = TRUE; } /*- End of function --------------------------------------------------------*/ static void real_time_frame_handler(t38_gateway_state_t *s, void *user_data, int direction, const uint8_t *msg, int len) { int i; i = (intptr_t) user_data; printf("%d: Real time frame handler on channel %d - %s, %s, length = %d\n", i, i, (direction) ? "PSTN->T.38" : "T.38->PSTN", t30_frametype(msg[2]), len); } /*- End of function --------------------------------------------------------*/ static int tx_packet_handler_a(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count) { int i; static int subst_seq = 0; /* This routine queues messages between two instances of T.38 processing */ if (simulate_incrementing_repeats) { for (i = 0; i < count; i++) { span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d\n", subst_seq, len); g1050_put(path_a_to_b, buf, len, subst_seq, when); subst_seq = (subst_seq + 1) & 0xFFFF; } } else { span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d, count %d\n", s->tx_seq_no, len, count); for (i = 0; i < count; i++) g1050_put(path_a_to_b, buf, len, s->tx_seq_no, when); } return 0; } /*- End of function --------------------------------------------------------*/ static int tx_packet_handler_b(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count) { int i; static int subst_seq = 0; /* This routine queues messages between two instances of T.38 processing */ if (simulate_incrementing_repeats) { for (i = 0; i < count; i++) { span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d\n", subst_seq, len); g1050_put(path_b_to_a, buf, len, subst_seq, when); subst_seq = (subst_seq + 1) & 0xFFFF; } } else { span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d, count %d\n", s->tx_seq_no, len, count); for (i = 0; i < count; i++) g1050_put(path_b_to_a, buf, len, s->tx_seq_no, when); } return 0; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int16_t silence[SAMPLES_PER_CHUNK]; int16_t t30_amp_a[SAMPLES_PER_CHUNK]; int16_t t38_amp_a[SAMPLES_PER_CHUNK]; int16_t t38_amp_hist_a[8][SAMPLES_PER_CHUNK]; int16_t t38_amp_b[SAMPLES_PER_CHUNK]; int16_t t38_amp_hist_b[8][SAMPLES_PER_CHUNK]; int16_t t30_amp_b[SAMPLES_PER_CHUNK]; int16_t out_amp[SAMPLES_PER_CHUNK*4]; int t30_len_a; int t38_len_a; int t38_len_b; int t30_len_b; int hist_ptr; int log_audio; int msg_len; uint8_t msg[1024]; int outframes; SNDFILE *wave_handle; int use_ecm; int use_tep; int feedback_audio; int use_transmit_on_idle; int t38_version; const char *input_file_name; int i; int seq_no; int g1050_model_no; int g1050_speed_pattern_no; double tx_when; double rx_when; int supported_modems; int fill_removal; int use_gui; int opt; int drop_frame; int drop_frame_rate; t38_stats_t stats; fax_state_t *fax; t30_state_t *t30; t38_gateway_state_t *t38; t38_core_state_t *t38_core; logging_state_t *logging; log_audio = FALSE; use_ecm = FALSE; t38_version = 1; input_file_name = INPUT_FILE_NAME; simulate_incrementing_repeats = FALSE; g1050_model_no = 0; g1050_speed_pattern_no = 1; fill_removal = FALSE; use_gui = FALSE; use_tep = FALSE; feedback_audio = FALSE; use_transmit_on_idle = TRUE; supported_modems = T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17; drop_frame = 0; drop_frame_rate = 0; while ((opt = getopt(argc, argv, "D:efFgi:Ilm:M:s:tv:")) != -1) { switch (opt) { case 'D': drop_frame_rate = drop_frame = atoi(optarg); break; case 'e': use_ecm = TRUE; break; case 'f': feedback_audio = TRUE; break; case 'F': fill_removal = TRUE; break; case 'g': #if defined(ENABLE_GUI) use_gui = TRUE; #else fprintf(stderr, "Graphical monitoring not available\n"); exit(2); #endif break; case 'i': input_file_name = optarg; break; case 'I': simulate_incrementing_repeats = TRUE; break; case 'l': log_audio = TRUE; break; case 'm': supported_modems = atoi(optarg); break; case 'M': g1050_model_no = optarg[0] - 'A' + 1; break; case 's': g1050_speed_pattern_no = atoi(optarg); break; case 't': use_tep = TRUE; break; case 'v': t38_version = atoi(optarg); break; default: //usage(); exit(2); break; } } printf("Using T.38 version %d\n", t38_version); if (use_ecm) printf("Using ECM\n"); wave_handle = NULL; if (log_audio) { if ((wave_handle = sf_open_telephony_write(OUTPUT_FILE_NAME_WAVE, 4)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUTPUT_FILE_NAME_WAVE); exit(2); } } memset(silence, 0, sizeof(silence)); srand48(0x1234567); if ((path_a_to_b = g1050_init(g1050_model_no, g1050_speed_pattern_no, 100, 33)) == NULL) { fprintf(stderr, "Failed to start IP network path model\n"); exit(2); } if ((path_b_to_a = g1050_init(g1050_model_no, g1050_speed_pattern_no, 100, 33)) == NULL) { fprintf(stderr, "Failed to start IP network path model\n"); exit(2); } if ((fax_state_a = fax_init(NULL, TRUE)) == NULL) { fprintf(stderr, "Cannot start FAX\n"); exit(2); } fax = fax_state_a; t30 = fax_get_t30_state(fax); fax_set_transmit_on_idle(fax, use_transmit_on_idle); fax_set_tep_mode(fax, use_tep); t30_set_supported_modems(t30, supported_modems); t30_set_tx_ident(t30, "11111111"); t30_set_tx_nsf(t30, (const uint8_t *) "\x50\x00\x00\x00Spandsp\x00", 12); t30_set_tx_file(t30, input_file_name, -1, -1); t30_set_phase_b_handler(t30, phase_b_handler, (void *) (intptr_t) 'A'); t30_set_phase_d_handler(t30, phase_d_handler, (void *) (intptr_t) 'A'); t30_set_phase_e_handler(t30, phase_e_handler, (void *) (intptr_t) 'A'); t30_set_ecm_capability(t30, use_ecm); if (use_ecm) t30_set_supported_compressions(t30, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION); t30_set_minimum_scan_line_time(t30, 40); //t30_set_iaf_mode(t30, T30_IAF_MODE_NO_FILL_BITS); logging = fax_get_logging_state(fax); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "FAX-A "); logging = t30_get_logging_state(t30); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "FAX-A "); memset(t30_amp_a, 0, sizeof(t30_amp_a)); memset(t38_amp_hist_a, 0, sizeof(t38_amp_hist_a)); memset(t38_amp_hist_b, 0, sizeof(t38_amp_hist_b)); if ((t38_state_a = t38_gateway_init(NULL, tx_packet_handler_a, t38_state_b)) == NULL) { fprintf(stderr, "Cannot start the T.38 channel\n"); exit(2); } t38 = t38_state_a; t38_core = t38_gateway_get_t38_core_state(t38); t38_gateway_set_transmit_on_idle(t38, use_transmit_on_idle); t38_gateway_set_supported_modems(t38, supported_modems); //t38_gateway_set_nsx_suppression(t38, NULL, 0, NULL, 0); t38_gateway_set_fill_bit_removal(t38, fill_removal); t38_gateway_set_real_time_frame_handler(t38, real_time_frame_handler, NULL); t38_set_t38_version(t38_core, t38_version); t38_gateway_set_ecm_capability(t38, use_ecm); logging = t38_gateway_get_logging_state(t38); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-A"); logging = t38_core_get_logging_state(t38_core); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-A"); memset(t38_amp_a, 0, sizeof(t38_amp_a)); if ((t38_state_b = t38_gateway_init(NULL, tx_packet_handler_b, t38_state_a)) == NULL) { fprintf(stderr, "Cannot start the T.38 channel\n"); exit(2); } t38 = t38_state_b; t38_core = t38_gateway_get_t38_core_state(t38); t38_gateway_set_transmit_on_idle(t38, use_transmit_on_idle); t38_gateway_set_supported_modems(t38, supported_modems); //t38_gateway_set_nsx_suppression(t38, FALSE); t38_gateway_set_fill_bit_removal(t38, fill_removal); t38_set_t38_version(t38_core, t38_version); t38_gateway_set_ecm_capability(t38, use_ecm); logging = t38_gateway_get_logging_state(t38); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-B"); logging = t38_core_get_logging_state(t38_core); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-B"); memset(t38_amp_b, 0, sizeof(t38_amp_b)); if ((fax_state_b = fax_init(NULL, FALSE)) == NULL) { fprintf(stderr, "Cannot start FAX\n"); exit(2); } fax = fax_state_b; t30 = fax_get_t30_state(fax); fax_set_transmit_on_idle(fax, use_transmit_on_idle); fax_set_tep_mode(fax, use_tep); t30_set_supported_modems(t30, supported_modems); t30_set_tx_ident(t30, "22222222"); t30_set_tx_nsf(t30, (const uint8_t *) "\x50\x00\x00\x00Spandsp\x00", 12); t30_set_rx_file(t30, OUTPUT_FILE_NAME, -1); t30_set_phase_b_handler(t30, phase_b_handler, (void *) (intptr_t) 'B'); t30_set_phase_d_handler(t30, phase_d_handler, (void *) (intptr_t) 'B'); t30_set_phase_e_handler(t30, phase_e_handler, (void *) (intptr_t) 'B'); t30_set_ecm_capability(t30, use_ecm); if (use_ecm) t30_set_supported_compressions(t30, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION); t30_set_minimum_scan_line_time(t30, 40); logging = fax_get_logging_state(fax); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "FAX-B "); logging = t30_get_logging_state(t30); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "FAX-B "); memset(t30_amp_b, 0, sizeof(t30_amp_b)); #if defined(ENABLE_GUI) if (use_gui) start_media_monitor(); #endif hist_ptr = 0; for (;;) { logging = fax_get_logging_state(fax_state_a); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); t30 = fax_get_t30_state(fax_state_a); logging = t30_get_logging_state(t30); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); logging = t38_gateway_get_logging_state(t38_state_a); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); t38_core = t38_gateway_get_t38_core_state(t38_state_a); logging = t38_core_get_logging_state(t38_core); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); logging = t38_gateway_get_logging_state(t38_state_b); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); t38_core = t38_gateway_get_t38_core_state(t38_state_b); logging = t38_core_get_logging_state(t38_core); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); logging = fax_get_logging_state(fax_state_b); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); t30 = fax_get_t30_state(fax_state_b); logging = t30_get_logging_state(t30); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); memset(out_amp, 0, sizeof(out_amp)); t30_len_a = fax_tx(fax_state_a, t30_amp_a, SAMPLES_PER_CHUNK); if (!use_transmit_on_idle) { /* The receive side always expects a full block of samples, but the transmit side may not be sending any when it doesn't need to. We may need to pad with some silence. */ if (t30_len_a < SAMPLES_PER_CHUNK) { memset(t30_amp_a + t30_len_a, 0, sizeof(int16_t)*(SAMPLES_PER_CHUNK - t30_len_a)); t30_len_a = SAMPLES_PER_CHUNK; } } if (log_audio) { for (i = 0; i < t30_len_a; i++) out_amp[i*4] = t30_amp_a[i]; } if (feedback_audio) { for (i = 0; i < t30_len_a; i++) t30_amp_a[i] += t38_amp_hist_a[hist_ptr][i] >> 1; memcpy(t38_amp_hist_a[hist_ptr], t38_amp_a, sizeof(int16_t)*SAMPLES_PER_CHUNK); } if (drop_frame_rate && --drop_frame == 0) { drop_frame = drop_frame_rate; if (t38_gateway_rx_fillin(t38_state_a, t30_len_a)) break; } else { if (t38_gateway_rx(t38_state_a, t30_amp_a, t30_len_a)) break; } t38_len_a = t38_gateway_tx(t38_state_a, t38_amp_a, SAMPLES_PER_CHUNK); if (!use_transmit_on_idle) { if (t38_len_a < SAMPLES_PER_CHUNK) { memset(t38_amp_a + t38_len_a, 0, sizeof(int16_t)*(SAMPLES_PER_CHUNK - t38_len_a)); t38_len_a = SAMPLES_PER_CHUNK; } } if (log_audio) { for (i = 0; i < t38_len_a; i++) out_amp[i*4 + 1] = t38_amp_a[i]; } if (fax_rx(fax_state_a, t38_amp_a, SAMPLES_PER_CHUNK)) break; t30_len_b = fax_tx(fax_state_b, t30_amp_b, SAMPLES_PER_CHUNK); if (!use_transmit_on_idle) { /* The receive side always expects a full block of samples, but the transmit side may not be sending any when it doesn't need to. We may need to pad with some silence. */ if (t30_len_b < SAMPLES_PER_CHUNK) { memset(t30_amp_b + t30_len_b, 0, sizeof(int16_t)*(SAMPLES_PER_CHUNK - t30_len_b)); t30_len_b = SAMPLES_PER_CHUNK; } } if (log_audio) { for (i = 0; i < t30_len_b; i++) out_amp[i*4 + 3] = t30_amp_b[i]; } if (feedback_audio) { for (i = 0; i < t30_len_b; i++) t30_amp_b[i] += t38_amp_hist_b[hist_ptr][i] >> 1; memcpy(t38_amp_hist_b[hist_ptr], t38_amp_b, sizeof(int16_t)*SAMPLES_PER_CHUNK); } if (drop_frame_rate && --drop_frame == 0) { drop_frame = drop_frame_rate; if (t38_gateway_rx_fillin(t38_state_b, t30_len_b)) break; } else { if (t38_gateway_rx(t38_state_b, t30_amp_b, t30_len_b)) break; } t38_len_b = t38_gateway_tx(t38_state_b, t38_amp_b, SAMPLES_PER_CHUNK); if (!use_transmit_on_idle) { if (t38_len_b < SAMPLES_PER_CHUNK) { memset(t38_amp_b + t38_len_b, 0, sizeof(int16_t)*(SAMPLES_PER_CHUNK - t38_len_b)); t38_len_b = SAMPLES_PER_CHUNK; } } if (log_audio) { for (i = 0; i < t38_len_b; i++) out_amp[i*4 + 2] = t38_amp_b[i]; } if (fax_rx(fax_state_b, t38_amp_b, SAMPLES_PER_CHUNK)) break; when += (float) SAMPLES_PER_CHUNK/(float) SAMPLE_RATE; while ((msg_len = g1050_get(path_a_to_b, msg, 1024, when, &seq_no, &tx_when, &rx_when)) >= 0) { #if defined(ENABLE_GUI) if (use_gui) media_monitor_rx(seq_no, tx_when, rx_when); #endif t38_core = t38_gateway_get_t38_core_state(t38_state_b); t38_core_rx_ifp_packet(t38_core, msg, msg_len, seq_no); } while ((msg_len = g1050_get(path_b_to_a, msg, 1024, when, &seq_no, &tx_when, &rx_when)) >= 0) { #if defined(ENABLE_GUI) if (use_gui) media_monitor_rx(seq_no, tx_when, rx_when); #endif t38_core = t38_gateway_get_t38_core_state(t38_state_a); t38_core_rx_ifp_packet(t38_core, msg, msg_len, seq_no); } if (log_audio) { outframes = sf_writef_short(wave_handle, out_amp, SAMPLES_PER_CHUNK); if (outframes != SAMPLES_PER_CHUNK) break; } if (done[0] && done[1]) break; #if defined(ENABLE_GUI) if (use_gui) media_monitor_update_display(); #endif if (++hist_ptr > 3) hist_ptr = 0; } t38_gateway_get_transfer_statistics(t38_state_a, &stats); printf("A side exchanged %d pages at %dbps, in %s mode\n", stats.pages_transferred, stats.bit_rate, (stats.error_correcting_mode) ? "ECM" : "non-ECM"); t38_gateway_get_transfer_statistics(t38_state_a, &stats); printf("B side exchanged %d pages at %dbps, in %s mode\n", stats.pages_transferred, stats.bit_rate, (stats.error_correcting_mode) ? "ECM" : "non-ECM"); fax_release(fax_state_a); fax_release(fax_state_b); if (log_audio) { if (sf_close(wave_handle) != 0) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME_WAVE); exit(2); } } if (!succeeded[0] || !succeeded[1]) { printf("Tests failed\n"); exit(2); } printf("Tests passed\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/v27ter_tests.c0000664000175000017500000005024112101213302013754 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v27ter_tests.c * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page v27ter_tests_page V.27ter modem tests \section v27ter_tests_page_sec_1 What does it do? These tests test one way paths, as V.27ter is a half-duplex modem. They allow either: - A V.27ter transmit modem to feed a V.27ter receive modem through a telephone line model. BER testing is then used to evaluate performance under various line conditions. This is effective for testing the basic performance of the receive modem. It is also the only test mode provided for evaluating the transmit modem. - A V.27ter receive modem is used to decode V.27ter audio, stored in an audio file. This is good way to evaluate performance with audio recorded from other models of modem, and with real world problematic telephone lines. If the appropriate GUI environment exists, the tests are built such that a visual display of modem status is maintained. \section v27ter_tests_page_sec_2 How is it used? */ /* Enable the following definition to enable direct probing into the FAX structures */ #define WITH_SPANDSP_INTERNALS #if defined(HAVE_CONFIG_H) #include "config.h" #endif #if defined(HAVE_FL_FL_H) && defined(HAVE_FL_FL_CARTESIAN_H) && defined(HAVE_FL_FL_AUDIO_METER_H) #define ENABLE_GUI #endif #include #include #include #include #include #include #include #if defined(HAVE_FENV_H) #define __USE_GNU #include #endif //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #if defined(ENABLE_GUI) #include "modem_monitor.h" #include "line_model_monitor.h" #endif #define BLOCK_LEN 160 #define OUT_FILE_NAME "v27ter.wav" char *decode_test_file = NULL; int use_gui = FALSE; int symbol_no = 0; int rx_bits = 0; bert_state_t bert; one_way_line_model_state_t *line_model; #if defined(ENABLE_GUI) qam_monitor_t *qam_monitor; #endif bert_results_t latest_results; static void reporter(void *user_data, int reason, bert_results_t *results) { switch (reason) { case BERT_REPORT_REGULAR: fprintf(stderr, "BERT report regular - %d bits, %d bad bits, %d resyncs\n", results->total_bits, results->bad_bits, results->resyncs); memcpy(&latest_results, results, sizeof(latest_results)); break; default: fprintf(stderr, "BERT report %s\n", bert_event_to_str(reason)); break; } } /*- End of function --------------------------------------------------------*/ static void v27ter_rx_status(void *user_data, int status) { v27ter_rx_state_t *s; int i; int len; #if defined(SPANDSP_USE_FIXED_POINTx) complexi16_t *coeffs; #else complexf_t *coeffs; #endif printf("V.27ter rx status is %s (%d)\n", signal_status_to_str(status), status); s = (v27ter_rx_state_t *) user_data; switch (status) { case SIG_STATUS_TRAINING_SUCCEEDED: len = v27ter_rx_equalizer_state(s, &coeffs); printf("Equalizer:\n"); for (i = 0; i < len; i++) #if defined(SPANDSP_USE_FIXED_POINTx) printf("%3d (%15.5f, %15.5f)\n", i, coeffs[i].re/4096.0f, coeffs[i].im/4096.0f); #else printf("%3d (%15.5f, %15.5f) -> %15.5f\n", i, coeffs[i].re, coeffs[i].im, powerf(&coeffs[i])); #endif break; } } /*- End of function --------------------------------------------------------*/ static void v27terputbit(void *user_data, int bit) { if (bit < 0) { v27ter_rx_status(user_data, bit); return; } if (decode_test_file) printf("Rx bit %d - %d\n", rx_bits++, bit); else bert_put_bit(&bert, bit); } /*- End of function --------------------------------------------------------*/ static void v27ter_tx_status(void *user_data, int status) { printf("V.27ter tx status is %s (%d)\n", signal_status_to_str(status), status); } /*- End of function --------------------------------------------------------*/ static int v27tergetbit(void *user_data) { return bert_get_bit(&bert); } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINTx) static void qam_report(void *user_data, const complexi16_t *constel, const complexi16_t *target, int symbol) #else static void qam_report(void *user_data, const complexf_t *constel, const complexf_t *target, int symbol) #endif { int i; int len; #if defined(SPANDSP_USE_FIXED_POINTx) complexi16_t *coeffs; complexf_t constel_point; #else complexf_t *coeffs; #endif float fpower; float error; v27ter_rx_state_t *rx; static float smooth_power = 0.0f; #if defined(ENABLE_GUI) static int reports = 0; #endif rx = (v27ter_rx_state_t *) user_data; if (constel) { fpower = (constel->re - target->re)*(constel->re - target->re) + (constel->im - target->im)*(constel->im - target->im); #if defined(SPANDSP_USE_FIXED_POINTx) fpower /= 1024.0*1024.0; #endif smooth_power = 0.95f*smooth_power + 0.05f*fpower; #if defined(ENABLE_GUI) if (use_gui) { #if defined(SPANDSP_USE_FIXED_POINTx) constel_point.re = constel->re/1024.0; constel_point.im = constel->im/1024.0; qam_monitor_update_constel(qam_monitor, &constel_point); #else qam_monitor_update_constel(qam_monitor, constel); #endif qam_monitor_update_carrier_tracking(qam_monitor, v27ter_rx_carrier_frequency(rx)); qam_monitor_update_symbol_tracking(qam_monitor, v27ter_rx_symbol_timing_correction(rx)); } #endif error = constel->im*target->re - constel->re*target->im; #if defined(SPANDSP_USE_FIXED_POINTx) printf("Tracking error %f %f %f %f %f %f\n", error, v27ter_rx_carrier_frequency(rx), constel->re/1024.0, constel->im/1024.0, target->re/1024.0, target->im/1024.0); #else printf("Tracking error %f %f %f %f %f %f\n", error, v27ter_rx_carrier_frequency(rx), constel->re, constel->im, target->re, target->im); #endif printf("%8d [%8.4f, %8.4f] [%8.4f, %8.4f] %2x %8.4f %8.4f %9.4f %7.3f %7.4f\n", symbol_no, #if defined(SPANDSP_USE_FIXED_POINTx) constel->re/1024.0, constel->im/1024.0, target->re/1024.0, target->im/1024.0, #else constel->re, constel->im, target->re, target->im, #endif symbol, fpower, smooth_power, v27ter_rx_carrier_frequency(rx), v27ter_rx_signal_power(rx), v27ter_rx_symbol_timing_correction(rx)); len = v27ter_rx_equalizer_state(rx, &coeffs); printf("Equalizer B:\n"); for (i = 0; i < len; i++) #if defined(SPANDSP_USE_FIXED_POINTx) printf("%3d (%15.5f, %15.5f)\n", i, coeffs[i].re/1024.0f, coeffs[i].im/1024.0f); #else printf("%3d (%15.5f, %15.5f) -> %15.5f\n", i, coeffs[i].re, coeffs[i].im, powerf(&coeffs[i])); #endif #if defined(WITH_SPANDSP_INTERNALS) printf("Gardtest %d %f %d\n", symbol_no, v27ter_rx_symbol_timing_correction(rx), rx->gardner_integrate); #endif printf("Carcar %d %f\n", symbol_no, v27ter_rx_carrier_frequency(rx)); #if defined(ENABLE_GUI) if (use_gui) { if (++reports >= 1000) { #if defined(SPANDSP_USE_FIXED_POINTx) qam_monitor_update_int_equalizer(qam_monitor, coeffs, len); #else qam_monitor_update_equalizer(qam_monitor, coeffs, len); #endif reports = 0; } } #endif symbol_no++; } else { printf("Gardner step %d\n", symbol); len = v27ter_rx_equalizer_state(rx, &coeffs); printf("Equalizer A:\n"); for (i = 0; i < len; i++) #if defined(SPANDSP_USE_FIXED_POINTx) printf("%3d (%15.5f, %15.5f)\n", i, coeffs[i].re/1024.0f, coeffs[i].im/1024.0f); #else printf("%3d (%15.5f, %15.5f) -> %15.5f\n", i, coeffs[i].re, coeffs[i].im, powerf(&coeffs[i])); #endif #if defined(ENABLE_GUI) if (use_gui) { #if defined(SPANDSP_USE_FIXED_POINTx) qam_monitor_update_int_equalizer(qam_monitor, coeffs, len); #else qam_monitor_update_equalizer(qam_monitor, coeffs, len); #endif } #endif } } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_FENV_H) static void sigfpe_handler(int sig_num, siginfo_t *info, void *data) { switch (sig_num) { case SIGFPE: switch (info->si_code) { case FPE_INTDIV: fprintf(stderr, "integer divide by zero at %p\n", info->si_addr); break; case FPE_INTOVF: fprintf(stderr, "integer overflow at %p\n", info->si_addr); break; case FPE_FLTDIV: fprintf(stderr, "FP divide by zero at %p\n", info->si_addr); break; case FPE_FLTOVF: fprintf(stderr, "FP overflow at %p\n", info->si_addr); break; case FPE_FLTUND: fprintf(stderr, "FP underflow at %p\n", info->si_addr); break; case FPE_FLTRES: fprintf(stderr, "FP inexact result at %p\n", info->si_addr); break; case FPE_FLTINV: fprintf(stderr, "FP invalid operation at %p\n", info->si_addr); break; case FPE_FLTSUB: fprintf(stderr, "subscript out of range at %p\n", info->si_addr); break; } break; default: fprintf(stderr, "Unexpected signal %d\n", sig_num); break; } exit(2); } /*- End of function --------------------------------------------------------*/ static void fpe_trap_setup(void) { struct sigaction trap; sigemptyset(&trap.sa_mask); trap.sa_flags = SA_SIGINFO; trap.sa_sigaction = sigfpe_handler; sigaction(SIGFPE, &trap, NULL); //feenableexcept(FE_DIVBYZERO | FE_INEXACT | FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW); //feenableexcept(FE_ALL_EXCEPT); feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); } /*- End of function --------------------------------------------------------*/ #endif int main(int argc, char *argv[]) { v27ter_rx_state_t *rx; v27ter_tx_state_t *tx; bert_results_t bert_results; int16_t gen_amp[BLOCK_LEN]; int16_t amp[BLOCK_LEN]; SNDFILE *inhandle; SNDFILE *outhandle; int outframes; int samples; int tep; int test_bps; int noise_level; int signal_level; int bits_per_test; int line_model_no; int block_no; int log_audio; int channel_codec; int rbs_pattern; int opt; logging_state_t *logging; channel_codec = MUNGE_CODEC_NONE; rbs_pattern = 0; test_bps = 4800; tep = FALSE; line_model_no = 0; decode_test_file = NULL; use_gui = FALSE; noise_level = -70; signal_level = -13; bits_per_test = 50000; log_audio = FALSE; while ((opt = getopt(argc, argv, "b:B:c:d:glm:n:r:s:t")) != -1) { switch (opt) { case 'b': test_bps = atoi(optarg); if (test_bps != 4800 && test_bps != 2400) { fprintf(stderr, "Invalid bit rate specified\n"); exit(2); } break; case 'B': bits_per_test = atoi(optarg); break; case 'c': channel_codec = atoi(optarg); break; case 'd': decode_test_file = optarg; break; case 'g': #if defined(ENABLE_GUI) use_gui = TRUE; #else fprintf(stderr, "Graphical monitoring not available\n"); exit(2); #endif break; case 'l': log_audio = TRUE; break; case 'm': line_model_no = atoi(optarg); break; case 'n': noise_level = atoi(optarg); break; case 'r': rbs_pattern = atoi(optarg); break; case 's': signal_level = atoi(optarg); break; case 't': tep = TRUE; break; default: //usage(); exit(2); break; } } inhandle = NULL; outhandle = NULL; #if defined(HAVE_FENV_H) fpe_trap_setup(); #endif if (log_audio) { if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME); exit(2); } } if (decode_test_file) { /* We will decode the audio from a file. */ tx = NULL; if ((inhandle = sf_open_telephony_read(decode_test_file, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", decode_test_file); exit(2); } } else { /* We will generate V.27ter audio, and add some noise to it. */ tx = v27ter_tx_init(NULL, test_bps, tep, v27tergetbit, NULL); logging = v27ter_tx_get_logging_state(tx); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "V.27ter-tx"); v27ter_tx_power(tx, signal_level); v27ter_tx_set_modem_status_handler(tx, v27ter_tx_status, (void *) tx); /* Move the carrier off a bit */ #if defined(WITH_SPANDSP_INTERNALS) tx->carrier_phase_rate = dds_phase_ratef(1810.0f); #endif bert_init(&bert, bits_per_test, BERT_PATTERN_ITU_O152_11, test_bps, 20); bert_set_report(&bert, 10000, reporter, NULL); if ((line_model = one_way_line_model_init(line_model_no, (float) noise_level, channel_codec, rbs_pattern)) == NULL) { fprintf(stderr, " Failed to create line model\n"); exit(2); } } rx = v27ter_rx_init(NULL, test_bps, v27terputbit, NULL); logging = v27ter_rx_get_logging_state(rx); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "V.27ter-rx"); v27ter_rx_set_modem_status_handler(rx, v27ter_rx_status, (void *) rx); v27ter_rx_set_qam_report_handler(rx, qam_report, (void *) rx); #if defined(ENABLE_GUI) if (use_gui) { qam_monitor = qam_monitor_init(2.0f, NULL); if (!decode_test_file) { start_line_model_monitor(129); line_model_monitor_line_model_update(line_model->near_filter, line_model->near_filter_len); } } #endif memset(&latest_results, 0, sizeof(latest_results)); for (block_no = 0; ; block_no++) { if (decode_test_file) { samples = sf_readf_short(inhandle, amp, BLOCK_LEN); #if defined(ENABLE_GUI) if (use_gui) qam_monitor_update_audio_level(qam_monitor, amp, samples); #endif if (samples == 0) break; } else { samples = v27ter_tx(tx, gen_amp, BLOCK_LEN); #if defined(ENABLE_GUI) if (use_gui) qam_monitor_update_audio_level(qam_monitor, gen_amp, samples); #endif if (samples == 0) { printf("Restarting on zero output\n"); /* Push a little silence through, to ensure all the data bits get out of the buffers */ vec_zeroi16(amp, BLOCK_LEN); v27ter_rx(rx, amp, BLOCK_LEN); v27ter_rx(rx, amp, BLOCK_LEN); v27ter_rx(rx, amp, BLOCK_LEN); /* Note that we might get a few bad bits as the carrier shuts down. */ bert_result(&bert, &bert_results); fprintf(stderr, "Final result %ddBm0/%ddBm0, %d bits, %d bad bits, %d resyncs\n", signal_level, noise_level, bert_results.total_bits, bert_results.bad_bits, bert_results.resyncs); fprintf(stderr, "Last report %ddBm0/%ddBm0, %d bits, %d bad bits, %d resyncs\n", signal_level, noise_level, latest_results.total_bits, latest_results.bad_bits, latest_results.resyncs); /* See if bit errors are appearing yet. Also check we are getting enough bits out of the receiver. The last regular report should be error free, though the final report will generally contain bits errors as the carrier was dying. The total number of bits out of the receiver should be at least the number we sent. Also, since BERT sync should have occurred rapidly at the start of transmission, the last report should have occurred at not much less than the total number of bits we sent. */ if (bert_results.total_bits < bits_per_test || latest_results.total_bits < bits_per_test - 100 || latest_results.bad_bits != 0) { break; } memset(&latest_results, 0, sizeof(latest_results)); signal_level--; v27ter_tx_restart(tx, test_bps, tep); v27ter_tx_power(tx, signal_level); v27ter_rx_restart(rx, test_bps, FALSE); bert_init(&bert, bits_per_test, BERT_PATTERN_ITU_O152_11, test_bps, 20); bert_set_report(&bert, 10000, reporter, NULL); one_way_line_model_release(line_model); if ((line_model = one_way_line_model_init(line_model_no, (float) noise_level, channel_codec, 0)) == NULL) { fprintf(stderr, " Failed to create line model\n"); exit(2); } } if (log_audio) { outframes = sf_writef_short(outhandle, gen_amp, samples); if (outframes != samples) { fprintf(stderr, " Error writing audio file\n"); exit(2); } } one_way_line_model(line_model, amp, gen_amp, samples); } #if defined(ENABLE_GUI) if (use_gui && !decode_test_file) line_model_monitor_line_spectrum_update(amp, samples); #endif v27ter_rx(rx, amp, samples); } if (!decode_test_file) { bert_result(&bert, &bert_results); fprintf(stderr, "At completion:\n"); fprintf(stderr, "Final result %ddBm0/%ddBm0, %d bits, %d bad bits, %d resyncs\n", signal_level, noise_level, bert_results.total_bits, bert_results.bad_bits, bert_results.resyncs); fprintf(stderr, "Last report %ddBm0/%ddBm0, %d bits, %d bad bits, %d resyncs\n", signal_level, noise_level, latest_results.total_bits, latest_results.bad_bits, latest_results.resyncs); one_way_line_model_release(line_model); if (signal_level > -43) { printf("Tests failed.\n"); exit(2); } printf("Tests passed.\n"); } #if defined(ENABLE_GUI) if (use_gui) qam_wait_to_end(qam_monitor); #endif if (decode_test_file) { if (sf_close_telephony(inhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", decode_test_file); exit(2); } } if (log_audio) { if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME); exit(2); } } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/bert_tests.c0000664000175000017500000003225112101212424013564 00000000000000/* * SpanDSP - a series of DSP components for telephony * * bert_tests.c - Tests for the BER tester. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page bert_tests_page BERT tests \section bert_tests_page_sec_1 What does it do? These tests exercise each of the BERT standards supported by the BERT module. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" /* Use a local random generator, so the results are consistent across platforms */ static int my_rand(void) { static int rndnum = 1234567; return (rndnum = 1664525U*rndnum + 1013904223U); } /*- End of function --------------------------------------------------------*/ static void reporter(void *user_data, int reason, bert_results_t *results) { int channel; channel = (int) (intptr_t) user_data; printf("%d: BERT report '%s' ", channel, bert_event_to_str(reason)); switch (reason) { case BERT_REPORT_REGULAR: printf("%d bits, %d bad bits, %d resyncs", results->total_bits, results->bad_bits, results->resyncs); break; } printf("\r"); } /*- End of function --------------------------------------------------------*/ int8_t test[0x800000]; int main(int argc, char *argv[]) { bert_state_t tx_bert; bert_state_t rx_bert; bert_state_t bert; bert_results_t bert_results; int i; int bit; int zeros; int max_zeros; int failed; bert_init(&tx_bert, 0, BERT_PATTERN_ZEROS, 300, 20); bert_init(&rx_bert, 0, BERT_PATTERN_ZEROS, 300, 20); for (i = 0; i < 511*2; i++) { bit = bert_get_bit(&tx_bert); bert_put_bit(&rx_bert, bit); } bert_result(&rx_bert, &bert_results); printf("Zeros: Bad bits %d/%d\n", bert_results.bad_bits, bert_results.total_bits); if (bert_results.bad_bits || bert_results.total_bits != 950) { printf("Test failed.\n"); exit(2); } bert_init(&tx_bert, 0, BERT_PATTERN_ONES, 300, 20); bert_init(&rx_bert, 0, BERT_PATTERN_ONES, 300, 20); for (i = 0; i < 511*2; i++) { bit = bert_get_bit(&tx_bert); bert_put_bit(&rx_bert, bit); } bert_result(&rx_bert, &bert_results); printf("Ones: Bad bits %d/%d\n", bert_results.bad_bits, bert_results.total_bits); if (bert_results.bad_bits || bert_results.total_bits != 950) { printf("Test failed.\n"); exit(2); } bert_init(&tx_bert, 0, BERT_PATTERN_1_TO_7, 300, 20); bert_init(&rx_bert, 0, BERT_PATTERN_1_TO_7, 300, 20); for (i = 0; i < 511*2; i++) { bit = bert_get_bit(&tx_bert); bert_put_bit(&rx_bert, bit); } bert_result(&rx_bert, &bert_results); printf("1 to 7: Bad bits %d/%d\n", bert_results.bad_bits, bert_results.total_bits); if (bert_results.bad_bits || bert_results.total_bits != 950) { printf("Test failed.\n"); exit(2); } bert_init(&tx_bert, 0, BERT_PATTERN_1_TO_3, 300, 20); bert_init(&rx_bert, 0, BERT_PATTERN_1_TO_3, 300, 20); for (i = 0; i < 511*2; i++) { bit = bert_get_bit(&tx_bert); bert_put_bit(&rx_bert, bit); } bert_result(&rx_bert, &bert_results); printf("1 to 3: Bad bits %d/%d\n", bert_results.bad_bits, bert_results.total_bits); if (bert_results.bad_bits || bert_results.total_bits != 950) { printf("Test failed.\n"); exit(2); } bert_init(&tx_bert, 0, BERT_PATTERN_1_TO_1, 300, 20); bert_init(&rx_bert, 0, BERT_PATTERN_1_TO_1, 300, 20); for (i = 0; i < 511*2; i++) { bit = bert_get_bit(&tx_bert); bert_put_bit(&rx_bert, bit); } bert_result(&rx_bert, &bert_results); printf("1 to 1: Bad bits %d/%d\n", bert_results.bad_bits, bert_results.total_bits); if (bert_results.bad_bits || bert_results.total_bits != 950) { printf("Test failed.\n"); exit(2); } bert_init(&tx_bert, 0, BERT_PATTERN_3_TO_1, 300, 20); bert_init(&rx_bert, 0, BERT_PATTERN_3_TO_1, 300, 20); for (i = 0; i < 511*2; i++) { bit = bert_get_bit(&tx_bert); bert_put_bit(&rx_bert, bit); } bert_result(&rx_bert, &bert_results); printf("3 to 1: Bad bits %d/%d\n", bert_results.bad_bits, bert_results.total_bits); if (bert_results.bad_bits || bert_results.total_bits != 950) { printf("Test failed.\n"); exit(2); } bert_init(&tx_bert, 0, BERT_PATTERN_7_TO_1, 300, 20); bert_init(&rx_bert, 0, BERT_PATTERN_7_TO_1, 300, 20); for (i = 0; i < 511*2; i++) { bit = bert_get_bit(&tx_bert); bert_put_bit(&rx_bert, bit); } bert_result(&rx_bert, &bert_results); printf("7 to 1: Bad bits %d/%d\n", bert_results.bad_bits, bert_results.total_bits); if (bert_results.bad_bits || bert_results.total_bits != 950) { printf("Test failed.\n"); exit(2); } bert_init(&tx_bert, 0, BERT_PATTERN_ITU_O153_9, 300, 20); bert_init(&rx_bert, 0, BERT_PATTERN_ITU_O153_9, 300, 20); for (i = 0; i < 0x200; i++) test[i] = 0; max_zeros = 0; zeros = 0; for (i = 0; i < 511*2; i++) { bit = bert_get_bit(&tx_bert); if (bit) { if (zeros > max_zeros) max_zeros = zeros; zeros = 0; } else { zeros++; } bert_put_bit(&rx_bert, bit); test[tx_bert.tx.reg]++; } failed = FALSE; if (test[0] != 0) { printf("XXX %d %d\n", 0, test[0]); failed = TRUE; } for (i = 1; i < 0x200; i++) { if (test[i] != 2) { printf("XXX %d %d\n", i, test[i]); failed = TRUE; } } bert_result(&rx_bert, &bert_results); printf("O.153(9): Bad bits %d/%d, max zeros %d\n", bert_results.bad_bits, bert_results.total_bits, max_zeros); if (bert_results.bad_bits || bert_results.total_bits != 986 || failed) { printf("Test failed.\n"); exit(2); } bert_init(&tx_bert, 0, BERT_PATTERN_ITU_O152_11, 300, 20); bert_init(&rx_bert, 0, BERT_PATTERN_ITU_O152_11, 300, 20); for (i = 0; i < 0x800; i++) test[i] = 0; max_zeros = 0; zeros = 0; for (i = 0; i < 2047*2; i++) { bit = bert_get_bit(&tx_bert); if (bit) { if (zeros > max_zeros) max_zeros = zeros; zeros = 0; } else { zeros++; } bert_put_bit(&rx_bert, bit); test[tx_bert.tx.reg]++; } failed = FALSE; if (test[0] != 0) { printf("XXX %d %d\n", 0, test[0]); failed = TRUE; } for (i = 1; i < 0x800; i++) { if (test[i] != 2) { printf("XXX %d %d\n", i, test[i]); failed = TRUE; } } bert_result(&rx_bert, &bert_results); printf("O.152(11): Bad bits %d/%d, max zeros %d\n", bert_results.bad_bits, bert_results.total_bits, max_zeros); if (bert_results.bad_bits || bert_results.total_bits != 4052 || failed) { printf("Test failed.\n"); exit(2); } bert_init(&tx_bert, 0, BERT_PATTERN_ITU_O151_15, 300, 20); bert_init(&rx_bert, 0, BERT_PATTERN_ITU_O151_15, 300, 20); for (i = 0; i < 0x8000; i++) test[i] = 0; max_zeros = 0; zeros = 0; for (i = 0; i < 32767*2; i++) { bit = bert_get_bit(&tx_bert); if (bit) { if (zeros > max_zeros) max_zeros = zeros; zeros = 0; } else { zeros++; } bert_put_bit(&rx_bert, bit); test[tx_bert.tx.reg]++; } failed = FALSE; if (test[0] != 0) { printf("XXX %d %d\n", 0, test[0]); failed = TRUE; } for (i = 1; i < 0x8000; i++) { if (test[i] != 2) { printf("XXX %d %d\n", i, test[i]); failed = TRUE; } } bert_result(&rx_bert, &bert_results); printf("O.151(15): Bad bits %d/%d, max zeros %d\n", bert_results.bad_bits, bert_results.total_bits, max_zeros); if (bert_results.bad_bits || bert_results.total_bits != 65480 || failed) { printf("Test failed.\n"); exit(2); } bert_init(&tx_bert, 0, BERT_PATTERN_ITU_O151_20, 300, 20); bert_init(&rx_bert, 0, BERT_PATTERN_ITU_O151_20, 300, 20); for (i = 0; i < 0x100000; i++) test[i] = 0; max_zeros = 0; zeros = 0; for (i = 0; i < 1048575*2; i++) { bit = bert_get_bit(&tx_bert); if (bit) { if (zeros > max_zeros) max_zeros = zeros; zeros = 0; } else { zeros++; } bert_put_bit(&rx_bert, bit); test[tx_bert.tx.reg]++; } failed = FALSE; if (test[0] != 0) { printf("XXX %d %d\n", 0, test[0]); failed = TRUE; } for (i = 1; i < 0x100000; i++) { if (test[i] != 2) printf("XXX %d %d\n", i, test[i]); } bert_result(&rx_bert, &bert_results); printf("O.151(20): Bad bits %d/%d, max zeros %d\n", bert_results.bad_bits, bert_results.total_bits, max_zeros); if (bert_results.bad_bits || bert_results.total_bits != 2097066 || failed) { printf("Test failed.\n"); exit(2); } bert_init(&tx_bert, 0, BERT_PATTERN_ITU_O151_23, 300, 20); bert_init(&rx_bert, 0, BERT_PATTERN_ITU_O151_23, 300, 20); for (i = 0; i < 0x800000; i++) test[i] = 0; max_zeros = 0; zeros = 0; for (i = 0; i < 8388607*2; i++) { bit = bert_get_bit(&tx_bert); if (bit) { if (zeros > max_zeros) max_zeros = zeros; zeros = 0; } else { zeros++; } bert_put_bit(&rx_bert, bit); test[tx_bert.tx.reg]++; } failed = FALSE; if (test[0] != 0) { printf("XXX %d %d\n", 0, test[0]); failed = TRUE; } for (i = 1; i < 0x800000; i++) { if (test[i] != 2) printf("XXX %d %d\n", i, test[i]); } bert_result(&rx_bert, &bert_results); printf("O.151(23): Bad bits %d/%d, max zeros %d\n", bert_results.bad_bits, bert_results.total_bits, max_zeros); if (bert_results.bad_bits || bert_results.total_bits != 16777136 || failed) { printf("Test failed.\n"); exit(2); } bert_init(&tx_bert, 0, BERT_PATTERN_QBF, 300, 20); bert_init(&rx_bert, 0, BERT_PATTERN_QBF, 300, 20); for (i = 0; i < 100000; i++) { bit = bert_get_bit(&tx_bert); bert_put_bit(&rx_bert, bit); } bert_result(&rx_bert, &bert_results); printf("QBF: Bad bits %d/%d\n", bert_results.bad_bits, bert_results.total_bits); if (bert_results.bad_bits || bert_results.total_bits != 100000) { printf("Test failed.\n"); exit(2); } /* Test the mechanism for categorising the error rate into <10^x bands */ /* TODO: The result of this test is not checked automatically */ bert_init(&bert, 15000000, BERT_PATTERN_ITU_O152_11, 300, 20); bert_set_report(&bert, 100000, reporter, (intptr_t) 0); for (;;) { if ((bit = bert_get_bit(&bert)) == SIG_STATUS_END_OF_DATA) { bert_result(&bert, &bert_results); printf("Rate test: %d bits, %d bad bits, %d resyncs\n", bert_results.total_bits, bert_results.bad_bits, bert_results.resyncs); if (bert_results.total_bits != 15000000 - 42 || bert_results.bad_bits != 58 || bert_results.resyncs != 0) { printf("Tests failed\n"); exit(2); } break; //bert_init(&bert, 15000000, BERT_PATTERN_ITU_O152_11, 300, 20); //bert_set_report(&bert, 100000, reporter, (intptr_t) 0); //continue; } if ((my_rand() & 0x3FFFF) == 0) bit ^= 1; //if ((my_rand() & 0xFFF) == 0) // bert_put_bit(&bert, bit); bert_put_bit(&bert, bit); } printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/math_fixed_tests.c0000644000175000017500000002523012101005452014736 00000000000000/* * SpanDSP - a series of DSP components for telephony * * math_fixed_tests.c - Test the fixed point math functions. * * Written by Steve Underwood * * Copyright (C) 2010 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page math_fixed_tests_page Fixed point math function tests \section math_fixed_tests_page_sec_1 What does it do? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" static void fixed_reciprocal16_tests(void) { int x; uint16_t yu16; uint32_t yu32; double z; double ratio; double max; double min; int shift; /* The reciprocal should be with about 0.4%, except for 0, which is obviously a special case. */ printf("fixed_reciprocal16() function tests\n"); if (fixed_reciprocal16(0, &shift) != 0xFFFF || shift != 0) { printf("Test failed\n"); exit(2); } min = 999999.0; max = -999999.0; for (x = 1; x < 65536; x++) { yu16 = fixed_reciprocal16(x, &shift); yu32 = ((uint32_t) yu16) << shift; z = 32768.0*32768.0/x; ratio = z/yu32; //printf("%6x %15d %f %f\n", x, yu32, z, ratio); if (ratio < min) min = ratio; if (ratio > max) max = ratio; if (ratio < 0.996 || ratio > 1.004) { printf("Test failed\n"); exit(2); } } printf("min %f, max %f\n", min, max); printf("Test passed\n"); } /*- End of function --------------------------------------------------------*/ static void fixed_divide16_tests(void) { int x; int y; uint16_t yu16; double z; double ratio; double max; double min; printf("fixed_divide16() function tests\n"); if (fixed_divide16(12345, 0) != 0xFFFF) { printf("Test failed\n"); exit(2); } min = 999999.0; max = -999999.0; for (y = 32; y < 65536; y += 16) { for (x = y*16; x < 65536; x += 16) { yu16 = fixed_divide16(y, x); z = 32768.0*y/x; ratio = z/yu16; //printf("%6d %6d %6d %f %f\n", x, y, yu16, z, ratio); if (ratio < min) min = ratio; if (ratio > max) max = ratio; if (ratio < 0.996 || ratio > 1.07) { printf("Test failed\n"); exit(2); } } } printf("min %f, max %f\n", min, max); printf("Test passed\n"); } /*- End of function --------------------------------------------------------*/ static void fixed_divide32_tests(void) { uint32_t xu32; uint16_t yu16; uint32_t yu32; double z; double ratio; double max; double min; printf("fixed_divide32() function tests\n"); if (fixed_divide32(12345, 0) != 0xFFFF) { printf("Test failed\n"); exit(2); } min = 999999.0; max = -999999.0; for (yu32 = 32; yu32 < 65536; yu32 += 16) { for (xu32 = yu32*16; xu32 < 65535; xu32 += 16) { yu16 = fixed_divide32(yu32, xu32); z = 32768.0*yu32/xu32; ratio = z/yu16; //printf("%6u %6u %6u %f %f\n", xu32, yu32, yu16, z, ratio); if (ratio < min) min = ratio; if (ratio > max) max = ratio; if (ratio < 0.996 || ratio > 1.07) { printf("Test failed\n"); exit(2); } } } printf("min %f, max %f\n", min, max); printf("Test passed\n"); } /*- End of function --------------------------------------------------------*/ static void fixed_log10_16_tests(void) { int x; int16_t yi16; double z; double ratio; double max; double min; printf("Log10 16 bit function tests\n"); min = 999999.0; max = -999999.0; for (x = 1; x < 32500; x++) { yi16 = fixed_log10_16(x); z = 4096.0*log10(x/32768.0); ratio = z - yi16; //printf("%6d %15d %f %f\n", x, yi16, z, ratio); if (ratio < min) min = ratio; if (ratio > max) max = ratio; if (ratio < -8.0 || ratio > 8.0) { printf("Test failed\n"); exit(2); } } printf("min %f, max %f\n", min, max); printf("Test passed\n"); } /*- End of function --------------------------------------------------------*/ static void fixed_log10_32_tests(void) { int x; int32_t yi32; double z; double ratio; double max; double min; printf("fixed_log10_32() function tests\n"); min = 999999.0; max = -999999.0; for (x = 1; x < 32767*65536; x += 0x4000) { yi32 = fixed_log10_32(x); z = 4096.0*log10(x/(32768.0*65536.0)); ratio = z - yi32; //printf("%6d %15d %f %f\n", x, yi32, z, ratio); if (ratio < min) min = ratio; if (ratio > max) max = ratio; if (ratio < -8.0 || ratio > 8.0) { printf("Test failed\n"); exit(2); } } printf("min %f, max %f\n", min, max); printf("Test passed\n"); } /*- End of function --------------------------------------------------------*/ static void fixed_sqrt16_tests(void) { int x; uint16_t yu16; double z; double ratio; double max; double min; printf("fixed_sqrt16() function tests\n"); min = 999999.0; max = -999999.0; for (x = 1; x < 65536; x++) { yu16 = fixed_sqrt16(x); z = sqrt(x)*256.0; ratio = z/yu16; //printf("%6d %6d %f %f\n", x, yu16, z, ratio); if (ratio < min) min = ratio; if (ratio > max) max = ratio; if (ratio < 0.999 || ratio > 1.008) { printf("Test failed\n"); exit(2); } } printf("min %f, max %f\n", min, max); printf("Test passed\n"); } /*- End of function --------------------------------------------------------*/ static void fixed_sqrt32_tests(void) { uint32_t xu32; uint16_t yu16; double z; double ratio; double max; double min; printf("fixed_sqrt32() function tests\n"); min = 999999.0; max = -999999.0; for (xu32 = 20000; xu32 < 0xFFFF0000; xu32 += 10000) { yu16 = fixed_sqrt32(xu32); z = sqrt(xu32); ratio = z/yu16; //printf("%10u %6d %f %f\n", xu32, yu16, z, ratio); if (ratio < min) min = ratio; if (ratio > max) max = ratio; if (ratio < 0.999 || ratio > 1.009) { printf("Test failed\n"); exit(2); } } printf("min %f, max %f\n", min, max); printf("Test passed\n"); } /*- End of function --------------------------------------------------------*/ static void fixed_sin_tests(void) { int x; int16_t yi16; double z; double ratio; double max; double min; printf("fixed_sin() function tests\n"); min = 999999.0; max = -999999.0; for (x = 0; x < 65536; x++) { yi16 = fixed_sin(x); z = sin(2.0*3.1415926535*x/65536.0)*32768.0; ratio = z - yi16; //printf("%6d %6d %f %f\n", x, yi16, z, ratio); if (ratio < min) min = ratio; if (ratio > max) max = ratio; if (ratio < -2.0 || ratio > 2.0) { printf("Test failed\n"); exit(2); } } printf("min %f, max %f\n", min, max); printf("Test passed\n"); } /*- End of function --------------------------------------------------------*/ static void fixed_cos_tests(void) { int x; int16_t yi16; double z; double ratio; double max; double min; printf("fixed_cos() function tests\n"); min = 999999.0; max = -999999.0; for (x = 0; x < 65536; x++) { yi16 = fixed_cos(x); z = cos(2.0*3.1415926535*x/65536.0)*32768.0; ratio = z - yi16; //printf("%6d %6d %f %f\n", x, yi16, z, ratio); if (ratio < min) min = ratio; if (ratio > max) max = ratio; if (ratio < -2.0 || ratio > 2.0) { printf("Test failed\n"); exit(2); } } printf("min %f, max %f\n", min, max); printf("Test passed\n"); } /*- End of function --------------------------------------------------------*/ static void fixed_atan2_tests(void) { int i; int x; int y; uint16_t yu16; double z; double ratio; double max; double min; printf("fixed_atan2() function tests\n"); min = 999999.0; max = -999999.0; for (i = 0; i < 65536; i++) { x = 16384.0*cos(i*2.0*3.1415926535/65536.0); y = 16384.0*sin(i*2.0*3.1415926535/65536.0); yu16 = fixed_atan2(y, x); z = atan2(y/32768.0, x/32768.0)*65536.0/(2.0*3.1415926535); if (z < 0.0) z += 65536.0; ratio = z - yu16; //printf("%6d %6d %6d %6d %f %f\n", i, x, y, yu16, z, ratio); if (ratio < min) min = ratio; if (ratio > max) max = ratio; if (ratio < -43.0 || ratio > 43.0) { printf("Test failed\n"); exit(2); } } printf("min %f, max %f\n", min, max); printf("Test passed\n"); } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { fixed_reciprocal16_tests(); fixed_divide16_tests(); fixed_divide32_tests(); fixed_log10_16_tests(); fixed_log10_32_tests(); fixed_sqrt16_tests(); fixed_sqrt32_tests(); fixed_sin_tests(); fixed_cos_tests(); fixed_atan2_tests(); printf("Tests passed\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/modem_echo_tests.c0000664000175000017500000003120612101217351014732 00000000000000/* * SpanDSP - a series of DSP components for telephony * * modem_echo_tests.c * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page modem_echo_can_tests_page Line echo cancellation for modems tests \section modem_echo_can_tests_page_sec_1 What does it do? Currently the echo cancellation tests only provide simple exercising of the cancellor in the way it might be used for line echo cancellation. The test code is in echotests.c. The goal is to test the echo cancellor again the G.16X specs. Clearly, that also means the goal for the cancellor itself is to comply with those specs. Right now, the only aspect of these tests implemented is the line impulse response models in g168tests.c. \section modem_echo_can_tests_page_sec_2 How does it work? The current test consists of feeding an audio file of real speech to the echo cancellor as the transmit signal. A very simple model of a telephone line is used to simulate a simple echo from the transmit signal. A second audio file of real speech is also used to simulate a signal received form the far end of the line. This is gated so it is only placed for one second every 10 seconds, simulating the double talk condition. The resulting echo cancelled signal can either be store in a file for further analysis, or played back as the data is processed. A number of modified versions of this test have been performed. The signal level of the two speech sources has been varied. Several simple models of the telephone line have been used. Although the current cancellor design has known limitations, it seems stable for all these test conditions. No instability has been observed in the current version due to arithmetic overflow when the speech is very loud (with earlier versions, well, ....:) ). The lack of saturating arithmetic in general purpose CPUs is a huge disadvantage here, as software saturation logic would cause a major slow down. Floating point would be good, but is not usable in the Linux kernel. Anyway, the bottom line seems to be the current design is genuinely useful, if imperfect. \section modem_echo_can_tests_page_sec_2 How do I use it? Build the tests with the command "./build". Currently there is no proper make setup, or way to build individual tests. "./build" will built all the tests which currently exist for the DSP functions. The echo cancellation test assumes there are two audio files containing mono, 16 bit signed PCM speech data, sampled at 8kHz. These should be called local_sound.wav and far_sound.wav. A third wave file will be produced. This very crudely starts with the first 256 bytes from the local_sound.wav file, followed by the results of the echo cancellation. The resulting audio is also played to the /dev/dsp device. A printf near the end of echo_tests.c is commented out with a \#if. If this is enabled, detailed information about the results of the echo cancellation will be written to stdout. By saving this into a file, Grace (recommended), GnuPlot, or some other plotting package may be used to graphically display the functioning of the cancellor. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #if defined(HAVE_FL_FL_H) && defined(HAVE_FL_FL_CARTESIAN_H) && defined(HAVE_FL_FL_AUDIO_METER_H) #define ENABLE_GUI #endif #include #include #include #include #include #include #if defined(HAVE_MATH_H) #define GEN_CONST #endif //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp/g168models.h" #include "spandsp-sim.h" #if defined(ENABLE_GUI) #include "echo_monitor.h" #endif #if !defined(NULL) #define NULL (void *) 0 #endif typedef struct { const char *name; int max; int cur; SNDFILE *handle; int16_t signal[8000]; } signal_source_t; signal_source_t local_css; fir32_state_t line_model; SNDFILE *resulthandle; int16_t residue_sound[8000]; int residue_cur = 0; int do_codec_munge = TRUE; int use_gui = FALSE; static const int16_t tone_1khz[] = {10362, 7327, 0, -7327, -10362, -7327, 0, 7327}; static inline void put_residue(int16_t tx, int16_t residue) { int outframes; residue_sound[residue_cur++] = tx; residue_sound[residue_cur++] = residue; if (residue_cur >= 8000) { residue_cur >>= 1; outframes = sf_writef_short(resulthandle, residue_sound, residue_cur); if (outframes != residue_cur) { fprintf(stderr, " Error writing residue sound\n"); exit(2); } residue_cur = 0; } } /*- End of function --------------------------------------------------------*/ static void signal_load(signal_source_t *sig, const char *name) { sig->name = name; if ((sig->handle = sf_open_telephony_read(sig->name, 1)) == NULL) { fprintf(stderr, " Cannot open sound file '%s'\n", sig->name); exit(2); } sig->max = sf_readf_short(sig->handle, sig->signal, 8000); if (sig->max < 0) { fprintf(stderr, " Error reading sound file '%s'\n", sig->name); exit(2); } } /*- End of function --------------------------------------------------------*/ static void signal_free(signal_source_t *sig) { if (sf_close_telephony(sig->handle)) { fprintf(stderr, " Cannot close sound file '%s'\n", sig->name); exit(2); } } /*- End of function --------------------------------------------------------*/ static void signal_restart(signal_source_t *sig) { sig->cur = 0; } /*- End of function --------------------------------------------------------*/ static int16_t signal_amp(signal_source_t *sig) { int16_t tx; tx = sig->signal[sig->cur++]; if (sig->cur >= sig->max) sig->cur = 0; return tx; } /*- End of function --------------------------------------------------------*/ static inline int16_t codec_munger(int16_t amp) { if (do_codec_munge) return alaw_to_linear(linear_to_alaw(amp)); return amp; } /*- End of function --------------------------------------------------------*/ static void channel_model_create(int model) { static const int32_t *line_models[] = { line_model_d2_coeffs, line_model_d3_coeffs, line_model_d4_coeffs, line_model_d5_coeffs, line_model_d6_coeffs, line_model_d7_coeffs, line_model_d8_coeffs, line_model_d9_coeffs }; static int line_model_sizes[] = { sizeof(line_model_d2_coeffs)/sizeof(int32_t), sizeof(line_model_d3_coeffs)/sizeof(int32_t), sizeof(line_model_d4_coeffs)/sizeof(int32_t), sizeof(line_model_d5_coeffs)/sizeof(int32_t), sizeof(line_model_d6_coeffs)/sizeof(int32_t), sizeof(line_model_d7_coeffs)/sizeof(int32_t), sizeof(line_model_d8_coeffs)/sizeof(int32_t), sizeof(line_model_d9_coeffs)/sizeof(int32_t) }; fir32_create(&line_model, line_models[model], line_model_sizes[model]); } /*- End of function --------------------------------------------------------*/ static int16_t channel_model(int16_t local, int16_t far) { int16_t echo; int16_t rx; /* Channel modelling is merely simulating the effects of A-law distortion and using one of the echo models from G.168 */ /* The local tx signal will have gone through an A-law munging before it reached the line's analogue area where the echo occurs. */ echo = fir32(&line_model, codec_munger(local/8)); /* The far end signal will have been through an A-law munging, although this should not affect things. */ rx = echo + codec_munger(far); /* This mixed echo and far end signal will have been through an A-law munging when it came back into the digital network. */ rx = codec_munger(rx); return rx; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { modem_echo_can_state_t *ctx; //awgn_state_t local_noise_source; awgn_state_t far_noise_source; int i; int clean; int16_t rx; int16_t tx; int line_model_no; time_t now; power_meter_t power_before; power_meter_t power_after; float unadapted_output_power; float unadapted_echo_power; float adapted_output_power; float adapted_echo_power; #if defined(ENABLE_GUI) int16_t amp[2]; #endif line_model_no = 0; use_gui = FALSE; for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-g") == 0) { use_gui = TRUE; continue; } line_model_no = atoi(argv[1]); } time(&now); ctx = modem_echo_can_init(256); awgn_init_dbm0(&far_noise_source, 7162534, -50.0f); signal_load(&local_css, "sound_c1_8k.wav"); if ((resulthandle = sf_open_telephony_write("modem_echo.wav", 2)) == NULL) { fprintf(stderr, " Failed to open result file\n"); exit(2); } #if defined(ENABLE_GUI) if (use_gui) start_echo_can_monitor(256); #endif channel_model_create(line_model_no); #if defined(ENABLE_GUI) if (use_gui) echo_can_monitor_line_model_update(line_model.coeffs, line_model.taps); #endif modem_echo_can_flush(ctx); power_meter_init(&power_before, 5); power_meter_init(&power_after, 5); /* Measure the echo power before adaption */ modem_echo_can_adaption_mode(ctx, FALSE); for (i = 0; i < 8000*5; i++) { tx = tone_1khz[i & 7]; rx = channel_model(tx, 0); clean = modem_echo_can_update(ctx, tx, rx); power_meter_update(&power_before, rx); power_meter_update(&power_after, clean); } unadapted_output_power = power_meter_current_dbm0(&power_before); unadapted_echo_power = power_meter_current_dbm0(&power_after); printf("Pre-adaption: output power %10.5fdBm0, echo power %10.5fdBm0\n", unadapted_output_power, unadapted_echo_power); /* Converge the canceller */ signal_restart(&local_css); modem_echo_can_adaption_mode(ctx, TRUE); for (i = 0; i < 800*2; i++) { clean = modem_echo_can_update(ctx, 0, 0); put_residue(0, clean); } for (i = 0; i < 8000*50; i++) { tx = signal_amp(&local_css); rx = channel_model(tx, 0); clean = modem_echo_can_update(ctx, tx, rx); power_meter_update(&power_before, rx); power_meter_update(&power_after, clean); #if 0 if (i%800 == 0) printf("Powers %10.5fdBm0 %10.5fdBm0\n", power_meter_current_dbm0(&power_before), power_meter_current_dbm0(&power_after)); #endif put_residue(tx, clean); #if defined(ENABLE_GUI) if (use_gui) { echo_can_monitor_can_update(ctx->fir_taps16, 256); amp[0] = tx; echo_can_monitor_line_spectrum_update(amp, 1); } #endif } /* Now lets see how well adapted we are */ modem_echo_can_adaption_mode(ctx, FALSE); for (i = 0; i < 8000*5; i++) { tx = tone_1khz[i & 7]; rx = channel_model(tx, 0); clean = modem_echo_can_update(ctx, tx, rx); power_meter_update(&power_before, rx); power_meter_update(&power_after, clean); } adapted_output_power = power_meter_current_dbm0(&power_before); adapted_echo_power = power_meter_current_dbm0(&power_after); printf("Post-adaption: output power %10.5fdBm0, echo power %10.5fdBm0\n", adapted_output_power, adapted_echo_power); if (fabsf(adapted_output_power - unadapted_output_power) > 0.1f || adapted_echo_power > unadapted_echo_power - 30.0f) { printf("Tests failed.\n"); exit(2); } modem_echo_can_free(ctx); signal_free(&local_css); if (sf_close_telephony(resulthandle)) { fprintf(stderr, " Cannot close speech file '%s'\n", "result_sound.wav"); exit(2); } #if defined(ENABLE_GUI) if (use_gui) echo_can_monitor_wait_to_end(); #endif printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/v29_tests.c0000664000175000017500000004571312101213252013257 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v29_tests.c * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page v29_tests_page V.29 modem tests \section v29_tests_page_sec_1 What does it do? These tests test one way paths, as V.29 is a half-duplex modem. They allow either: - A V.29 transmit modem to feed a V.29 receive modem through a telephone line model. BER testing is then used to evaluate performance under various line conditions. This is effective for testing the basic performance of the receive modem. It is also the only test mode provided for evaluating the transmit modem. - A V.29 receive modem is used to decode V.29 audio, stored in an audio file. This is good way to evaluate performance with audio recorded from other models of modem, and with real world problematic telephone lines. If the appropriate GUI environment exists, the tests are built such that a visual display of modem status is maintained. \section v29_tests_page_sec_2 How is it used? */ /* Enable the following definition to enable direct probing into the FAX structures */ #define WITH_SPANDSP_INTERNALS #if defined(HAVE_CONFIG_H) #include "config.h" #endif #if defined(HAVE_FL_FL_H) && defined(HAVE_FL_FL_CARTESIAN_H) && defined(HAVE_FL_FL_AUDIO_METER_H) #define ENABLE_GUI #endif #include #include #include #include #include #include #include #if defined(HAVE_FENV_H) #define __USE_GNU #include #endif //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #if defined(ENABLE_GUI) #include "modem_monitor.h" #include "line_model_monitor.h" #endif #define BLOCK_LEN 160 #define OUT_FILE_NAME "v29.wav" char *decode_test_file = NULL; int use_gui = FALSE; int symbol_no = 0; int rx_bits = 0; bert_state_t bert; one_way_line_model_state_t *line_model; #if defined(ENABLE_GUI) qam_monitor_t *qam_monitor; #endif bert_results_t latest_results; static void reporter(void *user_data, int reason, bert_results_t *results) { switch (reason) { case BERT_REPORT_REGULAR: fprintf(stderr, "BERT report regular - %d bits, %d bad bits, %d resyncs\n", results->total_bits, results->bad_bits, results->resyncs); memcpy(&latest_results, results, sizeof(latest_results)); break; default: fprintf(stderr, "BERT report %s\n", bert_event_to_str(reason)); break; } } /*- End of function --------------------------------------------------------*/ static void v29_rx_status(void *user_data, int status) { v29_rx_state_t *s; int i; int len; #if defined(SPANDSP_USE_FIXED_POINT) complexi16_t *coeffs; #else complexf_t *coeffs; #endif printf("V.29 rx status is %s (%d)\n", signal_status_to_str(status), status); s = (v29_rx_state_t *) user_data; switch (status) { case SIG_STATUS_TRAINING_SUCCEEDED: printf("Training succeeded\n"); len = v29_rx_equalizer_state(s, &coeffs); printf("Equalizer:\n"); for (i = 0; i < len; i++) #if defined(SPANDSP_USE_FIXED_POINT) printf("%3d (%15.5f, %15.5f)\n", i, coeffs[i].re/4096.0f, coeffs[i].im/4096.0f); #else printf("%3d (%15.5f, %15.5f) -> %15.5f\n", i, coeffs[i].re, coeffs[i].im, powerf(&coeffs[i])); #endif break; } } /*- End of function --------------------------------------------------------*/ static void v29putbit(void *user_data, int bit) { if (bit < 0) { v29_rx_status(user_data, bit); return; } if (decode_test_file) printf("Rx bit %d - %d\n", rx_bits++, bit); else bert_put_bit(&bert, bit); } /*- End of function --------------------------------------------------------*/ static void v29_tx_status(void *user_data, int status) { printf("V.29 tx status is %s (%d)\n", signal_status_to_str(status), status); } /*- End of function --------------------------------------------------------*/ static int v29getbit(void *user_data) { return bert_get_bit(&bert); } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINTx) static void qam_report(void *user_data, const complexi16_t *constel, const complexi16_t *target, int symbol) #else static void qam_report(void *user_data, const complexf_t *constel, const complexf_t *target, int symbol) #endif { int i; int len; #if defined(SPANDSP_USE_FIXED_POINT) complexi16_t *coeffs; //complexf_t constel_point; #else complexf_t *coeffs; #endif float fpower; v29_rx_state_t *rx; static float smooth_power = 0.0f; static int update_interval = 100; rx = (v29_rx_state_t *) user_data; if (constel) { fpower = (constel->re - target->re)*(constel->re - target->re) + (constel->im - target->im)*(constel->im - target->im); #if defined(SPANDSP_USE_FIXED_POINT) fpower /= 4096.0*4096.0; #endif smooth_power = 0.95f*smooth_power + 0.05f*fpower; #if defined(ENABLE_GUI) if (use_gui) { #if defined(SPANDSP_USE_FIXED_POINTx) constel_point.re = constel->re/4096.0; constel_point.im = constel->im/4096.0; qam_monitor_update_constel(qam_monitor, &constel_point); #else qam_monitor_update_constel(qam_monitor, constel); #endif qam_monitor_update_carrier_tracking(qam_monitor, v29_rx_carrier_frequency(rx)); //qam_monitor_update_carrier_tracking(qam_monitor, (fpower) ? fpower : 0.001f); qam_monitor_update_symbol_tracking(qam_monitor, v29_rx_symbol_timing_correction(rx)); } #endif printf("%8d [%8.4f, %8.4f] [%8.4f, %8.4f] %2x %8.4f %8.4f %9.4f %7.3f %7.4f\n", symbol_no, #if defined(SPANDSP_USE_FIXED_POINTx) constel->re/4096.0, constel->im/4096.0, target->re/4096.0, target->im/4096.0, #else constel->re, constel->im, target->re, target->im, #endif symbol, fpower, smooth_power, v29_rx_carrier_frequency(rx), v29_rx_signal_power(rx), v29_rx_symbol_timing_correction(rx)); symbol_no++; if (--update_interval <= 0) { len = v29_rx_equalizer_state(rx, &coeffs); printf("Equalizer A:\n"); for (i = 0; i < len; i++) #if defined(SPANDSP_USE_FIXED_POINT) printf("%3d (%15.5f, %15.5f)\n", i, coeffs[i].re/4096.0f, coeffs[i].im/4096.0f); #else printf("%3d (%15.5f, %15.5f) -> %15.5f\n", i, coeffs[i].re, coeffs[i].im, powerf(&coeffs[i])); #endif #if defined(ENABLE_GUI) if (use_gui) { #if defined(SPANDSP_USE_FIXED_POINT) qam_monitor_update_int_equalizer(qam_monitor, coeffs, len); #else qam_monitor_update_equalizer(qam_monitor, coeffs, len); #endif } #endif update_interval = 100; } } } /*- End of function --------------------------------------------------------*/ #if defined(HAVE_FENV_H) static void sigfpe_handler(int sig_num, siginfo_t *info, void *data) { switch (sig_num) { case SIGFPE: switch (info->si_code) { case FPE_INTDIV: fprintf(stderr, "integer divide by zero at %p\n", info->si_addr); break; case FPE_INTOVF: fprintf(stderr, "integer overflow at %p\n", info->si_addr); break; case FPE_FLTDIV: fprintf(stderr, "FP divide by zero at %p\n", info->si_addr); break; case FPE_FLTOVF: fprintf(stderr, "FP overflow at %p\n", info->si_addr); break; case FPE_FLTUND: fprintf(stderr, "FP underflow at %p\n", info->si_addr); break; case FPE_FLTRES: fprintf(stderr, "FP inexact result at %p\n", info->si_addr); break; case FPE_FLTINV: fprintf(stderr, "FP invalid operation at %p\n", info->si_addr); break; case FPE_FLTSUB: fprintf(stderr, "subscript out of range at %p\n", info->si_addr); break; } break; default: fprintf(stderr, "Unexpected signal %d\n", sig_num); break; } exit(2); } /*- End of function --------------------------------------------------------*/ static void fpe_trap_setup(void) { struct sigaction trap; sigemptyset(&trap.sa_mask); trap.sa_flags = SA_SIGINFO; trap.sa_sigaction = sigfpe_handler; sigaction(SIGFPE, &trap, NULL); //feenableexcept(FE_DIVBYZERO | FE_INEXACT | FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW); //feenableexcept(FE_ALL_EXCEPT); feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW); } /*- End of function --------------------------------------------------------*/ #endif int main(int argc, char *argv[]) { v29_rx_state_t *rx; v29_tx_state_t *tx; bert_results_t bert_results; int16_t gen_amp[BLOCK_LEN]; int16_t amp[BLOCK_LEN]; SNDFILE *inhandle; SNDFILE *outhandle; int outframes; int samples; int tep; int test_bps; int noise_level; int signal_level; int bits_per_test; int line_model_no; int block_no; int log_audio; int channel_codec; int rbs_pattern; int opt; logging_state_t *logging; channel_codec = MUNGE_CODEC_NONE; rbs_pattern = 0; test_bps = 9600; tep = FALSE; line_model_no = 0; decode_test_file = NULL; use_gui = FALSE; noise_level = -70; signal_level = -13; bits_per_test = 50000; log_audio = FALSE; while ((opt = getopt(argc, argv, "b:B:c:d:glm:n:r:s:t")) != -1) { switch (opt) { case 'b': test_bps = atoi(optarg); if (test_bps != 9600 && test_bps != 7200 && test_bps != 4800) { fprintf(stderr, "Invalid bit rate specified\n"); exit(2); } break; case 'B': bits_per_test = atoi(optarg); break; case 'c': channel_codec = atoi(optarg); break; case 'd': decode_test_file = optarg; break; case 'g': #if defined(ENABLE_GUI) use_gui = TRUE; #else fprintf(stderr, "Graphical monitoring not available\n"); exit(2); #endif break; case 'l': log_audio = TRUE; break; case 'm': line_model_no = atoi(optarg); break; case 'n': noise_level = atoi(optarg); break; case 'r': rbs_pattern = atoi(optarg); break; case 's': signal_level = atoi(optarg); break; case 't': tep = TRUE; break; default: //usage(); exit(2); break; } } inhandle = NULL; outhandle = NULL; #if defined(HAVE_FENV_H) fpe_trap_setup(); #endif if (log_audio) { if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME); exit(2); } } if (decode_test_file) { /* We will decode the audio from a file. */ tx = NULL; if ((inhandle = sf_open_telephony_read(decode_test_file, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", decode_test_file); exit(2); } } else { /* We will generate V.29 audio, and add some noise to it. */ tx = v29_tx_init(NULL, test_bps, tep, v29getbit, NULL); logging = v29_tx_get_logging_state(tx); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "V.29-tx"); v29_tx_power(tx, signal_level); v29_tx_set_modem_status_handler(tx, v29_tx_status, (void *) tx); #if defined(WITH_SPANDSP_INTERNALS) /* Move the carrier off a bit */ tx->carrier_phase_rate = dds_phase_ratef(1710.0f); tx->carrier_phase = 0; #endif bert_init(&bert, bits_per_test, BERT_PATTERN_ITU_O152_11, test_bps, 20); bert_set_report(&bert, 10000, reporter, NULL); if ((line_model = one_way_line_model_init(line_model_no, (float) noise_level, channel_codec, rbs_pattern)) == NULL) { fprintf(stderr, " Failed to create line model\n"); exit(2); } } rx = v29_rx_init(NULL, test_bps, v29putbit, NULL); logging = v29_rx_get_logging_state(rx); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "V.29-rx"); v29_rx_signal_cutoff(rx, -45.5f); v29_rx_set_modem_status_handler(rx, v29_rx_status, (void *) rx); v29_rx_set_qam_report_handler(rx, qam_report, (void *) rx); #if defined(WITH_SPANDSP_INTERNALS) /* Rotate the starting phase */ rx->carrier_phase = 0x80000000; #endif #if defined(ENABLE_GUI) if (use_gui) { qam_monitor = qam_monitor_init(6.0f, NULL); if (!decode_test_file) { start_line_model_monitor(129); line_model_monitor_line_model_update(line_model->near_filter, line_model->near_filter_len); } } #endif memset(&latest_results, 0, sizeof(latest_results)); for (block_no = 0; ; block_no++) { if (decode_test_file) { samples = sf_readf_short(inhandle, amp, BLOCK_LEN); #if defined(ENABLE_GUI) if (use_gui) qam_monitor_update_audio_level(qam_monitor, amp, samples); #endif if (samples == 0) break; } else { samples = v29_tx(tx, gen_amp, BLOCK_LEN); #if defined(ENABLE_GUI) if (use_gui) qam_monitor_update_audio_level(qam_monitor, gen_amp, samples); #endif if (samples == 0) { /* Push a little silence through, to ensure all the data bits get out of the buffers */ vec_zeroi16(amp, BLOCK_LEN); v29_rx(rx, amp, BLOCK_LEN); /* Note that we might get a few bad bits as the carrier shuts down. */ bert_result(&bert, &bert_results); fprintf(stderr, "Final result %ddBm0/%ddBm0, %d bits, %d bad bits, %d resyncs\n", signal_level, noise_level, bert_results.total_bits, bert_results.bad_bits, bert_results.resyncs); fprintf(stderr, "Last report %ddBm0/%ddBm0, %d bits, %d bad bits, %d resyncs\n", signal_level, noise_level, latest_results.total_bits, latest_results.bad_bits, latest_results.resyncs); /* See if bit errors are appearing yet. Also check we are getting enough bits out of the receiver. The last regular report should be error free, though the final report will generally contain bits errors as the carrier was dying. The total number of bits out of the receiver should be at least the number we sent. Also, since BERT sync should have occurred rapidly at the start of transmission, the last report should have occurred at not much less than the total number of bits we sent. */ if (bert_results.total_bits < bits_per_test || latest_results.total_bits < bits_per_test - 100 || latest_results.bad_bits != 0) { break; } memset(&latest_results, 0, sizeof(latest_results)); signal_level--; v29_tx_restart(tx, test_bps, tep); v29_tx_power(tx, signal_level); v29_rx_restart(rx, test_bps, FALSE); #if defined(WITH_SPANDSP_INTERNALS) rx->eq_put_step = rand()%(48*10/3); #endif bert_init(&bert, bits_per_test, BERT_PATTERN_ITU_O152_11, test_bps, 20); bert_set_report(&bert, 10000, reporter, NULL); one_way_line_model_release(line_model); if ((line_model = one_way_line_model_init(line_model_no, (float) noise_level, channel_codec, 0)) == NULL) { fprintf(stderr, " Failed to create line model\n"); exit(2); } } if (log_audio) { outframes = sf_writef_short(outhandle, gen_amp, samples); if (outframes != samples) { fprintf(stderr, " Error writing audio file\n"); exit(2); } } one_way_line_model(line_model, amp, gen_amp, samples); } #if defined(ENABLE_GUI) if (use_gui && !decode_test_file) line_model_monitor_line_spectrum_update(amp, samples); #endif v29_rx(rx, amp, samples); } if (!decode_test_file) { bert_result(&bert, &bert_results); fprintf(stderr, "At completion:\n"); fprintf(stderr, "Final result %ddBm0/%ddBm0, %d bits, %d bad bits, %d resyncs\n", signal_level, noise_level, bert_results.total_bits, bert_results.bad_bits, bert_results.resyncs); fprintf(stderr, "Last report %ddBm0/%ddBm0, %d bits, %d bad bits, %d resyncs\n", signal_level, noise_level, latest_results.total_bits, latest_results.bad_bits, latest_results.resyncs); one_way_line_model_release(line_model); if (signal_level > -43) { printf("Tests failed.\n"); exit(2); } printf("Tests passed.\n"); } #if defined(ENABLE_GUI) if (use_gui) qam_wait_to_end(qam_monitor); #endif if (decode_test_file) { if (sf_close_telephony(inhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", decode_test_file); exit(2); } } if (log_audio) { if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME); exit(2); } } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/plc_tests.c0000664000175000017500000001221212101216240013401 00000000000000/* * SpanDSP - a series of DSP components for telephony * * plc_tests.c * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page plc_tests_page Packet loss concealment tests \section plc_tests_page_sec_1 What does it do? These tests run a speech file through the packet loss concealment routines. The loss rate, in percent, and the packet size, in samples, may be specified on the command line. \section plc_tests_page_sec_2 How are the tests run? These tests process a speech file called pre_plc.wav. This file should contain 8000 sample/second 16 bits/sample linear audio. The tests read this file in blocks, of a size specified on the command line. Some of these blocks are dropped, to simulate packet loss. The rate of loss is also specified on the command line. The PLC module is then used to reconstruct an acceptable approximation to the original signal. The resulting audio is written to a new audio file, called post_plc.wav. This file contains 8000 sample/second 16 bits/sample linear audio. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include "spandsp.h" #include "spandsp-sim.h" #define INPUT_FILE_NAME "../test-data/local/short_nb_voice.wav" #define OUTPUT_FILE_NAME "post_plc.wav" int main(int argc, char *argv[]) { SNDFILE *inhandle; SNDFILE *outhandle; plc_state_t plc; int inframes; int outframes; int16_t amp[1024]; int block_no; int lost_blocks; int block_len; int loss_rate; int dropit; int block_real; int block_synthetic; int tone; int i; uint32_t phase_acc; int32_t phase_rate; int opt; loss_rate = 25; block_len = 160; block_real = FALSE; block_synthetic = FALSE; tone = -1; while ((opt = getopt(argc, argv, "b:l:rst:")) != -1) { switch (opt) { case 'b': block_len = atoi(optarg); break; case 'l': loss_rate = atoi(optarg); break; case 'r': block_real = TRUE; break; case 's': block_synthetic = TRUE; break; case 't': tone = atoi(optarg); break; } } phase_rate = 0; inhandle = NULL; if (tone < 0) { if ((inhandle = sf_open_telephony_read(INPUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Failed to open audio file '%s'\n", INPUT_FILE_NAME); exit(2); } } else { phase_rate = dds_phase_ratef((float) tone); } if ((outhandle = sf_open_telephony_write(OUTPUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Failed to open audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } plc_init(&plc); lost_blocks = 0; for (block_no = 0; ; block_no++) { if (tone < 0) { inframes = sf_readf_short(inhandle, amp, block_len); if (inframes != block_len) break; } else { if (block_no > 10000) break; for (i = 0; i < block_len; i++) amp[i] = (int16_t) dds_modf(&phase_acc, phase_rate, 10000.0, 0); inframes = block_len; } dropit = rand()/(RAND_MAX/100); if (dropit > loss_rate) { plc_rx(&plc, amp, inframes); if (block_real) memset(amp, 0, sizeof(int16_t)*inframes); } else { lost_blocks++; plc_fillin(&plc, amp, inframes); if (block_synthetic) memset(amp, 0, sizeof(int16_t)*inframes); } outframes = sf_writef_short(outhandle, amp, inframes); if (outframes != inframes) { fprintf(stderr, " Error writing out sound\n"); exit(2); } } printf("Dropped %d of %d blocks\n", lost_blocks, block_no); if (tone < 0) { if (sf_close_telephony(inhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", INPUT_FILE_NAME); exit(2); } } if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/awgn_tests.c0000664000175000017500000001070412101212371013564 00000000000000/* * SpanDSP - a series of DSP components for telephony * * awgn_tests.c * * Written by Steve Underwood * * Copyright (C) 2001 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page awgn_tests_page AWGN tests \section awgn_tests_page_sec_1 What does it do? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #if !defined(M_PI) # define M_PI 3.14159265358979323846 /* pi */ #endif #define OUT_FILE_NAME "awgn.wav" /* Some simple sanity tests for the Gaussian noise generation routines */ int main(int argc, char *argv[]) { int i; int j; int clip_high; int clip_low; int total_samples; int idum = 1234567; int16_t value; double total; double x; double p; double o; double error; int bins[65536]; awgn_state_t noise_source; /* Generate noise at several RMS levels between -50dBm and 0dBm. Noise is generated for a large number of samples (1,000,000), and the RMS value of the noise is calculated along the way. If the resulting level is close to the requested RMS level, at least the scaling of the noise should be Ok. At high level some clipping may distort the result a little. */ for (j = -50; j <= 0; j += 5) { clip_high = 0; clip_low = 0; total = 0.0; awgn_init_dbm0(&noise_source, idum, (float) j); total_samples = 1000000; for (i = 0; i < total_samples; i++) { value = awgn(&noise_source); if (value == 32767) clip_high++; else if (value == -32768) clip_low++; total += ((double) value)*((double) value); } error = 100.0*(1.0 - sqrt(total/total_samples)/noise_source.rms); printf("RMS = %.3f (expected %d) %.2f%% error [clipped samples %d+%d]\n", 10.0*log10((total/total_samples)/(32768.0*32768.0) + 1.0e-10) + DBM0_MAX_POWER, j, error, clip_low, clip_high); /* We don't check the result at 0dBm0, as there will definitely be a lot of error due to clipping */ if (j < 0 && fabs(error) > 0.2) { printf("Test failed.\n"); exit(2); } } /* Now look at the statistical spread of the results, by collecting data in bins from a large number of samples. Use a fairly high noise level, but low enough to avoid significant clipping. Use the Gaussian model to predict the real probability, and present the results for graphing. */ memset(bins, 0, sizeof(bins)); clip_high = 0; clip_low = 0; awgn_init_dbm0(&noise_source, idum, -15); total_samples = 10000000; for (i = 0; i < total_samples; i++) { value = awgn(&noise_source); if (value == 32767) clip_high++; else if (value == -32768) clip_low++; bins[value + 32768]++; } o = noise_source.rms; for (i = 0; i < 65536 - 10; i++) { x = i - 32768; /* Find the real probability for this bin */ p = (1.0/(o*sqrt(2.0*M_PI)))*exp(-(x*x)/(2.0*o*o)); /* Now do a little smoothing on the real data to get a reasonably steady answer */ x = 0; for (j = 0; j < 10; j++) x += bins[i + j]; x /= 10.0; x /= total_samples; /* Now send it out for graphing. */ printf("%6d %.7f %.7f\n", i - 32768, x, p); } printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/v8_tests.c0000664000175000017500000005570612101213061013175 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v8_tests.c * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page v8_tests_page V.8 tests \section v8_tests_page_sec_1 What does it do? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define FALSE 0 #define TRUE (!FALSE) #define SAMPLES_PER_CHUNK 160 #define OUTPUT_FILE_NAME "v8.wav" int negotiations_ok = 0; #if 0 static int select_modulation(int mask) { /* Select the fastest data modem available */ if (mask & V8_MOD_V90) return V8_MOD_V90; /*endif*/ if (mask & V8_MOD_V34) return V8_MOD_V34; /*endif*/ if (mask & V8_MOD_V32) return V8_MOD_V32; /*endif*/ if (mask & V8_MOD_V23) return V8_MOD_V23; /*endif*/ if (mask & V8_MOD_V21) return V8_MOD_V21; /*endif*/ return -1; } /*- End of function --------------------------------------------------------*/ #endif static void handler(void *user_data, v8_parms_t *result) { const char *s; s = (const char *) user_data; printf("%s ", s); switch (result->status) { case V8_STATUS_IN_PROGRESS: printf("V.8 negotiation in progress\n"); return; case V8_STATUS_V8_OFFERED: printf("V.8 offered by the other party\n"); break; case V8_STATUS_V8_CALL: printf("V.8 call negotiation successful\n"); break; case V8_STATUS_NON_V8_CALL: printf("Non-V.8 call negotiation successful\n"); break; case V8_STATUS_FAILED: printf("V.8 call negotiation failed\n"); return; default: printf("Unexpected V.8 status %d\n", result->status); break; } /*endswitch*/ printf(" Modem connect tone '%s' (%d)\n", modem_connect_tone_to_str(result->modem_connect_tone), result->modem_connect_tone); printf(" Call function '%s' (%d)\n", v8_call_function_to_str(result->call_function), result->call_function); printf(" Far end modulations 0x%X\n", result->modulations); printf(" Protocol '%s' (%d)\n", v8_protocol_to_str(result->protocol), result->protocol); printf(" PSTN access '%s' (%d)\n", v8_pstn_access_to_str(result->pstn_access), result->pstn_access); printf(" PCM modem availability '%s' (%d)\n", v8_pcm_modem_availability_to_str(result->pcm_modem_availability), result->pcm_modem_availability); if (result->t66 >= 0) printf(" T.66 '%s' (%d)\n", v8_t66_to_str(result->t66), result->t66); /*endif*/ if (result->nsf >= 0) printf(" NSF %d\n", result->nsf); /*endif*/ switch (result->status) { case V8_STATUS_V8_OFFERED: /* Edit the result information appropriately */ //result->call_function = V8_CALL_T30_TX; result->modulations &= (V8_MOD_V17 | V8_MOD_V21 //| V8_MOD_V22 //| V8_MOD_V23HDX //| V8_MOD_V23 //| V8_MOD_V26BIS //| V8_MOD_V26TER | V8_MOD_V27TER | V8_MOD_V29 //| V8_MOD_V32 | V8_MOD_V34HDX //| V8_MOD_V34 //| V8_MOD_V90 | V8_MOD_V92); break; case V8_STATUS_V8_CALL: if (result->call_function == V8_CALL_V_SERIES && result->protocol == V8_PROTOCOL_LAPM_V42) { negotiations_ok++; } /*endif*/ break; case V8_STATUS_NON_V8_CALL: negotiations_ok = 42; break; } /*endswitch*/ } /*- End of function --------------------------------------------------------*/ static int v8_calls_v8_tests(SNDFILE *outhandle) { v8_state_t *v8_caller; v8_state_t *v8_answerer; logging_state_t *caller_logging; logging_state_t *answerer_logging; int caller_available_modulations; int answerer_available_modulations; int i; int samples; int remnant; int outframes; int16_t amp[SAMPLES_PER_CHUNK]; int16_t out_amp[2*SAMPLES_PER_CHUNK]; v8_parms_t v8_call_parms; v8_parms_t v8_answer_parms; caller_available_modulations = V8_MOD_V17 | V8_MOD_V21 | V8_MOD_V22 | V8_MOD_V23HDX | V8_MOD_V23 | V8_MOD_V26BIS | V8_MOD_V26TER | V8_MOD_V27TER | V8_MOD_V29 | V8_MOD_V32 | V8_MOD_V34HDX | V8_MOD_V34 | V8_MOD_V90 | V8_MOD_V92; answerer_available_modulations = V8_MOD_V17 | V8_MOD_V21 | V8_MOD_V22 | V8_MOD_V23HDX | V8_MOD_V23 | V8_MOD_V26BIS | V8_MOD_V26TER | V8_MOD_V27TER | V8_MOD_V29 | V8_MOD_V32 | V8_MOD_V34HDX | V8_MOD_V34 | V8_MOD_V90 | V8_MOD_V92; negotiations_ok = 0; v8_call_parms.modem_connect_tone = MODEM_CONNECT_TONES_NONE; v8_call_parms.send_ci = TRUE; v8_call_parms.v92 = -1; v8_call_parms.call_function = V8_CALL_V_SERIES; v8_call_parms.modulations = caller_available_modulations; v8_call_parms.protocol = V8_PROTOCOL_LAPM_V42; v8_call_parms.pcm_modem_availability = 0; v8_call_parms.pstn_access = 0; v8_call_parms.nsf = -1; v8_call_parms.t66 = -1; v8_caller = v8_init(NULL, TRUE, &v8_call_parms, handler, (void *) "caller"); v8_answer_parms.modem_connect_tone = MODEM_CONNECT_TONES_ANSAM_PR; v8_answer_parms.send_ci = TRUE; v8_answer_parms.v92 = -1; v8_answer_parms.call_function = V8_CALL_V_SERIES; v8_answer_parms.modulations = answerer_available_modulations; v8_answer_parms.protocol = V8_PROTOCOL_LAPM_V42; v8_answer_parms.pcm_modem_availability = 0; v8_answer_parms.pstn_access = 0; v8_answer_parms.nsf = -1; v8_answer_parms.t66 = -1; v8_answerer = v8_init(NULL, FALSE, &v8_answer_parms, handler, (void *) "answerer"); caller_logging = v8_get_logging_state(v8_caller); span_log_set_level(caller_logging, SPAN_LOG_FLOW | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(caller_logging, "caller"); answerer_logging = v8_get_logging_state(v8_answerer); span_log_set_level(answerer_logging, SPAN_LOG_FLOW | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(answerer_logging, "answerer"); for (i = 0; i < 1000; i++) { samples = v8_tx(v8_caller, amp, SAMPLES_PER_CHUNK); if (samples < SAMPLES_PER_CHUNK) { vec_zeroi16(amp + samples, SAMPLES_PER_CHUNK - samples); samples = SAMPLES_PER_CHUNK; } /*endif*/ span_log_bump_samples(caller_logging, samples); remnant = v8_rx(v8_answerer, amp, samples); for (i = 0; i < samples; i++) out_amp[2*i] = amp[i]; /*endfor*/ samples = v8_tx(v8_answerer, amp, SAMPLES_PER_CHUNK); if (samples < SAMPLES_PER_CHUNK) { vec_zeroi16(amp + samples, SAMPLES_PER_CHUNK - samples); samples = SAMPLES_PER_CHUNK; } /*endif*/ span_log_bump_samples(answerer_logging, samples); if (v8_rx(v8_caller, amp, samples) && remnant) break; /*endif*/ for (i = 0; i < samples; i++) out_amp[2*i + 1] = amp[i]; /*endfor*/ if (outhandle) { outframes = sf_writef_short(outhandle, out_amp, samples); if (outframes != samples) { fprintf(stderr, " Error writing audio file\n"); exit(2); } /*endif*/ } /*endif*/ } /*endfor*/ v8_free(v8_caller); v8_free(v8_answerer); if (negotiations_ok != 2) { printf("Tests failed.\n"); exit(2); } /*endif*/ return 0; } /*- End of function --------------------------------------------------------*/ static int non_v8_calls_v8_tests(SNDFILE *outhandle) { silence_gen_state_t *non_v8_caller_tx; modem_connect_tones_rx_state_t *non_v8_caller_rx; v8_state_t *v8_answerer; logging_state_t *answerer_logging; int answerer_available_modulations; int i; int samples; int remnant; int outframes; int tone; int16_t amp[SAMPLES_PER_CHUNK]; int16_t out_amp[2*SAMPLES_PER_CHUNK]; v8_parms_t v8_answer_parms; answerer_available_modulations = V8_MOD_V17 | V8_MOD_V21 | V8_MOD_V22 | V8_MOD_V23HDX | V8_MOD_V23 | V8_MOD_V26BIS | V8_MOD_V26TER | V8_MOD_V27TER | V8_MOD_V29 | V8_MOD_V32 | V8_MOD_V34HDX | V8_MOD_V34 | V8_MOD_V90 | V8_MOD_V92; negotiations_ok = 0; non_v8_caller_tx = silence_gen_init(NULL, 10*SAMPLE_RATE); non_v8_caller_rx = modem_connect_tones_rx_init(NULL, MODEM_CONNECT_TONES_ANS_PR, NULL, NULL); v8_answer_parms.modem_connect_tone = MODEM_CONNECT_TONES_ANSAM_PR; v8_answer_parms.send_ci = TRUE; v8_answer_parms.v92 = -1; v8_answer_parms.call_function = V8_CALL_V_SERIES; v8_answer_parms.modulations = answerer_available_modulations; v8_answer_parms.protocol = V8_PROTOCOL_LAPM_V42; v8_answer_parms.pcm_modem_availability = 0; v8_answer_parms.pstn_access = 0; v8_answer_parms.nsf = -1; v8_answer_parms.t66 = -1; v8_answerer = v8_init(NULL, FALSE, &v8_answer_parms, handler, (void *) "answerer"); answerer_logging = v8_get_logging_state(v8_answerer); span_log_set_level(answerer_logging, SPAN_LOG_FLOW | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(answerer_logging, "answerer"); for (i = 0; i < 1000; i++) { samples = silence_gen(non_v8_caller_tx, amp, SAMPLES_PER_CHUNK); if (samples < SAMPLES_PER_CHUNK) { vec_zeroi16(amp + samples, SAMPLES_PER_CHUNK - samples); samples = SAMPLES_PER_CHUNK; } /*endif*/ remnant = v8_rx(v8_answerer, amp, samples); if (remnant) break; /*endif*/ for (i = 0; i < samples; i++) out_amp[2*i] = amp[i]; /*endfor*/ samples = v8_tx(v8_answerer, amp, SAMPLES_PER_CHUNK); if (samples < SAMPLES_PER_CHUNK) { vec_zeroi16(amp + samples, SAMPLES_PER_CHUNK - samples); samples = SAMPLES_PER_CHUNK; } /*endif*/ span_log_bump_samples(answerer_logging, samples); modem_connect_tones_rx(non_v8_caller_rx, amp, samples); if ((tone = modem_connect_tones_rx_get(non_v8_caller_rx)) != MODEM_CONNECT_TONES_NONE) { printf("Detected %s (%d)\n", modem_connect_tone_to_str(tone), tone); if (tone == MODEM_CONNECT_TONES_ANSAM_PR) negotiations_ok++; /*endif*/ } /*endif*/ for (i = 0; i < samples; i++) out_amp[2*i + 1] = amp[i]; /*endfor*/ if (outhandle) { outframes = sf_writef_short(outhandle, out_amp, samples); if (outframes != samples) { fprintf(stderr, " Error writing audio file\n"); exit(2); } /*endif*/ } /*endif*/ } /*endfor*/ silence_gen_free(non_v8_caller_tx); modem_connect_tones_rx_free(non_v8_caller_rx); v8_free(v8_answerer); if (negotiations_ok != 1) { printf("Tests failed.\n"); exit(2); } /*endif*/ return 0; } /*- End of function --------------------------------------------------------*/ static int v8_calls_non_v8_tests(SNDFILE *outhandle) { v8_state_t *v8_caller; modem_connect_tones_tx_state_t *non_v8_answerer_tx; logging_state_t *caller_logging; int caller_available_modulations; int i; int samples; int outframes; int16_t amp[SAMPLES_PER_CHUNK]; int16_t out_amp[2*SAMPLES_PER_CHUNK]; v8_parms_t v8_call_parms; caller_available_modulations = V8_MOD_V17 | V8_MOD_V21 | V8_MOD_V22 | V8_MOD_V23HDX | V8_MOD_V23 | V8_MOD_V26BIS | V8_MOD_V26TER | V8_MOD_V27TER | V8_MOD_V29 | V8_MOD_V32 | V8_MOD_V34HDX | V8_MOD_V34 | V8_MOD_V90 | V8_MOD_V92; negotiations_ok = 0; v8_call_parms.modem_connect_tone = MODEM_CONNECT_TONES_NONE; v8_call_parms.send_ci = TRUE; v8_call_parms.v92 = -1; v8_call_parms.call_function = V8_CALL_V_SERIES; v8_call_parms.modulations = caller_available_modulations; v8_call_parms.protocol = V8_PROTOCOL_LAPM_V42; v8_call_parms.pcm_modem_availability = 0; v8_call_parms.pstn_access = 0; v8_call_parms.nsf = -1; v8_call_parms.t66 = -1; v8_caller = v8_init(NULL, TRUE, &v8_call_parms, handler, (void *) "caller"); non_v8_answerer_tx = modem_connect_tones_tx_init(NULL, MODEM_CONNECT_TONES_ANS_PR); caller_logging = v8_get_logging_state(v8_caller); span_log_set_level(caller_logging, SPAN_LOG_FLOW | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(caller_logging, "caller"); for (i = 0; i < 1000; i++) { samples = v8_tx(v8_caller, amp, SAMPLES_PER_CHUNK); if (samples < SAMPLES_PER_CHUNK) { vec_zeroi16(amp + samples, SAMPLES_PER_CHUNK - samples); samples = SAMPLES_PER_CHUNK; } /*endif*/ span_log_bump_samples(caller_logging, samples); for (i = 0; i < samples; i++) out_amp[2*i] = amp[i]; /*endfor*/ samples = modem_connect_tones_tx(non_v8_answerer_tx, amp, SAMPLES_PER_CHUNK); if (samples < SAMPLES_PER_CHUNK) { vec_zeroi16(amp + samples, SAMPLES_PER_CHUNK - samples); samples = SAMPLES_PER_CHUNK; } /*endif*/ if (v8_rx(v8_caller, amp, samples)) break; /*endif*/ for (i = 0; i < samples; i++) out_amp[2*i + 1] = amp[i]; /*endfor*/ if (outhandle) { outframes = sf_writef_short(outhandle, out_amp, samples); if (outframes != samples) { fprintf(stderr, " Error writing audio file\n"); exit(2); } /*endif*/ } /*endif*/ } /*endfor*/ v8_free(v8_caller); modem_connect_tones_tx_free(non_v8_answerer_tx); if (negotiations_ok != 42) { printf("Tests failed.\n"); exit(2); } /*endif*/ return 0; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int16_t amp[SAMPLES_PER_CHUNK]; int samples; int caller_available_modulations; int answerer_available_modulations; SNDFILE *inhandle; SNDFILE *outhandle; int opt; int log_audio; char *decode_test_file; v8_state_t *v8_caller; v8_state_t *v8_answerer; v8_parms_t v8_call_parms; v8_parms_t v8_answer_parms; logging_state_t *logging; decode_test_file = NULL; log_audio = FALSE; while ((opt = getopt(argc, argv, "d:l")) != -1) { switch (opt) { case 'd': decode_test_file = optarg; break; case 'l': log_audio = TRUE; break; default: //usage(); exit(2); break; } } if (decode_test_file) { caller_available_modulations = V8_MOD_V17 | V8_MOD_V21 | V8_MOD_V22 | V8_MOD_V23HDX | V8_MOD_V23 | V8_MOD_V26BIS | V8_MOD_V26TER | V8_MOD_V27TER | V8_MOD_V29 | V8_MOD_V32 | V8_MOD_V34HDX | V8_MOD_V34 | V8_MOD_V90 | V8_MOD_V92; answerer_available_modulations = V8_MOD_V17 | V8_MOD_V21 | V8_MOD_V22 | V8_MOD_V23HDX | V8_MOD_V23 | V8_MOD_V26BIS | V8_MOD_V26TER | V8_MOD_V27TER | V8_MOD_V29 | V8_MOD_V32 | V8_MOD_V34HDX | V8_MOD_V34 | V8_MOD_V90 | V8_MOD_V92; printf("Decode file '%s'\n", decode_test_file); v8_call_parms.modem_connect_tone = MODEM_CONNECT_TONES_NONE; v8_call_parms.send_ci = TRUE; v8_call_parms.v92 = -1; v8_call_parms.call_function = V8_CALL_V_SERIES; v8_call_parms.modulations = caller_available_modulations; v8_call_parms.protocol = V8_PROTOCOL_LAPM_V42; v8_call_parms.pcm_modem_availability = 0; v8_call_parms.pstn_access = 0; v8_call_parms.nsf = -1; v8_call_parms.t66 = -1; v8_caller = v8_init(NULL, TRUE, &v8_call_parms, handler, (void *) "caller"); logging = v8_get_logging_state(v8_caller); span_log_set_level(logging, SPAN_LOG_FLOW | SPAN_LOG_SHOW_TAG); span_log_set_tag(logging, "caller"); v8_answer_parms.modem_connect_tone = MODEM_CONNECT_TONES_ANSAM_PR; v8_answer_parms.send_ci = TRUE; v8_answer_parms.v92 = -1; v8_answer_parms.call_function = V8_CALL_V_SERIES; v8_answer_parms.modulations = answerer_available_modulations; v8_answer_parms.protocol = V8_PROTOCOL_LAPM_V42; v8_answer_parms.pcm_modem_availability = 0; v8_answer_parms.pstn_access = 0; v8_answer_parms.nsf = -1; v8_answer_parms.t66 = -1; v8_answerer = v8_init(NULL, FALSE, &v8_answer_parms, handler, (void *) "answerer"); logging = v8_get_logging_state(v8_answerer); span_log_set_level(logging, SPAN_LOG_FLOW | SPAN_LOG_SHOW_TAG); span_log_set_tag(logging, "answerer"); if ((inhandle = sf_open_telephony_read(decode_test_file, 1)) == NULL) { fprintf(stderr, " Cannot open speech file '%s'\n", decode_test_file); exit (2); } /*endif*/ while ((samples = sf_readf_short(inhandle, amp, SAMPLES_PER_CHUNK))) { v8_rx(v8_caller, amp, samples); v8_rx(v8_answerer, amp, samples); v8_tx(v8_caller, amp, samples); v8_tx(v8_answerer, amp, samples); } /*endwhile*/ v8_free(v8_caller); v8_free(v8_answerer); if (sf_close_telephony(inhandle)) { fprintf(stderr, " Cannot close speech file '%s'\n", decode_test_file); exit(2); } /*endif*/ } else { outhandle = NULL; if (log_audio) { if ((outhandle = sf_open_telephony_write(OUTPUT_FILE_NAME, 2)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } /*endif*/ } /*endif*/ printf("Test 1: V.8 terminal calls V.8 terminal\n"); v8_calls_v8_tests(outhandle); printf("Test 2: non-V.8 terminal calls V.8 terminal\n"); non_v8_calls_v8_tests(outhandle); printf("Test 3: V.8 terminal calls non-V.8 terminal\n"); v8_calls_non_v8_tests(outhandle); if (outhandle) { if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } /*endif*/ } /*endif*/ printf("Tests passed.\n"); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/v42bis_tests.c0000664000175000017500000001604312100757315013756 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v42bis_tests.c * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* THIS IS A WORK IN PROGRESS. IT IS NOT FINISHED. */ /*! \page v42bis_tests_page V.42bis tests \section v42bis_tests_page_sec_1 What does it do? These tests compress the contents of a file specified on the command line, writing the compressed data to v42bis_tests.v42bis. They then read back the contents of the compressed file, decompress, and write the results to v42bis_tests.out. The contents of this file should exactly match the original file. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #define COMPRESSED_FILE_NAME "v42bis_tests.v42bis" #define DECOMPRESSED_FILE_NAME "v42bis_tests.out" int in_octets_to_date = 0; int out_octets_to_date = 0; static void frame_handler(void *user_data, const uint8_t *buf, int len) { int ret; if ((ret = write((intptr_t) user_data, buf, len)) != len) fprintf(stderr, "Write error %d/%d\n", ret, errno); out_octets_to_date += len; } static void data_handler(void *user_data, const uint8_t *buf, int len) { int ret; if ((ret = write((intptr_t) user_data, buf, len)) != len) fprintf(stderr, "Write error %d/%d\n", ret, errno); out_octets_to_date += len; } int main(int argc, char *argv[]) { int len; v42bis_state_t state_a; v42bis_state_t state_b; uint8_t buf[1024]; int in_fd; int v42bis_fd; int out_fd; int do_compression; int do_decompression; int stutter_compression; int stutter_time; int seg; int opt; time_t now; const char *argv0; const char *original_file; const char *compressed_file; const char *decompressed_file; argv0 = argv[0]; do_compression = FALSE; do_decompression = FALSE; stutter_compression = FALSE; while ((opt = getopt(argc, argv, "cds")) != -1) { switch (opt) { case 'c': do_compression = TRUE; break; case 'd': do_decompression = TRUE; break; case 's': stutter_compression = TRUE; break; default: //usage(); exit(2); break; } } argc -= optind; argv += optind; if (argc < 1) { fprintf(stderr, "Usage: %s [-c] [-d] [-s] []\n", argv0); exit(2); } if (do_compression) { original_file = argv[0]; compressed_file = COMPRESSED_FILE_NAME; } else { original_file = NULL; compressed_file = argv[0]; } decompressed_file = (argc > 1) ? argv[1] : DECOMPRESSED_FILE_NAME; if (do_compression) { stutter_time = rand() & 0x3FF; if ((in_fd = open(argv[0], O_RDONLY)) < 0) { fprintf(stderr, "Error opening file '%s'.\n", original_file); exit(2); } if ((v42bis_fd = open(compressed_file, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) { fprintf(stderr, "Error opening file '%s'.\n", compressed_file); exit(2); } time(&now); v42bis_init(&state_a, 3, 512, 6, frame_handler, (void *) (intptr_t) v42bis_fd, 512, data_handler, NULL, 512); span_log_set_level(&state_a.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(&state_a.logging, "V.42bis"); //v42bis_compression_control(&state_a, V42BIS_COMPRESSION_MODE_ALWAYS); in_octets_to_date = 0; out_octets_to_date = 0; while ((len = read(in_fd, buf, 1024)) > 0) { seg = 0; if (stutter_compression) { while ((len - seg) >= stutter_time) { if (v42bis_compress(&state_a, buf + seg, stutter_time)) { fprintf(stderr, "Bad return code from compression\n"); exit(2); } v42bis_compress_flush(&state_a); seg += stutter_time; stutter_time = rand() & 0x3FF; } } if (v42bis_compress(&state_a, buf + seg, len - seg)) { fprintf(stderr, "Bad return code from compression\n"); exit(2); } in_octets_to_date += len; } v42bis_compress_flush(&state_a); printf("%d bytes compressed to %d bytes in %lds\n", in_octets_to_date, out_octets_to_date, time(NULL) - now); close(in_fd); close(v42bis_fd); } if (do_decompression) { /* Now open the files for the decompression. */ if ((v42bis_fd = open(compressed_file, O_RDONLY)) < 0) { fprintf(stderr, "Error opening file '%s'.\n", compressed_file); exit(2); } if ((out_fd = open(decompressed_file, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) { fprintf(stderr, "Error opening file '%s'.\n", decompressed_file); exit(2); } time(&now); v42bis_init(&state_b, 3, 512, 6, frame_handler, (void *) (intptr_t) v42bis_fd, 512, data_handler, (void *) (intptr_t) out_fd, 512); span_log_set_level(&state_b.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(&state_b.logging, "V.42bis"); in_octets_to_date = 0; out_octets_to_date = 0; while ((len = read(v42bis_fd, buf, 1024)) > 0) { if (v42bis_decompress(&state_b, buf, len)) { fprintf(stderr, "Bad return code from decompression\n"); exit(2); } in_octets_to_date += len; } v42bis_decompress_flush(&state_b); printf("%d bytes decompressed to %d bytes in %lds\n", in_octets_to_date, out_octets_to_date, time(NULL) - now); close(v42bis_fd); close(out_fd); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/line_model_monitor.h0000664000175000017500000000412511422612266015305 00000000000000/* * SpanDSP - a series of DSP components for telephony * * line_model_monitor.h - Model activity in a telephone line model, using the FLTK toolkit. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page line_model_monitor_page Telephone line model monitoring \section line_model_monitor_page_sec_1 What does it do? This code controls a GUI window, which provides monitoring of the internal status of a telephone line modem. It shows, graphically: - the spectrum of the received signal. - the line model in use (when a known line model is being used). - the adapted coefficients of the canceller. \section line_model_monitor_page_sec_2 How does it work? This code uses the FLTK cross platform GUI toolkit. It works on X11 and Windows platforms. In addition to the basic FLTK toolkit, fltk_cartesian is also required. */ #if !defined(_LINE_MODEL_MONITOR_H_) #define _LINE_MODEL_MONITOR_H_ #if defined(__cplusplus) extern "C" { #endif int start_line_model_monitor(int len); int line_model_monitor_can_update(const float *coeffs, int len); int line_model_monitor_line_model_update(const float *coeffs, int len); int line_model_monitor_line_spectrum_update(const int16_t amp[], int len); void line_model_monitor_wait_to_end(void); void line_model_monitor_update_display(void); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/fsk_tests.c0000664000175000017500000004645612101214020013421 00000000000000/* * SpanDSP - a series of DSP components for telephony * * fsk_tests.c - Tests for the low speed FSK modem code (V.21, V.23, etc.). * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page fsk_tests_page FSK modem tests \section fsk_tests_page_sec_1 What does it do? These tests allow either: - An FSK transmit modem to feed an FSK receive modem, of the same type, through a telephone line model. BER testing is then used to evaluate performance under various line conditions. This is effective for testing the basic performance of the receive modem. It is also the only test mode provided for evaluating the transmit modem. - An FSK receive modem is used to decode FSK audio, stored in a file. This is good way to evaluate performance with audio recorded from other models of modem, and with real world problematic telephone lines. \section fsk_tests_page_sec_2 How does it work? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define BLOCK_LEN 160 #define OUTPUT_FILE_NAME "fsk.wav" char *decode_test_file = NULL; both_ways_line_model_state_t *model; int rx_bits = 0; int cutoff_test_carrier = FALSE; static void rx_status(void *user_data, int status) { printf("FSK rx status is %s (%d)\n", signal_status_to_str(status), status); } /*- End of function --------------------------------------------------------*/ static void tx_status(void *user_data, int status) { printf("FSK tx status is %s (%d)\n", signal_status_to_str(status), status); } /*- End of function --------------------------------------------------------*/ static void put_bit(void *user_data, int bit) { if (bit < 0) { rx_status(user_data, bit); return; } printf("Rx bit %d - %d\n", rx_bits++, bit); } /*- End of function --------------------------------------------------------*/ static void cutoff_test_rx_status(void *user_data, int status) { printf("FSK rx status is %s (%d)\n", signal_status_to_str(status), status); switch (status) { case SIG_STATUS_CARRIER_UP: cutoff_test_carrier = TRUE; break; case SIG_STATUS_CARRIER_DOWN: cutoff_test_carrier = FALSE; break; } } /*- End of function --------------------------------------------------------*/ static void cutoff_test_put_bit(void *user_data, int bit) { if (bit < 0) { cutoff_test_rx_status(user_data, bit); return; } } /*- End of function --------------------------------------------------------*/ static void reporter(void *user_data, int reason, bert_results_t *results) { int channel; channel = (int) (intptr_t) user_data; switch (reason) { case BERT_REPORT_SYNCED: fprintf(stderr, "%d: BERT report synced\n", channel); break; case BERT_REPORT_UNSYNCED: fprintf(stderr, "%d: BERT report unsync'ed\n", channel); break; case BERT_REPORT_REGULAR: fprintf(stderr, "%d: BERT report regular - %d bits, %d bad bits, %d resyncs\n", channel, results->total_bits, results->bad_bits, results->resyncs); break; case BERT_REPORT_GT_10_2: fprintf(stderr, "%d: BERT report > 1 in 10^2\n", channel); break; case BERT_REPORT_LT_10_2: fprintf(stderr, "%d: BERT report < 1 in 10^2\n", channel); break; case BERT_REPORT_LT_10_3: fprintf(stderr, "%d: BERT report < 1 in 10^3\n", channel); break; case BERT_REPORT_LT_10_4: fprintf(stderr, "%d: BERT report < 1 in 10^4\n", channel); break; case BERT_REPORT_LT_10_5: fprintf(stderr, "%d: BERT report < 1 in 10^5\n", channel); break; case BERT_REPORT_LT_10_6: fprintf(stderr, "%d: BERT report < 1 in 10^6\n", channel); break; case BERT_REPORT_LT_10_7: fprintf(stderr, "%d: BERT report < 1 in 10^7\n", channel); break; default: fprintf(stderr, "%d: BERT report reason %d\n", channel, reason); break; } } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { fsk_tx_state_t *caller_tx; fsk_rx_state_t *caller_rx; fsk_tx_state_t *answerer_tx; fsk_rx_state_t *answerer_rx; bert_state_t caller_bert; bert_state_t answerer_bert; bert_results_t bert_results; power_meter_t caller_meter; power_meter_t answerer_meter; int16_t caller_amp[BLOCK_LEN]; int16_t answerer_amp[BLOCK_LEN]; int16_t caller_model_amp[BLOCK_LEN]; int16_t answerer_model_amp[BLOCK_LEN]; int16_t out_amp[2*BLOCK_LEN]; SNDFILE *inhandle; SNDFILE *outhandle; int outframes; int i; int j; int samples; int test_bps; int noise_level; int noise_sweep; int bits_per_test; int line_model_no; int modem_under_test_1; int modem_under_test_2; int modems_set; int log_audio; int channel_codec; int rbs_pattern; int on_at; int off_at; tone_gen_descriptor_t tone_desc; tone_gen_state_t tone_tx; int opt; channel_codec = MUNGE_CODEC_NONE; rbs_pattern = 0; line_model_no = 0; decode_test_file = NULL; noise_sweep = FALSE; modem_under_test_1 = FSK_V21CH1; modem_under_test_2 = FSK_V21CH2; log_audio = FALSE; modems_set = 0; while ((opt = getopt(argc, argv, "c:d:lm:nr:s:")) != -1) { switch (opt) { case 'c': channel_codec = atoi(optarg); break; case 'd': decode_test_file = optarg; break; case 'l': log_audio = TRUE; break; case 'm': line_model_no = atoi(optarg); break; case 'n': noise_sweep = TRUE; break; case 'r': rbs_pattern = atoi(optarg); break; case 's': switch (modems_set++) { case 0: modem_under_test_1 = atoi(optarg); break; case 1: modem_under_test_2 = atoi(optarg); break; } break; default: //usage(); exit(2); break; } } if (modem_under_test_1 >= 0) printf("Modem channel 1 is '%s'\n", preset_fsk_specs[modem_under_test_1].name); if (modem_under_test_2 >= 0) printf("Modem channel 2 is '%s'\n", preset_fsk_specs[modem_under_test_2].name); outhandle = NULL; if (log_audio) { if ((outhandle = sf_open_telephony_write(OUTPUT_FILE_NAME, 2)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } } noise_level = -200; bits_per_test = 0; inhandle = NULL; memset(caller_amp, 0, sizeof(*caller_amp)); memset(answerer_amp, 0, sizeof(*answerer_amp)); memset(caller_model_amp, 0, sizeof(*caller_model_amp)); memset(answerer_model_amp, 0, sizeof(*answerer_model_amp)); power_meter_init(&caller_meter, 7); power_meter_init(&answerer_meter, 7); if (decode_test_file) { if ((inhandle = sf_open_telephony_read(decode_test_file, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", decode_test_file); exit(2); } caller_rx = fsk_rx_init(NULL, &preset_fsk_specs[modem_under_test_1], FSK_FRAME_MODE_SYNC, put_bit, NULL); fsk_rx_set_modem_status_handler(caller_rx, rx_status, (void *) &caller_rx); test_bps = preset_fsk_specs[modem_under_test_1].baud_rate; for (;;) { samples = sf_readf_short(inhandle, caller_model_amp, BLOCK_LEN); if (samples < BLOCK_LEN) break; for (i = 0; i < samples; i++) power_meter_update(&caller_meter, caller_model_amp[i]); fsk_rx(caller_rx, caller_model_amp, samples); } if (sf_close_telephony(inhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", decode_test_file); exit(2); } } else { printf("Test cutoff level\n"); caller_rx = fsk_rx_init(NULL, &preset_fsk_specs[modem_under_test_1], FSK_FRAME_MODE_SYNC, cutoff_test_put_bit, NULL); fsk_rx_signal_cutoff(caller_rx, -30.0f); fsk_rx_set_modem_status_handler(caller_rx, cutoff_test_rx_status, (void *) &caller_rx); on_at = 0; for (i = -40; i < -25; i++) { tone_gen_descriptor_init(&tone_desc, 1500, i, 0, 0, 1, 0, 0, 0, TRUE); tone_gen_init(&tone_tx, &tone_desc); for (j = 0; j < 10; j++) { samples = tone_gen(&tone_tx, caller_model_amp, 160); fsk_rx(caller_rx, caller_model_amp, samples); } if (cutoff_test_carrier) break; } on_at = i; off_at = 0; for ( ; i > -40; i--) { tone_gen_descriptor_init(&tone_desc, 1500, i, 0, 0, 1, 0, 0, 0, TRUE); tone_gen_init(&tone_tx, &tone_desc); for (j = 0; j < 10; j++) { samples = tone_gen(&tone_tx, caller_model_amp, 160); fsk_rx(caller_rx, caller_model_amp, samples); } if (!cutoff_test_carrier) break; } off_at = i; printf("Carrier on at %d, off at %d\n", on_at, off_at); if (on_at < -29 || on_at > -26 || off_at < -35 || off_at > -31) { printf("Tests failed.\n"); exit(2); } printf("Test with BERT\n"); test_bps = preset_fsk_specs[modem_under_test_1].baud_rate; if (modem_under_test_1 >= 0) { caller_tx = fsk_tx_init(NULL, &preset_fsk_specs[modem_under_test_1], (get_bit_func_t) bert_get_bit, &caller_bert); fsk_tx_set_modem_status_handler(caller_tx, tx_status, (void *) &caller_tx); answerer_rx = fsk_rx_init(NULL, &preset_fsk_specs[modem_under_test_1], FSK_FRAME_MODE_SYNC, (put_bit_func_t) bert_put_bit, &answerer_bert); fsk_rx_set_modem_status_handler(answerer_rx, rx_status, (void *) &answerer_rx); } if (modem_under_test_2 >= 0) { answerer_tx = fsk_tx_init(NULL, &preset_fsk_specs[modem_under_test_2], (get_bit_func_t) bert_get_bit, &answerer_bert); fsk_tx_set_modem_status_handler(answerer_tx, tx_status, (void *) &answerer_tx); caller_rx = fsk_rx_init(NULL, &preset_fsk_specs[modem_under_test_2], FSK_FRAME_MODE_SYNC, (put_bit_func_t) bert_put_bit, &caller_bert); fsk_rx_set_modem_status_handler(caller_rx, rx_status, (void *) &caller_rx); } test_bps = preset_fsk_specs[modem_under_test_1].baud_rate; bits_per_test = 500000; noise_level = -24; bert_init(&caller_bert, bits_per_test, BERT_PATTERN_ITU_O152_11, test_bps, 20); bert_set_report(&caller_bert, 100000, reporter, (void *) (intptr_t) 1); bert_init(&answerer_bert, bits_per_test, BERT_PATTERN_ITU_O152_11, test_bps, 20); bert_set_report(&answerer_bert, 100000, reporter, (void *) (intptr_t) 2); if ((model = both_ways_line_model_init(line_model_no, (float) noise_level, -15.0f, -15.0f, line_model_no, (float) noise_level, -15.0f, -15.0f, channel_codec, rbs_pattern)) == NULL) { fprintf(stderr, " Failed to create line model\n"); exit(2); } for (;;) { samples = fsk_tx(caller_tx, caller_amp, BLOCK_LEN); for (i = 0; i < samples; i++) power_meter_update(&caller_meter, caller_amp[i]); samples = fsk_tx(answerer_tx, answerer_amp, BLOCK_LEN); for (i = 0; i < samples; i++) power_meter_update(&answerer_meter, answerer_amp[i]); both_ways_line_model(model, caller_model_amp, caller_amp, answerer_model_amp, answerer_amp, samples); //printf("Powers %10.5fdBm0 %10.5fdBm0\n", power_meter_current_dbm0(&caller_meter), power_meter_current_dbm0(&answerer_meter)); fsk_rx(answerer_rx, caller_model_amp, samples); for (i = 0; i < samples; i++) out_amp[2*i] = caller_model_amp[i]; for ( ; i < BLOCK_LEN; i++) out_amp[2*i] = 0; fsk_rx(caller_rx, answerer_model_amp, samples); for (i = 0; i < samples; i++) out_amp[2*i + 1] = answerer_model_amp[i]; for ( ; i < BLOCK_LEN; i++) out_amp[2*i + 1] = 0; if (log_audio) { outframes = sf_writef_short(outhandle, out_amp, BLOCK_LEN); if (outframes != BLOCK_LEN) { fprintf(stderr, " Error writing audio file\n"); exit(2); } } if (samples < BLOCK_LEN) { bert_result(&caller_bert, &bert_results); fprintf(stderr, "%ddB AWGN, %d bits, %d bad bits, %d resyncs\n", noise_level, bert_results.total_bits, bert_results.bad_bits, bert_results.resyncs); if (!noise_sweep) { if (bert_results.total_bits != bits_per_test - 43 || bert_results.bad_bits != 0 || bert_results.resyncs != 0) { printf("Tests failed.\n"); exit(2); } } bert_result(&answerer_bert, &bert_results); fprintf(stderr, "%ddB AWGN, %d bits, %d bad bits, %d resyncs\n", noise_level, bert_results.total_bits, bert_results.bad_bits, bert_results.resyncs); if (!noise_sweep) { if (bert_results.total_bits != bits_per_test - 43 || bert_results.bad_bits != 0 || bert_results.resyncs != 0) { printf("Tests failed.\n"); exit(2); } break; } /* Put a little silence between the chunks in the file. */ memset(out_amp, 0, sizeof(out_amp)); if (log_audio) { for (i = 0; i < 200; i++) outframes = sf_writef_short(outhandle, out_amp, BLOCK_LEN); } if (modem_under_test_1 >= 0) { caller_tx = fsk_tx_init(NULL, &preset_fsk_specs[modem_under_test_1], (get_bit_func_t) bert_get_bit, &caller_bert); fsk_tx_set_modem_status_handler(caller_tx, tx_status, (void *) &caller_tx); answerer_rx = fsk_rx_init(NULL, &preset_fsk_specs[modem_under_test_1], FSK_FRAME_MODE_SYNC, (put_bit_func_t) bert_put_bit, &answerer_bert); fsk_rx_set_modem_status_handler(answerer_rx, rx_status, (void *) &answerer_rx); } if (modem_under_test_2 >= 0) { answerer_tx = fsk_tx_init(NULL, &preset_fsk_specs[modem_under_test_2], (get_bit_func_t) bert_get_bit, &answerer_bert); fsk_tx_set_modem_status_handler(answerer_tx, tx_status, (void *) &answerer_tx); caller_rx = fsk_rx_init(NULL, &preset_fsk_specs[modem_under_test_2], FSK_FRAME_MODE_SYNC, (put_bit_func_t) bert_put_bit, &caller_bert); fsk_rx_set_modem_status_handler(caller_rx, rx_status, (void *) &caller_rx); } noise_level++; if ((model = both_ways_line_model_init(line_model_no, (float) noise_level, line_model_no, -15.0f, -15.0f, noise_level, channel_codec, -15.0f, -15.0f, 0)) == NULL) { fprintf(stderr, " Failed to create line model\n"); exit(2); } bert_init(&caller_bert, bits_per_test, BERT_PATTERN_ITU_O152_11, test_bps, 20); bert_set_report(&caller_bert, 100000, reporter, (void *) (intptr_t) 1); bert_init(&answerer_bert, bits_per_test, BERT_PATTERN_ITU_O152_11, test_bps, 20); bert_set_report(&answerer_bert, 100000, reporter, (void *) (intptr_t) 2); } } printf("Tests passed.\n"); } if (log_audio) { if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/complex_vector_int_tests.c0000664000175000017500000000700711422612266016551 00000000000000/* * SpanDSP - a series of DSP components for telephony * * complex_vector_int_tests.c * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include "spandsp.h" static complexi32_t cvec_dot_prodi16_dumb(const complexi16_t x[], const complexi16_t y[], int n) { complexi32_t z; int i; z = complex_seti32(0, 0); for (i = 0; i < n; i++) { z.re += ((int32_t) x[i].re*(int32_t) y[i].re - (int32_t) x[i].im*(int32_t) y[i].im); z.im += ((int32_t) x[i].re*(int32_t) y[i].im + (int32_t) x[i].im*(int32_t) y[i].re); } return z; } /*- End of function --------------------------------------------------------*/ static int test_cvec_dot_prodi16(void) { int i; complexi32_t za; complexi32_t zb; complexi16_t x[99]; complexi16_t y[99]; for (i = 0; i < 99; i++) { x[i].re = rand(); x[i].im = rand(); y[i].re = rand(); y[i].im = rand(); } for (i = 1; i < 99; i++) { za = cvec_dot_prodi16(x, y, i); zb = cvec_dot_prodi16_dumb(x, y, i); if (za.re != zb.re || za.im != zb.im) { printf("Tests failed\n"); exit(2); } } return 0; } /*- End of function --------------------------------------------------------*/ static int test_cvec_circular_dot_prodi16(void) { int i; int j; int pos; int len; complexi32_t za; complexi32_t zb; complexi16_t x[99]; complexi16_t y[99]; /* Verify that we can do circular sample buffer "dot" linear coefficient buffer operations properly, by doing two sub-dot products. */ for (i = 0; i < 99; i++) { x[i].re = rand(); x[i].im = rand(); y[i].re = rand(); y[i].im = rand(); } len = 95; for (pos = 0; pos < len; pos++) { za = cvec_circular_dot_prodi16(x, y, len, pos); zb = complex_seti32(0, 0); for (i = 0; i < len; i++) { j = (pos + i) % len; zb.re += ((int32_t) x[j].re*(int32_t) y[i].re - (int32_t) x[j].im*(int32_t) y[i].im); zb.im += ((int32_t) x[j].re*(int32_t) y[i].im + (int32_t) x[j].im*(int32_t) y[i].re); } if (za.re != zb.re || za.im != zb.im) { printf("Tests failed\n"); exit(2); } } return 0; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { test_cvec_dot_prodi16(); test_cvec_circular_dot_prodi16(); printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/udptl.h0000664000175000017500000001235412100554351012554 00000000000000/* * SpanDSP - a series of DSP components for telephony * * udptl.c * * Written by Steve Underwood * * Copyright (C) 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(_SPANDSP_UDPTL_H_) #define _SPANDSP_UDPTL_H_ #define LOCAL_FAX_MAX_DATAGRAM 400 #define LOCAL_FAX_MAX_FEC_PACKETS 5 #define UDPTL_BUF_MASK 15 typedef int (*udptl_rx_packet_handler_t) (void *user_data, const uint8_t msg[], int len, int seq_no); typedef struct { int buf_len; uint8_t buf[LOCAL_FAX_MAX_DATAGRAM]; } udptl_fec_tx_buffer_t; typedef struct { int buf_len; uint8_t buf[LOCAL_FAX_MAX_DATAGRAM]; int fec_len[LOCAL_FAX_MAX_FEC_PACKETS]; uint8_t fec[LOCAL_FAX_MAX_FEC_PACKETS][LOCAL_FAX_MAX_DATAGRAM]; int fec_span; int fec_entries; } udptl_fec_rx_buffer_t; struct udptl_state_s { udptl_rx_packet_handler_t rx_packet_handler; void *user_data; /*! This option indicates the error correction scheme used in transmitted UDPTL packets. */ int error_correction_scheme; /*! This option indicates the number of error correction entries transmitted in UDPTL packets. */ int error_correction_entries; /*! This option indicates the span of the error correction entries in transmitted UDPTL packets (FEC only). */ int error_correction_span; /*! This option indicates the maximum size of a datagram that can be accepted by the remote device. */ int far_max_datagram_size; /*! This option indicates the maximum size of a datagram that we are prepared to accept. */ int local_max_datagram_size; int verbose; int tx_seq_no; int rx_seq_no; int rx_expected_seq_no; udptl_fec_tx_buffer_t tx[UDPTL_BUF_MASK + 1]; udptl_fec_rx_buffer_t rx[UDPTL_BUF_MASK + 1]; }; enum { UDPTL_ERROR_CORRECTION_NONE, UDPTL_ERROR_CORRECTION_FEC, UDPTL_ERROR_CORRECTION_REDUNDANCY }; typedef struct udptl_state_s udptl_state_t; #if defined(__cplusplus) extern "C" { #endif /*! \brief Process an arriving UDPTL packet. \param s The UDPTL context. \param buf The UDPTL packet buffer. \param len The length of the packet. \return 0 for OK. */ int udptl_rx_packet(udptl_state_t *s, const uint8_t buf[], int len); /*! \brief Construct a UDPTL packet, ready for transmission. \param s The UDPTL context. \param buf The UDPTL packet buffer. \param msg The primary packet. \param len The length of the primary packet. \return The length of the constructed UDPTL packet. */ int udptl_build_packet(udptl_state_t *s, uint8_t buf[], const uint8_t msg[], int msg_len); /*! \brief Change the error correction settings of a UDPTL context. \param s The UDPTL context. \param ec_scheme One of the optional error correction schemes. \param span The packet span over which error correction should be applied. \param entries The number of error correction entries to include in packets. \return 0 for OK. */ int udptl_set_error_correction(udptl_state_t *s, int ec_scheme, int span, int entries); /*! \brief Check the error correction settings of a UDPTL context. \param s The UDPTL context. \param ec_scheme One of the optional error correction schemes. \param span The packet span over which error correction is being applied. \param entries The number of error correction being included in packets. \return 0 for OK. */ int udptl_get_error_correction(udptl_state_t *s, int *ec_scheme, int *span, int *entries); int udptl_set_local_max_datagram(udptl_state_t *s, int max_datagram); int udptl_get_local_max_datagram(udptl_state_t *s); int udptl_set_far_max_datagram(udptl_state_t *s, int max_datagram); int udptl_get_far_max_datagram(udptl_state_t *s); /*! \brief Initialise a UDPTL context. \param s The UDPTL context. \param ec_scheme One of the optional error correction schemes. \param span The packet span over which error correction should be applied. \param entries The number of error correction entries to include in packets. \param rx_packet_handler The callback function, used to report arriving IFP packets. \param user_data An opaque pointer supplied to rx_packet_handler. \return A pointer to the UDPTL context, or NULL if there was a problem. */ udptl_state_t *udptl_init(udptl_state_t *s, int ec_scheme, int span, int entries, udptl_rx_packet_handler_t rx_packet_handler, void *user_data); /*! \brief Release a UDPTL context. \param s The UDPTL context. \return 0 for OK. */ int udptl_release(udptl_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/fax_utils.h0000664000175000017500000000257212101214410013411 00000000000000/* * SpanDSP - a series of DSP components for telephony * * fax_utils.h * * Written by Steve Underwood * * Copyright (C) 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_FAX_UTILS_H_) #define _SPANDSP_FAX_UTILS_H_ #if defined(__cplusplus) extern "C" { #endif void fax_log_tx_parameters(t30_state_t *s, const char *tag); void fax_log_rx_parameters(t30_state_t *s, const char *tag); void fax_log_page_transfer_statistics(t30_state_t *s, const char *tag); void fax_log_final_transfer_statistics(t30_state_t *s, const char *tag); int get_tiff_total_pages(const char *file); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/image_translate_tests.c0000664000175000017500000003577012101216345016006 00000000000000/* * SpanDSP - a series of DSP components for telephony * * image_translate_tests.c - Tests for the image translation routines. * * Written by Steve Underwood * * Copyright (C) 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page image_translate_tests_page Image translation tests \section image_translate_tests_page_sec_1 What does it do? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #define INPUT_TIFF_FILE_NAME "../test-data/local/lenna-colour.tif" typedef struct { const uint8_t *image; int width; int length; int current_row; int bytes_per_pixel; } image_descriptor_t; static void display_row(int row, int width, uint8_t buf[]) { int i; int test_pixel; printf("%3d: ", row); for (i = 0; i < width; i++) { test_pixel = (buf[i >> 3] >> (7 - (i & 7))) & 0x01; printf("%c", (test_pixel) ? ' ' : '@'); } printf("\n"); } /*- End of function --------------------------------------------------------*/ static int test_dithered_50_by_50(int row, int width, uint8_t buf[]) { static const char *image[50] = { " 0: @ @ @ @ @ @ @ @@ @@@@@@@@@@@@@@", " 1: @ @ @ @ @ @ @ @ @ @@ @@ @ @ @ @ @@@@", " 2: @ @ @ @ @ @ @ @@ @ @ @@@ @@@@@@ @@", " 3: @ @ @ @ @ @ @ @ @ @ @@@ @@@@ @@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@@ @ @@ @ @@ @@@@@@@", " 30: @ @ @ @ @ @ @ @ @ @ @ @@@@@@@ @@@@@", " 31: @ @ @ @ @ @ @ @ @ @@@@ @ @ @@@@ @@", " 32: @ @ @ @ @ @ @ @ @ @@ @ @ @@@@@@@ @@@@@", " 33: @ @ @ @ @ @ @ @@@ @@ @ @ @@@@@@@", " 34: @ @ @ @ @ @ @ @ @ @ @ @ @@ @@@@@@ @ @@@", " 35: @ @ @ @ @ @ @ @ @ @@ @ @ @@@@@@@", " 36: @ @ @ @ @ @ @ @ @@ @@@ @@@@@@@ @@@ @", " 37: @ @ @ @ @ @ @ @ @ @ @@ @ @ @@@@@@@", " 38: @ @ @ @ @ @ @ @ @@ @@ @@@@@@@ @@ @@", " 39: @ @ @ @ @ @ @ @ @ @ @@ @@ @ @ @@@@@@@", " 40: @ @ @ @ @ @ @ @ @ @@ @@ @@@@ @@@@@", " 41: @ @ @ @ @ @ @ @ @ @@ @ @@ @@@ @@@@ @@", " 42: @ @ @ @ @ @ @@ @@ @@ @@ @@@ @@@@@", " 43: @ @ @ @ @ @ @ @ @ @ @@ @@@ @@@@@@@", " 44: @ @ @ @ @ @ @ @ @ @ @@@ @@@ @@@ @@ @@", " 45: @ @ @ @ @ @ @@ @ @ @ @@ @@@@@@@", " 46: @ @ @ @ @ @ @ @ @ @ @ @@ @@@@@@@@@ @@@@@", " 47: @ @ @ @ @ @ @ @ @ @@ @ @ @ @@@@ @@", " 48: @ @ @ @ @ @ @@ @ @@ @@@@@@ @@@@@", " 49: @ @ @ @ @ @ @ @ @ @ @ @@ @@ @ @ @@@@@@@" }; int i; int match; int ref_pixel; int test_pixel; match = 0; for (i = 0; i < width; i++) { ref_pixel = (image[row][i + 5] == ' '); test_pixel = (buf[i >> 3] >> (7 - (i & 7))) & 0x01; if (ref_pixel != test_pixel) match = -1; } return match; } /*- End of function --------------------------------------------------------*/ static int row_read(void *user_data, uint8_t buf[], size_t len) { image_descriptor_t *im; im = (image_descriptor_t *) user_data; if (im->current_row >= im->length) return 0; memcpy(buf, &im->image[im->current_row*im->width*im->bytes_per_pixel], len); im->current_row++; return len; } /*- End of function --------------------------------------------------------*/ static void get_flattened_image(image_translate_state_t *s, int compare) { int i; int len; uint8_t row_buf[5000]; for (i = 0; i < s->output_length; i++) { if ((len = image_translate_row(s, row_buf, (s->output_width + 7)/8)) != (s->output_width + 7)/8) { printf("Image finished early - %d %d\n", len, (s->output_width + 7)/8); exit(2); } display_row(i, s->output_width, row_buf); if (compare) { if (test_dithered_50_by_50(i, s->output_width, row_buf)) { printf("Dithered image mismatch at row %d\n", i); printf("Test failed\n"); exit(2); } } } if ((len = image_translate_row(s, row_buf, (s->output_width + 7)/8)) != 0) { printf("Image finished late - %d %d\n", len, (s->output_width + 7)/8); exit(2); } } /*- End of function --------------------------------------------------------*/ static void dither_tests_gray16(void) { int i; int j; image_translate_state_t bw; image_translate_state_t *s = &bw; uint16_t image[50*50]; image_descriptor_t im; printf("Dithering from a 16 bit per sample gray scale to bi-level\n"); im.image = (const uint8_t *) image; im.width = 50; im.length = 50; im.bytes_per_pixel = 2; im.current_row = 0; for (i = 0; i < im.length; i++) { for (j = 0; j < im.width; j++) image[i*im.width + j] = j*1200; } s = image_translate_init(s, IMAGE_TRANSLATE_FROM_GRAY_16, im.width, im.length, -1, row_read, &im); get_flattened_image(s, TRUE); } /*- End of function --------------------------------------------------------*/ static void dither_tests_gray8(void) { int i; int j; image_translate_state_t bw; image_translate_state_t *s = &bw; uint8_t image[50*50]; image_descriptor_t im; printf("Dithering from a 8 bit per sample gray scale to bi-level\n"); im.image = image; im.width = 50; im.length = 50; im.bytes_per_pixel = 1; im.current_row = 0; for (i = 0; i < im.length; i++) { for (j = 0; j < im.width; j++) image[i*im.width + j] = j*1200/256; } s = image_translate_init(s, IMAGE_TRANSLATE_FROM_GRAY_8, im.width, im.length, -1, row_read, &im); get_flattened_image(s, TRUE); } /*- End of function --------------------------------------------------------*/ static void dither_tests_colour16(void) { int i; int j; image_translate_state_t bw; image_translate_state_t *s = &bw; uint16_t image[50*50*3]; image_descriptor_t im; printf("Dithering from a 3x16 bit per sample colour to bi-level\n"); im.image = (const uint8_t *) image; im.width = 50; im.length = 50; im.bytes_per_pixel = 6; im.current_row = 0; for (i = 0; i < im.length; i++) { for (j = 0; j < im.width; j++) { image[i*3*im.width + 3*j + 0] = j*1200; image[i*3*im.width + 3*j + 1] = j*1200; image[i*3*im.width + 3*j + 2] = j*1200; } } s = image_translate_init(s, IMAGE_TRANSLATE_FROM_COLOUR_16, im.width, im.length, -1, row_read, &im); get_flattened_image(s, TRUE); } /*- End of function --------------------------------------------------------*/ static void dither_tests_colour8(void) { int i; int j; image_translate_state_t bw; image_translate_state_t *s = &bw; uint8_t image[50*50*3]; image_descriptor_t im; printf("Dithering from a 3x8 bit per sample colour to bi-level\n"); im.image = image; im.width = 50; im.length = 50; im.bytes_per_pixel = 3; im.current_row = 0; for (i = 0; i < im.length; i++) { for (j = 0; j < im.width; j++) { image[i*3*im.width + 3*j + 0] = j*1200/256; image[i*3*im.width + 3*j + 1] = j*1200/256; image[i*3*im.width + 3*j + 2] = j*1200/256; } } s = image_translate_init(s, IMAGE_TRANSLATE_FROM_COLOUR_8, im.width, im.length, -1, row_read, &im); get_flattened_image(s, TRUE); } /*- End of function --------------------------------------------------------*/ static void grow_tests_colour8(void) { int i; int j; image_translate_state_t resize; image_translate_state_t *s1 = &resize; uint8_t image[50*50*3]; image_descriptor_t im; printf("Image growth tests\n"); im.image = image; im.width = 50; im.length = 50; im.bytes_per_pixel = 3; im.current_row = 0; for (i = 0; i < im.length; i++) { for (j = 0; j < im.width; j++) { image[i*3*im.width + 3*j + 0] = j*1200/256; image[i*3*im.width + 3*j + 1] = j*1200/256; image[i*3*im.width + 3*j + 2] = j*1200/256; } } s1 = image_translate_init(s1, IMAGE_TRANSLATE_FROM_COLOUR_8, im.width, im.length, 200, row_read, &im); get_flattened_image(s1, FALSE); } /*- End of function --------------------------------------------------------*/ static void lenna_tests(int output_width, const char *file) { TIFF *in_file; TIFF *out_file; int image_width; int image_length; int output_length; uint8_t *image; uint8_t *image2; int len; int total; int16_t bits_per_sample; int16_t samples_per_pixel; int i; int n; image_translate_state_t bw; image_translate_state_t *s = &bw; image_descriptor_t im; printf("Dithering Lenna from colour to bi-level test\n"); if ((in_file = TIFFOpen(INPUT_TIFF_FILE_NAME, "r")) == NULL) return; image_width = 0; TIFFGetField(in_file, TIFFTAG_IMAGEWIDTH, &image_width); if (image_width <= 0) return; image_length = 0; TIFFGetField(in_file, TIFFTAG_IMAGELENGTH, &image_length); if (image_length <= 0) return; bits_per_sample = 0; TIFFGetField(in_file, TIFFTAG_BITSPERSAMPLE, &bits_per_sample); samples_per_pixel = 0; TIFFGetField(in_file, TIFFTAG_SAMPLESPERPIXEL, &samples_per_pixel); printf("Original image is %d x %d, %d bits per sample, %d samples per pixel\n", image_width, image_length, bits_per_sample, samples_per_pixel); if ((image = malloc(image_width*image_length*samples_per_pixel)) == NULL) return; for (total = 0, i = 0; i < 1000; i++) { len = TIFFReadEncodedStrip(in_file, i, &image[total], image_width*image_length*samples_per_pixel - total); if (len <= 0) break; total += len; if (total == image_width*image_length*samples_per_pixel) { printf("Done\n"); break; } } printf("Image size %d %d\n", total, image_width*image_length*samples_per_pixel); TIFFClose(in_file); im.image = image; im.width = image_width; im.length = image_length; im.current_row = 0; im.bytes_per_pixel = samples_per_pixel; s = image_translate_init(s, IMAGE_TRANSLATE_FROM_COLOUR_8, image_width, image_length, output_width, row_read, &im); output_width = image_translate_get_output_width(s); output_length = image_translate_get_output_length(s); if ((out_file = TIFFOpen(file, "w")) == NULL) return; TIFFSetField(out_file, TIFFTAG_IMAGEWIDTH, output_width); TIFFSetField(out_file, TIFFTAG_IMAGELENGTH, output_length); TIFFSetField(out_file, TIFFTAG_BITSPERSAMPLE, 1); TIFFSetField(out_file, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT); TIFFSetField(out_file, TIFFTAG_SAMPLESPERPIXEL, 1); TIFFSetField(out_file, TIFFTAG_ROWSPERSTRIP, -1); TIFFSetField(out_file, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); TIFFSetField(out_file, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE); TIFFSetField(out_file, TIFFTAG_FILLORDER, FILLORDER_LSB2MSB); TIFFSetField(out_file, TIFFTAG_PAGENUMBER, 0, 1); TIFFSetField(out_file, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISWHITE); TIFFSetField(out_file, TIFFTAG_FILLORDER, FILLORDER_LSB2MSB); printf("Input %d x %d, output %d x %d\n", image_width, image_length, output_width, output_length); if ((image2 = malloc(output_width*output_length/8)) == NULL) return; memset(image2, 0, output_width*output_length/8); n = 0; for (i = 0; i < output_length; i++) n += image_translate_row(s, &image2[n], output_width/8); TIFFWriteEncodedStrip(out_file, 0, image2, output_width*output_length/8); TIFFWriteDirectory(out_file); TIFFClose(out_file); } /*- End of function --------------------------------------------------------*/ int main(int argc, char **argv) { #if 1 dither_tests_gray16(); dither_tests_gray8(); dither_tests_colour16(); dither_tests_colour8(); #endif #if 1 grow_tests_colour8(); #endif #if 1 lenna_tests(0, "lenna-bw.tif"); lenna_tests(1728, "lenna-bw-1728.tif"); lenna_tests(200, "lenna-bw-200.tif"); #endif printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/pcap_parse.h0000664000175000017500000000311512101216366013536 00000000000000/* * SpanDSP - a series of DSP components for telephony * * pcap_parse.h * * Written by Steve Underwood * * Copyright (C) 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_PCAP_PARSE_H_) #define _SPANDSP_PCAP_PARSE_H_ #if defined(__cplusplus) extern "C" { #endif typedef int (pcap_timing_update_handler_t)(void *user_data, struct timeval *ts); typedef int (pcap_packet_handler_t)(void *user_data, const uint8_t *pkt, int len); int pcap_scan_pkts(const char *file, uint32_t src_addr, uint16_t src_port, uint32_t dest_addr, uint16_t dest_port, pcap_timing_update_handler_t *timing_update_handler, pcap_packet_handler_t *packet_handler, void *user_data); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/power_meter_tests.c0000664000175000017500000002767112101216217015176 00000000000000/* * SpanDSP - a series of DSP components for telephony * * power_meter_tests.c * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page power_meter_tests_page Power meter tests \section power_meter_tests_page_sec_1 What does it do? These tests assess the accuracy of power meters built from the power meter module. Both tones and noise are used to check the meter's behaviour. \section power_meter_tests_page_sec_2 How does it work? ???. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define IN_FILE_NAME "../test-data/local/short_nb_voice.wav" #define OUT_FILE_NAME "power_meter_tests.wav" static int power_surge_detector_tests(void) { SNDFILE *outhandle; power_surge_detector_state_t *sig; int i; int sample; int16_t amp[8000]; int16_t amp_out[2*8000]; awgn_state_t *awgnx; int32_t phase_rate; uint32_t phase_acc; int16_t phase_scale; float signal_power; int32_t signal_level; int signal_present; int prev_signal_present; int ok; int extremes[4]; if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME, 2)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME); exit(2); } sig = power_surge_detector_init(NULL, -50.0f, 5.0f); prev_signal_present = FALSE; phase_rate = dds_phase_rate(450.0f); phase_acc = 0; phase_scale = dds_scaling_dbm0(-33.0f); awgnx = awgn_init_dbm0(NULL, 1234567, -45.0f); extremes[0] = 8001; extremes[1] = -1; extremes[2] = 8001; extremes[3] = -1; for (sample = 0; sample < 800000; sample += 8000) { ok = 0; for (i = 0; i < 8000; i++) { amp[i] = awgn(awgnx); if (i < 4000) amp[i] += dds_mod(&phase_acc, phase_rate, phase_scale, 0); signal_level = power_surge_detector(sig, amp[i]); signal_present = (signal_level != 0); if (prev_signal_present != signal_present) { signal_power = power_surge_detector_current_dbm0(sig); if (signal_present) { if (ok == 0 && i >= 0 && i < 25) ok = 1; if (extremes[0] > i) extremes[0] = i; if (extremes[1] < i) extremes[1] = i; printf("On at %f (%fdBm0)\n", (sample + i)/8000.0, signal_power); } else { if (ok == 1 && i >= 4000 + 0 && i < 4000 + 35) ok = 2; if (extremes[2] > i) extremes[2] = i; if (extremes[3] < i) extremes[3] = i; printf("Off at %f (%fdBm0)\n", (sample + i)/8000.0, signal_power); } prev_signal_present = signal_present; } amp_out[2*i] = amp[i]; amp_out[2*i + 1] = signal_present*5000; } sf_writef_short(outhandle, amp_out, 8000); if (ok != 2 || extremes[0] < 1 || extremes[1] > 30 || extremes[2] < 4001 || extremes[3] > 4030) { printf(" Surge not detected correctly (%d)\n", ok); exit(2); } } if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME); exit(2); } printf("Min on %d, max on %d, min off %d, max off %d\n", extremes[0], extremes[1], extremes[2], extremes[3]); return 0; } /*- End of function --------------------------------------------------------*/ static int power_surge_detector_file_test(const char *file) { SNDFILE *inhandle; SNDFILE *outhandle; int inframes; power_surge_detector_state_t *sig; int i; int16_t amp[8000]; int16_t amp_out[2*8000]; int sample; float signal_power; int32_t signal_level; int signal_present; int prev_signal_present; if ((inhandle = sf_open_telephony_read(file, 1)) == NULL) { printf(" Cannot open audio file '%s'\n", file); exit(2); } if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME); exit(2); } sig = power_surge_detector_init(NULL, -50.0f, 6.0f); prev_signal_present = FALSE; sample = 0; while ((inframes = sf_readf_short(inhandle, amp, 8000))) { for (i = 0; i < inframes; i++) { signal_level = power_surge_detector(sig, amp[i]); signal_present = (signal_level != 0); if (prev_signal_present != signal_present) { signal_power = power_surge_detector_current_dbm0(sig); if (signal_present) printf("On at %f (%fdBm0)\n", (sample + i)/8000.0, signal_power); else printf("Off at %f (%fdBm0)\n", (sample + i)/8000.0, signal_power); prev_signal_present = signal_present; } amp_out[2*i] = amp[i]; amp_out[2*i + 1] = signal_present*5000; } sf_writef_short(outhandle, amp_out, inframes); sample += inframes; } if (sf_close_telephony(inhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", file); exit(2); } if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME); exit(2); } return 0; } /*- End of function --------------------------------------------------------*/ static int power_meter_tests(void) { awgn_state_t noise_source; power_meter_t meter; tone_gen_descriptor_t tone_desc; tone_gen_state_t gen; int i; int idum = 1234567; int16_t amp[1000]; int len; int32_t level; power_meter_init(&meter, 7); printf("Testing with zero in the power register\n"); printf("Power: expected %fdBm0, got %fdBm0\n", -90.169f, power_meter_current_dbm0(&meter)); printf("Power: expected %fdBOv, got %fdBOv\n", -96.329f, power_meter_current_dbov(&meter)); printf("Testing with a square wave 10dB from maximum\n"); for (i = 0; i < 1000; i++) { amp[i] = (i & 1) ? 10362 : -10362; level = power_meter_update(&meter, amp[i]); //printf("%12d %fdBm0 %fdBov\n", level, power_meter_current_dbm0(&meter), power_meter_current_dbov(&meter)); } printf("Level: expected %" PRId32 "/%" PRId32 ", got %" PRId32 "\n", power_meter_level_dbov(-10.0f), power_meter_level_dbm0(-10.0f + DBM0_MAX_POWER), level); printf("Power: expected %fdBm0, got %fdBm0\n", -10.0f + DBM0_MAX_POWER, power_meter_current_dbm0(&meter)); printf("Power: expected %fdBOv, got %fdBOv\n", -10.0f, power_meter_current_dbov(&meter)); if (level < power_meter_level_dbov(-10.0f)*0.99f || level > power_meter_level_dbov(-10.0f)*1.01f) { printf("Test failed (level)\n"); exit(2); } if (0.1f < fabsf(power_meter_current_dbm0(&meter) + 10.0f - DBM0_MAX_POWER)) { printf("Test failed (dBm0)\n"); exit(2); } if (0.1f < fabsf(power_meter_current_dbov(&meter) + 10.0)) { printf("Test failed (dBOv)\n"); exit(2); } printf("Testing with a sine wave tone 10dB from maximum\n"); tone_gen_descriptor_init(&tone_desc, 1000, -4, 0, 1, 1, 0, 0, 0, TRUE); tone_gen_init(&gen, &tone_desc); len = tone_gen(&gen, amp, 1000); for (i = 0; i < len; i++) { level = power_meter_update(&meter, amp[i]); //printf("%12d %fdBm0 %fdBov\n", level, power_meter_current_dbm0(&meter), power_meter_current_dbov(&meter)); } printf("Level: expected %" PRId32 "/%" PRId32 ", got %" PRId32 "\n", power_meter_level_dbov(-10.0f), power_meter_level_dbm0(-10.0f + DBM0_MAX_POWER), level); printf("Power: expected %fdBm0, got %fdBm0\n", -10.0f + DBM0_MAX_POWER, power_meter_current_dbm0(&meter)); printf("Power: expected %fdBOv, got %fdBOv\n", -10.0f, power_meter_current_dbov(&meter)); if (level < power_meter_level_dbov(-10.0f)*0.95f || level > power_meter_level_dbov(-10.0f)*1.05f) { printf("Test failed (level)\n"); exit(2); } if (0.2f < fabsf(power_meter_current_dbm0(&meter) + 10.0f - DBM0_MAX_POWER)) { printf("Test failed (dBm0)\n"); exit(2); } if (0.2f < fabsf(power_meter_current_dbov(&meter) + 10.0)) { printf("Test failed (dBOv)\n"); exit(2); } printf("Testing with AWGN 10dB from maximum\n"); awgn_init_dbov(&noise_source, idum, -10.0f); for (i = 0; i < 1000; i++) amp[i] = awgn(&noise_source); for (i = 0; i < 1000; i++) { level = power_meter_update(&meter, amp[i]); //printf("%12d %fdBm0 %fdBov\n", level, power_meter_current_dbm0(&meter), power_meter_current_dbov(&meter)); } printf("Level: expected %" PRId32 "/%" PRId32 ", got %" PRId32 "\n", power_meter_level_dbov(-10.0f), power_meter_level_dbm0(-10.0f + DBM0_MAX_POWER), level); printf("Power: expected %fdBm0, got %fdBm0\n", -10.0f + DBM0_MAX_POWER, power_meter_current_dbm0(&meter)); printf("Power: expected %fdBOv, got %fdBOv\n", -10.0f, power_meter_current_dbov(&meter)); if (level < power_meter_level_dbov(-10.0f)*0.95f || level > power_meter_level_dbov(-10.0f)*1.05f) { printf("Test failed (level)\n"); exit(2); } if (0.2f < fabsf(power_meter_current_dbm0(&meter) + 10.0f - DBM0_MAX_POWER)) { printf("Test failed (dBm0)\n"); exit(2); } if (0.2f < fabsf(power_meter_current_dbov(&meter) + 10.0f)) { printf("Test failed (dBOv)\n"); exit(2); } return 0; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int basic_tests; int decode; int opt; const char *in_file; basic_tests = TRUE; decode = FALSE; in_file = IN_FILE_NAME; while ((opt = getopt(argc, argv, "d:")) != -1) { switch (opt) { case 'd': in_file = optarg; basic_tests = FALSE; decode = TRUE; break; default: //usage(); exit(2); } } if (basic_tests) { power_meter_tests(); power_surge_detector_tests(); } if (decode) { power_surge_detector_file_test(in_file); } printf("Tests passed\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/g711_tests.c0000664000175000017500000003465312101216503013321 00000000000000/* * SpanDSP - a series of DSP components for telephony * * g711_tests.c * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page g711_tests_page A-law and u-law conversion tests \section g711_tests_page_sec_1 What does it do? \section g711_tests_page_sec_2 How is it used? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define BLOCK_LEN 160 #define IN_FILE_NAME "../test-data/local/short_nb_voice.wav" #define ENCODED_FILE_NAME "g711.g711" #define OUT_FILE_NAME "post_g711.wav" int16_t amp[65536]; uint8_t ulaw_data[65536]; uint8_t alaw_data[65536]; const uint8_t alaw_1khz_sine[] = {0x34, 0x21, 0x21, 0x34, 0xB4, 0xA1, 0xA1, 0xB4}; const uint8_t ulaw_1khz_sine[] = {0x1E, 0x0B, 0x0B, 0x1E, 0x9E, 0x8B, 0x8B, 0x9E}; static void compliance_tests(int log_audio) { SNDFILE *outhandle; power_meter_t power_meter; int outframes; int i; int block; int pre; int post; int post_post; int alaw_failures; int ulaw_failures; float worst_alaw; float worst_ulaw; float tmp; int len; g711_state_t *enc_state; g711_state_t *transcode; g711_state_t *dec_state; outhandle = NULL; if (log_audio) { if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME); exit(2); } } printf("Conversion accuracy tests.\n"); alaw_failures = 0; ulaw_failures = 0; worst_alaw = 0.0; worst_ulaw = 0.0; for (block = 0; block < 1; block++) { for (i = 0; i < 65536; i++) { pre = i - 32768; post = alaw_to_linear(linear_to_alaw(pre)); if (abs(pre) > 140) { tmp = (float) abs(post - pre)/(float) abs(pre); if (tmp > 0.10) { printf("A-law: Excessive error at %d (%d)\n", pre, post); alaw_failures++; } if (tmp > worst_alaw) worst_alaw = tmp; } else { /* Small values need different handling for sensible measurement */ if (abs(post - pre) > 15) { printf("A-law: Excessive error at %d (%d)\n", pre, post); alaw_failures++; } } amp[i] = post; } if (log_audio) { outframes = sf_writef_short(outhandle, amp, 65536); if (outframes != 65536) { fprintf(stderr, " Error writing audio file\n"); exit(2); } } for (i = 0; i < 65536; i++) { pre = i - 32768; post = ulaw_to_linear(linear_to_ulaw(pre)); if (abs(pre) > 40) { tmp = (float) abs(post - pre)/(float) abs(pre); if (tmp > 0.10) { printf("u-law: Excessive error at %d (%d)\n", pre, post); ulaw_failures++; } if (tmp > worst_ulaw) worst_ulaw = tmp; } else { /* Small values need different handling for sensible measurement */ if (abs(post - pre) > 4) { printf("u-law: Excessive error at %d (%d)\n", pre, post); ulaw_failures++; } } amp[i] = post; } if (log_audio) { outframes = sf_writef_short(outhandle, amp, 65536); if (outframes != 65536) { fprintf(stderr, " Error writing audio file\n"); exit(2); } } } printf("Worst A-law error (ignoring small values) %f%%\n", worst_alaw*100.0); printf("Worst u-law error (ignoring small values) %f%%\n", worst_ulaw*100.0); if (alaw_failures || ulaw_failures) { printf("%d A-law values with excessive error\n", alaw_failures); printf("%d u-law values with excessive error\n", ulaw_failures); printf("Tests failed\n"); exit(2); } printf("Cyclic conversion repeatability tests.\n"); /* Find what happens to every possible linear value after a round trip. */ for (i = 0; i < 65536; i++) { pre = i - 32768; /* Make a round trip */ post = alaw_to_linear(linear_to_alaw(pre)); /* A second round trip should cause no further change */ post_post = alaw_to_linear(linear_to_alaw(post)); if (post_post != post) { printf("A-law second round trip mismatch - at %d, %d != %d\n", pre, post, post_post); printf("Tests failed\n"); exit(2); } /* Make a round trip */ post = ulaw_to_linear(linear_to_ulaw(pre)); /* A second round trip should cause no further change */ post_post = ulaw_to_linear(linear_to_ulaw(post)); if (post_post != post) { printf("u-law round trip mismatch - at %d, %d != %d\n", pre, post, post_post); printf("Tests failed\n"); exit(2); } } printf("Reference power level tests.\n"); power_meter_init(&power_meter, 7); for (i = 0; i < 8000; i++) { amp[i] = ulaw_to_linear(ulaw_1khz_sine[i & 7]); power_meter_update(&power_meter, amp[i]); } printf("Reference u-law 1kHz tone is %fdBm0\n", power_meter_current_dbm0(&power_meter)); if (log_audio) { outframes = sf_writef_short(outhandle, amp, 8000); if (outframes != 8000) { fprintf(stderr, " Error writing audio file\n"); exit(2); } } if (0.1f < fabs(power_meter_current_dbm0(&power_meter))) { printf("Test failed.\n"); exit(2); } for (i = 0; i < 8000; i++) { amp[i] = alaw_to_linear(alaw_1khz_sine[i & 7]); power_meter_update(&power_meter, amp[i]); } printf("Reference A-law 1kHz tone is %fdBm0\n", power_meter_current_dbm0(&power_meter)); if (log_audio) { outframes = sf_writef_short(outhandle, amp, 8000); if (outframes != 8000) { fprintf(stderr, " Error writing audio file\n"); exit(2); } } if (0.1f < fabs(power_meter_current_dbm0(&power_meter))) { printf("Test failed.\n"); exit(2); } /* Check the transcoding functions. */ printf("Testing transcoding A-law -> u-law -> A-law\n"); for (i = 0; i < 256; i++) { if (alaw_to_ulaw(ulaw_to_alaw(i)) != i) { if (abs(alaw_to_ulaw(ulaw_to_alaw(i)) - i) > 1) { printf("u-law -> A-law -> u-law gave %d -> %d\n", i, alaw_to_ulaw(ulaw_to_alaw(i))); printf("Test failed\n"); exit(2); } } } printf("Testing transcoding u-law -> A-law -> u-law\n"); for (i = 0; i < 256; i++) { if (ulaw_to_alaw(alaw_to_ulaw(i)) != i) { if (abs(alaw_to_ulaw(ulaw_to_alaw(i)) - i) > 1) { printf("A-law -> u-law -> A-law gave %d -> %d\n", i, ulaw_to_alaw(alaw_to_ulaw(i))); printf("Test failed\n"); exit(2); } } } enc_state = g711_init(NULL, G711_ALAW); transcode = g711_init(NULL, G711_ALAW); dec_state = g711_init(NULL, G711_ULAW); len = 65536; for (i = 0; i < len; i++) amp[i] = i - 32768; len = g711_encode(enc_state, alaw_data, amp, len); len = g711_transcode(transcode, ulaw_data, alaw_data, len); len = g711_decode(dec_state, amp, ulaw_data, len); if (len != 65536) { printf("Block coding gave the wrong length - %d instead of %d\n", len, 65536); printf("Test failed\n"); exit(2); } for (i = 0; i < len; i++) { pre = i - 32768; post = amp[i]; if (abs(pre) > 140) { tmp = (float) abs(post - pre)/(float) abs(pre); if (tmp > 0.10) { printf("Block: Excessive error at %d (%d)\n", pre, post); exit(2); } } else { /* Small values need different handling for sensible measurement */ if (abs(post - pre) > 15) { printf("Block: Excessive error at %d (%d)\n", pre, post); exit(2); } } } g711_release(enc_state); g711_release(transcode); g711_release(dec_state); if (log_audio) { if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME); exit(2); } } printf("Tests passed.\n"); } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { SNDFILE *inhandle; SNDFILE *outhandle; int outframes; int opt; int samples; int len2; int len3; int basic_tests; int law; int encode; int decode; int file; const char *in_file; const char *out_file; g711_state_t *enc_state; g711_state_t *dec_state; int16_t indata[BLOCK_LEN]; int16_t outdata[BLOCK_LEN]; uint8_t g711data[BLOCK_LEN]; basic_tests = TRUE; law = G711_ALAW; encode = FALSE; decode = FALSE; in_file = NULL; out_file = NULL; while ((opt = getopt(argc, argv, "ad:e:l:u")) != -1) { switch (opt) { case 'a': law = G711_ALAW; basic_tests = FALSE; break; case 'd': in_file = optarg; basic_tests = FALSE; decode = TRUE; break; case 'e': in_file = optarg; basic_tests = FALSE; encode = TRUE; break; case 'l': out_file = optarg; break; case 'u': law = G711_ULAW; basic_tests = FALSE; break; default: //usage(); exit(2); } } if (basic_tests) { compliance_tests(TRUE); } else { if (!decode && !encode) { decode = encode = TRUE; } if (in_file == NULL) { in_file = (encode) ? IN_FILE_NAME : ENCODED_FILE_NAME; } if (out_file == NULL) { out_file = (decode) ? OUT_FILE_NAME : ENCODED_FILE_NAME; } inhandle = NULL; outhandle = NULL; file = -1; enc_state = NULL; dec_state = NULL; if (encode) { if ((inhandle = sf_open_telephony_read(in_file, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", in_file); exit(2); } enc_state = g711_init(NULL, law); } else { if ((file = open(in_file, O_RDONLY)) < 0) { fprintf(stderr, " Failed to open '%s'\n", in_file); exit(2); } } if (decode) { if ((outhandle = sf_open_telephony_write(out_file, 1)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", out_file); exit(2); } dec_state = g711_init(NULL, law); } else { if ((file = open(out_file, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) { fprintf(stderr, " Failed to open '%s'\n", out_file); exit(2); } } for (;;) { if (encode) { samples = sf_readf_short(inhandle, indata, BLOCK_LEN); if (samples <= 0) break; len2 = g711_encode(enc_state, g711data, indata, samples); } else { len2 = read(file, g711data, BLOCK_LEN); if (len2 <= 0) break; } if (decode) { len3 = g711_decode(dec_state, outdata, g711data, len2); outframes = sf_writef_short(outhandle, outdata, len3); if (outframes != len3) { fprintf(stderr, " Error writing audio file\n"); exit(2); } } else { len3 = write(file, g711data, len2); if (len3 <= 0) break; } } if (encode) { if (sf_close_telephony(inhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", IN_FILE_NAME); exit(2); } } else { close(file); } if (decode) { if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME); exit(2); } } else { close(file); } printf("'%s' translated to '%s' using %s.\n", in_file, out_file, (law == G711_ALAW) ? "A-law" : "u-law"); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/logging_tests.c0000664000175000017500000002053112101216635014264 00000000000000/* * SpanDSP - a series of DSP components for telephony * * logging_tests.c - Tests for the logging functions. * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page logging_tests_page Logging tests \section logging_tests_page_sec_1 What does it do? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #define _POSIX_SOURCE #define _POSIX_C_SOURCE 200112L #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" static int tests_failed = FALSE; static int msg_step = 0; static int msg2_step = 0; static int error_step = 0; static int msg_done = FALSE; static int msg2_done = FALSE; static int error_done = FALSE; static void message_handler(int level, const char *text) { const char *ref[] = { "TAG Log with tag 1 2 3\n", "Log with protocol 1 2 3\n", "FLOW NewTag Log with new tag 1 2 3\n", "FLOW Protocol NewTag Log with protocol 1 2 3\n", "FLOW Protocol NewTag Buf 00 01 02 03 04 05 06 07 08 09\n", "FLOW Protocol NewTag Buf 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 ca cb cc cd ce cf d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df e0 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff 00 01 02 03 04 05 06 07 08 09\n", "00:00:00.000 FLOW Protocol NewTag Time tagged log 1 2 3\n", "00:00:00.020 FLOW Protocol NewTag Time tagged log 1 2 3\n", "00:00:00.040 FLOW Protocol NewTag Time tagged log 1 2 3\n", "00:00:00.060 FLOW Protocol NewTag Time tagged log 1 2 3\n", "00:00:00.080 FLOW Protocol NewTag Time tagged log 1 2 3\n", "00:00:00.100 FLOW Protocol NewTag Time tagged log 1 2 3\n", "00:00:00.120 FLOW Protocol NewTag Time tagged log 1 2 3\n", "00:00:00.140 FLOW Protocol NewTag Time tagged log 1 2 3\n", "00:00:00.160 FLOW Protocol NewTag Time tagged log 1 2 3\n", "00:00:00.180 FLOW Protocol NewTag Time tagged log 1 2 3\n", "" }; if (strcmp(ref[msg_step], text)) { printf(">>>: %s", ref[msg_step]); tests_failed = TRUE; } if (ref[++msg_step][0] == '\0') msg_done = TRUE; printf("MSG: %s", text); } /*- End of function --------------------------------------------------------*/ static void message_handler2(int level, const char *text) { /* TODO: This doesn't check if the date/time field makes sense */ if (strcmp(" FLOW Protocol NewTag Date/time tagged log 1 2 3\n", text + 23)) { printf(">>>: %s", text + 23); tests_failed = TRUE; } if (++msg2_step == 10) msg2_done = TRUE; printf("MSG: %s", text); } /*- End of function --------------------------------------------------------*/ static void error_handler(const char *text) { const char *ref[] = { "ERROR Log with severity log 1 2 3\n", "" }; if (strcmp(ref[error_step], text)) { printf(">>>: %s", ref[error_step]); tests_failed = TRUE; } if (ref[++error_step][0] == '\0') error_done = TRUE; printf("ERR: %s", text); } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { logging_state_t log; int i; uint8_t buf[1000]; struct timespec delay; /* Set up a logger */ if (span_log_init(&log, 123, "TAG") == NULL) { fprintf(stderr, "Failed to initialise log.\n"); exit(2); } /* Try it */ span_log_set_level(&log, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_FLOW); if (span_log(&log, SPAN_LOG_FLOW, "Logging to fprintf, as simple as %d %d %d\n", 1, 2, 3)) fprintf(stderr, "Logged.\n"); else fprintf(stderr, "Not logged.\n"); /* Now set a custom log handler */ span_log_set_message_handler(&log, &message_handler); span_log_set_error_handler(&log, &error_handler); span_log_set_sample_rate(&log, 44100); /* Try the different logging elements */ span_log_set_level(&log, SPAN_LOG_SHOW_TAG | SPAN_LOG_FLOW); if (span_log(&log, SPAN_LOG_FLOW, "Log with tag %d %d %d\n", 1, 2, 3)) fprintf(stderr, "Logged.\n"); else fprintf(stderr, "Not logged.\n"); span_log_set_level(&log, SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); if (span_log(&log, SPAN_LOG_FLOW, "Log with protocol %d %d %d\n", 1, 2, 3)) fprintf(stderr, "Logged.\n"); else fprintf(stderr, "Not logged.\n"); span_log_set_level(&log, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_FLOW); if (span_log(&log, SPAN_LOG_ERROR, "Log with severity log %d %d %d\n", 1, 2, 3)) fprintf(stderr, "Logged.\n"); else fprintf(stderr, "Not logged.\n"); span_log_set_level(&log, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_FLOW); span_log_set_tag(&log, "NewTag"); if (span_log(&log, SPAN_LOG_FLOW, "Log with new tag %d %d %d\n", 1, 2, 3)) fprintf(stderr, "Logged.\n"); else fprintf(stderr, "Not logged.\n"); span_log_set_protocol(&log, "Protocol"); if (span_log(&log, SPAN_LOG_FLOW, "Log with protocol %d %d %d\n", 1, 2, 3)) fprintf(stderr, "Logged.\n"); else fprintf(stderr, "Not logged.\n"); /* Test logging of buffer contents */ for (i = 0; i < 1000; i++) buf[i] = i; if (span_log_buf(&log, SPAN_LOG_FLOW, "Buf", buf, 10)) fprintf(stderr, "Logged.\n"); else fprintf(stderr, "Not logged.\n"); if (span_log_buf(&log, SPAN_LOG_FLOW, "Buf", buf, 1000)) fprintf(stderr, "Logged.\n"); else fprintf(stderr, "Not logged.\n"); /* Test the correct severities will be logged */ for (i = 0; i < 10; i++) { if (!span_log_test(&log, i)) { if (i != 6) tests_failed = TRUE; break; } } /* Check timestamping by samples */ span_log_set_level(&log, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_FLOW | SPAN_LOG_SHOW_SAMPLE_TIME); for (i = 0; i < 10; i++) { span_log(&log, SPAN_LOG_FLOW, "Time tagged log %d %d %d\n", 1, 2, 3); span_log_bump_samples(&log, 441*2); } /* Check timestamping by current date and time */ span_log_set_message_handler(&log, &message_handler2); span_log_set_level(&log, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_FLOW | SPAN_LOG_SHOW_DATE); for (i = 0; i < 10; i++) { span_log(&log, SPAN_LOG_FLOW, "Date/time tagged log %d %d %d\n", 1, 2, 3); delay.tv_sec = 0; delay.tv_nsec = 20000000; nanosleep(&delay, NULL); } if (tests_failed || !msg_done || !error_done) { printf("Tests failed - %d %d %d.\n", tests_failed, msg_done, error_done); return 2; } span_log_set_message_handler(&log, &message_handler); printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/bitstream_tests.c0000664000175000017500000001205511422612266014637 00000000000000/* * SpanDSP - a series of DSP components for telephony * * bitstream_tests.c * * Written by Steve Underwood * * Copyright (C) 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page bitstream_tests_page Bitstream tests \section bitstream_tests_page_sec_1 What does it do? \section bitstream_tests_page_sec_2 How is it used? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" uint8_t buffer[256]; #define PATTERN 0x11111111 #define SEQUENCE_LENGTH 17 uint8_t left[] = { 0x28, /* 2 of 4, 3, 2, 1 */ 0xC8, /* 1 of 6, 5, 2 of 4 */ 0xAE, /* 3 of 7, 5 of 6 */ 0x67, /* 4 of 8, 4 of 7 */ 0x74, /* 4 of 9, 4 of 8 */ 0x43, /* 3 of 10, 5 of 9 */ 0x32, /* 1 of 11, 7 of 10 */ 0xAA, /* 8 of 11 */ 0xAE, /* 6 of 12, 2 of 11 */ 0xED, /* 2 of 13, 6 of 12 */ 0x99, /* 8 of 13 */ 0x8E, /* 5 of 14, 3 of 13 */ 0xEE, /* 8 of 14 */ 0xEE, /* 7 of 15, 1 of 14 */ 0xEE, /* 8 of 15 */ 0xFF, /* 8 of 16 */ 0xFF, /* 8 of 16 */ 0x88, /* 8 of 17 */ 0x88, /* 8 of 17 */ 0x00 /* 1 of 17 */ }; uint8_t right[] = { 0xD2, /* 1, 2, 3, 2 of 4 */ 0x90, /* 2 of 4, 5, 1 of 6 */ 0xCA, /* 5 of 6, 3 of 7 */ 0x7C, /* 4 of 7, 4 of 8 */ 0x87, /* 4 of 8, 4 of 9 */ 0x28, /* 5 of 9, 3 of 10 */ 0x33, /* 7 of 10, 1 of 11 */ 0x55, /* 8 of 11 */ 0xED, /* 2 of 11, 6 of 12 */ 0x2E, /* 6 of 12, 2 of 13 */ 0x33, /* 8 of 13 */ 0xEB, /* 3 of 13, 5 of 14 */ 0xEE, /* 8 of 14 */ 0xDC, /* 1 of 14, 7 of 15 */ 0xDD, /* 8 of 15 */ 0xFF, /* 8 of 16 */ 0xFF, /* 8 of 16 */ 0x10, /* 8 of 17 */ 0x11, /* 8 of 17 */ 0x01 /* 1 of 17 */ }; int main(int argc, char *argv[]) { int i; bitstream_state_t state; bitstream_state_t *s; const uint8_t *r; uint8_t *w; uint8_t *cc; unsigned int x; int total_bits; s = bitstream_init(&state, TRUE); w = buffer; total_bits = 0; for (i = 0; i < SEQUENCE_LENGTH; i++) { bitstream_put(s, &w, PATTERN*i, i + 1); total_bits += (i + 1); } bitstream_flush(s, &w); printf("%d bits written\n", total_bits); for (cc = buffer; cc < w; cc++) printf("%02X ", *cc); printf("\n"); for (cc = right; cc < right + sizeof(right); cc++) printf("%02X ", *cc); printf("\n"); if ((w - buffer) != sizeof(right) || memcmp(buffer, right, sizeof(right))) { printf("Test failed\n"); exit(2); } s = bitstream_init(&state, TRUE); r = buffer; for (i = 0; i < SEQUENCE_LENGTH; i++) { x = bitstream_get(s, &r, i + 1); if (x != ((PATTERN*i) & ((1 << (i + 1)) - 1))) { printf("Error 0x%X 0x%X\n", x, ((PATTERN*i) & ((1 << (i + 1)) - 1))); printf("Test failed\n"); exit(2); } } s = bitstream_init(&state, FALSE); w = buffer; total_bits = 0; for (i = 0; i < SEQUENCE_LENGTH; i++) { bitstream_put(s, &w, PATTERN*i, i + 1); total_bits += (i + 1); } bitstream_flush(s, &w); printf("%d bits written\n", total_bits); for (cc = buffer; cc < w; cc++) printf("%02X ", *cc); printf("\n"); for (cc = left; cc < left + sizeof(left); cc++) printf("%02X ", *cc); printf("\n"); if ((w - buffer) != sizeof(left) || memcmp(buffer, left, sizeof(left))) { printf("Test failed\n"); exit(2); } s = bitstream_init(&state, FALSE); r = buffer; for (i = 0; i < SEQUENCE_LENGTH; i++) { x = bitstream_get(s, &r, i + 1); if (x != ((PATTERN*i) & ((1 << (i + 1)) - 1))) { printf("Error 0x%X 0x%X\n", x, ((PATTERN*i) & ((1 << (i + 1)) - 1))); printf("Test failed\n"); exit(2); } } printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/t38_terminal_to_gateway_tests.c0000664000175000017500000004110112101215246017363 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t38_terminal_to_gateway_tests.c - Joint tests for the T.38 FoIP terminal and gateway modules. * * Written by Steve Underwood * * Copyright (C) 2005, 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page t38_terminal_to_gateway_tests_page T.38 mixed gateway and termination tests \section t38_terminal_to_gateway_tests_page_sec_1 What does it do? These tests exercise the path T.38 termination -> T.38 gateway -> FAX machine */ /* Enable the following definition to enable direct probing into the FAX structures */ //#define WITH_SPANDSP_INTERNALS #if defined(HAVE_CONFIG_H) #include #endif #if defined(HAVE_FL_FL_H) && defined(HAVE_FL_FL_CARTESIAN_H) && defined(HAVE_FL_FL_AUDIO_METER_H) #define ENABLE_GUI #endif #include #include #include #include #include #include #include #if !defined(_WIN32) #include #endif //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #if defined(ENABLE_GUI) #include "media_monitor.h" #endif #include "fax_utils.h" #define SAMPLES_PER_CHUNK 160 #define INPUT_FILE_NAME "../test-data/itu/fax/itutests.tif" #define OUTPUT_FILE_NAME "t38.tif" #define OUTPUT_FILE_NAME_WAVE "t38_terminal_to_gateway.wav" t38_terminal_state_t *t38_state_a; t38_gateway_state_t *t38_state_b; fax_state_t *fax_state_b; g1050_state_t *path_a_to_b; g1050_state_t *path_b_to_a; double when = 0.0; int done[2] = {FALSE, FALSE}; int succeeded[2] = {FALSE, FALSE}; int simulate_incrementing_repeats = FALSE; static int phase_b_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; i = (int) (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase B", i); printf("%c: Phase B handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result)); fax_log_rx_parameters(s, tag); return T30_ERR_OK; } /*- End of function --------------------------------------------------------*/ static int phase_d_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; i = (int) (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase D", i); printf("%c: Phase D handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result)); fax_log_page_transfer_statistics(s, tag); fax_log_tx_parameters(s, tag); fax_log_rx_parameters(s, tag); return T30_ERR_OK; } /*- End of function --------------------------------------------------------*/ static void phase_e_handler(t30_state_t *s, void *user_data, int result) { int i; t30_stats_t t; char tag[20]; i = (int) (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase E", i); printf("%c: Phase E handler on channel %c - (%d) %s\n", i, i, result, t30_completion_code_to_str(result)); fax_log_final_transfer_statistics(s, tag); fax_log_tx_parameters(s, tag); fax_log_rx_parameters(s, tag); t30_get_transfer_statistics(s, &t); succeeded[i - 'A'] = (result == T30_ERR_OK) && (t.pages_tx == 12 || t.pages_rx == 12); done[i - 'A'] = TRUE; } /*- End of function --------------------------------------------------------*/ static int tx_packet_handler_a(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count) { int i; static int subst_seq = 0; /* This routine queues messages between two instances of T.38 processing */ if (simulate_incrementing_repeats) { for (i = 0; i < count; i++) { span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d\n", subst_seq, len); g1050_put(path_a_to_b, buf, len, subst_seq, when); subst_seq = (subst_seq + 1) & 0xFFFF; } } else { span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d, count %d\n", s->tx_seq_no, len, count); for (i = 0; i < count; i++) g1050_put(path_a_to_b, buf, len, s->tx_seq_no, when); } return 0; } /*- End of function --------------------------------------------------------*/ static int tx_packet_handler_b(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count) { int i; static int subst_seq = 0; /* This routine queues messages between two instances of T.38 processing */ if (simulate_incrementing_repeats) { for (i = 0; i < count; i++) { span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d\n", subst_seq, len); g1050_put(path_b_to_a, buf, len, subst_seq, when); subst_seq = (subst_seq + 1) & 0xFFFF; } } else { span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d, count %d\n", s->tx_seq_no, len, count); for (i = 0; i < count; i++) g1050_put(path_b_to_a, buf, len, s->tx_seq_no, when); } return 0; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int16_t t38_amp_b[SAMPLES_PER_CHUNK]; int16_t t30_amp_b[SAMPLES_PER_CHUNK]; int16_t out_amp[2*SAMPLES_PER_CHUNK]; int t38_len_b; int t30_len_b; int msg_len; uint8_t msg[1024]; int log_audio; int outframes; SNDFILE *wave_handle; int t38_version; int use_ecm; int use_tep; int feedback_audio; int use_transmit_on_idle; const char *input_file_name; int i; int seq_no; int g1050_model_no; int g1050_speed_pattern_no; double tx_when; double rx_when; int use_gui; int supported_modems; int opt; t30_state_t *t30; t38_core_state_t *t38_core; logging_state_t *logging; log_audio = FALSE; t38_version = 1; use_ecm = FALSE; input_file_name = INPUT_FILE_NAME; simulate_incrementing_repeats = FALSE; g1050_model_no = 0; g1050_speed_pattern_no = 1; use_gui = FALSE; use_tep = FALSE; feedback_audio = FALSE; use_transmit_on_idle = TRUE; supported_modems = T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17; while ((opt = getopt(argc, argv, "efgi:Ilm:M:s:tv:")) != -1) { switch (opt) { case 'e': use_ecm = TRUE; break; case 'f': feedback_audio = TRUE; break; case 'g': #if defined(ENABLE_GUI) use_gui = TRUE; #else fprintf(stderr, "Graphical monitoring not available\n"); exit(2); #endif break; case 'i': input_file_name = optarg; break; case 'I': simulate_incrementing_repeats = TRUE; break; case 'l': log_audio = TRUE; break; case 'm': supported_modems = atoi(optarg); break; case 'M': g1050_model_no = optarg[0] - 'A' + 1; break; case 's': g1050_speed_pattern_no = atoi(optarg); break; case 't': use_tep = TRUE; break; case 'v': t38_version = atoi(optarg); break; default: //usage(); exit(2); break; } } printf("Using T.38 version %d\n", t38_version); if (use_ecm) printf("Using ECM\n"); wave_handle = NULL; if (log_audio) { if ((wave_handle = sf_open_telephony_write(OUTPUT_FILE_NAME_WAVE, 2)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUTPUT_FILE_NAME_WAVE); exit(2); } } srand48(0x1234567); if ((path_a_to_b = g1050_init(g1050_model_no, g1050_speed_pattern_no, 100, 33)) == NULL) { fprintf(stderr, "Failed to start IP network path model\n"); exit(2); } if ((path_b_to_a = g1050_init(g1050_model_no, g1050_speed_pattern_no, 100, 33)) == NULL) { fprintf(stderr, "Failed to start IP network path model\n"); exit(2); } if ((t38_state_a = t38_terminal_init(NULL, TRUE, tx_packet_handler_a, &t38_state_b)) == NULL) { fprintf(stderr, "Cannot start the T.38 channel\n"); exit(2); } t30 = t38_terminal_get_t30_state(t38_state_a); t38_core = t38_terminal_get_t38_core_state(t38_state_a); t38_set_t38_version(t38_core, t38_version); logging = t38_terminal_get_logging_state(t38_state_a); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-A"); logging = t38_core_get_logging_state(t38_core); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-A"); logging = t30_get_logging_state(t30); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-A"); t30_set_supported_modems(t30, supported_modems); t30_set_tx_ident(t30, "11111111"); t30_set_tx_file(t30, input_file_name, -1, -1); t30_set_phase_b_handler(t30, phase_b_handler, (void *) (intptr_t) 'A'); t30_set_phase_d_handler(t30, phase_d_handler, (void *) (intptr_t) 'A'); t30_set_phase_e_handler(t30, phase_e_handler, (void *) (intptr_t) 'A'); t30_set_ecm_capability(t30, use_ecm); if (use_ecm) t30_set_supported_compressions(t30, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION); if ((t38_state_b = t38_gateway_init(NULL, tx_packet_handler_b, &t38_state_a)) == NULL) { fprintf(stderr, "Cannot start the T.38 channel\n"); exit(2); } t38_core = t38_gateway_get_t38_core_state(t38_state_b); t38_gateway_set_transmit_on_idle(t38_state_b, use_transmit_on_idle); t38_set_t38_version(t38_core, t38_version); t38_gateway_set_ecm_capability(t38_state_b, use_ecm); logging = t38_gateway_get_logging_state(t38_state_b); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-B"); logging = t38_core_get_logging_state(t38_core); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-B"); memset(t38_amp_b, 0, sizeof(t38_amp_b)); if ((fax_state_b = fax_init(NULL, FALSE)) == NULL) { fprintf(stderr, "Cannot start FAX\n"); exit(2); } t30 = fax_get_t30_state(fax_state_b); fax_set_transmit_on_idle(fax_state_b, use_transmit_on_idle); fax_set_tep_mode(fax_state_b, use_tep); t30_set_supported_modems(t30, supported_modems); t30_set_tx_ident(t30, "22222222"); t30_set_tx_nsf(t30, (const uint8_t *) "\x50\x00\x00\x00Spandsp\x00", 12); t30_set_rx_file(t30, OUTPUT_FILE_NAME, -1); t30_set_phase_b_handler(t30, phase_b_handler, (void *) (intptr_t) 'B'); t30_set_phase_d_handler(t30, phase_d_handler, (void *) (intptr_t) 'B'); t30_set_phase_e_handler(t30, phase_e_handler, (void *) (intptr_t) 'B'); t30_set_ecm_capability(t30, use_ecm); if (use_ecm) t30_set_supported_compressions(t30, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION); logging = fax_get_logging_state(fax_state_b); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "FAX-B "); logging = t30_get_logging_state(t30); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "FAX-B "); memset(t30_amp_b, 0, sizeof(t30_amp_b)); #if defined(ENABLE_GUI) if (use_gui) start_media_monitor(); #endif for (;;) { logging = t38_terminal_get_logging_state(t38_state_a); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); t38_core = t38_terminal_get_t38_core_state(t38_state_a); logging = t38_core_get_logging_state(t38_core); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); t30 = t38_terminal_get_t30_state(t38_state_a); logging = t30_get_logging_state(t30); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); logging = t38_gateway_get_logging_state(t38_state_b); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); t38_core = t38_gateway_get_t38_core_state(t38_state_b); logging = t38_core_get_logging_state(t38_core); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); logging = fax_get_logging_state(fax_state_b); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); t30 = fax_get_t30_state(fax_state_b); logging = t30_get_logging_state(t30); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); memset(out_amp, 0, sizeof(out_amp)); t38_terminal_send_timeout(t38_state_a, SAMPLES_PER_CHUNK); t30_len_b = fax_tx(fax_state_b, t30_amp_b, SAMPLES_PER_CHUNK); if (!use_transmit_on_idle) { /* The receive side always expects a full block of samples, but the transmit side may not be sending any when it doesn't need to. We may need to pad with some silence. */ if (t30_len_b < SAMPLES_PER_CHUNK) { memset(t30_amp_b + t30_len_b, 0, sizeof(int16_t)*(SAMPLES_PER_CHUNK - t30_len_b)); t30_len_b = SAMPLES_PER_CHUNK; } } if (feedback_audio) { for (i = 0; i < t30_len_b; i++) t30_amp_b[i] += t38_amp_b[i] >> 1; } if (log_audio) { for (i = 0; i < t30_len_b; i++) out_amp[2*i + 1] = t30_amp_b[i]; } if (t38_gateway_rx(t38_state_b, t30_amp_b, t30_len_b)) break; t38_len_b = t38_gateway_tx(t38_state_b, t38_amp_b, SAMPLES_PER_CHUNK); if (!use_transmit_on_idle) { if (t38_len_b < SAMPLES_PER_CHUNK) { memset(t38_amp_b + t38_len_b, 0, sizeof(int16_t)*(SAMPLES_PER_CHUNK - t38_len_b)); t38_len_b = SAMPLES_PER_CHUNK; } } if (log_audio) { for (i = 0; i < t38_len_b; i++) out_amp[2*i] = t38_amp_b[i]; } if (fax_rx(fax_state_b, t38_amp_b, SAMPLES_PER_CHUNK)) break; when += (float) SAMPLES_PER_CHUNK/(float) SAMPLE_RATE; while ((msg_len = g1050_get(path_a_to_b, msg, 1024, when, &seq_no, &tx_when, &rx_when)) >= 0) { #if defined(ENABLE_GUI) if (use_gui) media_monitor_rx(seq_no, tx_when, rx_when); #endif t38_core = t38_gateway_get_t38_core_state(t38_state_b); t38_core_rx_ifp_packet(t38_core, msg, msg_len, seq_no); } while ((msg_len = g1050_get(path_b_to_a, msg, 1024, when, &seq_no, &tx_when, &rx_when)) >= 0) { #if defined(ENABLE_GUI) if (use_gui) media_monitor_rx(seq_no, tx_when, rx_when); #endif t38_core = t38_terminal_get_t38_core_state(t38_state_a); t38_core_rx_ifp_packet(t38_core, msg, msg_len, seq_no); } if (log_audio) { outframes = sf_writef_short(wave_handle, out_amp, SAMPLES_PER_CHUNK); if (outframes != SAMPLES_PER_CHUNK) break; } if (done[0] && done[1]) break; #if defined(ENABLE_GUI) if (use_gui) media_monitor_update_display(); #endif } t38_terminal_release(t38_state_a); fax_release(fax_state_b); if (log_audio) { if (sf_close(wave_handle) != 0) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME_WAVE); exit(2); } } if (!succeeded[0] || !succeeded[1]) { printf("Tests failed\n"); exit(2); } printf("Tests passed\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/rfc2198_sim_tests.c0000664000175000017500000001663312101216064014610 00000000000000/* * SpanDSP - a series of DSP components for telephony * * rfc2198_sim_tests.c - Tests for the G.1050/TIA-921 model * with redundant transmission in the * style of UDPTL or RFC2198.. * * Written by Steve Underwood * * Copyright (C) 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #if defined(HAVE_FL_FL_H) && defined(HAVE_FL_FL_CARTESIAN_H) && defined(HAVE_FL_FL_AUDIO_METER_H) #define ENABLE_GUI #endif #include #include #include #include #include #include #include #if defined(HAVE_MATH_H) #define GEN_CONST #endif //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #if defined(ENABLE_GUI) #include "media_monitor.h" #endif #define PACKET_SIZE 256 #define PACKET_INTERVAL 20 #define SIMULATION_TIME 300 #define MODEL_NO 8 #define SPEED_PATTERN_NO 133 int main(int argc, char *argv[]) { rfc2198_sim_state_t *s; double *packet_arrival_times; int packets_per_sec; int num_packets; int model_no; int speed_pattern_no; int simulation_time; int i; int len; uint8_t put_pkt[256]; uint8_t get_pkt[256]; int put_pkt_len; int get_pkt_len; int get_seq_no; double get_departure_time; double get_arrival_time; int packets_put; int packets_really_put; int packets_got; int oos_packets_got; int missing_packets_got; int highest_seq_no_got; int opt; FILE *out_file; #if defined(ENABLE_GUI) int use_gui; #endif #if defined(ENABLE_GUI) use_gui = FALSE; #endif model_no = MODEL_NO; speed_pattern_no = SPEED_PATTERN_NO; simulation_time = SIMULATION_TIME; while ((opt = getopt(argc, argv, "gm:s:t:")) != -1) { switch (opt) { case 'g': #if defined(ENABLE_GUI) use_gui = TRUE; #else fprintf(stderr, "Graphical monitoring not available\n"); exit(2); #endif break; case 'm': model_no = optarg[0] - 'A' + 1; if (model_no < 0 || model_no > 8) { fprintf(stderr, "Bad model ID '%s'\n", optarg); exit(2); } break; case 's': speed_pattern_no = atoi(optarg); if (speed_pattern_no < 1 || speed_pattern_no > 133) { fprintf(stderr, "Bad link speed pattern %s\n", optarg); exit(2); } break; case 't': simulation_time = atoi(optarg); break; default: //usage(); exit(2); break; } } argc -= optind; argv += optind; if ((out_file = fopen("rfc2198_sim_tests.txt", "w")) == NULL) { fprintf(stderr, "Can't open %s\n", "rfc2198_sim_tests.txt"); return 2; } packets_per_sec = 1000/PACKET_INTERVAL; num_packets = packets_per_sec*simulation_time; if ((packet_arrival_times = calloc(num_packets, sizeof(double))) == NULL) { fprintf(stderr, "Can't allocate the data buffers\n"); return 2; } for (i = 0; i < num_packets; i++) packet_arrival_times[i] = 0.0; /* If we don't initialise this random number generator it gives endless zeros on some systems. */ /* Use a fixed seed to produce identical results in successive runs of the simulation, for debug purposes. */ srand48(0x1234567); if ((s = rfc2198_sim_init(model_no, speed_pattern_no, PACKET_SIZE, packets_per_sec, 3)) == NULL) { fprintf(stderr, "Failed to start the G.1050 model\n"); exit(2); } //rfc2198_sim_dump_parms(model_no, speed_pattern_no); #if defined(ENABLE_GUI) if (use_gui) start_media_monitor(); #endif for (i = 0; i < 256; i++) put_pkt[i] = i; put_pkt_len = 256; get_pkt_len = -1; get_seq_no = -1; get_arrival_time = -1; packets_put = 0; packets_really_put = 0; packets_got = 0; oos_packets_got = 0; missing_packets_got = 0; highest_seq_no_got = -1; for (i = 0; i < num_packets; i++) { if ((len = rfc2198_sim_put(s, put_pkt, put_pkt_len, i, (double) i*0.001*PACKET_INTERVAL)) > 0) packets_really_put++; packets_put++; #if 0 if (i == 5) rfc2198_sim_queue_dump(s); #endif if (i >= 5) { do { get_pkt_len = rfc2198_sim_get(s, get_pkt, 256, (double) i*0.001*PACKET_INTERVAL, &get_seq_no, &get_departure_time, &get_arrival_time); if (get_pkt_len >= 0) { #if defined(ENABLE_GUI) if (use_gui) media_monitor_rx(get_seq_no, get_departure_time, get_arrival_time); #endif packets_got++; if (get_seq_no < highest_seq_no_got) oos_packets_got++; else if (get_seq_no > highest_seq_no_got + 1) missing_packets_got += (get_seq_no - highest_seq_no_got - 1); if (get_seq_no > highest_seq_no_got) highest_seq_no_got = get_seq_no; fprintf(out_file, "%d, %.3f, %.8f\n", get_seq_no, get_seq_no*0.001*PACKET_INTERVAL, get_arrival_time); } } while (get_pkt_len >= 0); } #if defined(ENABLE_GUI) if (use_gui) media_monitor_update_display(); #endif } /* Clear out anything remaining in the queue, by jumping forwards in time */ do { get_pkt_len = rfc2198_sim_get(s, get_pkt, 256, (double) i*0.001*PACKET_INTERVAL + 5.0, &get_seq_no, &get_departure_time, &get_arrival_time); if (get_pkt_len >= 0) { packets_got++; fprintf(out_file, "%d, %.3f, %.8f\n", get_seq_no, get_seq_no*0.001*PACKET_INTERVAL, get_arrival_time); } } while (get_pkt_len >= 0); fclose(out_file); printf("Put %d packets. Really put %d packets. Got %d packets.\n", packets_put, packets_really_put, packets_got); printf("%d OOS packets, %d missing packets\n", oos_packets_got, missing_packets_got - oos_packets_got); printf("%d packets queued, %d received\n", packets_really_put, packets_got); printf("%.3f%% of packets lost before redundancy\n", 100.0*(packets_put - packets_really_put)/packets_put); printf("%.3f%% of packets lost after redundancy\n", 100.0*(packets_put - packets_got)/packets_put); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/timezone_tests.c0000664000175000017500000000474411435757501014513 00000000000000/* * SpanDSP - a series of DSP components for telephony * * timezone_tests.c - Timezone handling for time interpretation * * Written by Steve Underwood * * Copyright (C) 2010 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page timezone_tests_page Timezone handling tests \section timezone_tests_page_sec_1 What does it do? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #ifndef FALSE #define FALSE 0 #endif #ifndef TRUE #define TRUE (!FALSE) #endif int main(int argc, char *argv[]) { struct tm tms; struct tm *tmp = &tms; time_t ltime; tz_t *tz; /* Get the current time */ ltime = time(NULL); /* Compute the local current time now for several localities, based on Posix tz strings */ tz = tz_init(NULL, "GMT0GMT0,M10.5.0,M3.5.0"); tz_localtime(tz, tmp, ltime); printf("Local time is %02d:%02d:%02d\n", tmp->tm_hour, tmp->tm_min, tmp->tm_sec); printf("Time zone is %s\n", tz_tzname(tz, tmp->tm_isdst)); tz_init(tz, "CST-8CST-8,M10.5.0,M3.5.0"); tz_localtime(tz, tmp, ltime); printf("Local time is %02d:%02d:%02d\n", tmp->tm_hour, tmp->tm_min, tmp->tm_sec); printf("Time zone is %s\n", tz_tzname(tz, tmp->tm_isdst)); tz_init(tz, "AEST-10AEDT-11,M10.5.0,M3.5.0"); tz_localtime(tz, tmp, ltime); printf("Local time is %02d:%02d:%02d\n", tmp->tm_hour, tmp->tm_min, tmp->tm_sec); printf("Time zone is %s\n", tz_tzname(tz, tmp->tm_isdst)); tz_free(tz); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/fax_tester.h0000664000175000017500000001623112101212660013561 00000000000000/* * SpanDSP - a series of DSP components for telephony * * fax_tester.h * * Written by Steve Underwood * * Copyright (C) 2008 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if !defined(_SPANDSP_FAX_TESTER_H_) #define _SPANDSP_FAX_TESTER_H_ /*! \page fax_tester_page FAX over analogue modem handling \section fax_tester_page_sec_1 What does it do? \section fax_tester_page_sec_2 How does it work? */ typedef struct faxtester_state_s faxtester_state_t; typedef void (*faxtester_flush_handler_t)(faxtester_state_t *s, void *user_data, int which); /*! FAX tester real time frame handler. \brief FAX tester real time frame handler. \param s The FAX tester context. \param user_data An opaque pointer. \param direction TRUE for incoming, FALSE for outgoing. \param msg The HDLC message. \param len The length of the message. */ typedef void (*faxtester_real_time_frame_handler_t)(faxtester_state_t *s, void *user_data, int direction, const uint8_t *msg, int len); typedef void (*faxtester_front_end_step_complete_handler_t)(faxtester_state_t *s, void *user_data); /*! FAX tester descriptor. */ struct faxtester_state_s { /*! \brief Pointer to our current step in the test. */ xmlNodePtr cur; faxtester_flush_handler_t flush_handler; void *flush_user_data; /*! \brief A pointer to a callback routine to be called when frames are exchanged. */ faxtester_real_time_frame_handler_t real_time_frame_handler; /*! \brief An opaque pointer supplied in real time frame callbacks. */ void *real_time_frame_user_data; faxtester_front_end_step_complete_handler_t front_end_step_complete_handler; void *front_end_step_complete_user_data; faxtester_front_end_step_complete_handler_t front_end_step_timeout_handler; void *front_end_step_timeout_user_data; const uint8_t *image_buffer; int image_len; int image_ptr; int image_bit_ptr; int ecm_frame_size; int corrupt_crc; int final_delayed; fax_modems_state_t modems; /*! If TRUE, transmission is in progress */ int transmit; /*! \brief TRUE is the short training sequence should be used. */ int short_train; /*! \brief The currently select receiver type */ int current_rx_type; /*! \brief The currently select transmitter type */ int current_tx_type; int wait_for_silence; int tone_state; int64_t tone_on_time; int64_t timer; int64_t timeout; /*! \brief Error and flow logging control */ logging_state_t logging; }; #if defined(__cplusplus) extern "C" { #endif /*! Apply T.30 receive processing to a block of audio samples. \brief Apply T.30 receive processing to a block of audio samples. \param s The FAX tester context. \param amp The audio sample buffer. \param len The number of samples in the buffer. \return The number of samples unprocessed. This should only be non-zero if the software has reached the end of the FAX call. */ int faxtester_rx(faxtester_state_t *s, int16_t *amp, int len); /*! Apply T.30 transmit processing to generate a block of audio samples. \brief Apply T.30 transmit processing to generate a block of audio samples. \param s The FAX tester context. \param amp The audio sample buffer. \param max_len The number of samples to be generated. \return The number of samples actually generated. This will be zero when there is nothing to send. */ int faxtester_tx(faxtester_state_t *s, int16_t *amp, int max_len); void faxtester_set_tx_type(void *user_data, int type, int bit_rate, int short_train, int use_hdlc); void faxtester_set_rx_type(void *user_data, int type, int bit_rate, int short_train, int use_hdlc); void faxtest_set_rx_silence(faxtester_state_t *s); void faxtester_send_hdlc_flags(faxtester_state_t *s, int flags); void faxtester_send_hdlc_msg(faxtester_state_t *s, const uint8_t *msg, int len, int crc_ok); void faxtester_set_flush_handler(faxtester_state_t *s, faxtester_flush_handler_t handler, void *user_data); /*! Select whether silent audio will be sent when FAX transmit is idle. \brief Select whether silent audio will be sent when FAX transmit is idle. \param s The FAX tester context. \param transmit_on_idle TRUE if silent audio should be output when the FAX transmitter is idle. FALSE to transmit zero length audio when the FAX transmitter is idle. The default behaviour is FALSE. */ void faxtester_set_transmit_on_idle(faxtester_state_t *s, int transmit_on_idle); /*! Select whether talker echo protection tone will be sent for the image modems. \brief Select whether TEP will be sent for the image modems. \param s The FAX tester context. \param use_tep TRUE if TEP should be sent. */ void faxtester_set_tep_mode(faxtester_state_t *s, int use_tep); void faxtester_set_real_time_frame_handler(faxtester_state_t *s, faxtester_real_time_frame_handler_t handler, void *user_data); void faxtester_set_front_end_step_complete_handler(faxtester_state_t *s, faxtester_front_end_step_complete_handler_t handler, void *user_data); void faxtester_set_front_end_step_timeout_handler(faxtester_state_t *s, faxtester_front_end_step_complete_handler_t handler, void *user_data); void faxtester_set_timeout(faxtester_state_t *s, int timeout); void faxtester_set_non_ecm_image_buffer(faxtester_state_t *s, const uint8_t *buf, int len); void faxtester_set_ecm_image_buffer(faxtester_state_t *s, const uint8_t *buf, int len, int block, int frame_size, int crc_hit); /*! Initialise a FAX context. \brief Initialise a FAX context. \param s The FAX tester context. \param calling_party TRUE if the context is for a calling party. FALSE if the context is for an answering party. \return A pointer to the FAX context, or NULL if there was a problem. */ faxtester_state_t *faxtester_init(faxtester_state_t *s, int calling_party); /*! Release a FAX context. \brief Release a FAX context. \param s The FAX tester context. \return 0 for OK, else -1. */ int faxtester_release(faxtester_state_t *s); /*! Free a FAX context. \brief Free a FAX context. \param s The FAX tester context. \return 0 for OK, else -1. */ int faxtester_free(faxtester_state_t *s); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/noise_tests.c0000664000175000017500000001741012101217274013755 00000000000000/* * SpanDSP - a series of DSP components for telephony * * noise_tests.c * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page noise_tests_page Noise generator tests \section noise_tests_page_sec_1 What does it do? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #if !defined(M_PI) # define M_PI 3.14159265358979323846 /* pi */ #endif #define OUT_FILE_NAME "noise.wav" /* Some simple sanity tests for the noise generation routines */ int main (int argc, char *argv[]) { int i; int j; int level; int clip_high; int clip_low; int quality; int total_samples; int seed = 1234567; int outframes; int16_t value; double total; double x; double p; double o; int bins[65536]; int16_t amp[1024]; noise_state_t noise_source; SNDFILE *outhandle; if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME); exit(2); } for (quality = 7; quality <= 20; quality += (20 - 7)) { /* Generate AWGN at several RMS levels between -50dBOv and 0dBOv. Noise is generated for a large number of samples (1,000,000), and the RMS value of the noise is calculated along the way. If the resulting level is close to the requested RMS level, at least the scaling of the noise should be Ok. At high levels some clipping may distort the result a little. */ printf("Testing AWGN power, with quality %d\n", quality); for (level = -50; level <= 0; level += 5) { clip_high = 0; clip_low = 0; total = 0.0; noise_init_dbov(&noise_source, seed, (float) level, NOISE_CLASS_AWGN, quality); total_samples = 1000000; for (i = 0; i < total_samples; i++) { value = noise(&noise_source); if (value == 32767) clip_high++; else if (value == -32768) clip_low++; total += ((double) value)*((double) value); } printf ("RMS = %.3f (expected %d) %.2f%% error [clipped samples %d+%d]\n", 10.0*log10((total/total_samples)/(32768.0*32768.0) + 1.0e-10), level, 100.0*(1.0 - sqrt(total/total_samples)/(pow(10.0, level/20.0)*32768.0)), clip_low, clip_high); if (level < -5 && fabs(10.0*log10((total/total_samples)/(32768.0*32768.0) + 1.0e-10) - level) > 0.2) { printf("Test failed\n"); exit(2); } } } /* Now look at the statistical spread of the results, by collecting data in bins from a large number of samples. Use a fairly high noise level, but low enough to avoid significant clipping. Use the Gaussian model to predict the real probability, and present the results for graphing. */ quality = 7; printf("Testing the statistical spread of AWGN, with quality %d\n", quality); memset(bins, 0, sizeof(bins)); clip_high = 0; clip_low = 0; level = -15; noise_init_dbov(&noise_source, seed, (float) level, NOISE_CLASS_AWGN, quality); total_samples = 10000000; for (i = 0; i < total_samples; i++) { value = noise(&noise_source); if (value == 32767) clip_high++; else if (value == -32768) clip_low++; bins[value + 32768]++; } /* Find the RMS power level to expect */ o = pow(10.0, level/20.0)*(32768.0*0.70711); for (i = 0; i < 65536 - 10; i++) { x = i - 32768; /* Find the real probability for this bin */ p = (1.0/(o*sqrt(2.0*M_PI)))*exp(-(x*x)/(2.0*o*o)); /* Now do a little smoothing on the real data to get a reasonably steady answer */ x = 0; for (j = 0; j < 10; j++) x += bins[i + j]; x /= 10.0; x /= total_samples; /* Now send it out for graphing. */ if (p > 0.0000001) printf("%6d %.7f %.7f\n", i - 32768, x, p); } printf("Generating AWGN at -15dBOv to file\n"); for (j = 0; j < 50; j++) { for (i = 0; i < 1024; i++) amp[i] = noise(&noise_source); outframes = sf_writef_short(outhandle, amp, 1024); if (outframes != 1024) { fprintf(stderr, " Error writing audio file\n"); exit(2); } } /* Generate Hoth noise at several RMS levels between -50dBm and 0dBm. Noise is generated for a large number of samples (1,000,000), and the RMS value of the noise is calculated along the way. If the resulting level is close to the requested RMS level, at least the scaling of the noise should be Ok. At high levels some clipping may distort the result a little. */ quality = 7; printf("Testing Hoth noise power, with quality %d\n", quality); for (level = -50; level <= 0; level += 5) { clip_high = 0; clip_low = 0; total = 0.0; noise_init_dbov(&noise_source, seed, (float) level, NOISE_CLASS_HOTH, quality); total_samples = 1000000; for (i = 0; i < total_samples; i++) { value = noise(&noise_source); if (value == 32767) clip_high++; else if (value == -32768) clip_low++; total += ((double) value)*((double) value); } printf ("RMS = %.3f (expected %d) %.2f%% error [clipped samples %d+%d]\n", 10.0*log10((total/total_samples)/(32768.0*32768.0) + 1.0e-10), level, 100.0*(1.0 - sqrt(total/total_samples)/(pow(10.0, level/20.0)*32768.0)), clip_low, clip_high); if (level < -5 && fabs(10.0*log10((total/total_samples)/(32768.0*32768.0) + 1.0e-10) - level) > 0.2) { printf("Test failed\n"); exit(2); } } quality = 7; printf("Generating Hoth noise at -15dBOv to file\n"); level = -15; noise_init_dbov(&noise_source, seed, (float) level, NOISE_CLASS_HOTH, quality); for (j = 0; j < 50; j++) { for (i = 0; i < 1024; i++) amp[i] = noise(&noise_source); outframes = sf_writef_short(outhandle, amp, 1024); if (outframes != 1024) { fprintf(stderr, " Error writing audio file\n"); exit(2); } } if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME); exit(2); } printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/swept_tone_tests.c0000664000175000017500000000533612101215411015022 00000000000000/* * SpanDSP - a series of DSP components for telephony * * swept_tone_tests.c * * Written by Steve Underwood * * Copyright (C) 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include "spandsp.h" #include "spandsp-sim.h" #define OUTPUT_FILE_NAME "swept_tone.wav" #define BLOCK_LEN 160 int main(int argc, char *argv[]) { int i; int j; int outframes; int len; SNDFILE *outhandle; power_meter_t meter; swept_tone_state_t *s; int16_t buf[BLOCK_LEN]; power_meter_init(&meter, 10); if ((outhandle = sf_open_telephony_write(OUTPUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } printf("Test with swept tone.\n"); s = swept_tone_init(NULL, 200.0f, 3900.0f, -10.0f, 60*SAMPLE_RATE, TRUE); for (j = 0; j < 60*SAMPLE_RATE; j += BLOCK_LEN) { len = swept_tone(s, buf, BLOCK_LEN); for (i = 0; i < len; i++) power_meter_update(&meter, buf[i]); outframes = sf_writef_short(outhandle, buf, len); if (outframes != len) { fprintf(stderr, " Error writing audio file\n"); exit(2); } #if 0 printf("Current freq %.1fHz, Level is %fdBOv/%fdBm0\n", swept_tone_current_frequency(s), power_meter_current_dbov(&meter), power_meter_current_dbm0(&meter)); #else printf("%.1f %f\n", swept_tone_current_frequency(s), power_meter_current_dbm0(&meter)); #endif } if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/v42_tests.c0000664000175000017500000001251312100757311013252 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v42_tests.c * * Written by Steve Underwood * * Copyright (C) 2004, 2011 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* THIS IS A WORK IN PROGRESS. IT IS NOT FINISHED. */ /*! \page v42_tests_page V.42 tests \section v42_tests_page_sec_1 What does it do? These tests connect two instances of V.42 back to back. V.42 frames are then exchanged between them. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" v42_state_t caller; v42_state_t answerer; int variable_length; int rx_next[3] = {0}; int tx_next[3] = {0}; static void v42_status(void *user_data, int status) { v42_state_t *s; s = (v42_state_t *) user_data; if (status < 0) printf("%p: Status is '%s' (%d)\n", s, signal_status_to_str(status), status); else printf("%p: Status is '%s' (%d)\n", s, lapm_status_to_str(status), status); } /*- End of function --------------------------------------------------------*/ static int v42_get_frames(void *user_data, uint8_t msg[], int len) { int i; int j; int k; int x; v42_state_t *s; if (len < 0) { v42_status(user_data, len); return 0; } s = (v42_state_t *) user_data; x = (s == &caller) ? 1 : 2; if (variable_length) { j = make_mask32(len); do k = j & rand(); while (k > len); } else { k = len; } for (i = 0; i < k; i++) msg[i] = tx_next[x]++; return k; } /*- End of function --------------------------------------------------------*/ static void v42_put_frames(void *user_data, const uint8_t msg[], int len) { int i; v42_state_t *s; int x; static int count = 0; static int xxx = 0; if (len < 0) { v42_status(user_data, len); return; } s = (v42_state_t *) user_data; x = (s == &caller) ? 1 : 2; for (i = 0; i < len; i++) { if (msg[i] != (rx_next[x] & 0xFF)) { printf("%p: Mismatch 0x%02X 0x%02X\n", user_data, msg[i], rx_next[x] & 0xFF); exit(2); } rx_next[x]++; } printf("%p: Got frame len %d\n", user_data, len); printf("%p: %d Far end busy status %d\n", user_data, count, v42_get_far_busy_status(s)); if (s == &caller) { if (++count == 5) { v42_set_local_busy_status(s, TRUE); xxx = 1; } } else { if (xxx && ++count == 45) v42_set_local_busy_status(&caller, FALSE); } } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int i; int bit; int insert_caller_bit_errors; int insert_answerer_bit_errors; int opt; insert_caller_bit_errors = FALSE; insert_answerer_bit_errors = FALSE; variable_length = FALSE; while ((opt = getopt(argc, argv, "bv")) != -1) { switch (opt) { case 'b': insert_caller_bit_errors = 11000; insert_answerer_bit_errors = 10000; break; case 'v': variable_length = TRUE; break; default: //usage(); exit(2); break; } } v42_init(&caller, TRUE, TRUE, v42_get_frames, v42_put_frames, (void *) &caller); v42_init(&answerer, FALSE, TRUE, v42_get_frames, v42_put_frames, (void *) &answerer); v42_set_status_callback(&caller, v42_status, (void *) &caller); v42_set_status_callback(&answerer, v42_status, (void *) &answerer); v42_restart(&caller); v42_restart(&answerer); span_log_set_level(&caller.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_DEBUG); span_log_set_tag(&caller.logging, "caller"); span_log_set_level(&answerer.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_DEBUG); span_log_set_tag(&answerer.logging, "answerer"); for (i = 0; i < 1000000; i++) { bit = v42_tx_bit(&caller); if (insert_caller_bit_errors && i%insert_caller_bit_errors == 0) bit ^= 1; v42_rx_bit(&answerer, bit); bit = v42_tx_bit(&answerer); if (insert_answerer_bit_errors && i%insert_answerer_bit_errors == 0) bit ^= 1; v42_rx_bit(&caller, bit); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/Makefile.am0000664000175000017500000003452512343625043013321 00000000000000## ## SpanDSP - a series of DSP components for telephony ## ## Makefile.am - Process this file with automake to produce Makefile.in ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License version 2, as ## published by the Free Software Foundation. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. AM_CFLAGS = $(COMP_VENDOR_CFLAGS) AM_LDFLAGS = $(COMP_VENDOR_LDFLAGS) LIBS += $(TESTLIBS) noinst_DATA = sound_c1_8k.wav sound_c3_8k.wav EXTRA_DIST = fax_tests.sh \ regression_tests.sh \ tsb85_extra_tests.sh \ tsb85_tests.sh \ v42bis_tests.sh \ msvc/adsi_tests.vcproj \ msvc/complex_tests.vcproj \ msvc/complex_vector_float_tests.vcproj \ msvc/complex_vector_int_tests.vcproj \ msvc/dtmf_rx_tests.vcproj \ msvc/dtmf_tx_tests.vcproj \ msvc/queue_tests.vcproj \ msvc/t38_core_tests.vcproj \ msvc/t38_non_ecm_buffer_tests.vcproj \ msvc/t38_terminal_tests.vcproj \ msvc/v22bis_tests.vcproj \ msvc/v29_tests.vcproj \ msvc/v8_tests.vcproj \ msvc/v80_tests.vcproj \ msvc/vector_float_tests.vcproj \ msvc/vector_int_tests.vcproj MAINTAINERCLEANFILES = Makefile.in AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_builddir)/spandsp-sim -DDATADIR="\"$(pkgdatadir)\"" LIBDIR = -L$(top_builddir)/src noinst_PROGRAMS = ademco_contactid_tests \ adsi_tests \ async_tests \ at_interpreter_tests \ awgn_tests \ bell_mf_rx_tests \ bell_mf_tx_tests \ bert_tests \ bit_operations_tests \ bitstream_tests \ complex_tests \ complex_vector_float_tests \ complex_vector_int_tests \ crc_tests \ dc_restore_tests \ dds_tests \ dtmf_rx_tests \ dtmf_tx_tests \ echo_tests \ fax_decode \ fax_tests \ fsk_tests \ g1050_tests \ g168_tests \ g711_tests \ g722_tests \ g726_tests \ gsm0610_tests \ hdlc_tests \ ima_adpcm_tests \ image_translate_tests \ line_model_tests \ logging_tests \ lpc10_tests \ make_g168_css \ math_fixed_tests \ modem_connect_tones_tests \ modem_echo_tests \ noise_tests \ oki_adpcm_tests \ playout_tests \ plc_tests \ power_meter_tests \ queue_tests \ r2_mf_rx_tests \ r2_mf_tx_tests \ rfc2198_sim_tests \ saturated_tests \ schedule_tests \ sig_tone_tests \ super_tone_rx_tests \ super_tone_tx_tests \ swept_tone_tests \ t31_tests \ t35_tests \ t38_core_tests \ t38_decode \ t38_gateway_tests \ t38_gateway_to_terminal_tests \ t38_non_ecm_buffer_tests \ t38_terminal_tests \ t38_terminal_to_gateway_tests \ t4_tests \ time_scale_tests \ timezone_tests \ tone_detect_tests \ tone_generate_tests \ tsb85_tests \ v17_tests \ v18_tests \ v22bis_tests \ v27ter_tests \ v29_tests \ v42_tests \ v42bis_tests \ v8_tests \ vector_float_tests \ vector_int_tests \ tsb85_tests noinst_HEADERS = echo_monitor.h \ fax_tester.h \ fax_utils.h \ line_model_monitor.h \ media_monitor.h \ modem_monitor.h \ pcap_parse.h \ udptl.h ademco_contactid_tests_SOURCES = ademco_contactid_tests.c ademco_contactid_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp adsi_tests_SOURCES = adsi_tests.c adsi_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp async_tests_SOURCES = async_tests.c async_tests_LDADD = $(LIBDIR) -lspandsp at_interpreter_tests_SOURCES = at_interpreter_tests.c at_interpreter_tests_LDADD = $(LIBDIR) -lspandsp awgn_tests_SOURCES = awgn_tests.c awgn_tests_LDADD = $(LIBDIR) -lspandsp bell_mf_rx_tests_SOURCES = bell_mf_rx_tests.c bell_mf_rx_tests_LDADD = $(LIBDIR) -lspandsp bell_mf_tx_tests_SOURCES = bell_mf_tx_tests.c bell_mf_tx_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp bert_tests_SOURCES = bert_tests.c bert_tests_LDADD = $(LIBDIR) -lspandsp bit_operations_tests_SOURCES = bit_operations_tests.c bit_operations_tests_LDADD = $(LIBDIR) -lspandsp bitstream_tests_SOURCES = bitstream_tests.c bitstream_tests_LDADD = $(LIBDIR) -lspandsp complex_tests_SOURCES = complex_tests.c complex_tests_LDADD = $(LIBDIR) -lspandsp complex_vector_float_tests_SOURCES = complex_vector_float_tests.c complex_vector_float_tests_LDADD = $(LIBDIR) -lspandsp complex_vector_int_tests_SOURCES = complex_vector_int_tests.c complex_vector_int_tests_LDADD = $(LIBDIR) -lspandsp crc_tests_SOURCES = crc_tests.c crc_tests_LDADD = $(LIBDIR) -lspandsp dc_restore_tests_SOURCES = dc_restore_tests.c dc_restore_tests_LDADD = $(LIBDIR) -lspandsp dds_tests_SOURCES = dds_tests.c dds_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp dtmf_rx_tests_SOURCES = dtmf_rx_tests.c dtmf_rx_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp dtmf_tx_tests_SOURCES = dtmf_tx_tests.c dtmf_tx_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp echo_tests_SOURCES = echo_tests.c echo_monitor.cpp echo_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp fax_decode_SOURCES = fax_decode.c fax_decode_LDADD = $(LIBDIR) -lspandsp fax_tests_SOURCES = fax_tests.c fax_utils.c media_monitor.cpp fax_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp fsk_tests_SOURCES = fsk_tests.c fsk_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp g1050_tests_SOURCES = g1050_tests.c media_monitor.cpp g1050_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp g168_tests_SOURCES = g168_tests.c g168_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp g711_tests_SOURCES = g711_tests.c g711_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp g722_tests_SOURCES = g722_tests.c g722_tests_LDADD = $(LIBDIR) -lspandsp g726_tests_SOURCES = g726_tests.c g726_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp gsm0610_tests_SOURCES = gsm0610_tests.c gsm0610_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp hdlc_tests_SOURCES = hdlc_tests.c hdlc_tests_LDADD = $(LIBDIR) -lspandsp ima_adpcm_tests_SOURCES = ima_adpcm_tests.c ima_adpcm_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp image_translate_tests_SOURCES = image_translate_tests.c image_translate_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp line_model_tests_SOURCES = line_model_tests.c line_model_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp logging_tests_SOURCES = logging_tests.c logging_tests_LDADD = $(LIBDIR) -lspandsp lpc10_tests_SOURCES = lpc10_tests.c lpc10_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp make_g168_css_SOURCES = make_g168_css.c make_g168_css_LDADD = $(LIBDIR) -lspandsp math_fixed_tests_SOURCES = math_fixed_tests.c math_fixed_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp modem_echo_tests_SOURCES = modem_echo_tests.c echo_monitor.cpp modem_echo_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp modem_connect_tones_tests_SOURCES = modem_connect_tones_tests.c modem_connect_tones_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp noise_tests_SOURCES = noise_tests.c noise_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp oki_adpcm_tests_SOURCES = oki_adpcm_tests.c oki_adpcm_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp playout_tests_SOURCES = playout_tests.c media_monitor.cpp playout_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp plc_tests_SOURCES = plc_tests.c plc_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp power_meter_tests_SOURCES = power_meter_tests.c power_meter_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp queue_tests_SOURCES = queue_tests.c queue_tests_LDADD = $(LIBDIR) -lspandsp r2_mf_rx_tests_SOURCES = r2_mf_rx_tests.c r2_mf_rx_tests_LDADD = $(LIBDIR) -lspandsp r2_mf_tx_tests_SOURCES = r2_mf_tx_tests.c r2_mf_tx_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp rfc2198_sim_tests_SOURCES = rfc2198_sim_tests.c media_monitor.cpp rfc2198_sim_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp saturated_tests_SOURCES = saturated_tests.c saturated_tests_LDADD = $(LIBDIR) -lspandsp schedule_tests_SOURCES = schedule_tests.c schedule_tests_LDADD = $(LIBDIR) -lspandsp sig_tone_tests_SOURCES = sig_tone_tests.c sig_tone_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp super_tone_rx_tests_SOURCES = super_tone_rx_tests.c super_tone_rx_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp super_tone_tx_tests_SOURCES = super_tone_tx_tests.c super_tone_tx_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp swept_tone_tests_SOURCES = swept_tone_tests.c swept_tone_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp t31_tests_SOURCES = t31_tests.c fax_utils.c media_monitor.cpp t31_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp t35_tests_SOURCES = t35_tests.c t35_tests_LDADD = $(LIBDIR) -lspandsp t38_core_tests_SOURCES = t38_core_tests.c t38_core_tests_LDADD = $(LIBDIR) -lspandsp t38_decode_SOURCES = t38_decode.c fax_utils.c pcap_parse.c udptl.c t38_decode_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp -lpcap t38_gateway_tests_SOURCES = t38_gateway_tests.c fax_utils.c media_monitor.cpp t38_gateway_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp t38_gateway_to_terminal_tests_SOURCES = t38_gateway_to_terminal_tests.c fax_utils.c media_monitor.cpp t38_gateway_to_terminal_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp t38_non_ecm_buffer_tests_SOURCES = t38_non_ecm_buffer_tests.c t38_non_ecm_buffer_tests_LDADD = $(LIBDIR) -lspandsp t38_terminal_tests_SOURCES = t38_terminal_tests.c fax_utils.c media_monitor.cpp t38_terminal_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp t38_terminal_to_gateway_tests_SOURCES = t38_terminal_to_gateway_tests.c fax_utils.c media_monitor.cpp t38_terminal_to_gateway_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp t4_tests_SOURCES = t4_tests.c t4_tests_LDADD = $(LIBDIR) -lspandsp time_scale_tests_SOURCES = time_scale_tests.c time_scale_tests_LDADD = $(LIBDIR) -lspandsp timezone_tests_SOURCES = timezone_tests.c timezone_tests_LDADD = $(LIBDIR) -lspandsp tone_detect_tests_SOURCES = tone_detect_tests.c tone_detect_tests_LDADD = $(LIBDIR) -lspandsp tone_generate_tests_SOURCES = tone_generate_tests.c tone_generate_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp tsb85_tests_SOURCES = tsb85_tests.c fax_utils.c fax_tester.c tsb85_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp v17_tests_SOURCES = v17_tests.c line_model_monitor.cpp modem_monitor.cpp v17_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp v18_tests_SOURCES = v18_tests.c v18_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp v22bis_tests_SOURCES = v22bis_tests.c line_model_monitor.cpp modem_monitor.cpp v22bis_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp v27ter_tests_SOURCES = v27ter_tests.c line_model_monitor.cpp modem_monitor.cpp v27ter_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp v29_tests_SOURCES = v29_tests.c line_model_monitor.cpp modem_monitor.cpp v29_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp v42_tests_SOURCES = v42_tests.c v42_tests_LDADD = $(LIBDIR) -lspandsp v42bis_tests_SOURCES = v42bis_tests.c v42bis_tests_LDADD = $(LIBDIR) -lspandsp v8_tests_SOURCES = v8_tests.c v8_tests_LDADD = -L$(top_builddir)/spandsp-sim -lspandsp-sim $(LIBDIR) -lspandsp vector_float_tests_SOURCES = vector_float_tests.c vector_float_tests_LDADD = $(LIBDIR) -lspandsp vector_int_tests_SOURCES = vector_int_tests.c vector_int_tests_LDADD = $(LIBDIR) -lspandsp # We need to create the CSS files for echo cancellation tests. sound_c1_8k.wav sound_c3_8k.wav: make_g168_css$(EXEEXT) ./make_g168_css$(EXEEXT) sox sound_c1.wav -r8000 sound_c1_8k.wav sox sound_c3.wav -r8000 sound_c3_8k.wav rm sound_c1.wav sound_c3.wav spandsp-0.0.6/tests/t38_gateway_to_terminal_tests.c0000664000175000017500000005662212101215105017373 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t38_gateway_to_terminal_tests.c - Joint tests for the T.38 FoIP terminal and gateway modules. * * Written by Steve Underwood * * Copyright (C) 2005, 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page t38_gateway_to_terminal_tests_page T.38 mixed gateway and termination tests \section t38_gateway_to_terminal_tests_page_sec_1 What does it do? These tests exercise the path FAX machine -> T.38 gateway -> T.38 termination */ /* Enable the following definition to enable direct probing into the FAX structures */ //#define WITH_SPANDSP_INTERNALS #if defined(HAVE_CONFIG_H) #include #endif #if defined(HAVE_FL_FL_H) && defined(HAVE_FL_FL_CARTESIAN_H) && defined(HAVE_FL_FL_AUDIO_METER_H) #define ENABLE_GUI #endif #include #include #include #include #include #include #include #if !defined(_WIN32) #include #endif //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #if defined(ENABLE_GUI) #include "media_monitor.h" #endif #include "fax_utils.h" #define SAMPLES_PER_CHUNK 160 #define INPUT_FILE_NAME "../test-data/itu/fax/itutests.tif" #define OUTPUT_FILE_NAME "t38.tif" #define OUTPUT_FILE_NAME_WAVE "t38_gateway_to_terminal.wav" fax_state_t *fax_state_a; t38_gateway_state_t *t38_state_a; t38_terminal_state_t *t38_state_b; g1050_state_t *path_a_to_b; g1050_state_t *path_b_to_a; double when = 0.0; int done[2] = {FALSE, FALSE}; int succeeded[2] = {FALSE, FALSE}; int simulate_incrementing_repeats = FALSE; int t38_version; int use_ecm; int use_tep; int use_transmit_on_idle; int supported_modems; int use_gui; int g1050_model_no; int g1050_speed_pattern_no; static int phase_b_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; i = (int) (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase B", i); printf("%c: Phase B handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result)); fax_log_rx_parameters(s, tag); return T30_ERR_OK; } /*- End of function --------------------------------------------------------*/ static int phase_d_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; i = (int) (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase D", i); printf("%c: Phase D handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result)); fax_log_page_transfer_statistics(s, tag); fax_log_tx_parameters(s, tag); fax_log_rx_parameters(s, tag); return T30_ERR_OK; } /*- End of function --------------------------------------------------------*/ static void phase_e_handler(t30_state_t *s, void *user_data, int result) { int i; t30_stats_t t; char tag[20]; i = (int) (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase E", i); printf("%c: Phase E handler on channel %c - (%d) %s\n", i, i, result, t30_completion_code_to_str(result)); fax_log_final_transfer_statistics(s, tag); fax_log_tx_parameters(s, tag); fax_log_rx_parameters(s, tag); t30_get_transfer_statistics(s, &t); succeeded[i - 'A'] = (result == T30_ERR_OK) && (t.pages_tx == 12 || t.pages_rx == 12); done[i - 'A'] = TRUE; } /*- End of function --------------------------------------------------------*/ static int tx_packet_handler_a(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count) { int i; static int subst_seq = 0; /* This routine queues messages between two instances of T.38 processing */ if (simulate_incrementing_repeats) { for (i = 0; i < count; i++) { span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d\n", subst_seq, len); g1050_put(path_a_to_b, buf, len, subst_seq, when); subst_seq = (subst_seq + 1) & 0xFFFF; } } else { span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d, count %d\n", s->tx_seq_no, len, count); for (i = 0; i < count; i++) g1050_put(path_a_to_b, buf, len, s->tx_seq_no, when); } return 0; } /*- End of function --------------------------------------------------------*/ static int tx_packet_handler_b(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count) { int i; static int subst_seq = 0; /* This routine queues messages between two instances of T.38 processing */ if (simulate_incrementing_repeats) { for (i = 0; i < count; i++) { span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d\n", subst_seq, len); g1050_put(path_b_to_a, buf, len, subst_seq, when); subst_seq = (subst_seq + 1) & 0xFFFF; } } else { span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d, count %d\n", s->tx_seq_no, len, count); for (i = 0; i < count; i++) g1050_put(path_b_to_a, buf, len, s->tx_seq_no, when); } return 0; } /*- End of function --------------------------------------------------------*/ static int decode_test(const char *decode_test_file) { int16_t t38_amp_a[SAMPLES_PER_CHUNK]; int16_t t30_amp_a[SAMPLES_PER_CHUNK]; SNDFILE *wave_handle; t30_state_t *t30; t38_core_state_t *t38_core; logging_state_t *logging; int t38_len_a; int t30_len_a; int msg_len; uint8_t msg[1024]; int seq_no; double tx_when; double rx_when; printf("Decode test data file '%s'\n", decode_test_file); if ((wave_handle = sf_open_telephony_read(decode_test_file, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", decode_test_file); exit(2); } srand48(0x1234567); if ((path_a_to_b = g1050_init(g1050_model_no, g1050_speed_pattern_no, 100, 33)) == NULL) { fprintf(stderr, "Failed to start IP network path model\n"); exit(2); } if ((path_b_to_a = g1050_init(g1050_model_no, g1050_speed_pattern_no, 100, 33)) == NULL) { fprintf(stderr, "Failed to start IP network path model\n"); exit(2); } memset(t30_amp_a, 0, sizeof(t30_amp_a)); if ((t38_state_a = t38_gateway_init(NULL, tx_packet_handler_a, t38_state_b)) == NULL) { fprintf(stderr, "Cannot start the T.38 channel\n"); exit(2); } t38_core = t38_gateway_get_t38_core_state(t38_state_a); t38_gateway_set_transmit_on_idle(t38_state_a, use_transmit_on_idle); t38_set_t38_version(t38_core, t38_version); t38_gateway_set_ecm_capability(t38_state_a, use_ecm); logging = t38_gateway_get_logging_state(t38_state_a); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-A"); logging = t38_core_get_logging_state(t38_core); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-A"); logging = &t38_state_a->audio.modems.fast_modems.v17_rx.logging; span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "V.17-A"); memset(t38_amp_a, 0, sizeof(t38_amp_a)); if ((t38_state_b = t38_terminal_init(NULL, FALSE, tx_packet_handler_b, t38_state_a)) == NULL) { fprintf(stderr, "Cannot start the T.38 channel\n"); exit(2); } t30 = t38_terminal_get_t30_state(t38_state_b); t38_core = t38_terminal_get_t38_core_state(t38_state_b); t38_set_t38_version(t38_core, t38_version); logging = t38_terminal_get_logging_state(t38_state_b); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-B"); logging = t38_core_get_logging_state(t38_core); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-B"); logging = t30_get_logging_state(t30); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-B"); t30_set_supported_modems(t30, supported_modems); t30_set_tx_ident(t30, "22222222"); t30_set_rx_file(t30, OUTPUT_FILE_NAME, -1); t30_set_phase_b_handler(t30, phase_b_handler, (void *) (intptr_t) 'B'); t30_set_phase_d_handler(t30, phase_d_handler, (void *) (intptr_t) 'B'); t30_set_phase_e_handler(t30, phase_e_handler, (void *) (intptr_t) 'B'); t30_set_ecm_capability(t30, use_ecm); if (use_ecm) t30_set_supported_compressions(t30, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION); #if defined(ENABLE_GUI) if (use_gui) start_media_monitor(); #endif for (;;) { t30_len_a = sf_readf_short(wave_handle, t30_amp_a, SAMPLES_PER_CHUNK); logging = t38_gateway_get_logging_state(t38_state_a); span_log_bump_samples(logging, t30_len_a); t38_core = t38_gateway_get_t38_core_state(t38_state_a); logging = t38_core_get_logging_state(t38_core); span_log_bump_samples(logging, t30_len_a); logging = &t38_state_a->audio.modems.fast_modems.v17_rx.logging; span_log_bump_samples(logging, t30_len_a); logging = t38_terminal_get_logging_state(t38_state_b); span_log_bump_samples(logging, t30_len_a); t38_core = t38_terminal_get_t38_core_state(t38_state_b); logging = t38_core_get_logging_state(t38_core); span_log_bump_samples(logging, t30_len_a); t30 = t38_terminal_get_t30_state(t38_state_b); logging = t30_get_logging_state(t30); span_log_bump_samples(logging, t30_len_a); t38_terminal_send_timeout(t38_state_b, t30_len_a); if (t38_gateway_rx(t38_state_a, t30_amp_a, t30_len_a)) break; t38_len_a = t38_gateway_tx(t38_state_a, t38_amp_a, t30_len_a); if (!use_transmit_on_idle) { if (t38_len_a < SAMPLES_PER_CHUNK) { memset(t38_amp_a + t38_len_a, 0, sizeof(int16_t)*(t30_len_a - t38_len_a)); t38_len_a = t30_len_a; } } when += (float) t30_len_a/(float) SAMPLE_RATE; while ((msg_len = g1050_get(path_a_to_b, msg, 1024, when, &seq_no, &tx_when, &rx_when)) >= 0) { #if defined(ENABLE_GUI) if (use_gui) media_monitor_rx(seq_no, tx_when, rx_when); #endif t38_core = t38_terminal_get_t38_core_state(t38_state_b); t38_core_rx_ifp_packet(t38_core, msg, msg_len, seq_no); } while ((msg_len = g1050_get(path_b_to_a, msg, 1024, when, &seq_no, &tx_when, &rx_when)) >= 0) { #if defined(ENABLE_GUI) if (use_gui) media_monitor_rx(seq_no, tx_when, rx_when); #endif t38_core = t38_gateway_get_t38_core_state(t38_state_a); t38_core_rx_ifp_packet(t38_core, msg, msg_len, seq_no); } if (done[0] && done[1]) break; #if defined(ENABLE_GUI) if (use_gui) media_monitor_update_display(); #endif } t38_gateway_release(t38_state_a); t38_terminal_release(t38_state_b); if (sf_close(wave_handle) != 0) { fprintf(stderr, " Cannot close audio file '%s'\n", decode_test_file); exit(2); } return 0; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int16_t t38_amp_a[SAMPLES_PER_CHUNK]; int16_t t30_amp_a[SAMPLES_PER_CHUNK]; int16_t out_amp[2*SAMPLES_PER_CHUNK]; int t38_len_a; int t30_len_a; int msg_len; uint8_t msg[1024]; int log_audio; int outframes; int feedback_audio; SNDFILE *wave_handle; const char *input_file_name; int i; int seq_no; double tx_when; double rx_when; int opt; t30_state_t *t30; t38_core_state_t *t38_core; logging_state_t *logging; char *decode_test_file; log_audio = FALSE; t38_version = 1; use_ecm = FALSE; input_file_name = INPUT_FILE_NAME; simulate_incrementing_repeats = FALSE; g1050_model_no = 0; g1050_speed_pattern_no = 1; use_gui = FALSE; use_tep = FALSE; feedback_audio = FALSE; use_transmit_on_idle = TRUE; supported_modems = T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17; decode_test_file = NULL; while ((opt = getopt(argc, argv, "d:efgi:Ilm:M:s:tv:")) != -1) { switch (opt) { case 'd': decode_test_file = optarg; break; case 'e': use_ecm = TRUE; break; case 'f': feedback_audio = TRUE; break; case 'g': #if defined(ENABLE_GUI) use_gui = TRUE; #else fprintf(stderr, "Graphical monitoring not available\n"); exit(2); #endif break; case 'i': input_file_name = optarg; break; case 'I': simulate_incrementing_repeats = TRUE; break; case 'l': log_audio = TRUE; break; case 'm': supported_modems = atoi(optarg); break; case 'M': g1050_model_no = optarg[0] - 'A' + 1; break; case 's': g1050_speed_pattern_no = atoi(optarg); break; case 't': use_tep = TRUE; break; case 'v': t38_version = atoi(optarg); break; default: //usage(); exit(2); break; } } printf("Using T.38 version %d\n", t38_version); if (use_ecm) printf("Using ECM\n"); if (decode_test_file) { decode_test(decode_test_file); return 0; } wave_handle = NULL; if (log_audio) { if ((wave_handle = sf_open_telephony_write(OUTPUT_FILE_NAME_WAVE, 2)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUTPUT_FILE_NAME_WAVE); exit(2); } } srand48(0x1234567); if ((path_a_to_b = g1050_init(g1050_model_no, g1050_speed_pattern_no, 100, 33)) == NULL) { fprintf(stderr, "Failed to start IP network path model\n"); exit(2); } if ((path_b_to_a = g1050_init(g1050_model_no, g1050_speed_pattern_no, 100, 33)) == NULL) { fprintf(stderr, "Failed to start IP network path model\n"); exit(2); } if ((fax_state_a = fax_init(NULL, TRUE)) == NULL) { fprintf(stderr, "Cannot start FAX\n"); exit(2); } t30 = fax_get_t30_state(fax_state_a); fax_set_transmit_on_idle(fax_state_a, use_transmit_on_idle); fax_set_tep_mode(fax_state_a, use_tep); t30_set_supported_modems(t30, supported_modems); t30_set_tx_ident(t30, "11111111"); t30_set_tx_nsf(t30, (const uint8_t *) "\x50\x00\x00\x00Spandsp\x00", 12); t30_set_tx_file(t30, input_file_name, -1, -1); t30_set_phase_b_handler(t30, phase_b_handler, (void *) (intptr_t) 'A'); t30_set_phase_d_handler(t30, phase_d_handler, (void *) (intptr_t) 'A'); t30_set_phase_e_handler(t30, phase_e_handler, (void *) (intptr_t) 'A'); t30_set_ecm_capability(t30, use_ecm); if (use_ecm) t30_set_supported_compressions(t30, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION); logging = fax_get_logging_state(fax_state_a); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "FAX-A "); logging = t30_get_logging_state(t30); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "FAX-A "); memset(t30_amp_a, 0, sizeof(t30_amp_a)); if ((t38_state_a = t38_gateway_init(NULL, tx_packet_handler_a, t38_state_b)) == NULL) { fprintf(stderr, "Cannot start the T.38 channel\n"); exit(2); } t38_core = t38_gateway_get_t38_core_state(t38_state_a); t38_gateway_set_transmit_on_idle(t38_state_a, use_transmit_on_idle); t38_set_t38_version(t38_core, t38_version); t38_gateway_set_ecm_capability(t38_state_a, use_ecm); logging = t38_gateway_get_logging_state(t38_state_a); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-A"); logging = t38_core_get_logging_state(t38_core); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-A"); logging = &t38_state_a->audio.modems.fast_modems.v17_rx.logging; span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "V.17-A"); memset(t38_amp_a, 0, sizeof(t38_amp_a)); if ((t38_state_b = t38_terminal_init(NULL, FALSE, tx_packet_handler_b, t38_state_a)) == NULL) { fprintf(stderr, "Cannot start the T.38 channel\n"); exit(2); } t30 = t38_terminal_get_t30_state(t38_state_b); t38_core = t38_terminal_get_t38_core_state(t38_state_b); t38_set_t38_version(t38_core, t38_version); logging = t38_terminal_get_logging_state(t38_state_b); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-B"); logging = t38_core_get_logging_state(t38_core); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-B"); logging = t30_get_logging_state(t30); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-B"); t30_set_supported_modems(t30, supported_modems); t30_set_tx_ident(t30, "22222222"); t30_set_rx_file(t30, OUTPUT_FILE_NAME, -1); t30_set_phase_b_handler(t30, phase_b_handler, (void *) (intptr_t) 'B'); t30_set_phase_d_handler(t30, phase_d_handler, (void *) (intptr_t) 'B'); t30_set_phase_e_handler(t30, phase_e_handler, (void *) (intptr_t) 'B'); t30_set_ecm_capability(t30, use_ecm); if (use_ecm) t30_set_supported_compressions(t30, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION); #if defined(ENABLE_GUI) if (use_gui) start_media_monitor(); #endif for (;;) { logging = fax_get_logging_state(fax_state_a); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); t30 = fax_get_t30_state(fax_state_a); logging = t30_get_logging_state(t30); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); logging = t38_gateway_get_logging_state(t38_state_a); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); t38_core = t38_gateway_get_t38_core_state(t38_state_a); logging = t38_core_get_logging_state(t38_core); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); logging = &t38_state_a->audio.modems.fast_modems.v17_rx.logging; span_log_bump_samples(logging, SAMPLES_PER_CHUNK); logging = t38_terminal_get_logging_state(t38_state_b); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); t38_core = t38_terminal_get_t38_core_state(t38_state_b); logging = t38_core_get_logging_state(t38_core); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); t30 = t38_terminal_get_t30_state(t38_state_b); logging = t30_get_logging_state(t30); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); memset(out_amp, 0, sizeof(out_amp)); t38_terminal_send_timeout(t38_state_b, SAMPLES_PER_CHUNK); t30_len_a = fax_tx(fax_state_a, t30_amp_a, SAMPLES_PER_CHUNK); if (!use_transmit_on_idle) { /* The receive side always expects a full block of samples, but the transmit side may not be sending any when it doesn't need to. We may need to pad with some silence. */ if (t30_len_a < SAMPLES_PER_CHUNK) { memset(t30_amp_a + t30_len_a, 0, sizeof(int16_t)*(SAMPLES_PER_CHUNK - t30_len_a)); t30_len_a = SAMPLES_PER_CHUNK; } } if (log_audio) { for (i = 0; i < t30_len_a; i++) out_amp[2*i] = t30_amp_a[i]; } if (feedback_audio) { for (i = 0; i < t30_len_a; i++) t30_amp_a[i] += t38_amp_a[i] >> 1; } if (t38_gateway_rx(t38_state_a, t30_amp_a, t30_len_a)) break; t38_len_a = t38_gateway_tx(t38_state_a, t38_amp_a, SAMPLES_PER_CHUNK); if (!use_transmit_on_idle) { if (t38_len_a < SAMPLES_PER_CHUNK) { memset(t38_amp_a + t38_len_a, 0, sizeof(int16_t)*(SAMPLES_PER_CHUNK - t38_len_a)); t38_len_a = SAMPLES_PER_CHUNK; } } if (log_audio) { for (i = 0; i < t38_len_a; i++) out_amp[2*i + 1] = t38_amp_a[i]; } if (fax_rx(fax_state_a, t38_amp_a, SAMPLES_PER_CHUNK)) break; when += (float) SAMPLES_PER_CHUNK/(float) SAMPLE_RATE; while ((msg_len = g1050_get(path_a_to_b, msg, 1024, when, &seq_no, &tx_when, &rx_when)) >= 0) { #if defined(ENABLE_GUI) if (use_gui) media_monitor_rx(seq_no, tx_when, rx_when); #endif t38_core = t38_terminal_get_t38_core_state(t38_state_b); t38_core_rx_ifp_packet(t38_core, msg, msg_len, seq_no); } while ((msg_len = g1050_get(path_b_to_a, msg, 1024, when, &seq_no, &tx_when, &rx_when)) >= 0) { #if defined(ENABLE_GUI) if (use_gui) media_monitor_rx(seq_no, tx_when, rx_when); #endif t38_core = t38_gateway_get_t38_core_state(t38_state_a); t38_core_rx_ifp_packet(t38_core, msg, msg_len, seq_no); } if (log_audio) { outframes = sf_writef_short(wave_handle, out_amp, SAMPLES_PER_CHUNK); if (outframes != SAMPLES_PER_CHUNK) break; } if (done[0] && done[1]) break; #if defined(ENABLE_GUI) if (use_gui) media_monitor_update_display(); #endif } fax_release(fax_state_a); t38_gateway_release(t38_state_a); t38_terminal_release(t38_state_b); if (log_audio) { if (sf_close(wave_handle) != 0) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME_WAVE); exit(2); } } if (!succeeded[0] || !succeeded[1]) { printf("Tests failed\n"); exit(2); } printf("Tests passed\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/bell_mf_rx_tests.c0000664000175000017500000004340712101212401014741 00000000000000/* * SpanDSP - a series of DSP components for telephony * * bell_mf_tests.c - Test the Bell MF detector against the spec., whatever the * spec. may be :) * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page bell_mf_tests_page Bell MF tone generation and detection tests \section bell_mf_tests_page_sec_1 What does it do? These tests are fashioned after those on the CM7291 test tape from Mitel. Those tests are for DTMF, rather than Bell MF, but make a fair starting point for a set of meaningful tests of Bell MF. These tests include conversion to and from A-law. It is assumed the distortion this produces is comparable to u-law, so it should be a fair test of performance in a real PSTN channel. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" /* Basic Bell MF specs: * * Signal generation: * Tone on time = KP: 100+-7ms. All other signals: 68+-7ms * Tone off time (between digits) = 68+-7ms * Frequency tolerance +- 1.5% * Signal level -7+-1dBm per frequency * * Signal reception: * Frequency tolerance +- 1.5% +-10Hz * Signal level -14dBm to 0dBm * Perform a "two and only two tones present" test. * Twist <= 6dB accepted * Receiver sensitive to signals above -22dBm per frequency * Test for a minimum of 55ms if KP, or 30ms of other signals. * Signals to be recognised if the two tones arrive within 8ms of each other. * Invalid signals result in the return of the re-order tone. */ #define MF_DURATION (68*8) #define MF_PAUSE (68*8) #define MF_CYCLE (MF_DURATION + MF_PAUSE) /*! MF tone descriptor for tests. */ typedef struct { float f1; /* First freq */ float f2; /* Second freq */ int8_t level1; /* Level of the first freq (dB) */ int8_t level2; /* Level of the second freq (dB) */ uint8_t on_time; /* Tone on time (ms) */ uint8_t off_time; /* Minimum post tone silence (ms) */ } mf_digit_tones_t; static const mf_digit_tones_t bell_mf_tones[] = { { 700.0, 900.0, -7, -7, 68, 68}, { 700.0, 1100.0, -7, -7, 68, 68}, { 900.0, 1100.0, -7, -7, 68, 68}, { 700.0, 1300.0, -7, -7, 68, 68}, { 900.0, 1300.0, -7, -7, 68, 68}, {1100.0, 1300.0, -7, -7, 68, 68}, { 700.0, 1500.0, -7, -7, 68, 68}, { 900.0, 1500.0, -7, -7, 68, 68}, {1100.0, 1500.0, -7, -7, 68, 68}, {1300.0, 1500.0, -7, -7, 68, 68}, { 700.0, 1700.0, -7, -7, 68, 68}, /* ST''' - use 'C' */ { 900.0, 1700.0, -7, -7, 68, 68}, /* ST' - use 'A' */ {1100.0, 1700.0, -7, -7, 100, 68}, /* KP - use '*' */ {1300.0, 1700.0, -7, -7, 68, 68}, /* ST'' - use 'B' */ {1500.0, 1700.0, -7, -7, 68, 68}, /* ST - use '#' */ {0.0, 0.0, 0, 0, 0, 0} }; static tone_gen_descriptor_t my_mf_digit_tones[16]; static char bell_mf_tone_codes[] = "1234567890CA*B#"; int callback_ok; int callback_roll; static void my_mf_gen_init(float low_fudge, int low_level, float high_fudge, int high_level, int duration, int gap) { int i; /* The fiddle factor on the tone duration is to make KP consistently 50% longer than the other digits, as the digit durations are varied for the tests. This is an approximation, as the real scaling should be 100/68 */ for (i = 0; i < 15; i++) { tone_gen_descriptor_init(&my_mf_digit_tones[i], bell_mf_tones[i].f1*(1.0 + low_fudge), low_level, bell_mf_tones[i].f2*(1.0 + high_fudge), high_level, (i == 12) ? 3*duration/2 : duration, gap, 0, 0, FALSE); } } /*- End of function --------------------------------------------------------*/ static int my_mf_generate(int16_t amp[], const char *digits) { int len; char *cp; tone_gen_state_t tone; len = 0; while (*digits) { if ((cp = strchr(bell_mf_tone_codes, *digits))) { tone_gen_init(&tone, &my_mf_digit_tones[cp - bell_mf_tone_codes]); len += tone_gen(&tone, amp + len, 9999); } digits++; } return len; } /*- End of function --------------------------------------------------------*/ static void codec_munge(int16_t amp[], int len) { int i; uint8_t alaw; for (i = 0; i < len; i++) { alaw = linear_to_alaw (amp[i]); amp[i] = alaw_to_linear (alaw); } } /*- End of function --------------------------------------------------------*/ #define ALL_POSSIBLE_DIGITS "1234567890CA*B#" static void digit_delivery(void *data, const char *digits, int len) { int i; int seg; const char *s = ALL_POSSIBLE_DIGITS; const char *t; if (data != (void *) 0x12345678) { callback_ok = FALSE; return; } callback_ok = TRUE; t = s + callback_roll; seg = 15 - callback_roll; for (i = 0; i < len; i += seg, seg = 15) { if (i + seg > len) seg = len - i; if (memcmp(digits + i, t, seg)) { callback_ok = FALSE; printf("Fail at %d %d\n", i, seg); break; } t = s; callback_roll = (callback_roll + seg)%15; } } /*- End of function --------------------------------------------------------*/ static int16_t amp[1000000]; int main(int argc, char *argv[]) { int duration; int i; int j; int len; int sample; const char *s; char digit[2]; char buf[MAX_BELL_MF_DIGITS + 1]; int actual; int nplus; int nminus; float rrb; float rcfo; time_t now; bell_mf_rx_state_t *mf_state; awgn_state_t noise_source; time(&now); mf_state = bell_mf_rx_init(NULL, NULL, NULL); /* Test 1: Mitel's test 1 isn't really a test. Its a calibration step, which has no meaning here. */ printf ("Test 1: Calibration\n"); printf (" Passed\n"); /* Test 2: Decode check This is a sanity check, that all digits are reliably detected under ideal conditions. Each possible digit is repeated 10 times, with 68ms bursts. The level of each tone is about 6dB down from clip */ printf ("Test 2: Decode check\n"); my_mf_gen_init(0.0, -3, 0.0, -3, 68, 68); s = ALL_POSSIBLE_DIGITS; digit[1] = '\0'; while (*s) { digit[0] = *s++; for (i = 0; i < 10; i++) { len = my_mf_generate(amp, digit); codec_munge(amp, len); bell_mf_rx(mf_state, amp, len); actual = bell_mf_rx_get(mf_state, buf, 128); if (actual != 1 || buf[0] != digit[0]) { printf (" Sent '%s'\n", digit); printf (" Received '%s' [%d]\n", buf, actual); printf (" Failed\n"); exit (2); } } } printf (" Passed\n"); /* Test 3: Recognition bandwidth and channel centre frequency check. Use all digits. Each digit types requires four tests to complete the check. Each section contains 40 pulses of 68ms duration, with an amplitude of -20dB from clip per frequency. Four sections covering the tests for one tone (1 digit) are: a. H frequency at 0% deviation from center, L frequency at +0.1%. L frequency is then increments in +01.% steps up to +4%. The number of tone bursts is noted and designated N+. b. H frequency at 0% deviation, L frequency at -0.1%. L frequency is then incremental in -0.1% steps, up to -4%. The number of tone bursts is noted and designated N-. c. The test in (a) is repeated with the L frequency at 0% and the H frequency varied up to +4%. d. The test in (b) is repeated with the L frequency and 0% and the H frequency varied to -4%. Receiver Recognition Bandwidth (RRB) is calculated as follows: RRB% = (N+ + N-)/10 Receiver Center Frequency Offset (RCFO) is calculated as follows: RCFO% = X + (N+ - N-)/20 Note that this test doesn't test what it says it is testing at all, and the results are quite inaccurate, if not a downright lie! However, it follows the Mitel procedure, so how can it be bad? :) The spec calls for +-1.5% +-10Hz of bandwidth. */ printf ("Test 3: Recognition bandwidth and channel centre frequency check\n"); s = ALL_POSSIBLE_DIGITS; digit[1] = '\0'; j = 0; while (*s) { digit[0] = *s++; for (nplus = 0, i = 1; i <= 60; i++) { my_mf_gen_init((float) i/1000.0, -17, 0.0, -17, 68, 68); len = my_mf_generate(amp, digit); codec_munge(amp, len); bell_mf_rx(mf_state, amp, len); nplus += bell_mf_rx_get(mf_state, buf, 128); } for (nminus = 0, i = -1; i >= -60; i--) { my_mf_gen_init((float) i/1000.0, -17, 0.0, -17, 68, 68); len = my_mf_generate(amp, digit); codec_munge(amp, len); bell_mf_rx(mf_state, amp, len); nminus += bell_mf_rx_get(mf_state, buf, 128); } rrb = (float) (nplus + nminus)/10.0; rcfo = (float) (nplus - nminus)/10.0; printf (" %c (low) rrb = %5.2f%%, rcfo = %5.2f%%, max -ve = %5.2f, max +ve = %5.2f\n", digit[0], rrb, rcfo, (float) nminus/10.0, (float) nplus/10.0); if (rrb < 3.0 + rcfo + (2.0*100.0*10.0/bell_mf_tones[j].f1) || rrb >= 15.0 + rcfo) { printf (" Failed\n"); exit (2); } for (nplus = 0, i = 1; i <= 60; i++) { my_mf_gen_init(0.0, -17, (float) i/1000.0, -17, 68, 68); len = my_mf_generate(amp, digit); codec_munge(amp, len); bell_mf_rx(mf_state, amp, len); nplus += bell_mf_rx_get(mf_state, buf, 128); } for (nminus = 0, i = -1; i >= -60; i--) { my_mf_gen_init(0.0, -17, (float) i/1000.0, -17, 68, 68); len = my_mf_generate(amp, digit); codec_munge(amp, len); bell_mf_rx(mf_state, amp, len); nminus += bell_mf_rx_get(mf_state, buf, 128); } rrb = (float) (nplus + nminus)/10.0; rcfo = (float) (nplus - nminus)/10.0; printf (" %c (high) rrb = %5.2f%%, rcfo = %5.2f%%, max -ve = %5.2f, max +ve = %5.2f\n", digit[0], rrb, rcfo, (float) nminus/10.0, (float) nplus/10.0); if (rrb < 3.0 + rcfo + (2.0*100.0*10.0/bell_mf_tones[j].f2) || rrb >= 15.0 + rcfo) { printf (" Failed\n"); exit (2); } j++; } printf (" Passed\n"); /* Test 4: Acceptable amplitude ratio (twist). Twist all digits in both directions, and check the maximum twist we can accept. The way this is done is styled after the Mitel DTMF test, and has good and bad points. */ printf ("Test 4: Acceptable amplitude ratio (twist)\n"); s = ALL_POSSIBLE_DIGITS; digit[1] = '\0'; while (*s) { digit[0] = *s++; for (nplus = 0, i = -50; i >= -250; i--) { my_mf_gen_init(0.0, -5, 0.0, i/10, 68, 68); len = my_mf_generate(amp, digit); codec_munge(amp, len); bell_mf_rx(mf_state, amp, len); nplus += bell_mf_rx_get(mf_state, buf, 128); } printf(" %c normal twist = %.2fdB\n", digit[0], (float) nplus/10.0); if (nplus < 60) { printf(" Failed\n"); exit(2); } for (nminus = 0, i = -50; i >= -250; i--) { my_mf_gen_init(0.0, i/10, 0.0, -5, 68, 68); len = my_mf_generate(amp, digit); codec_munge(amp, len); bell_mf_rx(mf_state, amp, len); nminus += bell_mf_rx_get(mf_state, buf, 128); } printf(" %c reverse twist = %.2fdB\n", digit[0], (float) nminus/10.0); if (nminus < 60) { printf(" Failed\n"); exit(2); } } printf(" Passed\n"); /* Test 5: Dynamic range This test sends all possible digits, with gradually increasing amplitude. We determine the span over which we achieve reliable detection. The spec says we should detect between -14dBm and 0dBm, but the tones clip above -3dBm, so this cannot really work. */ printf("Test 5: Dynamic range\n"); for (nplus = nminus = -1000, i = -50; i <= 3; i++) { my_mf_gen_init(0.0, i, 0.0, i, 68, 68); for (j = 0; j < 100; j++) { len = my_mf_generate(amp, ALL_POSSIBLE_DIGITS); codec_munge(amp, len); bell_mf_rx(mf_state, amp, len); if (bell_mf_rx_get(mf_state, buf, 128) != 15) break; if (strcmp(buf, ALL_POSSIBLE_DIGITS) != 0) break; } if (j == 100) { if (nplus == -1000) nplus = i; } else { if (nplus != -1000 && nminus == -1000) nminus = i; } } printf(" Dynamic range = %ddB to %ddB\n", nplus, nminus - 1); if (nplus > -22 || nminus <= -3) { printf(" Failed\n"); exit(2); } printf(" Passed\n"); /* Test 6: Guard time This test sends all possible digits, with a gradually reducing duration. The spec defines a narrow range of tone duration times we can expect, so as long as we detect reliably at the specified minimum we should be OK. However, the spec also says we should detect on a minimum of 55ms of KP, or 30ms of other digits. */ printf("Test 6: Guard time\n"); for (i = 30; i < 62; i++) { my_mf_gen_init(0.0, -5, 0.0, -3, i, 68); for (j = 0; j < 500; j++) { len = my_mf_generate(amp, ALL_POSSIBLE_DIGITS); codec_munge(amp, len); bell_mf_rx(mf_state, amp, len); if (bell_mf_rx_get(mf_state, buf, 128) != 15) break; if (strcmp(buf, ALL_POSSIBLE_DIGITS) != 0) break; } if (j == 500) break; } printf(" Guard time = %dms\n", i); if (i > 61) { printf(" Failed\n"); exit(2); } printf(" Passed\n"); /* Test 7: Acceptable signal to noise ratio We send all possible digits at -6dBm from clip, mixed with AWGN. We gradually reduce the noise until we get clean detection. */ printf("Test 7: Acceptable signal to noise ratio\n"); my_mf_gen_init(0.0, -3, 0.0, -3, 68, 68); for (i = -10; i > -50; i--) { awgn_init_dbm0(&noise_source, 1234567, (float) i); for (j = 0; j < 500; j++) { len = my_mf_generate(amp, ALL_POSSIBLE_DIGITS); for (sample = 0; sample < len; sample++) amp[sample] = saturate(amp[sample] + awgn(&noise_source)); codec_munge(amp, len); bell_mf_rx(mf_state, amp, len); if (bell_mf_rx_get(mf_state, buf, 128) != 15) break; if (strcmp(buf, ALL_POSSIBLE_DIGITS) != 0) break; } if (j == 500) break; } printf(" Acceptable S/N ratio is %ddB\n", -3 - i); if (-3 - i > 26) { printf(" Failed\n"); exit(2); } printf(" Passed\n"); /* The remainder of the Mitel tape is the talk-off test. This is meaningless for Bell MF. However the decoder's tolerance of out of band noise is significant. */ /* TODO: add a OOB tolerance test. */ /* Test the callback mode for delivering detected digits */ printf("Test: Callback digit delivery mode.\n"); callback_ok = FALSE; callback_roll = 0; mf_state = bell_mf_rx_init(NULL, digit_delivery, (void *) 0x12345678); my_mf_gen_init(0.0, -10, 0.0, -10, 68, 68); for (i = 1; i < 10; i++) { len = 0; for (j = 0; j < i; j++) len += my_mf_generate(amp + len, ALL_POSSIBLE_DIGITS); bell_mf_rx(mf_state, amp, len); if (!callback_ok) break; } if (!callback_ok) { printf(" Failed\n"); exit (2); } printf(" Passed\n"); duration = time (NULL) - now; printf ("Tests passed in %ds\n", duration); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/fax_tests.c0000664000175000017500000004407712101214636013426 00000000000000/* * SpanDSP - a series of DSP components for telephony * * fax_tests.c * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page fax_tests_page FAX tests \section fax_tests_page_sec_1 What does it do? \section fax_tests_page_sec_2 How does it work? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #include "fax_utils.h" #define SAMPLES_PER_CHUNK 160 #define INPUT_TIFF_FILE_NAME "../test-data/itu/fax/itutests.tif" #define OUTPUT_FILE_NAME_WAVE "fax_tests.wav" #define FAX_MACHINES 2 struct machine_s { int chan; int16_t amp[SAMPLES_PER_CHUNK]; int len; fax_state_t *fax; awgn_state_t *awgn; int done; int succeeded; char tag[50]; int error_delay; int total_audio_time; } machines[FAX_MACHINES]; int use_receiver_not_ready = FALSE; int test_local_interrupt = FALSE; int t30_state_to_wreck = -1; static int phase_b_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; i = (int) (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase B", i); printf("%c: Phase B handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result)); fax_log_rx_parameters(s, tag); return T30_ERR_OK; } /*- End of function --------------------------------------------------------*/ static int phase_d_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; i = (int) (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase D", i); printf("%c: Phase D handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result)); fax_log_page_transfer_statistics(s, tag); fax_log_tx_parameters(s, tag); fax_log_rx_parameters(s, tag); if (use_receiver_not_ready) t30_set_receiver_not_ready(s, 3); if (test_local_interrupt) { if (i == 0) { printf("%d: Initiating interrupt request\n", i); t30_local_interrupt_request(s, TRUE); } else { switch (result) { case T30_PIP: case T30_PRI_MPS: case T30_PRI_EOM: case T30_PRI_EOP: printf("%d: Accepting interrupt request\n", i); t30_local_interrupt_request(s, TRUE); break; case T30_PIN: break; } } } return T30_ERR_OK; } /*- End of function --------------------------------------------------------*/ static void phase_e_handler(t30_state_t *s, void *user_data, int result) { int i; t30_stats_t t; char tag[20]; i = (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase E", i); printf("%c: Phase E handler on channel %c - (%d) %s\n", i, i, result, t30_completion_code_to_str(result)); fax_log_final_transfer_statistics(s, tag); fax_log_tx_parameters(s, tag); fax_log_rx_parameters(s, tag); t30_get_transfer_statistics(s, &t); machines[i - 'A'].succeeded = (result == T30_ERR_OK) && (t.pages_tx == 12 || t.pages_rx == 12); machines[i - 'A'].done = TRUE; } /*- End of function --------------------------------------------------------*/ static void real_time_frame_handler(t30_state_t *s, void *user_data, int direction, const uint8_t *msg, int len) { int i; i = (intptr_t) user_data; printf("%c: Real time frame handler on channel %c - %s, %s, length = %d\n", i, i, (direction) ? "line->T.30" : "T.30->line", t30_frametype(msg[2]), len); } /*- End of function --------------------------------------------------------*/ static int document_handler(t30_state_t *s, void *user_data, int event) { int i; i = (intptr_t) user_data; printf("%c: Document handler on channel %c - event %d\n", i, i, event); return FALSE; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { SNDFILE *wave_handle; SNDFILE *input_wave_handle; int i; int j; int k; struct machine_s *mc; int outframes; char buf[128 + 1]; int16_t silence[SAMPLES_PER_CHUNK]; int16_t out_amp[2*SAMPLES_PER_CHUNK]; int alldone; const char *input_tiff_file_name; const char *input_audio_file_name; int log_audio; int use_ecm; int use_tep; int use_transmit_on_idle; #if defined(WITH_SPANDSP_INTERNALS) int use_line_hits; #endif int polled_mode; int reverse_flow; int use_page_limits; int supported_modems; int signal_level; int noise_level; float signal_scaling; time_t start_time; time_t end_time; int scan_line_time; char *page_header_info; int opt; t30_state_t *t30; logging_state_t *logging; log_audio = FALSE; input_tiff_file_name = INPUT_TIFF_FILE_NAME; input_audio_file_name = NULL; use_ecm = FALSE; #if defined(WITH_SPANDSP_INTERNALS) use_line_hits = FALSE; #endif use_tep = FALSE; polled_mode = FALSE; page_header_info = NULL; reverse_flow = FALSE; use_transmit_on_idle = TRUE; use_receiver_not_ready = FALSE; use_page_limits = FALSE; signal_level = 0; noise_level = -99; scan_line_time = 0; supported_modems = T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17; while ((opt = getopt(argc, argv, "ehH:i:I:lm:n:prRs:S:tTw:")) != -1) { switch (opt) { case 'e': use_ecm = TRUE; break; #if defined(WITH_SPANDSP_INTERNALS) case 'h': use_line_hits = TRUE; break; #endif case 'H': page_header_info = optarg; break; case 'i': input_tiff_file_name = optarg; break; case 'I': input_audio_file_name = optarg; break; case 'l': log_audio = TRUE; break; case 'm': supported_modems = atoi(optarg); break; case 'n': noise_level = atoi(optarg); break; case 'p': polled_mode = TRUE; break; case 'r': reverse_flow = TRUE; break; case 'R': use_receiver_not_ready = TRUE; break; case 's': signal_level = atoi(optarg); break; case 'S': scan_line_time = atoi(optarg); break; case 't': use_tep = TRUE; break; case 'T': use_page_limits = TRUE; break; case 'w': t30_state_to_wreck = atoi(optarg); break; default: //usage(); exit(2); break; } } input_wave_handle = NULL; if (input_audio_file_name) { if ((input_wave_handle = sf_open_telephony_read(input_audio_file_name, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", input_audio_file_name); exit(2); } } wave_handle = NULL; if (log_audio) { if ((wave_handle = sf_open_telephony_write(OUTPUT_FILE_NAME_WAVE, 2)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUTPUT_FILE_NAME_WAVE); exit(2); } } memset(silence, 0, sizeof(silence)); for (j = 0; j < FAX_MACHINES; j++) { machines[j].chan = j; mc = &machines[j]; i = mc->chan + 1; sprintf(buf, "%d%d%d%d%d%d%d%d", i, i, i, i, i, i, i, i); if (reverse_flow) mc->fax = fax_init(NULL, (mc->chan & 1) ? TRUE : FALSE); else mc->fax = fax_init(NULL, (mc->chan & 1) ? FALSE : TRUE); mc->awgn = NULL; signal_scaling = 1.0f; if (noise_level > -99) { mc->awgn = awgn_init_dbm0(NULL, 1234567, noise_level); signal_scaling = powf(10.0f, signal_level/20.0f); printf("Signal scaling %f\n", signal_scaling); } fax_set_transmit_on_idle(mc->fax, use_transmit_on_idle); fax_set_tep_mode(mc->fax, use_tep); t30 = fax_get_t30_state(mc->fax); t30_set_tx_ident(t30, buf); t30_set_tx_sub_address(t30, "Sub-address"); t30_set_tx_sender_ident(t30, "Sender ID"); t30_set_tx_password(t30, "Password"); t30_set_tx_polled_sub_address(t30, "Polled sub-address"); t30_set_tx_selective_polling_address(t30, "Selective polling address"); t30_set_tx_page_header_info(t30, page_header_info); t30_set_tx_nsf(t30, (const uint8_t *) "\x50\x00\x00\x00Spandsp\x00", 12); t30_set_ecm_capability(t30, use_ecm); t30_set_supported_t30_features(t30, T30_SUPPORT_IDENTIFICATION | T30_SUPPORT_SELECTIVE_POLLING | T30_SUPPORT_SUB_ADDRESSING); if ((mc->chan & 1)) t30_set_minimum_scan_line_time(t30, scan_line_time); t30_set_supported_image_sizes(t30, T30_SUPPORT_US_LETTER_LENGTH | T30_SUPPORT_US_LEGAL_LENGTH | T30_SUPPORT_UNLIMITED_LENGTH | T30_SUPPORT_215MM_WIDTH | T30_SUPPORT_255MM_WIDTH | T30_SUPPORT_303MM_WIDTH); t30_set_supported_resolutions(t30, T30_SUPPORT_STANDARD_RESOLUTION | T30_SUPPORT_FINE_RESOLUTION | T30_SUPPORT_SUPERFINE_RESOLUTION | T30_SUPPORT_R8_RESOLUTION | T30_SUPPORT_R16_RESOLUTION | T30_SUPPORT_300_300_RESOLUTION | T30_SUPPORT_400_400_RESOLUTION | T30_SUPPORT_600_600_RESOLUTION | T30_SUPPORT_1200_1200_RESOLUTION | T30_SUPPORT_300_600_RESOLUTION | T30_SUPPORT_400_800_RESOLUTION | T30_SUPPORT_600_1200_RESOLUTION); t30_set_supported_modems(t30, supported_modems); if (use_ecm) #if defined(SPANDSP_SUPPORT_T85) t30_set_supported_compressions(t30, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION | T30_SUPPORT_T85_COMPRESSION); #else t30_set_supported_compressions(t30, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION); #endif if ((mc->chan & 1)) { if (polled_mode) { if (use_page_limits) t30_set_tx_file(t30, input_tiff_file_name, 3, 6); else t30_set_tx_file(t30, input_tiff_file_name, -1, -1); } else { sprintf(buf, "fax_tests_%d.tif", (mc->chan + 1)/2); t30_set_rx_file(t30, buf, -1); t30_set_rx_encoding(t30, T4_COMPRESSION_ITU_T6); } } else { if (polled_mode) { sprintf(buf, "fax_tests_%d.tif", (mc->chan + 1)/2); t30_set_rx_file(t30, buf, -1); t30_set_rx_encoding(t30, T4_COMPRESSION_ITU_T6); } else { if (use_page_limits) t30_set_tx_file(t30, input_tiff_file_name, 3, 6); else t30_set_tx_file(t30, input_tiff_file_name, -1, -1); } } t30_set_phase_b_handler(t30, phase_b_handler, (void *) (intptr_t) mc->chan + 'A'); t30_set_phase_d_handler(t30, phase_d_handler, (void *) (intptr_t) mc->chan + 'A'); t30_set_phase_e_handler(t30, phase_e_handler, (void *) (intptr_t) mc->chan + 'A'); t30_set_real_time_frame_handler(t30, real_time_frame_handler, (void *) (intptr_t) mc->chan + 'A'); t30_set_document_handler(t30, document_handler, (void *) (intptr_t) mc->chan + 'A'); sprintf(mc->tag, "FAX-%d", j + 1); logging = t30_get_logging_state(t30); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW); span_log_set_tag(logging, mc->tag); if ((j & 1)) { span_log_set_level(&t30->t4.rx.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW); span_log_set_tag(&t30->t4.rx.logging, mc->tag); } else { span_log_set_level(&t30->t4.tx.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW); span_log_set_tag(&t30->t4.tx.logging, mc->tag); } logging = fax_get_logging_state(mc->fax); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW); span_log_set_tag(logging, mc->tag); memset(mc->amp, 0, sizeof(mc->amp)); mc->total_audio_time = 0; mc->done = FALSE; } time(&start_time); for (;;) { alldone = TRUE; for (j = 0; j < FAX_MACHINES; j++) { mc = &machines[j]; if ((j & 1) == 0 && input_audio_file_name) { mc->len = sf_readf_short(input_wave_handle, mc->amp, SAMPLES_PER_CHUNK); if (mc->len == 0) break; } else { mc->len = fax_tx(mc->fax, mc->amp, SAMPLES_PER_CHUNK); if (mc->awgn) { for (k = 0; k < mc->len; k++) mc->amp[k] = ((int16_t) (mc->amp[k]*signal_scaling)) + awgn(mc->awgn); } } mc->total_audio_time += SAMPLES_PER_CHUNK; if (!use_transmit_on_idle) { /* The receive side always expects a full block of samples, but the transmit side may not be sending any when it doesn't need to. We may need to pad with some silence. */ if (mc->len < SAMPLES_PER_CHUNK) { memset(mc->amp + mc->len, 0, sizeof(int16_t)*(SAMPLES_PER_CHUNK - mc->len)); mc->len = SAMPLES_PER_CHUNK; } } t30 = fax_get_t30_state(mc->fax); logging = t30_get_logging_state(t30); span_log_bump_samples(logging, mc->len); logging = fax_get_logging_state(mc->fax); span_log_bump_samples(logging, mc->len); if (log_audio) { for (k = 0; k < mc->len; k++) out_amp[2*k + j] = mc->amp[k]; } if (machines[j ^ 1].len < SAMPLES_PER_CHUNK) memset(machines[j ^ 1].amp + machines[j ^ 1].len, 0, sizeof(int16_t)*(SAMPLES_PER_CHUNK - machines[j ^ 1].len)); t30 = fax_get_t30_state(mc->fax); #if defined(WITH_SPANDSP_INTERNALS) if (use_line_hits) { /* TODO: This applies very crude line hits. improve it */ if (t30->state == 22) { if (++mc->error_delay == 100) { fprintf(stderr, "HIT %d!\n", j); mc->error_delay = 0; for (k = 0; k < 5; k++) mc->amp[k] = 0; } } } if (t30->state == t30_state_to_wreck) memset(machines[j ^ 1].amp, 0, sizeof(int16_t)*SAMPLES_PER_CHUNK); #endif if (fax_rx(mc->fax, machines[j ^ 1].amp, SAMPLES_PER_CHUNK)) break; if (!mc->done) alldone = FALSE; } if (log_audio) { outframes = sf_writef_short(wave_handle, out_amp, SAMPLES_PER_CHUNK); if (outframes != SAMPLES_PER_CHUNK) break; } if (alldone || j < FAX_MACHINES) break; } time(&end_time); for (j = 0; j < FAX_MACHINES; j++) { mc = &machines[j]; fax_release(mc->fax); } if (log_audio) { if (sf_close(wave_handle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME_WAVE); exit(2); } } if (input_audio_file_name) { if (sf_close(input_wave_handle)) { fprintf(stderr, " Cannot close audio file '%s'\n", input_audio_file_name); exit(2); } } printf("Total audio time = %ds (wall time %ds)\n", machines[0].total_audio_time/8000, (int) (end_time - start_time)); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/fax_decode.c0000664000175000017500000004020512101212625013470 00000000000000/* * SpanDSP - a series of DSP components for telephony * * fax_decode.c - a simple FAX audio decoder * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page fax_decode_page FAX decoder \section fax_decode_page_sec_1 What does it do? ???. \section fax_decode_tests_page_sec_2 How does it work? ???. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #define SAMPLES_PER_CHUNK 160 #define DISBIT1 0x01 #define DISBIT2 0x02 #define DISBIT3 0x04 #define DISBIT4 0x08 #define DISBIT5 0x10 #define DISBIT6 0x20 #define DISBIT7 0x40 #define DISBIT8 0x80 enum { FAX_NONE, FAX_V27TER_RX, FAX_V29_RX, FAX_V17_RX }; static const struct { int bit_rate; int modem_type; int which; uint8_t dcs_code; } fallback_sequence[] = { {14400, T30_MODEM_V17, T30_SUPPORT_V17, DISBIT6}, {12000, T30_MODEM_V17, T30_SUPPORT_V17, (DISBIT6 | DISBIT4)}, { 9600, T30_MODEM_V17, T30_SUPPORT_V17, (DISBIT6 | DISBIT3)}, { 9600, T30_MODEM_V29, T30_SUPPORT_V29, DISBIT3}, { 7200, T30_MODEM_V17, T30_SUPPORT_V17, (DISBIT6 | DISBIT4 | DISBIT3)}, { 7200, T30_MODEM_V29, T30_SUPPORT_V29, (DISBIT4 | DISBIT3)}, { 4800, T30_MODEM_V27TER, T30_SUPPORT_V27TER, DISBIT4}, { 2400, T30_MODEM_V27TER, T30_SUPPORT_V27TER, 0}, { 0, 0, 0, 0} }; int decode_test = FALSE; int rx_bits = 0; t30_state_t t30_dummy; t4_rx_state_t t4_rx_state; int t4_up = FALSE; hdlc_rx_state_t hdlcrx; int fast_trained = FAX_NONE; uint8_t ecm_data[256][260]; int16_t ecm_len[256]; int line_encoding = T4_COMPRESSION_ITU_T4_1D; int x_resolution = T4_X_RESOLUTION_R8; int y_resolution = T4_Y_RESOLUTION_STANDARD; int image_width = 1728; int octets_per_ecm_frame = 256; int error_correcting_mode = FALSE; int current_fallback = 0; static void decode_20digit_msg(const uint8_t *pkt, int len) { int p; int k; char msg[T30_MAX_IDENT_LEN + 1]; if (len > T30_MAX_IDENT_LEN + 3) { fprintf(stderr, "XXX %d %d\n", len, T30_MAX_IDENT_LEN + 1); msg[0] = '\0'; return; } pkt += 2; p = len - 2; /* Strip trailing spaces */ while (p > 1 && pkt[p - 1] == ' ') p--; /* The string is actually backwards in the message */ k = 0; while (p > 1) msg[k++] = pkt[--p]; msg[k] = '\0'; fprintf(stderr, "%s is: \"%s\"\n", t30_frametype(pkt[0]), msg); } /*- End of function --------------------------------------------------------*/ static void print_frame(const char *io, const uint8_t *fr, int frlen) { int i; int type; const char *country; const char *vendor; const char *model; fprintf(stderr, "%s %s:", io, t30_frametype(fr[2])); for (i = 2; i < frlen; i++) fprintf(stderr, " %02x", fr[i]); fprintf(stderr, "\n"); type = fr[2] & 0xFE; if (type == T30_DIS || type == T30_DTC || type == T30_DCS) t30_decode_dis_dtc_dcs(&t30_dummy, fr, frlen); if (type == T30_CSI || type == T30_TSI || type == T30_PWD || type == T30_SEP || type == T30_SUB || type == T30_SID) decode_20digit_msg(fr, frlen); if (type == T30_NSF || type == T30_NSS || type == T30_NSC) { if (t35_decode(&fr[3], frlen - 3, &country, &vendor, &model)) { if (country) fprintf(stderr, "The remote was made in '%s'\n", country); if (vendor) fprintf(stderr, "The remote was made by '%s'\n", vendor); if (model) fprintf(stderr, "The remote is a '%s'\n", model); } } } /*- End of function --------------------------------------------------------*/ static int find_fallback_entry(int dcs_code) { int i; /* The table is short, and not searched often, so a brain-dead linear scan seems OK */ for (i = 0; fallback_sequence[i].bit_rate; i++) { if (fallback_sequence[i].dcs_code == dcs_code) break; } if (fallback_sequence[i].bit_rate == 0) return -1; return i; } /*- End of function --------------------------------------------------------*/ static int check_rx_dcs(const uint8_t *msg, int len) { static const int widths[3][4] = { { 864, 1024, 1216, -1}, /* R4 resolution - no longer used in recent versions of T.30 */ {1728, 2048, 2432, -1}, /* R8 resolution */ {3456, 4096, 4864, -1} /* R16 resolution */ }; uint8_t dcs_frame[T30_MAX_DIS_DTC_DCS_LEN]; /* Check DCS frame from remote */ if (len < 6) { printf("Short DCS frame\n"); return -1; } /* Make a local copy of the message, padded to the maximum possible length with zeros. This allows us to simply pick out the bits, without worrying about whether they were set from the remote side. */ if (len > T30_MAX_DIS_DTC_DCS_LEN) { memcpy(dcs_frame, msg, T30_MAX_DIS_DTC_DCS_LEN); } else { memcpy(dcs_frame, msg, len); if (len < T30_MAX_DIS_DTC_DCS_LEN) memset(dcs_frame + len, 0, T30_MAX_DIS_DTC_DCS_LEN - len); } octets_per_ecm_frame = (dcs_frame[6] & DISBIT4) ? 256 : 64; if ((dcs_frame[8] & DISBIT1)) y_resolution = T4_Y_RESOLUTION_SUPERFINE; else if (dcs_frame[4] & DISBIT7) y_resolution = T4_Y_RESOLUTION_FINE; else y_resolution = T4_Y_RESOLUTION_STANDARD; image_width = widths[(dcs_frame[8] & DISBIT3) ? 2 : 1][dcs_frame[5] & (DISBIT2 | DISBIT1)]; /* Check which compression we will use. */ if ((dcs_frame[6] & DISBIT7)) line_encoding = T4_COMPRESSION_ITU_T6; else if ((dcs_frame[4] & DISBIT8)) line_encoding = T4_COMPRESSION_ITU_T4_2D; else line_encoding = T4_COMPRESSION_ITU_T4_1D; fprintf(stderr, "Selected compression %d\n", line_encoding); if ((current_fallback = find_fallback_entry(dcs_frame[4] & (DISBIT6 | DISBIT5 | DISBIT4 | DISBIT3))) < 0) printf("Remote asked for a modem standard we do not support\n"); error_correcting_mode = ((dcs_frame[6] & DISBIT3) != 0); //v17_rx_restart(&v17, fallback_sequence[fallback_entry].bit_rate, FALSE); return 0; } /*- End of function --------------------------------------------------------*/ static void hdlc_accept(void *user_data, const uint8_t *msg, int len, int ok) { int type; int frame_no; int i; if (len < 0) { /* Special conditions */ fprintf(stderr, "HDLC status is %s (%d)\n", signal_status_to_str(len), len); return; } if (ok) { if (msg[0] != 0xFF || !(msg[1] == 0x03 || msg[1] == 0x13)) { fprintf(stderr, "Bad frame header - %02x %02x\n", msg[0], msg[1]); return; } print_frame("HDLC: ", msg, len); type = msg[2] & 0xFE; switch (type) { case T4_FCD: if (len <= 4 + 256) { frame_no = msg[3]; /* Just store the actual image data, and record its length */ memcpy(&ecm_data[frame_no][0], &msg[4], len - 4); ecm_len[frame_no] = (int16_t) (len - 4); } break; case T30_DCS: check_rx_dcs(msg, len); break; } } else { fprintf(stderr, "Bad HDLC frame "); for (i = 0; i < len; i++) fprintf(stderr, " %02x", msg[i]); fprintf(stderr, "\n"); } } /*- End of function --------------------------------------------------------*/ static void t4_begin(void) { int i; //printf("Begin T.4 - %d %d %d %d\n", line_encoding, x_resolution, y_resolution, image_width); t4_rx_set_rx_encoding(&t4_rx_state, line_encoding); t4_rx_set_x_resolution(&t4_rx_state, x_resolution); t4_rx_set_y_resolution(&t4_rx_state, y_resolution); t4_rx_set_image_width(&t4_rx_state, image_width); t4_rx_start_page(&t4_rx_state); t4_up = TRUE; for (i = 0; i < 256; i++) ecm_len[i] = -1; } /*- End of function --------------------------------------------------------*/ static void t4_end(void) { t4_stats_t stats; int i; if (!t4_up) return; if (error_correcting_mode) { for (i = 0; i < 256; i++) { if (ecm_len[i] > 0) t4_rx_put_chunk(&t4_rx_state, ecm_data[i], ecm_len[i]); fprintf(stderr, "%d", (ecm_len[i] <= 0) ? 0 : 1); } fprintf(stderr, "\n"); } t4_rx_end_page(&t4_rx_state); t4_rx_get_transfer_statistics(&t4_rx_state, &stats); fprintf(stderr, "Pages = %d\n", stats.pages_transferred); fprintf(stderr, "Image size = %dx%d\n", stats.width, stats.length); fprintf(stderr, "Image resolution = %dx%d\n", stats.x_resolution, stats.y_resolution); fprintf(stderr, "Bad rows = %d\n", stats.bad_rows); fprintf(stderr, "Longest bad row run = %d\n", stats.longest_bad_row_run); t4_up = FALSE; } /*- End of function --------------------------------------------------------*/ static void v21_put_bit(void *user_data, int bit) { if (bit < 0) { /* Special conditions */ fprintf(stderr, "V.21 rx status is %s (%d)\n", signal_status_to_str(bit), bit); switch (bit) { case SIG_STATUS_CARRIER_DOWN: //t4_end(); break; } return; } if (fast_trained == FAX_NONE) hdlc_rx_put_bit(&hdlcrx, bit); //printf("V.21 Rx bit %d - %d\n", rx_bits++, bit); } /*- End of function --------------------------------------------------------*/ static void v17_put_bit(void *user_data, int bit) { if (bit < 0) { /* Special conditions */ fprintf(stderr, "V.17 rx status is %s (%d)\n", signal_status_to_str(bit), bit); switch (bit) { case SIG_STATUS_TRAINING_SUCCEEDED: fast_trained = FAX_V17_RX; t4_begin(); break; case SIG_STATUS_CARRIER_DOWN: t4_end(); if (fast_trained == FAX_V17_RX) fast_trained = FAX_NONE; break; } return; } if (error_correcting_mode) { hdlc_rx_put_bit(&hdlcrx, bit); } else { if (t4_rx_put_bit(&t4_rx_state, bit)) { t4_end(); fprintf(stderr, "End of page detected\n"); } } //printf("V.17 Rx bit %d - %d\n", rx_bits++, bit); } /*- End of function --------------------------------------------------------*/ static void v29_put_bit(void *user_data, int bit) { if (bit < 0) { /* Special conditions */ fprintf(stderr, "V.29 rx status is %s (%d)\n", signal_status_to_str(bit), bit); switch (bit) { case SIG_STATUS_TRAINING_SUCCEEDED: fast_trained = FAX_V29_RX; t4_begin(); break; case SIG_STATUS_CARRIER_DOWN: t4_end(); if (fast_trained == FAX_V29_RX) fast_trained = FAX_NONE; break; } return; } if (error_correcting_mode) { hdlc_rx_put_bit(&hdlcrx, bit); } else { if (t4_rx_put_bit(&t4_rx_state, bit)) { t4_end(); fprintf(stderr, "End of page detected\n"); } } //printf("V.29 Rx bit %d - %d\n", rx_bits++, bit); } /*- End of function --------------------------------------------------------*/ static void v27ter_put_bit(void *user_data, int bit) { if (bit < 0) { /* Special conditions */ fprintf(stderr, "V.27ter rx status is %s (%d)\n", signal_status_to_str(bit), bit); switch (bit) { case SIG_STATUS_TRAINING_SUCCEEDED: fast_trained = FAX_V27TER_RX; t4_begin(); break; case SIG_STATUS_CARRIER_DOWN: t4_end(); if (fast_trained == FAX_V27TER_RX) fast_trained = FAX_NONE; break; } return; } if (error_correcting_mode) { hdlc_rx_put_bit(&hdlcrx, bit); } else { if (t4_rx_put_bit(&t4_rx_state, bit)) { t4_end(); fprintf(stderr, "End of page detected\n"); } } //printf("V.27ter Rx bit %d - %d\n", rx_bits++, bit); } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { fsk_rx_state_t *fsk; v17_rx_state_t *v17; v29_rx_state_t *v29; v27ter_rx_state_t *v27ter; int16_t amp[SAMPLES_PER_CHUNK]; SNDFILE *inhandle; SF_INFO info; int len; const char *filename; logging_state_t *logging; filename = "fax_samp.wav"; if (argc > 1) filename = argv[1]; memset(&info, 0, sizeof(info)); if ((inhandle = sf_open(filename, SFM_READ, &info)) == NULL) { fprintf(stderr, " Cannot open audio file '%s' for reading\n", filename); exit(2); } if (info.samplerate != SAMPLE_RATE) { fprintf(stderr, " Unexpected sample rate in audio file '%s'\n", filename); exit(2); } if (info.channels != 1) { fprintf(stderr, " Unexpected number of channels in audio file '%s'\n", filename); exit(2); } memset(&t30_dummy, 0, sizeof(t30_dummy)); span_log_init(&t30_dummy.logging, SPAN_LOG_FLOW, NULL); span_log_set_protocol(&t30_dummy.logging, "T.30"); hdlc_rx_init(&hdlcrx, FALSE, TRUE, 5, hdlc_accept, NULL); fsk = fsk_rx_init(NULL, &preset_fsk_specs[FSK_V21CH2], FSK_FRAME_MODE_SYNC, v21_put_bit, NULL); v17 = v17_rx_init(NULL, 14400, v17_put_bit, NULL); v29 = v29_rx_init(NULL, 9600, v29_put_bit, NULL); //v29 = v29_rx_init(NULL, 7200, v29_put_bit, NULL); v27ter = v27ter_rx_init(NULL, 4800, v27ter_put_bit, NULL); fsk_rx_signal_cutoff(fsk, -45.5); v17_rx_signal_cutoff(v17, -45.5); v29_rx_signal_cutoff(v29, -45.5); v27ter_rx_signal_cutoff(v27ter, -40.0); #if 1 logging = v17_rx_get_logging_state(v17); span_log_init(logging, SPAN_LOG_FLOW, NULL); span_log_set_protocol(logging, "V.17"); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_FLOW); logging = v29_rx_get_logging_state(v29); span_log_init(logging, SPAN_LOG_FLOW, NULL); span_log_set_protocol(logging, "V.29"); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_FLOW); logging = v27ter_rx_get_logging_state(v27ter); span_log_init(logging, SPAN_LOG_FLOW, NULL); span_log_set_protocol(logging, "V.27ter"); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_FLOW); #endif if (t4_rx_init(&t4_rx_state, "fax_decode.tif", T4_COMPRESSION_ITU_T4_2D) == NULL) { fprintf(stderr, "Failed to init\n"); exit(0); } for (;;) { len = sf_readf_short(inhandle, amp, SAMPLES_PER_CHUNK); if (len < SAMPLES_PER_CHUNK) break; fsk_rx(fsk, amp, len); v17_rx(v17, amp, len); v29_rx(v29, amp, len); //v27ter_rx(v27ter, amp, len); } t4_rx_release(&t4_rx_state); if (sf_close(inhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", filename); exit(2); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/super_tone_rx_tests.c0000664000175000017500000003761312350611321015540 00000000000000/* * SpanDSP - a series of DSP components for telephony * * super_tone_detect_tests.c * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page super_tone_rx_tests_page Supervisory tone detection tests \section super_tone_rx_tests_page_sec_1 What does it do? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #include #include #if defined(HAVE_LIBXML_XMLMEMORY_H) #include #endif #if defined(HAVE_LIBXML_PARSER_H) #include #endif #if defined(HAVE_LIBXML_XINCLUDE_H) #include #endif //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define IN_FILE_NAME "super_tone.wav" #define MITEL_DIR "../test-data/mitel/" #define BELLCORE_DIR "../test-data/bellcore/" const char *bellcore_files[] = { MITEL_DIR "mitel-cm7291-talkoff.wav", BELLCORE_DIR "tr-tsy-00763-1.wav", BELLCORE_DIR "tr-tsy-00763-2.wav", BELLCORE_DIR "tr-tsy-00763-3.wav", BELLCORE_DIR "tr-tsy-00763-4.wav", BELLCORE_DIR "tr-tsy-00763-5.wav", BELLCORE_DIR "tr-tsy-00763-6.wav", "" }; const char *tone_names[20] = {NULL}; SNDFILE *inhandle; super_tone_rx_segment_t tone_segments[20][10]; super_tone_tx_step_t *dialtone_tree = NULL; super_tone_tx_step_t *ringback_tree = NULL; super_tone_tx_step_t *busytone_tree = NULL; super_tone_tx_step_t *nutone_tree = NULL; super_tone_tx_step_t *congestiontone_tree = NULL; super_tone_tx_step_t *waitingtone_tree = NULL; int level; #define SAMPLES_PER_CHUNK 160 #if defined(HAVE_LIBXML2) static int parse_tone(super_tone_rx_descriptor_t *desc, int tone_id, super_tone_tx_step_t **tree, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { xmlChar *x; float f1; float f2; float f_tol; float l1; float l2; float length; float length_tol; float recognition_length; float recognition_length_tol; int cycles; super_tone_tx_step_t *treep; int min_duration; int max_duration; cur = cur->xmlChildrenNode; while (cur) { if (xmlStrcmp(cur->name, (const xmlChar *) "step") == 0) { printf("Step - "); /* Set some defaults */ f1 = 0.0; f2 = 0.0; f_tol = 1.0; l1 = -11.0; l2 = -11.0; length = 0.0; length_tol = 10.0; recognition_length = 0.0; recognition_length_tol = 10.0; cycles = 1; if ((x = xmlGetProp(cur, (const xmlChar *) "freq"))) { sscanf((char *) x, "%f [%f%%]", &f1, &f_tol); sscanf((char *) x, "%f+%f [%f%%]", &f1, &f2, &f_tol); printf(" Frequency=%.2f+%.2f [%.2f%%]", f1, f2, f_tol); } if ((x = xmlGetProp(cur, (const xmlChar *) "level"))) { if (sscanf((char *) x, "%f+%f", &l1, &l2) < 2) l2 = l1; printf(" Level=%.2f+%.2f", l1, l2); } if ((x = xmlGetProp(cur, (const xmlChar *) "length"))) { sscanf((char *) x, "%f [%f%%]", &length, &length_tol); printf(" Length=%.2f [%.2f%%]", length, length_tol); } if ((x = xmlGetProp(cur, (const xmlChar *) "recognition-length"))) { sscanf((char *) x, "%f [%f%%]", &recognition_length, &recognition_length_tol); printf(" Recognition length=%.2f [%.2f%%]", recognition_length, recognition_length_tol); } if ((x = xmlGetProp(cur, (const xmlChar *) "cycles"))) { if (strcasecmp((char *) x, "endless") == 0) cycles = 0; else cycles = atoi((char *) x); printf(" Cycles='%d' ", cycles); } if ((x = xmlGetProp(cur, (const xmlChar *) "recorded-announcement"))) printf(" Recorded announcement='%s'", x); printf("\n"); if (f1 || f2 || length) { /* TODO: This cannot handle cycling patterns */ if (length == 0.0) { if (recognition_length) min_duration = recognition_length*1000.0 + 0.5; else min_duration = 700; max_duration = 0; } else { if (recognition_length) min_duration = recognition_length*1000.0 + 0.5; else min_duration = (length*1000.0 + 0.5)*(1.0 - length_tol/100.0) - 30; max_duration = (length*1000.0 + 0.5)*(1.0 + length_tol/100.0) + 30; } printf(">>>Detector element %10d %10d %10d %10d\n", (int) (f1 + 0.5), (int) (f2 + 0.5), min_duration, max_duration); super_tone_rx_add_element(desc, tone_id, f1 + 0.5, f2 + 0.5, min_duration, max_duration); } treep = super_tone_tx_make_step(NULL, f1, l1, f2, l2, length*1000.0 + 0.5, cycles); *tree = treep; tree = &treep->next; parse_tone(desc, tone_id, &treep->nest, doc, ns, cur); } /*endif*/ cur = cur->next; } /*endwhile*/ return 0; } /*- End of function --------------------------------------------------------*/ static void parse_tone_set(super_tone_rx_descriptor_t *desc, xmlDocPtr doc, xmlNsPtr ns, xmlNodePtr cur) { int tone_id; printf("Parsing tone set\n"); cur = cur->xmlChildrenNode; while (cur) { if (strcmp((char *) cur->name, "dial-tone") == 0) { printf("Hit %s\n", cur->name); tone_id = super_tone_rx_add_tone(desc); dialtone_tree = NULL; parse_tone(desc, tone_id, &dialtone_tree, doc, ns, cur); tone_names[tone_id] = "Dial tone"; } else if (strcmp((char *) cur->name, "ringback-tone") == 0) { printf("Hit %s\n", cur->name); tone_id = super_tone_rx_add_tone(desc); ringback_tree = NULL; parse_tone(desc, tone_id, &ringback_tree, doc, ns, cur); tone_names[tone_id] = "Ringback tone"; } else if (strcmp((char *) cur->name, "busy-tone") == 0) { printf("Hit %s\n", cur->name); tone_id = super_tone_rx_add_tone(desc); busytone_tree = NULL; parse_tone(desc, tone_id, &busytone_tree, doc, ns, cur); tone_names[tone_id] = "Busy tone"; } else if (strcmp((char *) cur->name, "number-unobtainable-tone") == 0) { printf("Hit %s\n", cur->name); tone_id = super_tone_rx_add_tone(desc); nutone_tree = NULL; parse_tone(desc, tone_id, &nutone_tree, doc, ns, cur); tone_names[tone_id] = "NU tone"; } else if (strcmp((char *) cur->name, "congestion-tone") == 0) { printf("Hit %s\n", cur->name); tone_id = super_tone_rx_add_tone(desc); congestiontone_tree = NULL; parse_tone(desc, tone_id, &congestiontone_tree, doc, ns, cur); tone_names[tone_id] = "Congestion tone"; } else if (strcmp((char *) cur->name, "waiting-tone") == 0) { printf("Hit %s\n", cur->name); tone_id = super_tone_rx_add_tone(desc); waitingtone_tree = NULL; parse_tone(desc, tone_id, &waitingtone_tree, doc, ns, cur); tone_names[tone_id] = "Waiting tone"; } /*endif*/ cur = cur->next; } /*endwhile*/ } /*- End of function --------------------------------------------------------*/ static void get_tone_set(super_tone_rx_descriptor_t *desc, const char *tone_file, const char *set_id) { xmlParserCtxtPtr ctxt; xmlDocPtr doc; xmlNsPtr ns; xmlNodePtr cur; xmlChar *x; ns = NULL; xmlKeepBlanksDefault(0); xmlCleanupParser(); if ((ctxt = xmlNewParserCtxt()) == NULL) { fprintf(stderr, "Failed to allocate parser context\n"); printf("Test failed\n"); exit(2); } /* parse the file, activating the DTD validation option */ if ((doc = xmlCtxtReadFile(ctxt, tone_file, NULL, XML_PARSE_XINCLUDE | XML_PARSE_DTDVALID)) == NULL) { fprintf(stderr, "Failed to read the XML document\n"); printf("Test failed\n"); exit(2); } if (ctxt->valid == 0) { fprintf(stderr, "Failed to validate the XML document\n"); xmlFreeDoc(doc); xmlFreeParserCtxt(ctxt); printf("Test failed\n"); exit(2); } xmlFreeParserCtxt(ctxt); /* Check the document is of the right kind */ if ((cur = xmlDocGetRootElement(doc)) == NULL) { fprintf(stderr, "Empty document\n"); xmlFreeDoc(doc); exit(2); } /*endif*/ if (xmlStrcmp(cur->name, (const xmlChar *) "global-tones")) { fprintf(stderr, "Document of the wrong type, root node != global-tones"); xmlFreeDoc(doc); exit(2); } /*endif*/ cur = cur->xmlChildrenNode; while (cur && xmlIsBlankNode (cur)) cur = cur->next; /*endwhile*/ if (cur == NULL) exit(2); /*endif*/ while (cur) { if (xmlStrcmp(cur->name, (const xmlChar *) "tone-set") == 0) { if ((x = xmlGetProp(cur, (const xmlChar *) "uncode"))) { if (strcmp((char *) x, set_id) == 0) parse_tone_set(desc, doc, ns, cur); } /*endif*/ } /*endif*/ cur = cur->next; } /*endwhile*/ xmlFreeDoc(doc); } /*- End of function --------------------------------------------------------*/ #endif static void super_tone_rx_fill_descriptor(super_tone_rx_descriptor_t *desc) { int tone_id; tone_id = super_tone_rx_add_tone(desc); super_tone_rx_add_element(desc, tone_id, 400, 0, 700, 0); tone_names[tone_id] = "XXX"; tone_id = super_tone_rx_add_tone(desc); super_tone_rx_add_element(desc, tone_id, 1100, 0, 400, 600); super_tone_rx_add_element(desc, tone_id, 0, 0, 2800, 3200); tone_names[tone_id] = "FAX tone"; } /*- End of function --------------------------------------------------------*/ static void wakeup(void *data, int code, int level, int delay) { if (code >= 0) printf("Current tone is %d '%s' '%s'\n", code, (tone_names[code]) ? tone_names[code] : "???", (char *) data); else printf("Tone off '%s'\n", (char *) data); } /*- End of function --------------------------------------------------------*/ static void tone_segment(void *data, int f1, int f2, int duration) { if (f1 < 0) printf("Result %5d silence\n", duration); else if (f2 < 0) printf("Result %5d %4d\n", duration, f1); else printf("Result %5d %4d + %4d\n", duration, f1, f2); } /*- End of function --------------------------------------------------------*/ static int talk_off_tests(super_tone_rx_state_t *super) { int16_t amp[8000]; int sample; int frames; int j; int x; /* Test for voice immunity */ printf("Talk off tests\n"); for (j = 0; bellcore_files[j][0]; j++) { if ((inhandle = sf_open_telephony_read(bellcore_files[j], 1)) == NULL) { printf(" Cannot open audio file '%s'\n", bellcore_files[j]); exit(2); } while ((frames = sf_readf_short(inhandle, amp, 8000))) { for (sample = 0; sample < frames; ) { x = super_tone_rx(super, amp + sample, frames - sample); sample += x; } } if (sf_close_telephony(inhandle)) { printf(" Cannot close speech file '%s'\n", bellcore_files[j]); exit(2); } } return 0; } /*- End of function --------------------------------------------------------*/ static int detection_range_tests(super_tone_rx_state_t *super) { int16_t amp[SAMPLES_PER_CHUNK]; int i; int j; uint32_t phase; int32_t phase_inc; int scale; printf("Detection range tests\n"); super_tone_rx_tone_callback(super, wakeup, (void *) "test"); phase = 0; phase_inc = dds_phase_rate(440.0f); for (level = -80; level < 0; level++) { printf("Testing at %ddBm0\n", level); scale = dds_scaling_dbm0(level); for (j = 0; j < 100; j++) { for (i = 0; i < SAMPLES_PER_CHUNK; i++) amp[i] = (dds(&phase, phase_inc)*scale) >> 15; super_tone_rx(super, amp, SAMPLES_PER_CHUNK); } } return 0; } /*- End of function --------------------------------------------------------*/ static int file_decode_tests(super_tone_rx_state_t *super, const char *file_name) { int16_t amp[8000]; int sample; int frames; int x; awgn_state_t noise_source; printf("File decode tests\n"); super_tone_rx_tone_callback(super, wakeup, (void *) "test"); awgn_init_dbm0(&noise_source, 1234567, -30.0f); printf("Processing file\n"); if ((inhandle = sf_open_telephony_read(file_name, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", file_name); exit(2); } while ((frames = sf_readf_short(inhandle, amp, 8000))) { /* Add some noise to the signal for a more meaningful test. */ //for (sample = 0; sample < frames; sample++) // amp[sample] += saturate(amp[sample] + awgn (&noise_source)); for (sample = 0; sample < frames; ) { x = super_tone_rx(super, amp + sample, frames - sample); sample += x; } } if (sf_close_telephony(inhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", file_name); exit(2); } return 0; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { const char *file_name; super_tone_rx_state_t *super; super_tone_rx_descriptor_t desc; super_tone_rx_make_descriptor(&desc); #if defined(HAVE_LIBXML2) get_tone_set(&desc, "../spandsp/global-tones.xml", (argc > 1) ? argv[1] : "hk"); #endif super_tone_rx_fill_descriptor(&desc); if ((super = super_tone_rx_init(NULL, &desc, wakeup, (void *) "test")) == NULL) { printf(" Failed to create detector.\n"); exit(2); } super_tone_rx_segment_callback(super, tone_segment); detection_range_tests(super); file_name = IN_FILE_NAME; file_decode_tests(super, file_name); talk_off_tests(super); super_tone_rx_free(super); printf("Done\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/bit_operations_tests.c0000664000175000017500000001617011422612266015670 00000000000000/* * SpanDSP - a series of DSP components for telephony * * bit_operations_tests.c * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page bit_operations_tests_page Bit operations tests \section bit_operations_tests_page_sec_1 What does it do? These tests check the operation of efficient bit manipulation routines, by comparing their operation with very dumb brute force versions of the same functionality. \section bit_operations_tests_page_sec_2 How is it used? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include "spandsp.h" uint8_t from[1000000]; uint8_t to[1000000]; static __inline__ int top_bit_dumb(unsigned int data) { int i; if (data == 0) return -1; for (i = 31; i >= 0; i--) { if ((data & (1 << i))) return i; } return -1; } /*- End of function --------------------------------------------------------*/ static __inline__ int bottom_bit_dumb(unsigned int data) { int i; if (data == 0) return -1; for (i = 0; i < 32; i++) { if ((data & (1 << i))) return i; } return -1; } /*- End of function --------------------------------------------------------*/ static __inline__ uint8_t bit_reverse8_dumb(uint8_t data) { int i; int result; result = 0; for (i = 0; i < 8; i++) { result = (result << 1) | (data & 1); data >>= 1; } return result; } /*- End of function --------------------------------------------------------*/ static __inline__ uint32_t bit_reverse_4bytes_dumb(uint32_t data) { int i; uint32_t result; result = 0; for (i = 0; i < 8; i++) { result = (result << 1) | (data & 0x01010101); data >>= 1; } return result; } /*- End of function --------------------------------------------------------*/ static __inline__ uint16_t bit_reverse16_dumb(uint16_t data) { int i; uint16_t result; result = 0; for (i = 0; i < 16; i++) { result = (result << 1) | (data & 1); data >>= 1; } return result; } /*- End of function --------------------------------------------------------*/ static __inline__ uint32_t bit_reverse32_dumb(uint32_t data) { int i; uint32_t result; result = 0; for (i = 0; i < 32; i++) { result = (result << 1) | (data & 1); data >>= 1; } return result; } /*- End of function --------------------------------------------------------*/ static __inline__ int parity8_dumb(uint8_t x) { uint8_t y; int i; for (y = 0, i = 0; i < 8; i++) { y ^= (x & 1); x >>= 1; } return y; } /*- End of function --------------------------------------------------------*/ static __inline__ int one_bits32_dumb(uint32_t x) { int i; int bits; bits = 0; for (i = 0; i < 32; i++) { if (x & 1) bits++; x >>= 1; } return bits; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int i; uint32_t x; uint8_t ax; uint8_t bx; uint16_t ax16; uint16_t bx16; uint32_t ax32; uint32_t bx32; for (i = 0, x = 0; i < 100000; i++) { ax = top_bit_dumb(x); bx = top_bit(x); if (ax != bx) { printf("Test failed: top bit mismatch 0x%" PRIx32 " -> %u %u\n", x, ax, bx); exit(2); } ax = bottom_bit_dumb(x); bx = bottom_bit(x); if (ax != bx) { printf("Test failed: bottom bit mismatch 0x%" PRIx32 " -> %u %u\n", x, ax, bx); exit(2); } x = rand(); } for (i = 0; i < 256; i++) { ax = bit_reverse8_dumb(i); bx = bit_reverse8(i); if (ax != bx) { printf("Test failed: bit reverse 8 - %02x %02x %02x\n", i, ax, bx); exit(2); } } for (i = 0; i < 1000000; i++) from[i] = rand(); bit_reverse(to, from, 1000000); for (i = 0; i < 1000000; i++) { if (bit_reverse8_dumb(from[i]) != to[i]) { printf("Test failed: bit reverse - at %d, %02x %02x %02x\n", i, from[i], bit_reverse8(from[i]), to[i]); exit(2); } } for (i = 0; i < 256; i++) { x = i | (((i + 1) & 0xFF) << 8) | (((i + 2) & 0xFF) << 16) | (((i + 3) & 0xFF) << 24); ax32 = bit_reverse_4bytes_dumb(x); bx32 = bit_reverse_4bytes(x); if (ax32 != bx32) { printf("Test failed: bit reverse 4 bytes - %" PRIx32 " %" PRIx32 " %" PRIx32 "\n", x, ax32, bx32); exit(2); } } for (i = 0; i < 65536; i++) { ax16 = bit_reverse16_dumb(i); bx16 = bit_reverse16(i); if (ax16 != bx16) { printf("Test failed: bit reverse 16 - %x %x %x\n", i, ax16, bx16); exit(2); } } for (i = 0; i < 0x7FFFFF00; i += 127) { ax32 = bit_reverse32_dumb(i); bx32 = bit_reverse32(i); if (ax32 != bx32) { printf("Test failed: bit reverse 32 - %d %" PRIx32 " %" PRIx32 "\n", i, ax32, bx32); exit(2); } } for (i = 0; i < 256; i++) { ax = parity8(i); bx = parity8_dumb(i); if (ax != bx) { printf("Test failed: parity 8 - %x %x %x\n", i, ax, bx); exit(2); } } for (i = -1; i < 32; i++) { ax32 = most_significant_one32(1 << i); if (ax32 != (1 << i)) { printf("Test failed: most significant one 32 - %x %" PRIx32 " %x\n", i, ax32, (1 << i)); exit(2); } ax32 = least_significant_one32(1 << i); if (ax32 != (1 << i)) { printf("Test failed: least significant one 32 - %x %" PRIx32 " %x\n", i, ax32, (1 << i)); exit(2); } } for (i = 0x80000000; i < 0x800FFFFF; i++) { ax = one_bits32_dumb(i); bx = one_bits32(i); if (ax != bx) { printf("Test failed: one bits - %d, %x %x\n", i, ax, bx); exit(2); } } printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/tone_detect_tests.c0000664000175000017500000001054611422612267015146 00000000000000/* * SpanDSP - a series of DSP components for telephony * * tone_detect_tests.c * * Written by Steve Underwood * * Copyright (C) 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page tone_detect_tests_page Tone detection tests \section tone_detect_tests_page_sec_1 What does it do? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #define DEC_SAMPLE_RATE 800 #define DEC_RATIO 10 #define BLOCK_LEN 56 #define PG_WINDOW 56 #define FREQ1 440.0f #define FREQ2 480.0f static int periodogram_tests(void) { int i; int j; int k; int len; complexf_t coeffs[PG_WINDOW/2]; complexf_t camp[BLOCK_LEN]; complexf_t last_result; complexf_t result; complexf_t phase_offset; float freq_error; float pg_scale; float level; float scale1; float scale2; int32_t phase_rate1; int32_t phase_rate2; uint32_t phase_acc1; uint32_t phase_acc2; awgn_state_t noise_source_re; awgn_state_t noise_source_im; phase_rate1 = DEC_RATIO*dds_phase_ratef(FREQ1 - 5.0f); phase_rate2 = DEC_RATIO*dds_phase_ratef(FREQ2); phase_acc1 = 0; phase_acc2 = 0; len = periodogram_generate_coeffs(coeffs, FREQ1, DEC_SAMPLE_RATE, PG_WINDOW); if (len != PG_WINDOW/2) { printf("Test failed\n"); return -1; } pg_scale = periodogram_generate_phase_offset(&phase_offset, FREQ1, DEC_SAMPLE_RATE, PG_WINDOW); scale1 = dds_scaling_dbm0f(-6.0f); scale2 = dds_scaling_dbm0f(-6.0f); for (k = -50; k < 0; k++) { printf("Setting noise to %ddBm0\n", k); awgn_init_dbm0(&noise_source_re, 1234567, (float) k); awgn_init_dbm0(&noise_source_im, 7654321, (float) k); last_result = complex_setf(0.0f, 0.0f); for (i = 0; i < 100; i++) { for (j = 0; j < PG_WINDOW; j++) { result = dds_complexf(&phase_acc1, phase_rate1); camp[j].re = result.re*scale1; camp[j].im = result.im*scale1; result = dds_complexf(&phase_acc2, phase_rate2); camp[j].re += result.re*scale2; camp[j].im += result.im*scale2; camp[j].re += awgn(&noise_source_re); camp[j].im += awgn(&noise_source_im); } result = periodogram(coeffs, camp, PG_WINDOW); level = sqrtf(result.re*result.re + result.im*result.im); freq_error = periodogram_freq_error(&phase_offset, pg_scale, &last_result, &result); last_result = result; if (i == 0) continue; printf("Signal level = %.5f, freq error = %.5f\n", level, freq_error); if (level < scale1*0.8f || level > scale1*1.2f) { printf("Test failed - %ddBm0 of noise, signal is %f (%f)\n", k, level, scale1); return -1; } if (freq_error < -10.0f || freq_error > 10.0f) { printf("Test failed - %ddBm0 of noise, %fHz error\n", k, freq_error); return -1; } } } return 0; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { if (periodogram_tests()) exit(2); printf("Tests passed\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/saturated_tests.c0000664000175000017500000002024611422612267014643 00000000000000/* * SpanDSP - a series of DSP components for telephony * * saturated_tests.c * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page saturated_tests_page Saturated arithmetic function tests \section saturated_tests_page_sec_1 What does it do? ???. \section saturated_tests_page_sec_2 How does it work? ???. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES #include "spandsp.h" int main(int argc, char *argv[]) { printf("Testing 16 bit saturation\n"); if (saturate16(10000) != 10000 || saturate16(-10000) != -10000 || saturate16(32767) != 32767 || saturate16(-32768) != -32768 || saturate16(32768) != 32767 || saturate16(-32769) != -32768) { printf("Test failed.\n"); exit(2); } printf("Testing 15 bit saturation\n"); if (saturate15(10000) != 10000 || saturate15(-10000) != -10000 || saturate15(16383) != 16383 || saturate15(-16384) != -16384 || saturate15(16384) != 16383 || saturate15(-16385) != -16384) { printf("Test failed.\n"); exit(2); } printf("Testing 16 bit unsigned saturation\n"); if (saturateu16(10000) != 10000 || saturateu16(32767) != 32767 || saturateu16(65535) != 65535 || saturateu16(65536) != 65535) { printf("Test failed.\n"); exit(2); } printf("Testing 8 bit unsigned saturation\n"); if (saturateu8(100) != 100 || saturateu8(127) != 127 || saturateu8(255) != 255 || saturateu8(256) != 255) { printf("Test failed.\n"); exit(2); } printf("Testing 16 bit saturation from float\n"); if (fsaturatef(10000.0f) != 10000 || fsaturatef(-10000.0f) != -10000 || fsaturatef(32767.0f) != 32767 || fsaturatef(-32768.0f) != -32768 || fsaturatef(32768.0f) != 32767 || fsaturatef(-32769.0f) != -32768) { printf("Test failed.\n"); exit(2); } printf("Testing 16 bit saturation from double\n"); if (fsaturate(10000.0) != 10000 || fsaturate(-10000.0) != -10000 || fsaturate(32767.0) != 32767 || fsaturate(-32768.0) != -32768 || fsaturate(32768.0) != 32767 || fsaturate(-32769.0) != -32768) { printf("Test failed.\n"); exit(2); } printf("Testing 16 bit fast saturation from float\n"); if (ffastsaturatef(10000.0f) != 10000 || ffastsaturatef(-10000.0f) != -10000 || ffastsaturatef(32767.0f) != 32767 || ffastsaturatef(-32768.0f) != -32768 || ffastsaturatef(32768.0f) != 32767 || ffastsaturatef(-32769.0f) != -32768) { printf("Test failed.\n"); exit(2); } printf("Testing 16 bit fast saturation from double\n"); if (ffastsaturate(10000.0) != 10000 || ffastsaturate(-10000.0) != -10000 || ffastsaturate(32767.0) != 32767 || ffastsaturate(-32768.0) != -32768 || ffastsaturate(32768.0) != 32767 || ffastsaturate(-32769.0) != -32768) { printf("Test failed.\n"); exit(2); } printf("Testing 16 bit float saturation from float\n"); if (ffsaturatef(10000.0f) != 10000.0f || ffsaturatef(-10000.0f) != -10000.0f || ffsaturatef(32767.0f) != 32767.0f || ffsaturatef(-32768.0f) != -32768.0f || ffsaturatef(32768.0f) != 32767.0f || ffsaturatef(-32769.0f) != -32768.0f) { printf("Test failed.\n"); exit(2); } printf("Testing 16 bit double saturation from double\n"); if (ffsaturate(10000.0) != 10000.0 || ffsaturate(-10000.0) != -10000.0 || ffsaturate(32767.0) != 32767.0 || ffsaturate(-32768.0) != -32768.0 || ffsaturate(32768.0) != 32767.0 || ffsaturate(-32769.0) != -32768.0) { printf("Test failed.\n"); exit(2); } printf("Testing 16 bit add\n"); if (saturated_add16(10000, 10000) != 20000 || saturated_add16(10000, -10000) != 0 || saturated_add16(-10000, 10000) != 0 || saturated_add16(-10000, -10000) != -20000 || saturated_add16(-30000, -30000) != INT16_MIN || saturated_add16(30000, 30000) != INT16_MAX) { printf("Test failed.\n"); exit(2); } printf("Testing 32 bit add\n"); if (saturated_add32(10000, 10000) != 20000 || saturated_add32(10000, -10000) != 0 || saturated_add32(-10000, 10000) != 0 || saturated_add32(-10000, -10000) != -20000 || saturated_add32(-2000000000, -2000000000) != INT32_MIN || saturated_add32(2000000000, 2000000000) != INT32_MAX) { printf("Test failed.\n"); exit(2); } printf("Testing 16 bit subtract\n"); if (saturated_sub16(10000, 10000) != 0 || saturated_sub16(10000, -10000) != 20000 || saturated_sub16(-10000, 10000) != -20000 || saturated_sub16(-10000, -10000) != 0 || saturated_sub16(-30000, 30000) != INT16_MIN || saturated_sub16(30000, -30000) != INT16_MAX) { printf("Test failed.\n"); exit(2); } printf("Testing 32 bit subtract\n"); if (saturated_sub32(10000, 10000) != 0 || saturated_sub32(10000, -10000) != 20000 || saturated_sub32(-10000, 10000) != -20000 || saturated_sub32(-10000, -10000) != 0 || saturated_sub32(-2000000000, 2000000000) != INT32_MIN || saturated_sub32(2000000000, -2000000000) != INT32_MAX) { printf("Test failed.\n"); exit(2); } printf("Testing 16 x 16 => 16 bit multiply\n"); if (saturated_mul16(100, 100) != 0 || saturated_mul16(255, 255) != 1 || saturated_mul16(32767, -32768) != -32767 || saturated_mul16(-32768, 32767) != -32767 || saturated_mul16(32767, 32767) != 32766 || saturated_mul16(-32768, -32768) != 32767) { printf("Test failed.\n"); exit(2); } printf("Testing 16 x 16 => 32 bit multiply\n"); if (saturated_mul16_32(100, 100) != 20000 || saturated_mul16_32(-100, 100) != -20000 || saturated_mul16_32(32767, -32768) != -2147418112 || saturated_mul16_32(-32768, 32767) != -2147418112 || saturated_mul16_32(32767, 32767) != 2147352578 || saturated_mul16_32(-32768, -32768) != -2147483648) { printf("Test failed.\n"); exit(2); } printf("Testing 16 bit absolute\n"); if (saturated_abs16(10000) != 10000 || saturated_abs16(-10000) != 10000 || saturated_abs16(32767) != 32767 || saturated_abs16(-32768) != 32767) { printf("Test failed.\n"); exit(2); } printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/media_monitor.h0000664000175000017500000000336411422612267014262 00000000000000/* * SpanDSP - a series of DSP components for telephony * * media_monitor.h - Display IP streaming media status, using the FLTK toolkit. * * Written by Steve Underwood * * Copyright (C) 2007 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page media_monitor_page IP streaming media performance monitoring \section media_monitor_page_sec_1 What does it do? This code controls a GUI window, which provides monitoring of the status of an IP media stream. It shows, graphically: \section media_monitor_page_sec_2 How does it work? This code uses the FLTK cross platform GUI toolkit. It works on X11 and Windows platforms. In addition to the basic FLTK toolkit, fltk_cartesian is also required. */ #if !defined(_MEDIA_MONITOR_H_) #define _MEDIA_MONITOR_H_ #if defined(__cplusplus) extern "C" { #endif int start_media_monitor(void); void media_monitor_rx(int seq_no, double departure_time, double arrival_time); void media_monitor_wait_to_end(void); void media_monitor_update_display(void); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/schedule_tests.c0000664000175000017500000000620112101216025014421 00000000000000/* * SpanDSP - a series of DSP components for telephony * * schedule_tests.c * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page schedule_tests_page Event scheduler tests \section schedule_tests_page_sec_1 What does it do? ???. \section schedule_tests_page_sec_2 How does it work? ???. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES #include "spandsp.h" uint64_t when1; uint64_t when2; static void callback1(span_sched_state_t *s, void *user_data) { int id; uint64_t when; when = span_schedule_time(s); printf("1: Callback at %f %" PRId64 "\n", (float) when/1000000.0, when - when1); if ((when - when1)) { printf("Callback occured at the wrong time.\n"); exit(2); } id = span_schedule_event(s, 500000, callback1, NULL); when1 = when + 500000; when = span_schedule_next(s); printf("1: Event %d, earliest is %" PRId64 "\n", id, when); } static void callback2(span_sched_state_t *s, void *user_data) { int id; uint64_t when; when = span_schedule_time(s); printf("2: Callback at %f %" PRId64 "\n", (float) when/1000000.0, when - when2); id = span_schedule_event(s, 550000, callback2, NULL); if ((when - when2) != 10000) { printf("Callback occured at the wrong time.\n"); exit(2); } when2 = when + 550000; when = span_schedule_next(s); printf("2: Event %d, earliest is %" PRId64 "\n", id, when); } int main(int argc, char *argv[]) { int i; span_sched_state_t sched; uint64_t when; span_schedule_init(&sched); span_schedule_event(&sched, 500000, callback1, NULL); span_schedule_event(&sched, 550000, callback2, NULL); when1 = span_schedule_time(&sched) + 500000; when2 = span_schedule_time(&sched) + 550000; //span_schedule_del(&sched, id); for (i = 0; i < 100000000; i += 20000) span_schedule_update(&sched, 20000); when = span_schedule_time(&sched); if ((when1 - when) < 0 || (when1 - when) > 500000 || (when2 - when) < 0 || (when2 - when) > 550000) { printf("Callback failed to occur.\n"); exit(2); } span_schedule_release(&sched); printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/r2_mf_tx_tests.c0000664000175000017500000000624112101216156014356 00000000000000/* * SpanDSP - a series of DSP components for telephony * * r2_mf_tx_tests.c - Test the Bell MF generator. * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page r2_mf_tx_tests_page R2 MF generation tests \section r2_mf_tx_tests_page_sec_1 What does it do? ???. \section r2_mf_tx_tests_page_sec_2 How does it work? ???. */ /* Enable the following definition to enable direct probing into the FAX structures */ //#define WITH_SPANDSP_INTERNALS #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define OUTPUT_FILE_NAME "r2_mf.wav" int main(int argc, char *argv[]) { r2_mf_tx_state_t gen; int16_t amp[1000]; int len; SNDFILE *outhandle; int digit; const char *digits = "0123456789BCDEF"; if ((outhandle = sf_open_telephony_write(OUTPUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } r2_mf_tx_init(&gen, FALSE); for (digit = 0; digits[digit]; digit++) { r2_mf_tx_put(&gen, digits[digit]); len = r2_mf_tx(&gen, amp, 1000); printf("Generated %d samples of %c\n", len, digits[digit]); if (len > 0) sf_writef_short(outhandle, amp, len); r2_mf_tx_put(&gen, 0); len = r2_mf_tx(&gen, amp, 1000); printf("Generated %d samples\n", len); if (len > 0) sf_writef_short(outhandle, amp, len); } r2_mf_tx_init(&gen, TRUE); for (digit = 0; digits[digit]; digit++) { r2_mf_tx_put(&gen, digits[digit]); len = r2_mf_tx(&gen, amp, 1000); printf("Generated %d samples of %c\n", len, digits[digit]); if (len > 0) sf_writef_short(outhandle, amp, len); r2_mf_tx_put(&gen, 0); len = r2_mf_tx(&gen, amp, 1000); printf("Generated %d samples\n", len); if (len > 0) sf_writef_short(outhandle, amp, len); } if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME); exit (2); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/ima_adpcm_tests.c0000664000175000017500000001442112101216345014547 00000000000000/* * SpanDSP - a series of DSP components for telephony * * ima_adpcm_tests.c - Test the IMA/DVI/Intel ADPCM encode and decode * software. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page ima_adpcm_tests_page IMA ADPCM tests \section ima_adpcm_tests_page_sec_1 What does it do? To perform a general audio quality test, ima_adpcm_tests should be run. The test file ../test-data/local/short_nb_voice.wav will be compressed to the specified bit rate, decompressed, and the resulting audio stored in post_ima_adpcm.wav. A simple SNR test is automatically performed. Listening tests may be used for a more detailed evaluation of the degradation in quality caused by the compression. \section ima_adpcm_tests_page_sec_2 How is it used? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define IN_FILE_NAME "../test-data/local/short_nb_voice.wav" #define OUT_FILE_NAME "post_ima_adpcm.wav" #define HIST_LEN 2000 int main(int argc, char *argv[]) { int i; SNDFILE *inhandle; SNDFILE *outhandle; int frames; int dec_frames; int ima_bytes; double pre_energy; double post_energy; double diff_energy; int16_t pre_amp[HIST_LEN]; int16_t post_amp[HIST_LEN]; uint8_t ima_data[HIST_LEN]; int16_t history[HIST_LEN]; int hist_in; int hist_out; ima_adpcm_state_t *ima_enc_state; ima_adpcm_state_t *ima_dec_state; int xx; int total_pre_samples; int total_compressed_bytes; int total_post_samples; const char *in_file_name; int variant; int chunk_size; int enc_chunk_size; int log_encoded_data; int opt; variant = IMA_ADPCM_DVI4; in_file_name = IN_FILE_NAME; chunk_size = 160; enc_chunk_size = 0; log_encoded_data = FALSE; while ((opt = getopt(argc, argv, "ac:i:lv")) != -1) { switch (opt) { case 'a': variant = IMA_ADPCM_IMA4; chunk_size = 505; break; case 'c': enc_chunk_size = atoi(optarg); break; case 'i': in_file_name = optarg; break; case 'l': log_encoded_data = TRUE; break; case 'v': variant = IMA_ADPCM_VDVI; break; default: //usage(); exit(2); break; } } if ((inhandle = sf_open_telephony_read(in_file_name, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", in_file_name); exit(2); } if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME, 1)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME); exit(2); } if ((ima_enc_state = ima_adpcm_init(NULL, variant, enc_chunk_size)) == NULL) { fprintf(stderr, " Cannot create encoder\n"); exit(2); } if ((ima_dec_state = ima_adpcm_init(NULL, variant, enc_chunk_size)) == NULL) { fprintf(stderr, " Cannot create decoder\n"); exit(2); } hist_in = 0; hist_out = 0; pre_energy = 0.0; post_energy = 0.0; diff_energy = 0.0; total_pre_samples = 0; total_compressed_bytes = 0; total_post_samples = 0; while ((frames = sf_readf_short(inhandle, pre_amp, chunk_size))) { total_pre_samples += frames; ima_bytes = ima_adpcm_encode(ima_enc_state, ima_data, pre_amp, frames); if (log_encoded_data) write(1, ima_data, ima_bytes); total_compressed_bytes += ima_bytes; dec_frames = ima_adpcm_decode(ima_dec_state, post_amp, ima_data, ima_bytes); total_post_samples += dec_frames; for (i = 0; i < frames; i++) { history[hist_in++] = pre_amp[i]; if (hist_in >= HIST_LEN) hist_in = 0; pre_energy += (double) pre_amp[i] * (double) pre_amp[i]; } for (i = 0; i < dec_frames; i++) { post_energy += (double) post_amp[i] * (double) post_amp[i]; xx = post_amp[i] - history[hist_out++]; if (hist_out >= HIST_LEN) hist_out = 0; diff_energy += (double) xx * (double) xx; } sf_writef_short(outhandle, post_amp, dec_frames); } if (sf_close_telephony(inhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", in_file_name); exit(2); } if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME); exit(2); } ima_adpcm_release(ima_enc_state); ima_adpcm_release(ima_dec_state); printf("Pre samples: %d\n", total_pre_samples); printf("Compressed bytes: %d\n", total_compressed_bytes); printf("Post samples: %d\n", total_post_samples); printf("Output energy is %f%% of input energy.\n", 100.0*post_energy/pre_energy); printf("Residual energy is %f%% of the total.\n", 100.0*diff_energy/post_energy); if (fabs(1.0 - post_energy/pre_energy) > 0.05 || fabs(diff_energy/post_energy) > 0.03) { printf("Tests failed.\n"); exit(2); } printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/g722_tests.c0000664000175000017500000005202412101216521013313 00000000000000/* * SpanDSP - a series of DSP components for telephony * * g722_tests.c - Test G.722 encode and decode. * * Written by Steve Underwood * * Copyright (C) 2005 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page g722_tests_page G.722 tests \section g722_tests_page_sec_1 What does it do? This modules implements two sets of tests: - The tests defined in the G.722 specification, using the test data files supplied with the specification. - A generally audio quality test, consisting of compressing and decompressing a speeech file for audible comparison. The speech file should be recorded at 16 bits/sample, 16000 samples/second, and named "pre_g722.wav". The ITU tests use the codec in a special mode, in which the QMFs, which split and recombine the sub-bands, are disabled. This means they do not test 100% of the codec. This is the reason for including the additional listening test. \section g722_tests_page_sec_2 How is it used? To perform the tests in the G.722 specification you need to obtain the test data files from the specification. These are copyright material, and so cannot be distributed with this test software. The files, containing test vectors, which are supplied with the G.722 specification, should be copied to itutests/g722. The ITU tests can then be run by executing g722_tests without any parameters. To perform a general audio quality test, g722_tests should be run with a parameter specifying the required bit rate for compression. The valid parameters are "-48", "-56", and "-64". The file ../test-data/local/short_wb_voice.wav will be compressed to the specified bit rate, decompressed, and the resulting audio stored in post_g722.wav. */ /* Enable the following definition to enable direct probing into the FAX structures */ //#define WITH_SPANDSP_INTERNALS #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #include "spandsp.h" #if 1 //defined(WITH_SPANDSP_INTERNALS) #include "spandsp/private/g722.h" #endif #define G722_SAMPLE_RATE 16000 #define BLOCK_LEN 320 #define MAX_TEST_VECTOR_LEN 40000 #define TESTDATA_DIR "../test-data/itu/g722/" #define EIGHTK_IN_FILE_NAME "../test-data/local/short_nb_voice.wav" #define IN_FILE_NAME "../test-data/local/short_wb_voice.wav" #define ENCODED_FILE_NAME "g722.g722" #define OUT_FILE_NAME "post_g722.wav" #if 0 static const char *itu_test_files[] = { TESTDATA_DIR "T1C1.XMT", /* 69973 bytes */ TESTDATA_DIR "T1C2.XMT", /* 3605 bytes */ TESTDATA_DIR "T1D3.COD", /* 69973 bytes */ TESTDATA_DIR "T2R1.COD", /* 69973 bytes */ TESTDATA_DIR "T2R2.COD", /* 3605 bytes */ TESTDATA_DIR "T3L1.RC1", /* 69973 bytes */ TESTDATA_DIR "T3L1.RC2", /* 69973 bytes */ TESTDATA_DIR "T3L1.RC3", /* 69973 bytes */ TESTDATA_DIR "T3H1.RC0", /* 69973 bytes */ TESTDATA_DIR "T3L2.RC1", /* 3605 bytes */ TESTDATA_DIR "T3L2.RC2", /* 3605 bytes */ TESTDATA_DIR "T3L2.RC3", /* 3605 bytes */ TESTDATA_DIR "T3H2.RC0", /* 3605 bytes */ TESTDATA_DIR "T3L3.RC1", /* 69973 bytes */ TESTDATA_DIR "T3L3.RC2", /* 69973 bytes */ TESTDATA_DIR "T3L3.RC3", /* 69973 bytes */ TESTDATA_DIR "T3H3.RC0" /* 69973 bytes */ }; #endif static const char *encode_test_files[] = { TESTDATA_DIR "T1C1.XMT", TESTDATA_DIR "T2R1.COD", TESTDATA_DIR "T1C2.XMT", TESTDATA_DIR "T2R2.COD", NULL }; static const char *decode_test_files[] = { TESTDATA_DIR "T2R1.COD", TESTDATA_DIR "T3L1.RC1", TESTDATA_DIR "T3L1.RC2", TESTDATA_DIR "T3L1.RC3", TESTDATA_DIR "T3H1.RC0", TESTDATA_DIR "T2R2.COD", TESTDATA_DIR "T3L2.RC1", TESTDATA_DIR "T3L2.RC2", TESTDATA_DIR "T3L2.RC3", TESTDATA_DIR "T3H2.RC0", TESTDATA_DIR "T1D3.COD", TESTDATA_DIR "T3L3.RC1", TESTDATA_DIR "T3L3.RC2", TESTDATA_DIR "T3L3.RC3", TESTDATA_DIR "T3H3.RC0", NULL }; int16_t itu_data[MAX_TEST_VECTOR_LEN]; uint16_t itu_ref[MAX_TEST_VECTOR_LEN]; uint16_t itu_ref_upper[MAX_TEST_VECTOR_LEN]; uint8_t compressed[MAX_TEST_VECTOR_LEN]; int16_t decompressed[MAX_TEST_VECTOR_LEN]; static int hex_get(char *s) { int i; int value; int x; for (value = i = 0; i < 4; i++) { x = *s++ - 0x30; if (x > 9) x -= 0x07; if (x > 15) x -= 0x20; if (x < 0 || x > 15) return -1; value <<= 4; value |= x; } return value; } /*- End of function --------------------------------------------------------*/ static int get_vector(FILE *file, uint16_t vec[]) { char buf[132 + 1]; char *s; int i; int value; while (fgets(buf, 133, file)) { if (buf[0] == '/' && buf[1] == '*') continue; s = buf; i = 0; while ((value = hex_get(s)) >= 0) { vec[i++] = value; s += 4; } return i; } return 0; } /*- End of function --------------------------------------------------------*/ static int get_test_vector(const char *file, uint16_t buf[], int max_len) { int octets; int i; FILE *infile; if ((infile = fopen(file, "r")) == NULL) { fprintf(stderr, " Failed to open '%s'\n", file); exit(2); } octets = 0; while ((i = get_vector(infile, buf + octets)) > 0) octets += i; fclose(infile); return octets; } /*- End of function --------------------------------------------------------*/ static void itu_compliance_tests(void) { g722_encode_state_t enc_state; g722_decode_state_t dec_state; int i; int j; int k; int len_comp; int len_comp_lower; int len_comp_upper; int len_data; int len; int len2; int mode; int file; #if 1 /* ITU G.722 encode tests, using configuration 1. The QMF is bypassed */ for (file = 0; encode_test_files[file]; file += 2) { printf("Testing %s -> %s\n", encode_test_files[file], encode_test_files[file + 1]); /* Get the input data */ len_data = get_test_vector(encode_test_files[file], (uint16_t *) itu_data, MAX_TEST_VECTOR_LEN); /* Get the reference output data */ len_comp = get_test_vector(encode_test_files[file + 1], itu_ref, MAX_TEST_VECTOR_LEN); if (len_data != len_comp) { printf("Test data length mismatch\n"); exit(2); } /* Process the input data */ /* Skip the reset stuff at each end of the data */ for (i = 0; i < len_data; i++) { if ((itu_data[i] & 1) == 0) break; } for (j = i; j < len_data; j++) { if ((itu_data[j] & 1)) break; } len = j - i; g722_encode_init(&enc_state, 64000, 0); enc_state.itu_test_mode = TRUE; len2 = g722_encode(&enc_state, compressed, itu_data + i, len); /* Check the result against the ITU's reference output data */ j = 0; for (k = 0; k < len2; k++) { if ((compressed[k] & 0xFF) != ((itu_ref[k + i] >> 8) & 0xFF)) { printf(">>> %6d %4x %4x\n", k, compressed[k] & 0xFF, itu_ref[k + i] & 0xFFFF); j++; } } printf("%d bad samples, out of %d/%d samples\n", j, len, len_data); if (j) { printf("Test failed\n"); exit(2); } printf("Test passed\n"); } #endif #if 1 /* ITU G.722 decode tests, using configuration 2. The QMF is bypassed */ /* Run each of the tests for each of the modes - 48kbps, 56kbps and 64kbps. */ for (mode = 1; mode <= 3; mode++) { for (file = 0; decode_test_files[file]; file += 5) { printf("Testing mode %d, %s -> %s + %s\n", mode, decode_test_files[file], decode_test_files[file + mode], decode_test_files[file + 4]); /* Get the input data */ len_data = get_test_vector(decode_test_files[file], (uint16_t *) itu_data, MAX_TEST_VECTOR_LEN); /* Get the lower reference output data */ len_comp_lower = get_test_vector(decode_test_files[file + mode], itu_ref, MAX_TEST_VECTOR_LEN); /* Get the upper reference output data */ len_comp_upper = get_test_vector(decode_test_files[file + 4], itu_ref_upper, MAX_TEST_VECTOR_LEN); if (len_data != len_comp_lower || len_data != len_comp_upper) { printf("Test data length mismatch\n"); exit(2); } /* Process the input data */ /* Skip the reset stuff at each end of the data */ for (i = 0; i < len_data; i++) { if ((itu_data[i] & 1) == 0) break; } for (j = i; j < len_data; j++) { if ((itu_data[j] & 1)) break; } len = j - i; for (k = 0; k < len; k++) compressed[k] = itu_data[k + i] >> ((mode == 3) ? 10 : (mode == 2) ? 9 : 8); g722_decode_init(&dec_state, (mode == 3) ? 48000 : (mode == 2) ? 56000 : 64000, 0); dec_state.itu_test_mode = TRUE; len2 = g722_decode(&dec_state, decompressed, compressed, len); /* Check the result against the ITU's reference output data */ j = 0; for (k = 0; k < len2; k += 2) { if ((decompressed[k] & 0xFFFF) != (itu_ref[(k >> 1) + i] & 0xFFFF) || (decompressed[k + 1] & 0xFFFF) != (itu_ref_upper[(k >> 1) + i] & 0xFFFF)) { printf(">>> %6d %4x %4x %4x %4x\n", k >> 1, decompressed[k] & 0xFFFF, decompressed[k + 1] & 0xFFFF, itu_ref[(k >> 1) + i] & 0xFFFF, itu_ref_upper[(k >> 1) + i] & 0xFFFF); j++; } } printf("%d bad samples, out of %d/%d samples\n", j, len, len_data); if (j) { printf("Test failed\n"); exit(2); } printf("Test passed\n"); } } #endif printf("Tests passed.\n"); } /*- End of function --------------------------------------------------------*/ static void signal_to_distortion_tests(void) { g722_encode_state_t enc_state; g722_decode_state_t dec_state; swept_tone_state_t *swept; power_meter_t in_meter; power_meter_t out_meter; int16_t original[1024]; uint8_t compressed[1024]; int16_t decompressed[1024]; int len; int len2; int len3; int i; int32_t in_level; int32_t out_level; /* Test a back to back encoder/decoder pair to ensure we comply with Figure 11/G.722 to Figure 16/G.722, Figure A.1/G.722, and Figure A.2/G.722 */ g722_encode_init(&enc_state, 64000, 0); g722_decode_init(&dec_state, 64000, 0); power_meter_init(&in_meter, 7); power_meter_init(&out_meter, 7); /* First some silence */ len = 1024; memset(original, 0, len*sizeof(original[0])); for (i = 0; i < len; i++) in_level = power_meter_update(&in_meter, original[i]); len2 = g722_encode(&enc_state, compressed, original, len); len3 = g722_decode(&dec_state, decompressed, compressed, len2); out_level = 0; for (i = 0; i < len3; i++) out_level = power_meter_update(&out_meter, decompressed[i]); printf("Silence produces %d at the output\n", out_level); /* Now a swept tone test */ swept = swept_tone_init(NULL, 25.0f, 3500.0f, -10.0f, 60*16000, FALSE); do { len = swept_tone(swept, original, 1024); for (i = 0; i < len; i++) in_level = power_meter_update(&in_meter, original[i]); len2 = g722_encode(&enc_state, compressed, original, len); len3 = g722_decode(&dec_state, decompressed, compressed, len2); for (i = 0; i < len3; i++) out_level = power_meter_update(&out_meter, decompressed[i]); printf("%10d, %10d, %f\n", in_level, out_level, (float) out_level/in_level); } while (len > 0); } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { g722_encode_state_t enc_state; g722_decode_state_t dec_state; int len2; int len3; int i; int file; SNDFILE *inhandle; SNDFILE *outhandle; SF_INFO info; int outframes; int samples; int opt; int itutests; int bit_rate; int eight_k_in; int eight_k_out; int encode; int decode; int tone_test; const char *in_file; const char *out_file; int16_t indata[BLOCK_LEN]; int16_t outdata[BLOCK_LEN]; uint8_t adpcmdata[BLOCK_LEN]; float tone_level; uint32_t tone_phase; int32_t tone_phase_rate; bit_rate = 64000; eight_k_in = FALSE; eight_k_out = FALSE; itutests = TRUE; encode = FALSE; decode = FALSE; tone_test = FALSE; in_file = NULL; out_file = NULL; while ((opt = getopt(argc, argv, "b:d:e:i:l:o:t")) != -1) { switch (opt) { case 'b': bit_rate = atoi(optarg); if (bit_rate != 48000 && bit_rate != 56000 && bit_rate != 64000) { fprintf(stderr, "Invalid bit rate selected. Only 48000, 56000 and 64000 are valid.\n"); exit(2); } itutests = FALSE; break; case 'd': in_file = optarg; decode = TRUE; itutests = FALSE; break; case 'e': in_file = optarg; encode = TRUE; itutests = FALSE; break; case 'i': i = atoi(optarg); if (i != 8000 && i != 16000) { fprintf(stderr, "Invalid incoming sample rate. Only 8000 and 16000 are valid.\n"); exit(2); } eight_k_in = (i == 8000); if (eight_k_in) in_file = EIGHTK_IN_FILE_NAME; break; case 'l': out_file = optarg; break; case 'o': i = atoi(optarg); if (i != 8000 && i != 16000) { fprintf(stderr, "Invalid outgoing sample rate. Only 8000 and 16000 are valid.\n"); exit(2); } eight_k_out = (i == 8000); break; case 't': tone_test = TRUE; itutests = FALSE; break; default: //usage(); exit(2); } } if (itutests) { itu_compliance_tests(); signal_to_distortion_tests(); } else { tone_level = dds_scaling_dbm0f(2.5f); tone_phase = 0; tone_phase_rate = dds_phase_ratef(1500.0f/2.0f); if (!decode && !encode) { decode = encode = TRUE; } if (in_file == NULL) { if (encode) { if (eight_k_in) in_file = EIGHTK_IN_FILE_NAME; else in_file = IN_FILE_NAME; } else { in_file = ENCODED_FILE_NAME; } } if (out_file == NULL) { out_file = (decode) ? OUT_FILE_NAME : ENCODED_FILE_NAME; } inhandle = NULL; outhandle = NULL; file = -1; if (encode) { if (eight_k_in) { if ((inhandle = sf_open(in_file, SFM_READ, &info)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", in_file); exit(2); } if (info.samplerate != SAMPLE_RATE) { fprintf(stderr, " Unexpected sample rate %d in audio file '%s'\n", info.samplerate, in_file); exit(2); } if (info.channels != 1) { fprintf(stderr, " Unexpected number of channels in audio file '%s'\n", in_file); exit(2); } } else { if ((inhandle = sf_open(in_file, SFM_READ, &info)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", in_file); exit(2); } if (info.samplerate != G722_SAMPLE_RATE) { fprintf(stderr, " Unexpected sample rate %d in audio file '%s'\n", info.samplerate, in_file); exit(2); } if (info.channels != 1) { fprintf(stderr, " Unexpected number of channels in audio file '%s'\n", in_file); exit(2); } } if (eight_k_in) g722_encode_init(&enc_state, bit_rate, G722_PACKED | G722_SAMPLE_RATE_8000); else g722_encode_init(&enc_state, bit_rate, G722_PACKED); } else { if ((file = open(in_file, O_RDONLY)) < 0) { fprintf(stderr, " Failed to open '%s'\n", in_file); exit(2); } } if (decode) { memset(&info, 0, sizeof(info)); info.frames = 0; info.samplerate = (eight_k_out) ? SAMPLE_RATE : G722_SAMPLE_RATE; info.channels = 1; info.format = SF_FORMAT_WAV | SF_FORMAT_PCM_16; info.sections = 1; info.seekable = 1; if ((outhandle = sf_open(out_file, SFM_WRITE, &info)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", out_file); exit(2); } if (eight_k_out) g722_decode_init(&dec_state, bit_rate, G722_PACKED | G722_SAMPLE_RATE_8000); else g722_decode_init(&dec_state, bit_rate, G722_PACKED); } else { if ((file = open(out_file, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) { fprintf(stderr, " Failed to open '%s'\n", out_file); exit(2); } } for (;;) { if (encode) { samples = sf_readf_short(inhandle, indata, BLOCK_LEN); if (samples <= 0) break; if (tone_test) { for (i = 0; i < samples; i++) indata[i] = dds_modf(&tone_phase, tone_phase_rate, tone_level, 0); } len2 = g722_encode(&enc_state, adpcmdata, indata, samples); } else { len2 = read(file, adpcmdata, BLOCK_LEN); if (len2 <= 0) break; } if (decode) { len3 = g722_decode(&dec_state, outdata, adpcmdata, len2); outframes = sf_writef_short(outhandle, outdata, len3); if (outframes != len3) { fprintf(stderr, " Error writing audio file\n"); exit(2); } } else { len3 = write(file, adpcmdata, len2); if (len3 <= 0) break; } } if (encode) { if (sf_close(inhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", IN_FILE_NAME); exit(2); } } else { close(file); } if (decode) { if (sf_close(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME); exit(2); } } else { close(file); } printf("'%s' translated to '%s' at %dbps.\n", in_file, out_file, bit_rate); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/msvc/0000775000175000017500000000000012357123347012311 500000000000000spandsp-0.0.6/tests/msvc/v8_tests.vcproj0000664000175000017500000001045211175014343015227 00000000000000 spandsp-0.0.6/tests/msvc/t38_terminal_tests.vcproj0000664000175000017500000001010011175003227017170 00000000000000 spandsp-0.0.6/tests/msvc/complex_vector_int_tests.vcproj0000664000175000017500000001053211175014343020574 00000000000000 spandsp-0.0.6/tests/msvc/queue_tests.vcproj0000664000175000017500000001046311175003227016017 00000000000000 spandsp-0.0.6/tests/msvc/t38_non_ecm_buffer_tests.vcproj0000664000175000017500000001053211175003227020335 00000000000000 spandsp-0.0.6/tests/msvc/complex_vector_float_tests.vcproj0000664000175000017500000001054011175014343021106 00000000000000 spandsp-0.0.6/tests/msvc/vector_int_tests.vcproj0000664000175000017500000001050211175014343017042 00000000000000 spandsp-0.0.6/tests/msvc/complex_tests.vcproj0000664000175000017500000001047111175014343016342 00000000000000 spandsp-0.0.6/tests/msvc/v80_tests.vcproj0000664000175000017500000001045511175014343015312 00000000000000 spandsp-0.0.6/tests/msvc/dtmf_tx_tests.vcproj0000664000175000017500000001047111175014343016340 00000000000000 spandsp-0.0.6/tests/msvc/v29_tests.vcproj0000664000175000017500000001045511175014343015315 00000000000000 spandsp-0.0.6/tests/msvc/adsi_tests.vcproj0000664000175000017500000001055711175003227015617 00000000000000 spandsp-0.0.6/tests/msvc/dtmf_rx_tests.vcproj0000664000175000017500000001047111175014343016336 00000000000000 spandsp-0.0.6/tests/msvc/vector_float_tests.vcproj0000664000175000017500000001051011175014343017354 00000000000000 spandsp-0.0.6/tests/msvc/v22bis_tests.vcproj0000664000175000017500000001046611175014343016006 00000000000000 spandsp-0.0.6/tests/msvc/t38_core_tests.vcproj0000664000175000017500000001047411175014343016324 00000000000000 spandsp-0.0.6/tests/fax_utils.c0000664000175000017500000001177212101214407013414 00000000000000/* * SpanDSP - a series of DSP components for telephony * * fax_utils.c * * Written by Steve Underwood * * Copyright (C) 2009 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #include "fax_utils.h" void fax_log_tx_parameters(t30_state_t *s, const char *tag) { const char *u; if ((u = t30_get_tx_ident(s))) printf("%s: Local ident '%s'\n", tag, u); if ((u = t30_get_tx_sub_address(s))) printf("%s: Local sub-address '%s'\n", tag, u); if ((u = t30_get_tx_polled_sub_address(s))) printf("%s: Local polled sub-address '%s'\n", tag, u); if ((u = t30_get_tx_selective_polling_address(s))) printf("%s: Local selective polling address '%s'\n", tag, u); if ((u = t30_get_tx_sender_ident(s))) printf("%s: Local sender ident '%s'\n", tag, u); if ((u = t30_get_tx_password(s))) printf("%s: Local password '%s'\n", tag, u); } /*- End of function --------------------------------------------------------*/ void fax_log_rx_parameters(t30_state_t *s, const char *tag) { const char *u; if ((u = t30_get_rx_ident(s))) printf("%s: Remote ident '%s'\n", tag, u); if ((u = t30_get_rx_sub_address(s))) printf("%s: Remote sub-address '%s'\n", tag, u); if ((u = t30_get_rx_polled_sub_address(s))) printf("%s: Remote polled sub-address '%s'\n", tag, u); if ((u = t30_get_rx_selective_polling_address(s))) printf("%s: Remote selective polling address '%s'\n", tag, u); if ((u = t30_get_rx_sender_ident(s))) printf("%s: Remote sender ident '%s'\n", tag, u); if ((u = t30_get_rx_password(s))) printf("%s: Remote password '%s'\n", tag, u); if ((u = t30_get_rx_country(s))) printf("%s: Remote was made in '%s'\n", tag, u); if ((u = t30_get_rx_vendor(s))) printf("%s: Remote was made by '%s'\n", tag, u); if ((u = t30_get_rx_model(s))) printf("%s: Remote is model '%s'\n", tag, u); } /*- End of function --------------------------------------------------------*/ void fax_log_final_transfer_statistics(t30_state_t *s, const char *tag) { t30_stats_t t; t30_get_transfer_statistics(s, &t); printf("%s: Bit rate %d\n", tag, t.bit_rate); printf("%s: ECM %s\n", tag, (t.error_correcting_mode) ? "on" : "off"); //printf("%s: RTP events %d. RTN events %d\n", tag, t.rtp_events, t.rtn_events); printf("%s: Tx pages %d, rx pages %d\n", tag, t.pages_tx, t.pages_rx); } /*- End of function --------------------------------------------------------*/ void fax_log_page_transfer_statistics(t30_state_t *s, const char *tag) { t30_stats_t t; t30_get_transfer_statistics(s, &t); printf("%s: Page statistics\n", tag); printf("%s: Pages in the file %d\n", tag, t.pages_in_file); printf("%s: Bad rows %d, longest bad row run %d\n", tag, t.bad_rows, t.longest_bad_row_run); printf("%s: Bad ECM frames %d\n", tag, t.error_correcting_mode_retries); printf("%s: Compression type %s (%d)\n", tag, t4_encoding_to_str(t.encoding), t.encoding); printf("%s: Compressed image size %d bytes\n", tag, t.image_size); printf("%s: Image size %d pels x %d pels\n", tag, t.width, t.length); printf("%s: Image resolution %d pels/m x %d pels/m\n", tag, t.x_resolution, t.y_resolution); #if defined(WITH_SPANDSP_INTERNALS) printf("%s: Bits per row - min %d, max %d\n", tag, s->t4.min_row_bits, s->t4.max_row_bits); #endif fax_log_final_transfer_statistics(s, tag); } /*- End of function --------------------------------------------------------*/ int get_tiff_total_pages(const char *file) { TIFF *tiff_file; int max; if ((tiff_file = TIFFOpen(file, "r")) == NULL) return -1; /* Each page *should* contain the total number of pages, but can this be trusted? Some files say 0. Actually searching for the last page is more reliable. */ max = 0; while (TIFFSetDirectory(tiff_file, (tdir_t) max)) max++; TIFFClose(tiff_file); return max; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/vector_int_tests.c0000664000175000017500000001015012101213112014771 00000000000000/* * SpanDSP - a series of DSP components for telephony * * complex_vector_int_tests.c * * Written by Steve Underwood * * Copyright (C) 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include "spandsp.h" static int32_t vec_dot_prodi16_dumb(const int16_t x[], const int16_t y[], int n) { int32_t z; int i; z = 0; for (i = 0; i < n; i++) z += (int32_t) x[i]*(int32_t) y[i]; return z; } /*- End of function --------------------------------------------------------*/ static int test_vec_dot_prodi16(void) { int i; int32_t za; int32_t zb; int16_t x[99]; int16_t y[99]; for (i = 0; i < 99; i++) { x[i] = rand(); y[i] = rand(); } for (i = 1; i < 99; i++) { za = vec_dot_prodi16(x, y, i); zb = vec_dot_prodi16_dumb(x, y, i); if (za != zb) { printf("Tests failed\n"); exit(2); } } return 0; } /*- End of function --------------------------------------------------------*/ static int32_t vec_min_maxi16_dumb(const int16_t x[], int n, int16_t out[]) { int i; int16_t min; int16_t max; int16_t temp; int32_t z; max = INT16_MIN; min = INT16_MAX; for (i = 0; i < n; i++) { temp = x[i]; if (temp > max) max = temp; /*endif*/ if (temp < min) min = temp; /*endif*/ } /*endfor*/ out[0] = max; out[1] = min; z = abs(min); if (z > max) return z; return max; } /*- End of function --------------------------------------------------------*/ static int test_vec_min_maxi16(void) { int i; int32_t za; int32_t zb; int16_t x[99]; int16_t outa[2]; int16_t outb[2]; for (i = 0; i < 99; i++) x[i] = rand(); x[42] = -32768; za = vec_min_maxi16_dumb(x, 99, outa); zb = vec_min_maxi16(x, 99, outb); if (za != zb || outa[0] != outb[0] || outa[1] != outb[1]) { printf("Tests failed\n"); exit(2); } return 0; } /*- End of function --------------------------------------------------------*/ static int test_vec_circular_dot_prodi16(void) { int i; int j; int pos; int len; int32_t za; int32_t zb; int16_t x[99]; int16_t y[99]; /* Verify that we can do circular sample buffer "dot" linear coefficient buffer operations properly, by doing two sub-dot products. */ for (i = 0; i < 99; i++) { x[i] = rand(); y[i] = rand(); } len = 95; for (pos = 0; pos < len; pos++) { za = vec_circular_dot_prodi16(x, y, len, pos); zb = 0; for (i = 0; i < len; i++) { j = (pos + i) % len; zb += (int32_t) x[j]*(int32_t) y[i]; } if (za != zb) { printf("Tests failed\n"); exit(2); } } return 0; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { test_vec_dot_prodi16(); test_vec_min_maxi16(); test_vec_circular_dot_prodi16(); printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/v22bis_tests.c0000664000175000017500000003477012101213326013751 00000000000000/* * SpanDSP - a series of DSP components for telephony * * v22bis_tests.c * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page v22bis_tests_page V.22bis modem tests \section v22bis_tests_page_sec_1 What does it do? These tests connect two V.22bis modems back to back, through a telephone line model. BER testing is then used to evaluate performance under various line conditions. If the appropriate GUI environment exists, the tests are built such that a visual display of modem status is maintained. \section v22bis_tests_page_sec_2 How is it used? */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #if defined(HAVE_FL_FL_H) && defined(HAVE_FL_FL_CARTESIAN_H) && defined(HAVE_FL_FL_AUDIO_METER_H) #define ENABLE_GUI #endif #include #include #include #include #include #include #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES #include "spandsp.h" #include "spandsp-sim.h" #if defined(ENABLE_GUI) #include "modem_monitor.h" #endif #define BLOCK_LEN 160 #define OUT_FILE_NAME "v22bis.wav" char *decode_test_file = NULL; int use_gui = FALSE; int rx_bits = 0; both_ways_line_model_state_t *model; typedef struct { v22bis_state_t *v22bis; bert_state_t bert_tx; bert_state_t bert_rx; bert_results_t latest_results; #if defined(ENABLE_GUI) qam_monitor_t *qam_monitor; #endif float smooth_power; int symbol_no; } endpoint_t; endpoint_t endpoint[2]; static void reporter(void *user_data, int reason, bert_results_t *results) { endpoint_t *s; s = (endpoint_t *) user_data; switch (reason) { case BERT_REPORT_REGULAR: fprintf(stderr, "V.22bis rx %p BERT report regular - %d bits, %d bad bits, %d resyncs\n", user_data, results->total_bits, results->bad_bits, results->resyncs); memcpy(&s->latest_results, results, sizeof(s->latest_results)); break; default: fprintf(stderr, "V.22bis rx %p BERT report %s\n", user_data, bert_event_to_str(reason)); break; } } /*- End of function --------------------------------------------------------*/ static void v22bis_rx_status(void *user_data, int status) { endpoint_t *s; int bit_rate; int i; int len; #if defined(SPANDSP_USE_FIXED_POINTx) complexi16_t *coeffs; #else complexf_t *coeffs; #endif /* Special conditions */ s = (endpoint_t *) user_data; printf("V.22bis rx %p status is %s (%d)\n", user_data, signal_status_to_str(status), status); switch (status) { case SIG_STATUS_TRAINING_SUCCEEDED: bit_rate = v22bis_get_current_bit_rate(s->v22bis); printf("Negotiated bit rate: %d\n", bit_rate); len = v22bis_rx_equalizer_state(s->v22bis, &coeffs); printf("Equalizer:\n"); for (i = 0; i < len; i++) #if defined(SPANDSP_USE_FIXED_POINTx) printf("%3d (%15.5f, %15.5f)\n", i, coeffs[i].re/1024.0f, coeffs[i].im/1024.0f); #else printf("%3d (%15.5f, %15.5f) -> %15.5f\n", i, coeffs[i].re, coeffs[i].im, powerf(&coeffs[i])); #endif break; } } /*- End of function --------------------------------------------------------*/ static void v22bis_putbit(void *user_data, int bit) { endpoint_t *s; if (bit < 0) { v22bis_rx_status(user_data, bit); return; } s = (endpoint_t *) user_data; if (decode_test_file) printf("Rx bit %p-%d - %d\n", user_data, rx_bits++, bit); else bert_put_bit(&s->bert_rx, bit); } /*- End of function --------------------------------------------------------*/ static int v22bis_getbit(void *user_data) { endpoint_t *s; int bit; s = (endpoint_t *) user_data; bit = bert_get_bit(&s->bert_tx); return bit; } /*- End of function --------------------------------------------------------*/ #if defined(SPANDSP_USE_FIXED_POINTx) static void qam_report(void *user_data, const complexi16_t *constel, const complexi16_t *target, int symbol) #else static void qam_report(void *user_data, const complexf_t *constel, const complexf_t *target, int symbol) #endif { int i; int len; #if defined(SPANDSP_USE_FIXED_POINTx) complexi16_t *coeffs; complexf_t constel_point; #else complexf_t *coeffs; #endif float fpower; endpoint_t *s; s = (endpoint_t *) user_data; if (constel) { #if defined(ENABLE_GUI) if (use_gui) { #if defined(SPANDSP_USE_FIXED_POINTx) constel_point.re = constel->re/1024.0; constel_point.im = constel->im/1024.0; qam_monitor_update_constel(s->qam_monitor, &constel_point); #else qam_monitor_update_constel(s->qam_monitor, constel); #endif qam_monitor_update_carrier_tracking(s->qam_monitor, v22bis_rx_carrier_frequency(s->v22bis)); qam_monitor_update_symbol_tracking(s->qam_monitor, v22bis_rx_symbol_timing_correction(s->v22bis)); } #endif fpower = (constel->re - target->re)*(constel->re - target->re) + (constel->im - target->im)*(constel->im - target->im); s->smooth_power = 0.95f*s->smooth_power + 0.05f*fpower; printf("%8d [%8.4f, %8.4f] [%8.4f, %8.4f] %2x %8.4f %8.4f %8.4f\n", s->symbol_no, #if defined(SPANDSP_USE_FIXED_POINTx) constel->re/1024.0, constel->im/1024.0, target->re/1024.0, target->im/1024.0, #else constel->re, constel->im, target->re, target->im, #endif symbol, fpower, s->smooth_power, v22bis_rx_signal_power(s->v22bis)); s->symbol_no++; } else { printf("Gardner step %d\n", symbol); len = v22bis_rx_equalizer_state(s->v22bis, &coeffs); printf("Equalizer A:\n"); for (i = 0; i < len; i++) #if defined(SPANDSP_USE_FIXED_POINTx) printf("%3d (%15.5f, %15.5f)\n", i, coeffs[i].re/1024.0f, coeffs[i].im/1024.0f); #else printf("%3d (%15.5f, %15.5f) -> %15.5f\n", i, coeffs[i].re, coeffs[i].im, powerf(&coeffs[i])); #endif #if defined(ENABLE_GUI) if (use_gui) { #if defined(SPANDSP_USE_FIXED_POINTx) qam_monitor_update_int_equalizer(s->qam_monitor, coeffs, len); #else qam_monitor_update_equalizer(s->qam_monitor, coeffs, len); #endif } #endif } } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int16_t amp[2][BLOCK_LEN]; int16_t model_amp[2][BLOCK_LEN]; int16_t out_amp[2*BLOCK_LEN]; SNDFILE *inhandle; SNDFILE *outhandle; int outframes; int samples; int samples2; int i; int j; int test_bps; int line_model_no; int bits_per_test; int noise_level; int signal_level; int log_audio; int channel_codec; int rbs_pattern; int guard_tone_option; int opt; channel_codec = MUNGE_CODEC_NONE; rbs_pattern = 0; test_bps = 2400; line_model_no = 0; decode_test_file = NULL; noise_level = -70; signal_level = -13; bits_per_test = 50000; guard_tone_option = V22BIS_GUARD_TONE_1800HZ; log_audio = FALSE; while ((opt = getopt(argc, argv, "b:B:c:d:gG:lm:n:r:s:")) != -1) { switch (opt) { case 'b': test_bps = atoi(optarg); if (test_bps != 2400 && test_bps != 1200) { fprintf(stderr, "Invalid bit rate specified\n"); exit(2); } break; case 'B': bits_per_test = atoi(optarg); break; case 'c': channel_codec = atoi(optarg); break; case 'd': decode_test_file = optarg; break; case 'g': #if defined(ENABLE_GUI) use_gui = TRUE; #else fprintf(stderr, "Graphical monitoring not available\n"); exit(2); #endif break; case 'G': guard_tone_option = atoi(optarg); break; case 'l': log_audio = TRUE; break; case 'm': line_model_no = atoi(optarg); break; case 'n': noise_level = atoi(optarg); break; case 'r': rbs_pattern = atoi(optarg); break; case 's': signal_level = atoi(optarg); break; default: //usage(); exit(2); break; } } inhandle = NULL; if (decode_test_file) { /* We will decode the audio from a file. */ if ((inhandle = sf_open_telephony_read(decode_test_file, 1)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", decode_test_file); exit(2); } } outhandle = NULL; if (log_audio) { if ((outhandle = sf_open_telephony_write(OUT_FILE_NAME, 2)) == NULL) { fprintf(stderr, " Cannot create audio file '%s'\n", OUT_FILE_NAME); exit(2); } } memset(endpoint, 0, sizeof(endpoint)); for (i = 0; i < 2; i++) { endpoint[i].v22bis = v22bis_init(NULL, test_bps, guard_tone_option, (i == 0), v22bis_getbit, &endpoint[i], v22bis_putbit, &endpoint[i]); v22bis_tx_power(endpoint[i].v22bis, signal_level); /* Move the carrier off a bit */ endpoint[i].v22bis->tx.carrier_phase_rate = dds_phase_ratef((i == 0) ? 1207.0f : 2407.0f); v22bis_rx_set_qam_report_handler(endpoint[i].v22bis, qam_report, (void *) &endpoint[i]); span_log_set_level(&endpoint[i].v22bis->logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME | SPAN_LOG_FLOW); span_log_set_tag(&endpoint[i].v22bis->logging, (i == 0) ? "caller" : "answerer"); endpoint[i].smooth_power = 0.0f; endpoint[i].symbol_no = 0; bert_init(&endpoint[i].bert_tx, bits_per_test, BERT_PATTERN_ITU_O152_11, test_bps, 20); bert_init(&endpoint[i].bert_rx, bits_per_test, BERT_PATTERN_ITU_O152_11, test_bps, 20); bert_set_report(&endpoint[i].bert_rx, 10000, reporter, &endpoint[i]); } #if defined(ENABLE_GUI) if (use_gui) { endpoint[0].qam_monitor = qam_monitor_init(6.0f, "Calling modem"); endpoint[1].qam_monitor = qam_monitor_init(6.0f, "Answering modem"); } #endif if ((model = both_ways_line_model_init(line_model_no, (float) noise_level, -15.0f, -15.0f, line_model_no, (float) noise_level, -15.0f, -15.0f, channel_codec, rbs_pattern)) == NULL) { fprintf(stderr, " Failed to create line model\n"); exit(2); } samples = 0; for (;;) { for (i = 0; i < 2; i++) { samples = v22bis_tx(endpoint[i].v22bis, amp[i], BLOCK_LEN); #if defined(ENABLE_GUI) if (use_gui) qam_monitor_update_audio_level(endpoint[i].qam_monitor, amp[i], samples); #endif if (samples == 0) { /* Note that we might get a few bad bits as the carrier shuts down. */ bert_result(&endpoint[i].bert_rx, &endpoint[i].latest_results); bert_init(&endpoint[i].bert_tx, bits_per_test, BERT_PATTERN_ITU_O152_11, test_bps, 20); bert_init(&endpoint[i].bert_rx, bits_per_test, BERT_PATTERN_ITU_O152_11, test_bps, 20); bert_set_report(&endpoint[i].bert_rx, 10000, reporter, &endpoint[i]); printf("Restarting on zero output\n"); v22bis_restart(endpoint[i].v22bis, test_bps); } } #if 1 both_ways_line_model(model, model_amp[0], amp[0], model_amp[1], amp[1], samples); #else vec_copyi16(model_amp[0], amp[0], samples); vec_copyi16(model_amp[1], amp[1], samples); #endif if (decode_test_file) { samples2 = sf_readf_short(inhandle, model_amp[0], samples); if (samples2 != samples) break; } for (i = 0; i < 2; i++) { span_log_bump_samples(&endpoint[i].v22bis->logging, samples); v22bis_rx(endpoint[i ^ 1].v22bis, model_amp[i], samples); for (j = 0; j < samples; j++) out_amp[2*j + i] = model_amp[i][j]; for ( ; j < BLOCK_LEN; j++) out_amp[2*j + i] = 0; } if (log_audio) { outframes = sf_writef_short(outhandle, out_amp, BLOCK_LEN); if (outframes != BLOCK_LEN) { fprintf(stderr, " Error writing audio file\n"); exit(2); } } } #if defined(ENABLE_GUI) if (use_gui) qam_wait_to_end(endpoint[0].qam_monitor); #endif if (decode_test_file) { if (sf_close_telephony(inhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", decode_test_file); exit(2); } } if (log_audio) { if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUT_FILE_NAME); exit(2); } } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/echo_monitor.h0000664000175000017500000000405211422612266014113 00000000000000/* * SpanDSP - a series of DSP components for telephony * * echo_monitor.h - Display echo canceller status, using the FLTK toolkit. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page echo_monitor_page Echo canceller performance monitoring \section echo_monitor_page_sec_1 What does it do? This code controls a GUI window, which provides monitoring of the internal status of a time domain echo canceller. It shows, graphically: - the spectrum of the received signal. - the line model in use (when a known line model is being used). - the adapted coefficients of the canceller. \section echo_monitor_page_sec_2 How does it work? This code uses the FLTK cross platform GUI toolkit. It works on X11 and Windows platforms. In addition to the basic FLTK toolkit, fltk_cartesian is also required. */ #if !defined(_ECHO_MONITOR_H_) #define _ECHO_MONITOR_H_ #if defined(__cplusplus) extern "C" { #endif int start_echo_can_monitor(int len); int echo_can_monitor_can_update(const int16_t *coeffs, int len); int echo_can_monitor_line_model_update(const int32_t *coeffs, int len); int echo_can_monitor_line_spectrum_update(const int16_t amp[], int len); void echo_can_monitor_wait_to_end(void); void echo_can_monitor_update_display(void); #if defined(__cplusplus) } #endif #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/at_interpreter_tests.c0000664000175000017500000012026011422612266015672 00000000000000/* * SpanDSP - a series of DSP components for telephony * * at_interpreter_tests.c - Tests for the AT interpreter. * * Written by Steve Underwood * * Copyright (C) 2004, 2005, 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page at_interpreter_tests_page AT interpreter tests \section at_interpreter_tests_page_sec_1 What does it do? These tests exercise all the commands which should be understood by the AT interpreter. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include #include #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES #include "spandsp.h" #define DLE 0x10 #define ETX 0x03 #define SUB 0x1A #define MANUFACTURER "www.soft-switch.org" struct command_response_s { const char *command; const char *response; }; static const struct command_response_s general_test_seq[] = { /* Try the various cases for "AT" */ {"atE1\r", "atE1\r\r\nOK\r\n"}, {"AtE1\r", "AtE1\r\r\nOK\r\n"}, {"aTE1\r", "aTE1\r\r\nOK\r\n"}, {"ATE1\r", "ATE1\r\r\nOK\r\n"}, {"ATE0\r", "ATE0\r\r\nOK\r\n"}, /* Try the various command formats */ {"ATS8?\r", "\r\n005\r\n\r\nOK\r\n"}, {"ATS8=1\r", "\r\nOK\r\n"}, {"ATS8.5?\r", "\r\n0\r\n\r\nOK\r\n"}, {"ATS8.5=1\r", "\r\nOK\r\n"}, {"ATS8.5?\r", "\r\n1\r\n\r\nOK\r\n"}, {"ATS8?\r", "\r\n033\r\n\r\nOK\r\n"}, {"AT+FCLASS=1\r", "\r\nOK\r\n"}, {"AT+FCLASS?\r", "\r\n1\r\n\r\nOK\r\n"}, {"AT+FCLASS=?\r", "\r\n0,1,1.0\r\n\r\nOK\r\n"}, /* Try all the commands */ {"AT&C\r", "\r\nOK\r\n"}, /* V.250 6.2.8 - Circuit 109 (received line signal detector), behaviour */ {"AT&D\r", "\r\nOK\r\n"}, /* V.250 6.2.9 - Circuit 108 (data terminal ready) behaviour */ {"AT&F\r", "\r\nOK\r\n"}, /* V.250 6.1.2 - Set to factory-defined configuration */ {"ATE0\r", "ATE0\r\r\nOK\r\n"}, /* Counteract the effects of the above */ {"AT+A8E=?\r", "\r\n+A8E:(0-6),(0-5),(00-FF)\r\n\r\nOK\r\n"}, /* V.251 5.1 - V.8 and V.8bis operation controls */ {"AT+A8M\r", "\r\nOK\r\n"}, /* V.251 5.2 - Send V.8 menu signals */ {"AT+A8T=?\r", "\r\n+A8T:(0-10)\r\n\r\nOK\r\n"}, /* V.251 5.3 - Send V.8bis signal and/or message(s) */ {"AT+ASTO=?\r", "\r\n+ASTO:\r\n\r\nOK\r\n"}, /* V.250 6.3.15 - Store telephone number */ {"AT+CAAP=?\r", "\r\n+CAAP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.25 - Automatic answer for eMLPP Service */ {"AT+CACM=?\r", "\r\n+CACM:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.25 - Accumulated call meter */ {"AT+CACSP=?\r", "\r\n+CACSP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.1.7 - Voice Group or Voice Broadcast Call State Attribute Presentation */ {"AT+CAEMLPP=?\r", "\r\n+CAEMLPP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.22 - eMLPP Priority Registration and Interrogation */ {"AT+CAHLD=?\r", "\r\n+CAHLD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.1.3 - Leave an ongoing Voice Group or Voice Broadcast Call */ {"AT+CAJOIN=?\r", "\r\n+CAJOIN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.1.1 - Accept an incoming Voice Group or Voice Broadcast Call */ {"AT+CALA=?\r", "\r\n+CALA:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.16 - Alarm */ {"AT+CALCC=?\r", "\r\n+CALCC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.1.6 - List current Voice Group and Voice Broadcast Calls */ {"AT+CALD=?\r", "\r\n+CALD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.38 - Delete alar m */ {"AT+CALM=?\r", "\r\n+CALM:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.20 - Alert sound mode */ {"AT+CAMM=?\r", "\r\n+CAMM:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.26 - Accumulated call meter maximum */ {"AT+CANCHEV=?\r", "\r\n+CANCHEV:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.1.8 - NCH Support Indication */ {"AT+CAOC=?\r", "\r\n+CAOC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.16 - Advice of Charge */ {"AT+CAPD=?\r", "\r\n+CAPD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.39 - Postpone or dismiss an alarm */ {"AT+CAPTT=?\r", "\r\n+CAPTT:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.1.4 - Talker Access for Voice Group Call */ {"AT+CAREJ=?\r", "\r\n+CAREJ:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.1.2 - Reject an incoming Voice Group or Voice Broadcast Call */ {"AT+CAULEV=?\r", "\r\n+CAULEV:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.1.5 - Voice Group Call Uplink Status Presentation */ {"AT+CBC=?\r", "\r\n+CBC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.4 - Battery charge */ {"AT+CBCS=?\r", "\r\n+CBCS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.3.2 - VBS subscriptions and GId status */ {"AT+CBST=?\r", "\r\n+CBST:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.7 - Select bearer service type */ {"AT+CCFC=?\r", "\r\n+CCFC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.11 - Call forwarding number and conditions */ {"AT+CCLK=?\r", "\r\n+CCLK:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.15 - Clock */ {"AT+CCUG=?\r", "\r\n+CCUG:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.10 - Closed user group */ {"AT+CCWA=?\r", "\r\n+CCWA:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.12 - Call waiting */ {"AT+CCWE=?\r", "\r\n+CCWE:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.28 - Call Meter maximum event */ {"AT+CDIP=?\r", "\r\n+CDIP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.9 - Called line identification presentation */ {"AT+CDIS=?\r", "\r\n+CDIS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.8 - Display control */ {"AT+CEER=?\r", "\r\n+CEER:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.10 - Extended error report */ {"AT+CFCS=?\r", "\r\n+CFCS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.24 - Fast call setup conditions */ {"AT+CFUN=?\r", "\r\n+CFUN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.2 - Set phone functionality */ {"AT+CGACT=?\r", "\r\n+CGACT:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.10 - PDP context activate or deactivate */ {"AT+CGANS=?\r", "\r\n+CGANS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.16 - Manual response to a network request for PDP context activation */ {"AT+CGATT=?\r", "\r\n+CGATT:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.9 - PS attach or detach */ {"AT+CGAUTO=?\r", "\r\n+CGAUTO:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.15 - Automatic response to a network request for PDP context activation */ {"AT+CGCLASS=?\r", "\r\n+CGCLASS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.17 - GPRS mobile station class (GPRS only) */ {"AT+CGCLOSP=?\r", "\r\n+CGCLOSP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.13 - Configure local octet stream PAD parameters (Obsolete) */ {"AT+CGCLPAD=?\r", "\r\n+CGCLPAD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.12 - Configure local triple-X PAD parameters (GPRS only) (Obsolete) */ {"AT+CGCMOD=?\r", "\r\n+CGCMOD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.11 - PDP Context Modify */ {"AT+CGCS=?\r", "\r\n+CGCS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.3.1 - VGCS subscriptions and GId status */ {"AT+CGDATA=?\r", "\r\n+CGDATA:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.12 - Enter data state */ {"AT+CGDCONT=?\r", "\r\n+CGDCONT:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.1 - Define PDP Context */ {"AT+CGDSCONT=?\r", "\r\n+CGDSCONT:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.2 - Define Secondary PDP Context */ {"AT+CGEQMIN=?\r", "\r\n+CGEQMIN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.7 - 3G Quality of Service Profile (Minimum acceptable) */ {"AT+CGEQNEG=?\r", "\r\n+CGEQNEG:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.8 - 3G Quality of Service Profile (Negotiated) */ {"AT+CGEQREQ=?\r", "\r\n+CGEQREQ:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.6 - 3G Quality of Service Profile (Requested) */ {"AT+CGEREP=?\r", "\r\n+CGEREP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.18 - Packet Domain event reporting */ {"AT+CGMI=?\r", "\r\n+CGMI:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 5.1 - Request manufacturer identification */ {"AT+CGMM=?\r", "\r\n+CGMM:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 5.2 - Request model identification */ {"AT+CGMR=?\r", "\r\n+CGMR:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 5.3 - Request revision identification */ {"AT+CGPADDR=?\r", "\r\n+CGPADDR:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.14 - Show PDP address */ {"AT+CGQMIN=?\r", "\r\n+CGQMIN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.5 - Quality of Service Profile (Minimum acceptable) */ {"AT+CGQREQ=?\r", "\r\n+CGQREQ:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.4 - Quality of Service Profile (Requested) */ {"AT+CGREG=?\r", "\r\n+CGREG:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.19 - GPRS network registration status */ {"AT+CGSMS=?\r", "\r\n+CGSMS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.20 - Select service for MO SMS messages */ {"AT+CGSN=?\r", "\r\n+CGSN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 5.4 - Request product serial number identification */ {"AT+CGTFT=?\r", "\r\n+CGTFT:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 10.1.3 - Traffic Flow Template */ {"AT+CHLD=?\r", "\r\n+CHLD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.13 - Call related supplementary services */ {"AT+CHSA=?\r", "\r\n+CHSA:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.18 - HSCSD non-transparent asymmetry configuration */ {"AT+CHSC=?\r", "\r\n+CHSC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.15 - HSCSD current call parameters */ {"AT+CHSD=?\r", "\r\n+CHSD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.12 - HSCSD device parameters */ {"AT+CHSN=?\r", "\r\n+CHSN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.14 - HSCSD non-transparent call configuration */ {"AT+CHSR=?\r", "\r\n+CHSR:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.16 - HSCSD parameters report */ {"AT+CHST=?\r", "\r\n+CHST:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.13 - HSCSD transparent call configuration */ {"AT+CHSU=?\r", "\r\n+CHSU:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.17 - HSCSD automatic user initiated upgrading */ {"AT+CHUP=?\r", "\r\n+CHUP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.5 - Hangup call */ {"AT+CIMI=?\r", "\r\n+CIMI:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 5.6 - Request international mobile subscriber identity */ {"AT+CIND=?\r", "\r\n+CIND:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.9 - Indicator control */ {"AT+CKPD=?\r", "\r\n+CKPD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.7 - Keypad control */ {"AT+CLAC=?\r", "\r\n+CLAC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.37 - List all available AT commands */ {"AT+CLAE=?\r", "\r\n+CLAE:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.31 - Language Event */ {"AT+CLAN=?\r", "\r\n+CLAN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.30 - Set Language */ {"AT+CLCC=?\r", "\r\n+CLCC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.18 - List current calls */ {"AT+CLCK=?\r", "\r\n+CLCK:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.4 - Facility lock */ {"AT+CLIP=?\r", "\r\n+CLIP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.6 - Calling line identification presentation */ {"AT+CLIR=?\r", "\r\n+CLIR:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.7 - Calling line identification restriction */ {"AT+CLVL=?\r", "\r\n+CLVL:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.23 - Loudspeaker volume level */ {"AT+CMAR=?\r", "\r\n+CMAR:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.36 - Master Reset */ {"AT+CMEC=?\r", "\r\n+CMEC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.6 - Mobile Termination control mode */ {"AT+CMER=?\r", "\r\n+CMER:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.10 - Mobile Termination event reporting */ {"AT+CMOD=?\r", "\r\n+CMOD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.4 - Call mode */ {"AT+CMUT=?\r", "\r\n+CMUT:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.24 - Mute control */ {"AT+CMUX=?\r", "\r\n+CMUX:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 5.7 - Multiplexing mode */ {"AT+CNUM=?\r", "\r\n+CNUM:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.1 - Subscriber number */ {"AT+COLP=?\r", "\r\n+COLP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.8 - Connected line identification presentation */ {"AT+COPN=?\r", "\r\n+COPN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.21 - Read operator names */ {"AT+COPS=?\r", "\r\n+COPS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.3 - PLMN selection */ {"AT+COTDI=?\r", "\r\n+COTDI:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 11.1.9 - Originator to Dispatcher Information */ {"AT+CPAS=?\r", "\r\n+CPAS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.1 - Phone activity status */ {"AT+CPBF=?\r", "\r\n+CPBF:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.13 - Find phonebook entries */ {"AT+CPBR=?\r", "\r\n+CPBR:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.12 - Read phonebook entries */ {"AT+CPBS=?\r", "\r\n+CPBS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.11 - Select phonebook memory storage */ {"AT+CPBW=?\r", "\r\n+CPBW:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.14 - Write phonebook entry */ {"AT+CPIN=?\r", "\r\n+CPIN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.3 - Enter PIN */ {"AT+CPLS=?\r", "\r\n+CPLS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.20 - Selection of preferred PLMN list */ {"AT+CPOL=?\r", "\r\n+CPOL:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.19 - Preferred PLMN list */ {"AT+CPPS=?\r", "\r\n+CPPS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.23 - eMLPP subscriptions */ {"AT+CPROT=?\r", "\r\n+CPROT:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.42 - Enter protocol mode */ {"AT+CPUC=?\r", "\r\n+CPUC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.27 - Price per unit and currency table */ {"AT+CPWC=?\r", "\r\n+CPWC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.29 - Power class */ {"AT+CPWD=?\r", "\r\n+CPWD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.5 - Change password */ {"AT+CR=?\r", "\r\n+CR:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.9 - Service reporting control */ {"AT+CRC=?\r", "\r\n+CRC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.11 - Cellular result codes */ {"AT+CREG=?\r", "\r\n+CREG:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.2 - Network registration */ {"AT+CRLP=?\r", "\r\n+CRLP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.8 - Radio link protocol */ {"AT+CRMC=?\r", "\r\n+CRMC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.34 - Ring Melody Control */ {"AT+CRMP=?\r", "\r\n+CRMP:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.35 - Ring Melody Playback */ {"AT+CRSL=?\r", "\r\n+CRSL:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.21 - Ringer sound level */ {"AT+CRSM=?\r", "\r\n+CRSM:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.18 - Restricted SIM access */ {"AT+CSCC=?\r", "\r\n+CSCC:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.19 - Secure control command */ {"AT+CSCS=?\r", "\r\n+CSCS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 5.5 - Select TE character set */ {"AT+CSDF=?\r", "\r\n+CSDF:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.22 - Settings date format */ {"AT+CSGT=?\r", "\r\n+CSGT:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.32 - Set Greeting Text */ {"AT+CSIL=?\r", "\r\n+CSIL:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.23 - Silence Command */ {"AT+CSIM=?\r", "\r\n+CSIM:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.17 - Generic SIM access */ {"AT+CSNS=?\r", "\r\n+CSNS:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.19 - Single numbering scheme */ {"AT+CSQ=?\r", "\r\n+CSQ:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.5 - Signal quality */ {"AT+CSSN=?\r", "\r\n+CSSN:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.17 - Supplementary service notifications */ {"AT+CSTA=?\r", "\r\n+CSTA:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.1 - Select type of address */ {"AT+CSTF=?\r", "\r\n+CSTF:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.24 - Settings time format */ {"AT+CSVM=?\r", "\r\n+CSVM:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.33 - Set Voice Mail Number */ {"AT+CTFR=?\r", "\r\n+CTFR:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.14 - Call deflection */ {"AT+CTZR=?\r", "\r\n+CTZR:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.41 - Time Zone Reporting */ {"AT+CTZU=?\r", "\r\n+CTZU:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.40 - Automatic Time Zone Update */ {"AT+CUSD=?\r", "\r\n+CUSD:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.15 - Unstructured supplementary service data */ {"AT+CUUS1=?\r", "\r\n+CUUS1:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 7.26 - User to User Signalling Service 1 */ {"AT+CV120=?\r", "\r\n+CV120:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.21 - V.120 rate adaption protocol */ {"AT+CVHU=?\r", "\r\n+CVHU:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 6.20 - Voice Hangup Control */ {"AT+CVIB=?\r", "\r\n+CVIB:\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 8.22 - Vibrator mode */ {"AT+DR=?\r", "\r\n+DR:\r\n\r\nOK\r\n"}, /* V.250 6.6.2 - Data compression reporting */ {"AT+DS=?\r", "\r\n+DS:\r\n\r\nOK\r\n"}, /* V.250 6.6.1 - Data compression */ {"AT+EB=?\r", "\r\n+EB:\r\n\r\nOK\r\n"}, /* V.250 6.5.2 - Break handling in error control operation */ {"AT+EFCS=?\r", "\r\n+EFCS:(0-2)\r\n\r\nOK\r\n"}, /* V.250 6.5.4 - 32-bit frame check sequence */ {"AT+EFCS?\r", "\r\n+EFCS:0\r\n\r\nOK\r\n"}, {"AT+EFRAM=?\r", "\r\n+EFRAM:(1-65535),(1-65535)\r\n\r\nOK\r\n"}, /* V.250 6.5.8 - Frame length */ {"AT+ER=?\r", "\r\n+ER:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.5.5 - Error control reporting */ {"AT+ES=?\r", "\r\n+ES:(0-7),(0-4),(0-9)\r\n\r\nOK\r\n"}, /* V.250 6.5.1 - Error control selection */ {"AT+ES?\r", "\r\n+ES:0,0,0\r\n\r\nOK\r\n"}, {"AT+ESA=?\r", "\r\n+ESA:(0-2),(0-1),(0-1),(0-1),(0-2),(0-1),(0-255),(0-255)\r\n\r\nOK\r\n"}, /* V.80 8.2 - Synchronous access mode configuration */ {"AT+ESA?\r", "\r\n+ESA:0,0,0,0,0,0,0,0\r\n\r\nOK\r\n"}, {"AT+ESR\r", "\r\nOK\r\n"}, /* V.250 6.5.3 - Selective repeat */ {"AT+ETBM=?\r", "\r\n+ETBM:(0-2),(0-2),(0-30)\r\n\r\nOK\r\n"}, /* T.31 8.5.1 - Adaptive reception control */ {"AT+ETBM?\r", "\r\n+ETBM:0,0\r\n\r\nOK\r\n"}, {"AT+EWIND=?\r", "\r\n+EWIND:(1-127),(1-127)\r\n\r\nOK\r\n"}, /* V.250 6.5.7 - Window size */ {"AT+EWIND?\r", "\r\n+EWIND:0,0\r\n\r\nOK\r\n"}, {"AT+F34=?\r", "\r\n+F34:(0-14),(0-14),(0-2),(0-14),(0-14)\r\n\r\nOK\r\n"}, /* T.31 B.6.1 - Initial V.34 rate controls for FAX */ {"AT+F34?\r", "\r\n+F34:0,0,0,0,0\r\n\r\nOK\r\n"}, {"AT+FAR=?\r", "\r\n0,1\r\n\r\nOK\r\n"}, /* T.31 8.5.1 - Adaptive reception control */ {"AT+FAR?\r", "\r\n0\r\n\r\nOK\r\n"}, {"AT+FCL=?\r", "\r\n(0-255)\r\n\r\nOK\r\n"}, /* T.31 8.5.2 - Carrier loss timeout */ {"AT+FCLASS=?\r", "\r\n0,1,1.0\r\n\r\nOK\r\n"}, /* T.31 8.2 - Capabilities identification and control */ {"AT+FCLASS?\r", "\r\n1\r\n\r\nOK\r\n"}, {"AT+FDD=?\r", "\r\n(0,1)\r\n\r\nOK\r\n"}, /* T.31 8.5.3 - Double escape character replacement */ {"AT+FDD?\r", "\r\n0\r\n\r\nOK\r\n"}, {"AT+FIT=?\r", "\r\n+FIT:(0-255),(0-1)\r\n\r\nOK\r\n"}, /* T.31 8.5.4 - DTE inactivity timeout */ {"AT+FIT?\r", "\r\n+FIT:0,0\r\n\r\nOK\r\n"}, {"AT+FLO\r", "\r\nOK\r\n"}, /* T.31 says to implement something similar to +IFC */ {"AT+FMI?\r", "\r\n" MANUFACTURER "\r\n\r\nOK\r\n"}, /* T.31 says to duplicate +GMI */ {"AT+FMM?\r", "\r\n" PACKAGE "\r\n\r\nOK\r\n"}, /* T.31 says to duplicate +GMM */ {"AT+FMR?\r", "\r\n" VERSION "\r\n\r\nOK\r\n"}, /* T.31 says to duplicate +GMR */ {"AT+FPR=?\r", "\r\n115200\r\n\r\nOK\r\n"}, /* T.31 says to implement something similar to +IPR */ {"AT+FPR?\r", "\r\n0\r\n\r\nOK\r\n"}, {"AT+FRH=?\r", "\r\n3\r\n\r\nOK\r\n"}, /* T.31 8.3.6 - HDLC receive */ {"AT+FRH?\r", "\r\n-1\r\n\r\nOK\r\n"}, {"AT+FRM=?\r", "\r\n24,48,72,73,74,96,97,98,121,122,145,146\r\n\r\nOK\r\n"}, /* T.31 8.3.4 - Facsimile receive */ {"AT+FRM?\r", "\r\n-1\r\n\r\nOK\r\n"}, {"AT+FRS=?\r", "\r\n0-255\r\n\r\nOK\r\n"}, /* T.31 8.3.2 - Receive silence */ {"AT+FRS?\r", "\r\n-1\r\n\r\nOK\r\n"}, {"AT+FTH=?\r", "\r\n3\r\n\r\nOK\r\n"}, /* T.31 8.3.5 - HDLC transmit */ {"AT+FTH?\r", "\r\n-1\r\n\r\nOK\r\n"}, {"AT+FTM=?\r", "\r\n24,48,72,73,74,96,97,98,121,122,145,146\r\n\r\nOK\r\n"}, /* T.31 8.3.3 - Facsimile transmit */ {"AT+FTM?\r", "\r\n-1\r\n\r\nOK\r\n"}, {"AT+FTS=?\r", "\r\n0-255\r\n\r\nOK\r\n"}, /* T.31 8.3.1 - Transmit silence */ {"AT+FTS?\r", "\r\n-1\r\n\r\nOK\r\n"}, {"AT+GCAP\r", "\r\nOK\r\n"}, /* V.250 6.1.9 - Request complete capabilities list */ {"AT+GCI=?\r", "\r\n+GCI:(00-FF)\r\n\r\nOK\r\n"}, /* V.250 6.1.10 - Country of installation, */ {"AT+GCI?\r", "\r\n+GCI:00\r\n\r\nOK\r\n"}, {"AT+GMI?\r", "\r\n" MANUFACTURER "\r\n\r\nOK\r\n"}, /* V.250 6.1.4 - Request manufacturer identification */ {"AT+GMM?\r", "\r\n" PACKAGE "\r\n\r\nOK\r\n"}, /* V.250 6.1.5 - Request model identification */ {"AT+GMR?\r", "\r\n" VERSION "\r\n\r\nOK\r\n"}, /* V.250 6.1.6 - Request revision identification */ {"AT+GOI\r", "\r\nOK\r\n"}, /* V.250 6.1.8 - Request global object identification */ {"AT+GSN?\r", "\r\n42\r\n\r\nOK\r\n"}, /* V.250 6.1.7 - Request product serial number identification */ {"AT+IBC=?\r", "\r\n+IBC:(0-2),(0,1),(0,1),(0,1),(0,1),(0,1),(0,1),(0,1),(0,1),(0,1),(0,1),(0.1),(0,1)\r\n\r\nOK\r\n"}, /* V.80 7.9 - Control of in-band control */ {"AT+IBC?\r", "\r\n+IBC:0,0,0,0,0,0,0,0,0,0,0,0,0\r\n\r\nOK\r\n"}, {"AT+IBM=?\r", "\r\n+IBM:(0-7),(0-255),(0-255)\r\n\r\nOK\r\n"}, /* V.80 7.10 - In-band MARK idle reporting control */ {"AT+IBM?\r", "\r\n+IBM:0,0,0\r\n\r\nOK\r\n"}, {"AT+ICF?\r", "\r\n+ICF:0,0\r\n\r\nOK\r\n"}, /* V.250 6.2.11 - DTE-DCE character framing */ {"AT+ICLOK?\r", "\r\n+ICLOK:0\r\n\r\nOK\r\n"}, /* V.250 6.2.14 - Select sync transmit clock source */ {"AT+IDSR?\r", "\r\n+IDSR:0\r\n\r\nOK\r\n"}, /* V.250 6.2.16 - Select data set ready option */ {"AT+IFC\r", "\r\nOK\r\n"}, /* V.250 6.2.12 - DTE-DCE local flow control */ {"AT+ILRR\r", "\r\nOK\r\n"}, /* V.250 6.2.13 - DTE-DCE local rate reporting */ {"AT+ILSD=?\r", "\r\n+ILSD:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.2.15 - Select long space disconnect option */ {"AT+ILSD?\r", "\r\n+ILSD:0\r\n\r\nOK\r\n"}, {"AT+IPR=?\r", "\r\n+IPR:(115200),(115200)\r\n\r\nOK\r\n"}, /* V.250 6.2.10 - Fixed DTE rate */ {"AT+IPR?\r", "\r\n+IPR:0\r\n\r\nOK\r\n"}, {"AT+IRTS=?\r", "\r\n+IRTS:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.2.17 - Select synchronous mode RTS option */ {"AT+IRTS?\r", "\r\n+IRTS:0\r\n\r\nOK\r\n"}, {"AT+MA\r", "\r\nOK\r\n"}, /* V.250 6.4.2 - Modulation automode control */ {"AT+MR=?\r", "\r\n+MR:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.4.3 - Modulation reporting control */ {"AT+MR?\r", "\r\n+MR:0\r\n\r\nOK\r\n"}, {"AT+MS\r", "\r\nOK\r\n"}, /* V.250 6.4.1 - Modulation selection */ {"AT+MSC=?\r", "\r\n+MSC:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.4.8 - Seamless rate change enable */ {"AT+MSC?\r", "\r\n+MSC:0\r\n\r\nOK\r\n"}, {"AT+MV18AM\r", "\r\nOK\r\n"}, /* V.250 6.4.6 - V.18 answering message editing */ {"AT+MV18P=?\r", "\r\n+MV18P:(2-7)\r\n\r\nOK\r\n"}, /* V.250 6.4.7 - Order of probes */ {"AT+MV18P?\r", "\r\n+MV18P:0\r\n\r\nOK\r\n"}, {"AT+MV18R=?\r", "\r\n+MV18R:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.4.5 - V.18 reporting control */ {"AT+MV18R?\r", "\r\n+MV18R:0\r\n\r\nOK\r\n"}, {"AT+MV18S\r", "\r\nOK\r\n"}, /* V.250 6.4.4 - V.18 selection */ {"AT+TADR\r", "\r\nOK\r\n"}, /* V.250 6.7.2.9 - Local V.54 address */ {"AT+TAL=?\r", "\r\n+TAL:(0,1),(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.15 - Local analogue loop */ {"AT+TAL?\r", "\r\n+TAL:0,0\r\n\r\nOK\r\n"}, {"AT+TALS=?\r", "\r\n+TALS:(0-3)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.6 - Analogue loop status */ {"AT+TALS?\r", "\r\n+TALS:0\r\n\r\nOK\r\n"}, {"AT+TDLS=?\r", "\r\n+TDLS:(0-4)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.7 - Local digital loop status */ {"AT+TDLS?\r", "\r\n+TDLS:0\r\n\r\nOK\r\n"}, {"AT+TE140=?\r", "\r\n+TE140:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.1 - Enable ckt 140 */ {"AT+TE140?\r", "\r\n+TE140:0\r\n\r\nOK\r\n"}, {"AT+TE141=?\r", "\r\n+TE141:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.2 - Enable ckt 141 */ {"AT+TE141?\r", "\r\n+TE141:0\r\n\r\nOK\r\n"}, {"AT+TEPAL=?\r", "\r\n+TEPAL:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.5 - Enable front panel analogue loop */ {"AT+TEPAL?\r", "\r\n+TEPAL:0\r\n\r\nOK\r\n"}, {"AT+TEPDL=?\r", "\r\n+TEPDL:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.4 - Enable front panel RDL */ {"AT+TEPDL?\r", "\r\n+TEPDL:0\r\n\r\nOK\r\n"}, {"AT+TERDL=?\r", "\r\n+TERDL:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.3 - Enable RDL from remote */ {"AT+TERDL?\r", "\r\n+TERDL:0\r\n\r\nOK\r\n"}, {"AT+TLDL=?\r", "\r\n+TLDL:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.13 - Local digital loop */ {"AT+TLDL?\r", "\r\n+TLDL:0\r\n\r\nOK\r\n"}, {"AT+TMODE=?\r", "\r\n+TMODE:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.10 - Set V.54 mode */ {"AT+TMODE?\r", "\r\n+TMODE:0\r\n\r\nOK\r\n"}, {"AT+TNUM\r", "\r\nOK\r\n"}, /* V.250 6.7.2.12 - Errored bit and block counts */ {"AT+TRDL=?\r", "\r\n+TRDL:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.14 - Request remote digital loop */ {"AT+TRDL?\r", "\r\n+TRDL:0\r\n\r\nOK\r\n"}, {"AT+TRDLS\r", "\r\nOK\r\n"}, /* V.250 6.7.2.8 - Remote digital loop status */ {"AT+TRES=?\r", "\r\n+TRES:(0-2)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.17 - Self test result */ {"AT+TRES?\r", "\r\n+TRES:0\r\n\r\nOK\r\n"}, {"AT+TSELF=?\r", "\r\n+TSELF:(0,1)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.16 - Self test */ {"AT+TSELF?\r", "\r\n+TSELF:0\r\n\r\nOK\r\n"}, {"AT+TTER=?\r", "\r\n+TTER:(0-65535),(0-65535)\r\n\r\nOK\r\n"}, /* V.250 6.7.2.11 - Test error rate */ {"AT+TTER?\r", "\r\n+TTER:0,0\r\n\r\nOK\r\n"}, {"AT+VBT\r", "\r\nOK\r\n"}, /* 3GPP TS 27.007 C.2.2 - Buffer threshold setting */ {"AT+VCID=?\r", "\r\n0,1\r\n\r\nOK\r\n"}, /* 3GPP TS 27.007 C.2.3 - Calling number ID presentation */ {"AT+VCID?\r", "\r\n0\r\n\r\nOK\r\n"}, {"AT+VDR\r", "\r\nOK\r\n"}, /* V.253 10.3.1 - Distinctive ring (ring cadence reporting) */ {"AT+VDT\r", "\r\nOK\r\n"}, /* V.253 10.3.2 - Control tone cadence reporting */ {"AT+VDX\r", "\r\nOK\r\n"}, /* V.253 10.5.6 - Speakerphone duplex mode */ {"AT+VEM\r", "\r\nOK\r\n"}, /* V.253 10.5.7 - Deliver event reports */ {"AT+VGM\r", "\r\nOK\r\n"}, /* V.253 10.5.2 - Microphone gain */ {"AT+VGR\r", "\r\nOK\r\n"}, /* V.253 10.2.1 - Receive gain selection */ {"AT+VGS\r", "\r\nOK\r\n"}, /* V.253 10.5.3 - Speaker gain */ {"AT+VGT\r", "\r\nOK\r\n"}, /* V.253 10.2.2 - Volume selection */ {"AT+VIP\r", "\r\nOK\r\n"}, /* V.253 10.1.1 - Initialize voice parameters */ {"AT+VIT\r", "\r\nOK\r\n"}, /* V.253 10.2.3 - DTE/DCE inactivity timer */ {"AT+VLS\r", "\r\nOK\r\n"}, /* V.253 10.2.4 - Analogue source/destination selection */ {"AT+VPP\r", "\r\nOK\r\n"}, /* V.253 10.4.2 - Voice packet protocol */ {"AT+VRA\r", "\r\nOK\r\n"}, /* V.253 10.2.5 - Ringing tone goes away timer */ {"AT+VRID?\r", "\r\n0\r\n\r\nOK\r\n"}, /* Extension - Find the originating and destination numbers */ {"AT+VRL\r", "\r\nOK\r\n"}, /* V.253 10.1.2 - Ring local phone */ {"AT+VRN\r", "\r\nOK\r\n"}, /* V.253 10.2.6 - Ringing tone never appeared timer */ {"AT+VRX\r", "\r\nOK\r\n"}, /* V.253 10.1.3 - Voice receive state */ {"AT+VSD\r", "\r\nOK\r\n"}, /* V.253 10.2.7 - Silence detection (QUIET and SILENCE) */ {"AT+VSID=12345\r", "\r\nOK\r\n"}, /* Extension - Set the originating number */ {"AT+VSID?\r", "\r\n12345\r\n\r\nOK\r\n"}, {"AT+VSM\r", "\r\nOK\r\n"}, /* V.253 10.2.8 - Compression method selection */ {"AT+VSP\r", "\r\nOK\r\n"}, /* V.253 10.5.1 - Voice speakerphone state */ {"AT+VTA\r", "\r\nOK\r\n"}, /* V.253 10.5.4 - Train acoustic echo-canceller */ {"AT+VTD\r", "\r\nOK\r\n"}, /* V.253 10.2.9 - Beep tone duration timer */ {"AT+VTH\r", "\r\nOK\r\n"}, /* V.253 10.5.5 - Train line echo-canceller */ {"AT+VTR\r", "\r\nOK\r\n"}, /* V.253 10.1.4 - Voice duplex state */ {"AT+VTS\r", "\r\nOK\r\n"}, /* V.253 10.1.5 - DTMF and tone generation in voice */ {"AT+VTX\r", "\r\nOK\r\n"}, /* V.253 10.1.6 - Transmit data state */ {"AT+WS46\r", "\r\nOK\r\n"}, /* 3GPP TS 27.007 5.9 - PCCA STD-101 [17] select wireless network */ {"ATA\r", "\r\nERROR\r\n"}, /* V.250 6.3.5 - Answer */ {"ATDT -1234567890ABCDPSTW*#+,!@\r;", ""}, /* V.250 6.3.1 - Dial */ {"ATE1\r", "\r\nOK\r\n"}, /* V.250 6.2.4 - Command echo */ {"ATE0\r", "ATE0\r\r\nOK\r\n"}, /* V.250 6.2.4 - Command echo */ {"ATH\r", "\r\nOK\r\n"}, /* V.250 6.3.6 - Hook control */ {"ATI\r", "\r\n" PACKAGE "\r\n\r\nOK\r\n"}, /* V.250 6.1.3 - Request identification information */ {"ATL\r", "\r\nOK\r\n"}, /* V.250 6.3.13 - Monitor speaker loudness */ {"ATM\r", "\r\nOK\r\n"}, /* V.250 6.3.14 - Monitor speaker mode */ {"ATO\r", "\r\nCONNECT\r\n\r\nOK\r\n"}, /* V.250 6.3.7 - Return to online data state */ {"ATP\r", "\r\nOK\r\n"}, /* V.250 6.3.3 - Select pulse dialling (command) */ {"ATQ\r", "\r\nOK\r\n"}, /* V.250 6.2.5 - Result code suppression */ {"ATS0=?\r", "\r\n000\r\n\r\nOK\r\n"}, /* V.250 6.3.8 - Automatic answer */ {"ATS0?\r", "\r\n000\r\n\r\nOK\r\n"}, {"ATS10=?\r", "\r\n000\r\n\r\nOK\r\n"}, /* V.250 6.3.12 - Automatic disconnect delay */ {"ATS10?\r", "\r\n000\r\n\r\nOK\r\n"}, {"ATS3=?\r", "\r\n000\r\n\r\nOK\r\n"}, /* V.250 6.2.1 - Command line termination character */ {"ATS3?\r", "\r\n013\r\n\r\nOK\r\n"}, {"ATS4=?\r", "\r\n000\r\n\r\nOK\r\n"}, /* V.250 6.2.2 - Response formatting character */ {"ATS4?\r", "\r\n010\r\n\r\nOK\r\n"}, {"ATS5=?\r", "\r\n000\r\n\r\nOK\r\n"}, /* V.250 6.2.3 - Command line editing character */ {"ATS5?\r", "\r\n008\r\n\r\nOK\r\n"}, {"ATS6=?\r", "\r\n000\r\n\r\nOK\r\n"}, /* V.250 6.3.9 - Pause before blind dialling */ {"ATS6?\r", "\r\n001\r\n\r\nOK\r\n"}, {"ATS7=?\r", "\r\n000\r\n\r\nOK\r\n"}, /* V.250 6.3.10 - Connection completion timeout */ {"ATS7?\r", "\r\n060\r\n\r\nOK\r\n"}, {"ATS8=?\r", "\r\n000\r\n\r\nOK\r\n"}, /* V.250 6.3.11 - Comma dial modifier time */ {"ATS8?\r", "\r\n005\r\n\r\nOK\r\n"}, {"ATT\r", "\r\nOK\r\n"}, /* V.250 6.3.2 - Select tone dialling (command) */ {"ATV0\r", "0\r"}, /* V.250 6.2.6 - DCE response format */ {"ATV1\r", "\r\nOK\r\n"}, {"ATX4\r", "\r\nOK\r\n"}, /* V.250 6.2.7 - Result code selection and call progress monitoring control */ {"ATZ\r", "\r\nOK\r\n"}, /* V.250 6.1.1 - Reset to default configuration */ {"", ""} }; char *decode_test_file = NULL; int countdown = 0; int command_response_test_step = -1; char response_buf[1000]; int response_buf_ptr = 0; static int at_rx(at_state_t *s, const char *t, int len) { at_interpreter(s, t, len); return 0; } /*- End of function --------------------------------------------------------*/ static int at_send(at_state_t *s, const char *t) { printf("%s", t); at_rx(s, t, strlen(t)); return 0; } /*- End of function --------------------------------------------------------*/ #if 0 static int at_send_at(at_state_t *s, const char *t) { uint8_t buf[500]; sprintf((char *) buf, "AT%s\r", t); printf("%s", t); at_rx(s, t, strlen(t)); return 0; } /*- End of function --------------------------------------------------------*/ static int at_expect(at_state_t *s, const char *t) { return 0; } /*- End of function --------------------------------------------------------*/ static int at_send_hdlc(at_state_t *s, uint8_t *t, int len) { uint8_t buf[100]; int i; int j; for (i = 0, j = 0; i < len; i++) { if (*t == DLE) buf[j++] = DLE; buf[j++] = *t++; } buf[j++] = DLE; buf[j++] = ETX; at_rx(s, (char *) buf, j); return 0; } /*- End of function --------------------------------------------------------*/ #endif static int general_test(at_state_t *s) { int i; for (i = 0; general_test_seq[i].command[0]; i++) { response_buf_ptr = 0; response_buf[0] = '\0'; command_response_test_step = i; at_send(s, general_test_seq[i].command); if (strcmp(general_test_seq[command_response_test_step].response, response_buf) != 0) { printf("Incorrect response\n"); printf("Expected: '%s'\n", general_test_seq[command_response_test_step].response); printf("Received: '%s'\n", response_buf); return -1; } } return 0; } /*- End of function --------------------------------------------------------*/ static int modem_call_control(at_state_t *s, void *user_data, int op, const char *num) { switch (op) { case AT_MODEM_CONTROL_CALL: printf("\nModem control - Dialing '%s'\n", num); break; case AT_MODEM_CONTROL_ANSWER: printf("\nModem control - Answering\n"); /* Force an error response, so we get something well defined for the test. */ return -1; case AT_MODEM_CONTROL_HANGUP: printf("\nModem control - Hanging up\n"); break; case AT_MODEM_CONTROL_OFFHOOK: printf("\nModem control - Going off hook\n"); break; case AT_MODEM_CONTROL_ONHOOK: printf("\nModem control - Going on hook\n"); break; case AT_MODEM_CONTROL_DTR: printf("\nModem control - DTR %d\n", (int) (intptr_t) num); break; case AT_MODEM_CONTROL_RTS: printf("\nModem control - RTS %d\n", (int) (intptr_t) num); break; case AT_MODEM_CONTROL_CTS: printf("\nModem control - CTS %d\n", (int) (intptr_t) num); break; case AT_MODEM_CONTROL_CAR: printf("\nModem control - CAR %d\n", (int) (intptr_t) num); break; case AT_MODEM_CONTROL_RNG: printf("\nModem control - RNG %d\n", (int) (intptr_t) num); break; case AT_MODEM_CONTROL_DSR: printf("\nModem control - DSR %d\n", (int) (intptr_t) num); break; case AT_MODEM_CONTROL_SETID: printf("\nModem control - Set ID '%s'\n", num); break; case AT_MODEM_CONTROL_RESTART: printf("\nModem control - Restart %d\n", (int) (intptr_t) num); break; case AT_MODEM_CONTROL_DTE_TIMEOUT: printf("\nModem control - Set DTE timeout %d\n", (int) (intptr_t) num); break; default: printf("\nModem control - operation %d\n", op); break; } /*endswitch*/ return 0; } /*- End of function --------------------------------------------------------*/ static int at_tx_handler(at_state_t *s, void *user_data, const uint8_t *buf, size_t len) { int i; for (i = 0; i < len; i++) { response_buf[response_buf_ptr++] = buf[i]; putchar(buf[i]); } response_buf[response_buf_ptr] = '\0'; return 0; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { at_state_t at_state; if (at_init(&at_state, at_tx_handler, NULL, modem_call_control, NULL) == NULL) { fprintf(stderr, "Cannot start the AT interpreter\n"); exit(2); } if (general_test(&at_state)) { printf("Tests failed.\n"); exit(2); } printf("Tests passed.\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/ademco_contactid_tests.c0000664000175000017500000002762712101003656016130 00000000000000/* * SpanDSP - a series of DSP components for telephony * * ademco_contactid.c - Ademco ContactID alarm protocol * * Written by Steve Underwood * * Copyright (C) 2012 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 2.1, * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \page ademco_contactid_tests_page Ademco ContactID tests \section ademco_contactid_tests_page_sec_1 What does it do? \section ademco_contactid_tests_page_sec_2 How does it work? */ /* Enable the following definition to enable direct probing into the FAX structures */ //#define WITH_SPANDSP_INTERNALS #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) //#define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #define SAMPLES_PER_CHUNK 160 #define OUTPUT_FILE_NAME "ademco_contactid.wav" #define MITEL_DIR "../test-data/mitel/" #define BELLCORE_DIR "../test-data/bellcore/" const char *bellcore_files[] = { MITEL_DIR "mitel-cm7291-talkoff.wav", BELLCORE_DIR "tr-tsy-00763-1.wav", BELLCORE_DIR "tr-tsy-00763-2.wav", BELLCORE_DIR "tr-tsy-00763-3.wav", BELLCORE_DIR "tr-tsy-00763-4.wav", BELLCORE_DIR "tr-tsy-00763-5.wav", BELLCORE_DIR "tr-tsy-00763-6.wav", "" }; static const ademco_contactid_report_t reports[] = { {0x1234, 0x18, 0x1, 0x131, 0x1, 0x15}, {0x1234, 0x18, 0x3, 0x131, 0x1, 0x15}, {0x1234, 0x18, 0x1, 0x401, 0x2, 0x3}, {0x1234, 0x18, 0x3, 0x401, 0x3, 0x5}, {0x1234, 0x56, 0x7, 0x890, 0xBC, 0xDEF}, {0x1234, 0x56, 0x7, 0x89A, 0xBC, 0xDEF} /* This one is bad, as it contains a hex 'A' */ }; static int reports_entry = 0; static int16_t amp[1000000]; int tx_callback_reported = FALSE; int rx_callback_reported = FALSE; int sending_complete = FALSE; SNDFILE *outhandle; static void talkoff_tx_callback(void *user_data, int tone, int level, int duration) { printf("Ademco sender report %d\n", tone); tx_callback_reported = TRUE; } static int mitel_cm7291_side_2_and_bellcore_tests(void) { int j; SNDFILE *inhandle; int frames; ademco_contactid_sender_state_t *sender; logging_state_t *logging; if ((sender = ademco_contactid_sender_init(NULL, talkoff_tx_callback, NULL)) == NULL) return -1; logging = ademco_contactid_sender_get_logging_state(sender); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Ademco-tx"); tx_callback_reported = FALSE; /* The remainder of the Mitel tape is the talk-off test */ /* Here we use the Bellcore test tapes (much tougher), in six files - 1 from each side of the original 3 cassette tapes */ /* Bellcore say you should get no more than 470 false detections with a good receiver. Dialogic claim 20. Of course, we can do better than that, eh? */ printf("Talk-off test\n"); for (j = 0; bellcore_files[j][0]; j++) { if ((inhandle = sf_open_telephony_read(bellcore_files[j], 1)) == NULL) { printf(" Cannot open speech file '%s'\n", bellcore_files[j]); return -1; } while ((frames = sf_readf_short(inhandle, amp, SAMPLE_RATE))) { ademco_contactid_sender_rx(sender, amp, frames); } if (sf_close_telephony(inhandle)) { printf(" Cannot close speech file '%s'\n", bellcore_files[j]); return -1; } printf(" File %d gave %d false hits.\n", j + 1, 0); } if (tx_callback_reported) { printf(" Failed\n"); return -1; } printf(" Passed\n"); return 0; } /*- End of function --------------------------------------------------------*/ static void rx_callback(void *user_data, const ademco_contactid_report_t *report) { printf("Ademco Contact ID message:\n"); printf(" Account %X\n", report->acct); printf(" Message type %X\n", report->mt); printf(" Qualifier %X\n", report->q); printf(" Event %X\n", report->xyz); printf(" Group/partition %X\n", report->gg); printf(" User/Zone information %X\n", report->ccc); if (memcmp(&reports[reports_entry], report, sizeof (*report))) { printf("Report mismatch\n"); exit(2); } rx_callback_reported = TRUE; } /*- End of function --------------------------------------------------------*/ static void tx_callback(void *user_data, int tone, int level, int duration) { ademco_contactid_sender_state_t *sender; sender = (ademco_contactid_sender_state_t *) user_data; printf("Ademco sender report %d\n", tone); switch (tone) { case -1: /* We are connected and ready to send */ ademco_contactid_sender_put(sender, &reports[reports_entry]); break; case 1: /* We have succeeded in sending, and are ready to send another message. */ if (++reports_entry < 5) ademco_contactid_sender_put(sender, &reports[reports_entry]); else sending_complete = TRUE; break; case 0: /* Sending failed after retries */ sending_complete = TRUE; break; } } /*- End of function --------------------------------------------------------*/ static int end_to_end_tests(void) { ademco_contactid_receiver_state_t *receiver; ademco_contactid_sender_state_t *sender; logging_state_t *logging; codec_munge_state_t *munge; awgn_state_t noise_source; int16_t amp[SAMPLES_PER_CHUNK]; int16_t sndfile_buf[2*SAMPLES_PER_CHUNK]; int samples; int i; int j; printf("End to end tests\n"); if ((outhandle = sf_open_telephony_write(OUTPUT_FILE_NAME, 2)) == NULL) { fprintf(stderr, " Cannot open audio file '%s'\n", OUTPUT_FILE_NAME); exit(2); } if ((receiver = ademco_contactid_receiver_init(NULL, rx_callback, NULL)) == NULL) return -1; ademco_contactid_receiver_set_realtime_callback(receiver, rx_callback, receiver); logging = ademco_contactid_receiver_get_logging_state(receiver); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Ademco-rx"); if ((sender = ademco_contactid_sender_init(NULL, tx_callback, NULL)) == NULL) return -1; ademco_contactid_sender_set_realtime_callback(sender, tx_callback, sender); logging = ademco_contactid_sender_get_logging_state(sender); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Ademco-tx"); awgn_init_dbm0(&noise_source, 1234567, -50); munge = codec_munge_init(MUNGE_CODEC_ALAW, 0); sending_complete = FALSE; rx_callback_reported = FALSE; for (i = 0; i < 1000; i++) { samples = ademco_contactid_sender_tx(sender, amp, SAMPLES_PER_CHUNK); for (j = samples; j < SAMPLES_PER_CHUNK; j++) amp[j] = 0; for (j = 0; j < SAMPLES_PER_CHUNK; j++) sndfile_buf[2*j] = amp[j]; /* There is no point in impairing this signal. It is just DTMF tones, which will work as wel as the DTMF detector beign used. */ ademco_contactid_receiver_rx(receiver, amp, SAMPLES_PER_CHUNK); samples = ademco_contactid_receiver_tx(receiver, amp, SAMPLES_PER_CHUNK); for (j = samples; j < SAMPLES_PER_CHUNK; j++) amp[j] = 0; /* We add AWGN and codec impairments to the signal, to stress the tone detector. */ codec_munge(munge, amp, SAMPLES_PER_CHUNK); for (j = 0; j < SAMPLES_PER_CHUNK; j++) { sndfile_buf[2*j + 1] = amp[j]; /* Add noise to the tones */ amp[j] += awgn(&noise_source); } codec_munge(munge, amp, SAMPLES_PER_CHUNK); ademco_contactid_sender_rx(sender, amp, SAMPLES_PER_CHUNK); sf_writef_short(outhandle, sndfile_buf, SAMPLES_PER_CHUNK); } if (!rx_callback_reported) { fprintf(stderr, " Report not received\n"); return -1; } if (sf_close_telephony(outhandle)) { fprintf(stderr, " Cannot close audio file '%s'\n", OUTPUT_FILE_NAME); return -1; } printf(" Passed\n"); return 0; } /*- End of function --------------------------------------------------------*/ static int encode_decode_tests(void) { char buf[100]; ademco_contactid_receiver_state_t *receiver; ademco_contactid_sender_state_t *sender; logging_state_t *logging; ademco_contactid_report_t result; int i; printf("Encode and decode tests\n"); if ((receiver = ademco_contactid_receiver_init(NULL, NULL, NULL)) == NULL) return 2; logging = ademco_contactid_receiver_get_logging_state(receiver); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Ademco-rx"); if ((sender = ademco_contactid_sender_init(NULL, NULL, NULL)) == NULL) return 2; logging = ademco_contactid_sender_get_logging_state(sender); span_log_set_level(logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_FLOW); span_log_set_tag(logging, "Ademco-tx"); for (i = 0; i < 5; i++) { if (encode_msg(buf, &reports[i]) < 0) { printf("Bad encode message\n"); return -1; } printf("'%s'\n", buf); if (decode_msg(&result, buf)) { printf("Bad decode message\n"); return -1; } ademco_contactid_receiver_log_msg(receiver, &result); printf("\n"); if (memcmp(&reports[i], &result, sizeof(result))) { printf("Received message does not match the one sent\n"); return -1; } } if (encode_msg(buf, &reports[5]) >= 0) { printf("Incorrectly good message\n"); return -1; } printf("'%s'\n", buf); printf("\n"); printf(" Passed\n"); return 0; } /*- End of function --------------------------------------------------------*/ static void decode_file(const char *file) { //SPAN_DECLARE(int) decode_msg(ademco_contactid_report_t *report, const char buf[]) } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int opt; const char *decode_test_file; decode_test_file = NULL; while ((opt = getopt(argc, argv, "d:")) != -1) { switch (opt) { case 'd': decode_test_file = optarg; break; default: //usage(); exit(2); break; } } if (decode_test_file) { decode_file(decode_test_file); return 0; } if (encode_decode_tests()) { printf("Tests failed\n"); return 2; } if (mitel_cm7291_side_2_and_bellcore_tests()) { printf("Tests failed\n"); return 2; } if (end_to_end_tests()) { printf("Tests failed\n"); return 2; } printf("Tests passed\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/t4_tests.c0000664000175000017500000007321512101215702013166 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t4_tests.c - ITU T.4 FAX image to and from TIFF file tests * * Written by Steve Underwood * * Copyright (C) 2003 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page t4_tests_page T.4 tests \section t4_tests_page_sec_1 What does it do These tests exercise the image compression and decompression methods defined in ITU specifications T.4 and T.6. */ #if defined(HAVE_CONFIG_H) #include "config.h" #endif #include #include #include #include #include //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #define IN_FILE_NAME "../test-data/itu/fax/itutests.tif" #define OUT_FILE_NAME "t4_tests_receive.tif" #define XSIZE 1728 t4_tx_state_t send_state; t4_rx_state_t receive_state; /* The following are some test cases from T.4 */ #define FILL_70 " " #define FILL_80 " " #define FILL_100 " " #define FILL_670 FILL_100 FILL_100 FILL_100 FILL_100 FILL_100 FILL_100 FILL_70 #define FILL_980 FILL_100 FILL_100 FILL_100 FILL_100 FILL_100 FILL_100 FILL_100 FILL_100 FILL_100 FILL_80 static const char t4_t6_test_patterns[][1728 + 1] = { "XXXXXX " FILL_980 " XXX XXX X " FILL_670 " XXXX", "XXXXXX " FILL_980 " XXX X " FILL_670 " XXXX", /* Line start should code to V(0). Line middle codes to VR(3) VL(2) V(0). Line end should code to V(0) V(0). */ " XXXX " FILL_980 " XXXXXXX " FILL_670 " XX ", "XXXXX " FILL_980 "XX XX " FILL_670 " XXXX", /* Line start should code to VL(1). Line middle codes to H(7,2). Line end should code to V(0) VR(2) */ "XXX " FILL_980 " XX XX XX XXX " FILL_670 " X ", " " FILL_980 " X XXX XXXX " FILL_670 " X XX", /* Line start should code to P. Line middle codes to P VL(1) V(0) H(3,4) P. Line end codes to V(0) VL(2) V(0). */ "XXXXX " FILL_980 " " FILL_670 " XXXX", " XXX " FILL_980 " " FILL_670 " XX ", /* Line start should code to VR(2). Line end codes to V(0) VL(2) V(0). */ " XX " FILL_980 " " FILL_670 " X XXX", "XXX X " FILL_980 " " FILL_670 " X ", /* Line start should code to H(0,3) VR(1). Line end codes to V(0) VR(3). */ " " FILL_980 " " FILL_670 " XX ", " " FILL_980 " " FILL_670 " ", /* Line end codes to P V(0) a'0. */ " " FILL_980 " " FILL_670 " XXXXXXXXXX", " " FILL_980 " " FILL_670 " XXXXXX XXXXXX", /* Line end codes to H(2,6). */ " " FILL_980 " " FILL_670 " XX XXXXX", " " FILL_980 " " FILL_670 " XX ", /* Line end codes to V(0) H(7,0). */ }; int rows_written = 0; int rows_read = 0; static void dump_image_as_xxx(t4_rx_state_t *state) { #if 1 int i; int j; int k; /* Dump the entire image as text 'X's and spaces */ printf("Image (%d x %d):\n", state->image_width, state->image_length); for (i = 0; i < state->image_length; i++) { for (j = 0; j < state->bytes_per_row; j++) { for (k = 0; k < 8; k++) printf((state->image_buffer[i*state->bytes_per_row + j] & (0x80 >> k)) ? "X" : " "); } printf("\n"); } #endif } /*- End of function --------------------------------------------------------*/ static void display_page_stats(t4_rx_state_t *s) { t4_stats_t stats; t4_rx_get_transfer_statistics(s, &stats); printf("Pages = %d\n", stats.pages_transferred); printf("Compression = %s\n", t4_encoding_to_str(stats.encoding)); printf("Compressed size = %d\n", stats.line_image_size); printf("Image size = %d pels x %d pels\n", stats.width, stats.length); printf("Image resolution = %d pels/m x %d pels/m\n", stats.x_resolution, stats.y_resolution); printf("Bad rows = %d\n", stats.bad_rows); printf("Longest bad row run = %d\n", stats.longest_bad_row_run); printf("Bits per row - min %d, max %d\n", s->min_row_bits, s->max_row_bits); } /*- End of function --------------------------------------------------------*/ static int row_read_handler(void *user_data, uint8_t buf[], size_t len) { int i; int j; const char *s; /* Send the test pattern. */ if (rows_read >= 16) return 0; s = t4_t6_test_patterns[rows_read++]; memset(buf, 0, len); for (i = 0; i < len; i++) { for (j = 0; j < 8; j++) { if (*s++ != ' ') buf[i] |= (0x80 >> j); } } if (*s) printf("Oops - '%c' at end of row %d\n", *s, rows_read); return len; } /*- End of function --------------------------------------------------------*/ static int row_write_handler(void *user_data, const uint8_t buf[], size_t len) { int i; int j; const char *s; uint8_t ref[8192]; /* Verify that what is received matches the test pattern. */ if (len == 0) return 0; s = t4_t6_test_patterns[rows_written++]; memset(ref, 0, len); for (i = 0; i < len; i++) { for (j = 0; j < 8; j++) { if (*s++ != ' ') ref[i] |= (0x80 >> j); } } if (*s) printf("Oops - '%c' at end of row %d\n", *s, rows_written); if (memcmp(buf, ref, len)) { printf("Test failed at row %d\n", rows_written); exit(2); } return 0; } /*- End of function --------------------------------------------------------*/ static int detect_page_end(int bit, int page_ended) { static int consecutive_eols; static int max_consecutive_eols; static int consecutive_zeros; static int consecutive_ones; static int eol_zeros; static int eol_ones; static int expected_eols; static int end_marks; /* Check the EOLs are added properly to the end of an image. We can't rely on the decoder giving the right answer, as a full set of EOLs is not needed for the decoder to work. */ if (bit == -1000000) { /* Reset */ consecutive_eols = 0; max_consecutive_eols = 0; consecutive_zeros = 0; consecutive_ones = 0; end_marks = 0; eol_zeros = 11; eol_ones = (page_ended == T4_COMPRESSION_ITU_T4_2D) ? 2 : 1; expected_eols = (page_ended == T4_COMPRESSION_ITU_T6) ? 2 : 6; return 0; } /* Monitor whether the EOLs are there in the correct amount */ if (bit == 0) { consecutive_zeros++; consecutive_ones = 0; } else if (bit == 1) { if (++consecutive_ones == eol_ones) { if (consecutive_eols == 0 && consecutive_zeros >= eol_zeros) consecutive_eols++; else if (consecutive_zeros == eol_zeros) consecutive_eols++; else consecutive_eols = 0; consecutive_zeros = 0; consecutive_ones = 0; } if (max_consecutive_eols < consecutive_eols) max_consecutive_eols = consecutive_eols; } else if (bit == SIG_STATUS_END_OF_DATA) { if (end_marks == 0) { if (max_consecutive_eols != expected_eols) { printf("Only %d EOLs (should be %d)\n", max_consecutive_eols, expected_eols); return 2; } consecutive_zeros = 0; consecutive_eols = 0; max_consecutive_eols = 0; } if (!page_ended) { /* We might need to push a few bits to get the receiver to report the end of page condition (at least with T.6). */ if (++end_marks > 50) { printf("Receiver missed the end of page mark\n"); return 2; } return 0; } return 1; } return 0; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { static const int compression_sequence[] = { //T4_COMPRESSION_NONE, T4_COMPRESSION_ITU_T4_1D, T4_COMPRESSION_ITU_T4_2D, T4_COMPRESSION_ITU_T6, #if defined(SPANDSP_SUPPORT_T42x) T4_COMPRESSION_ITU_T42, T4_COMPRESSION_ITU_SYCC_T42, #endif #if defined(SPANDSP_SUPPORT_T43x) T4_COMPRESSION_ITU_T43, #endif #if defined(SPANDSP_SUPPORT_T85) T4_COMPRESSION_ITU_T85, T4_COMPRESSION_ITU_T85_L0, #endif //T4_COMPRESSION_ITU_T45, -1 }; int sends; int bit; int end_of_page; int end_marks; int res; int compression; int compression_step; int add_page_headers; //int overlay_page_headers; int min_row_bits; int restart_pages; int block_size; char buf[1024]; uint8_t block[1024]; const char *in_file_name; const char *decode_file_name; const char *page_header_tz; tz_t tz; int opt; int i; int bit_error_rate; int dump_as_xxx; int tests_failed; unsigned int last_pkt_no; unsigned int pkt_no; int page_ended; FILE *file; tests_failed = 0; compression = -1; compression_step = 0; add_page_headers = FALSE; //overlay_page_headers = FALSE; restart_pages = FALSE; in_file_name = IN_FILE_NAME; decode_file_name = NULL; page_header_tz = NULL; /* Use a non-zero default minimum row length to ensure we test the consecutive EOLs part properly. */ min_row_bits = 50; block_size = 1; bit_error_rate = 0; dump_as_xxx = FALSE; while ((opt = getopt(argc, argv, "b:c:d:ehHri:m:t:x")) != -1) { switch (opt) { case 'b': block_size = atoi(optarg); if (block_size > 1024) block_size = 1024; break; case 'c': if (strcmp(optarg, "T41D") == 0) { compression = T4_COMPRESSION_ITU_T4_1D; compression_step = -1; } else if (strcmp(optarg, "T42D") == 0) { compression = T4_COMPRESSION_ITU_T4_2D; compression_step = -1; } else if (strcmp(optarg, "T6") == 0) { compression = T4_COMPRESSION_ITU_T6; compression_step = -1; } #if defined(SPANDSP_SUPPORT_T42) else if (strcmp(optarg, "T42") == 0) { compression = T4_COMPRESSION_ITU_T42; compression_step = -1; } #endif #if defined(SPANDSP_SUPPORT_T43) else if (strcmp(optarg, "T43") == 0) { compression = T4_COMPRESSION_ITU_T43; compression_step = -1; } #endif #if defined(SPANDSP_SUPPORT_T85) else if (strcmp(optarg, "T85") == 0) { compression = T4_COMPRESSION_ITU_T85; compression_step = -1; } #endif break; case 'd': decode_file_name = optarg; break; case 'e': bit_error_rate = 0x3FF; break; case 'h': add_page_headers = TRUE; //overlay_page_headers = FALSE; break; case 'H': add_page_headers = TRUE; //overlay_page_headers = TRUE; break; case 'r': restart_pages = TRUE; break; case 'i': in_file_name = optarg; break; case 'm': min_row_bits = atoi(optarg); break; case 't': page_header_tz = optarg; break; case 'x': dump_as_xxx = TRUE; break; default: //usage(); exit(2); break; } } /* Create a send and a receive end */ memset(&send_state, 0, sizeof(send_state)); memset(&receive_state, 0, sizeof(receive_state)); end_of_page = FALSE; if (decode_file_name) { if (compression < 0) compression = T4_COMPRESSION_ITU_T4_1D; /* Receive end puts TIFF to a new file. We assume the receive width here. */ if (t4_rx_init(&receive_state, OUT_FILE_NAME, T4_COMPRESSION_ITU_T4_2D) == NULL) { printf("Failed to init T.4 rx\n"); exit(2); } span_log_set_level(&receive_state.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_FLOW); t4_rx_set_rx_encoding(&receive_state, compression); t4_rx_set_x_resolution(&receive_state, T4_X_RESOLUTION_R8); //t4_rx_set_y_resolution(&receive_state, T4_Y_RESOLUTION_FINE); t4_rx_set_y_resolution(&receive_state, T4_Y_RESOLUTION_STANDARD); t4_rx_set_image_width(&receive_state, XSIZE); t4_rx_start_page(&receive_state); last_pkt_no = 0; file = fopen(decode_file_name, "r"); while (fgets(buf, 1024, file)) { if (sscanf(buf, "HDLC: FCD: 06 %x", &pkt_no) == 1) { /* Useful for breaking up T.38 ECM logs */ for (i = 0; i < 256; i++) { if (sscanf(&buf[18 + 3*i], "%x", (unsigned int *) &bit) != 1) break; if ((end_of_page = t4_rx_put_byte(&receive_state, bit))) break; } } else if (sscanf(buf, "HDLC: %x", &pkt_no) == 1) { /* Useful for breaking up HDLC decodes of ECM logs */ for (i = 0; i < 256; i++) { if (sscanf(&buf[19 + 3*i], "%x", (unsigned int *) &bit) != 1) break; if ((end_of_page = t4_rx_put_byte(&receive_state, bit))) break; } } else if (sscanf(buf, "%*d:%*d:%*d.%*d T.38 Rx %d: IFP %x %x", &pkt_no, (unsigned int *) &bit, (unsigned int *) &bit) == 3) { /* Useful for breaking up T.38 non-ECM logs */ if (pkt_no != last_pkt_no + 1) printf("Packet %u\n", pkt_no); last_pkt_no = pkt_no; for (i = 0; i < 256; i++) { if (sscanf(&buf[47 + 3*i], "%x", (unsigned int *) &bit) != 1) break; bit = bit_reverse8(bit); if ((end_of_page = t4_rx_put_byte(&receive_state, bit))) break; } } else if (strlen(buf) > 2 && sscanf(buf, "T.30 Rx: %x %x", (unsigned int *) &bit, (unsigned int *) &bit) == 2) { /* Useful for breaking up ECM logs */ if (pkt_no != last_pkt_no + 1) printf("Packet %u\n", pkt_no); last_pkt_no = pkt_no; for (i = 0; i < 256; i++) { if (sscanf(&buf[22 + 3*i], "%x", (unsigned int *) &bit) != 1) break; bit = bit_reverse8(bit); if ((end_of_page = t4_rx_put_byte(&receive_state, bit))) break; } } else if (sscanf(buf, "%04x %02x %02x %02x", (unsigned int *) &bit, (unsigned int *) &bit, (unsigned int *) &bit, (unsigned int *) &bit) == 4) { for (i = 0; i < 16; i++) { if (sscanf(&buf[6 + 3*i], "%x", (unsigned int *) &bit) != 1) break; bit = bit_reverse8(bit); if ((end_of_page = t4_rx_put_byte(&receive_state, bit))) break; } } else if (sscanf(buf, "%08x %02x %02x %02x", (unsigned int *) &bit, (unsigned int *) &bit, (unsigned int *) &bit, (unsigned int *) &bit) == 4) { for (i = 0; i < 16; i++) { if (sscanf(&buf[10 + 3*i], "%x", (unsigned int *) &bit) != 1) break; bit = bit_reverse8(bit); if ((end_of_page = t4_rx_put_byte(&receive_state, bit))) break; } } else if (sscanf(buf, "Rx bit %*d - %d", &bit) == 1) { if ((end_of_page = t4_rx_put_bit(&receive_state, bit))) { printf("End of page detected\n"); break; } } } fclose(file); if (dump_as_xxx) dump_image_as_xxx(&receive_state); t4_rx_end_page(&receive_state); display_page_stats(&receive_state); t4_rx_release(&receive_state); } else { #if 1 printf("Testing image_function->compress->decompress->image_function\n"); /* Send end gets image from a function */ if (t4_tx_init(&send_state, in_file_name, -1, -1) == NULL) { printf("Failed to init T.4 tx\n"); exit(2); } span_log_set_level(&send_state.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_FLOW); t4_tx_set_row_read_handler(&send_state, row_read_handler, NULL); t4_tx_set_min_bits_per_row(&send_state, min_row_bits); t4_tx_set_local_ident(&send_state, "111 2222 3333"); /* Receive end puts TIFF to a function. */ if (t4_rx_init(&receive_state, OUT_FILE_NAME, T4_COMPRESSION_ITU_T4_2D) == NULL) { printf("Failed to init T.4 rx\n"); exit(2); } span_log_set_level(&receive_state.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_FLOW); t4_rx_set_row_write_handler(&receive_state, row_write_handler, NULL); t4_rx_set_image_width(&receive_state, t4_tx_get_image_width(&send_state)); t4_rx_set_x_resolution(&receive_state, t4_tx_get_x_resolution(&send_state)); t4_rx_set_y_resolution(&receive_state, t4_tx_get_y_resolution(&send_state)); /* Now send and receive the test data with all compression modes. */ /* If we are stepping around the compression schemes, reset to the start of the sequence. */ if (compression_step > 0) compression_step = 0; for (;;) { end_marks = 0; if (compression_step >= 0) { compression = compression_sequence[compression_step++]; if (compression < 0) break; } t4_tx_set_tx_encoding(&send_state, compression); t4_rx_set_rx_encoding(&receive_state, compression); rows_read = 0; rows_written = 0; if (t4_tx_start_page(&send_state)) break; if (t4_rx_start_page(&receive_state)) break; switch (block_size) { case 0: do { bit = t4_tx_get_bit(&send_state); if (bit == SIG_STATUS_END_OF_DATA) { if (++end_marks > 50) { printf("Receiver missed the end of page mark\n"); tests_failed++; break; } } end_of_page = t4_rx_put_bit(&receive_state, bit & 1); } while (!end_of_page); break; case 1: do { bit = t4_tx_get_byte(&send_state); if ((bit & 0x100)) { if (++end_marks > 50) { printf("Receiver missed the end of page mark\n"); tests_failed++; break; } } end_of_page = t4_rx_put_byte(&receive_state, bit & 0xFF); } while (!end_of_page); if ((t4_tx_get_byte(&send_state) & 0x100) == 0) { printf("Page ended, but source is not reporting end of data\n"); tests_failed++; } break; default: do { bit = t4_tx_get_chunk(&send_state, block, block_size); if (bit > 0) end_of_page = t4_rx_put_chunk(&receive_state, block, bit); if (bit < block_size) { if (++end_marks > 50) { printf("Receiver missed the end of page mark\n"); tests_failed++; break; } } } while (!end_of_page); break; } display_page_stats(&receive_state); t4_tx_end_page(&send_state); t4_rx_end_page(&receive_state); if (rows_read != (15 + 1) || rows_written != (15 + 1)) { printf("Test failed: %d rows read, %d rows written\n", rows_read, rows_written); exit(2); } if (compression_step < 0) break; } t4_tx_release(&send_state); t4_rx_release(&receive_state); #endif #if 1 printf("Testing TIFF->compress->decompress->TIFF cycle\n"); /* Send end gets TIFF from a file */ if (t4_tx_init(&send_state, in_file_name, -1, -1) == NULL) { printf("Failed to init T.4 send\n"); exit(2); } span_log_set_level(&send_state.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_FLOW); t4_tx_set_min_bits_per_row(&send_state, min_row_bits); t4_tx_set_local_ident(&send_state, "111 2222 3333"); /* Receive end puts TIFF to a new file. */ if (t4_rx_init(&receive_state, OUT_FILE_NAME, T4_COMPRESSION_ITU_T4_2D) == NULL) { printf("Failed to init T.4 rx for '%s'\n", OUT_FILE_NAME); exit(2); } span_log_set_level(&receive_state.logging, SPAN_LOG_SHOW_SEVERITY | SPAN_LOG_SHOW_PROTOCOL | SPAN_LOG_SHOW_TAG | SPAN_LOG_FLOW); t4_rx_set_x_resolution(&receive_state, t4_tx_get_x_resolution(&send_state)); t4_rx_set_y_resolution(&receive_state, t4_tx_get_y_resolution(&send_state)); t4_rx_set_image_width(&receive_state, t4_tx_get_image_width(&send_state)); /* Now send and receive all the pages in the source TIFF file */ sends = 0; /* If we are stepping around the compression schemes, reset to the start of the sequence. */ if (compression_step > 0) compression_step = 0; for (;;) { end_marks = 0; /* Add a header line to alternate pages, if required */ if (add_page_headers && (sends & 2)) t4_tx_set_header_info(&send_state, "Header"); else t4_tx_set_header_info(&send_state, NULL); if (page_header_tz && page_header_tz[0]) { if (tz_init(&tz, page_header_tz)) t4_tx_set_header_tz(&send_state, &tz); } //t4_tx_set_header_overlays_image(&send_state, overlay_page_headers); if (restart_pages && (sends & 1)) { /* Use restart, to send the page a second time */ if (t4_tx_restart_page(&send_state)) break; } else { if (compression_step >= 0) { compression = compression_sequence[compression_step++]; if (compression < 0) { compression_step = 0; compression = compression_sequence[compression_step++]; } } t4_tx_set_tx_encoding(&send_state, compression); t4_rx_set_rx_encoding(&receive_state, compression); if (t4_tx_start_page(&send_state)) break; } t4_rx_start_page(&receive_state); detect_page_end(-1000000, compression); page_ended = FALSE; switch (block_size) { case 0: for (;;) { bit = t4_tx_get_bit(&send_state); /* Monitor whether the EOLs are there in the correct amount */ if ((res = detect_page_end(bit, page_ended))) { tests_failed += (res - 1); break; } if (!page_ended) { if (bit_error_rate) { if ((rand() % bit_error_rate) == 0) bit ^= 1; } if (t4_rx_put_bit(&receive_state, bit & 1)) page_ended = TRUE; } } /* Now throw junk at the receive context, to ensure stuff occuring after the end of page condition has no bad effect. */ for (i = 0; i < 1000; i++) { t4_rx_put_bit(&receive_state, (rand() >> 10) & 1); } break; case 1: do { bit = t4_tx_get_byte(&send_state); if ((bit & 0x100)) { if (++end_marks > 50) { printf("Receiver missed the end of page mark\n"); tests_failed++; break; } } end_of_page = t4_rx_put_byte(&receive_state, bit & 0xFF); } while (!end_of_page); if ((t4_tx_get_byte(&send_state) & 0x100) == 0) { printf("Page ended, but source is not reporting end of data\n"); tests_failed++; } break; default: do { bit = t4_tx_get_chunk(&send_state, block, block_size); if (bit > 0) end_of_page = t4_rx_put_chunk(&receive_state, block, bit); if (bit < block_size) { if (++end_marks > 50) { printf("Receiver missed the end of page mark\n"); tests_failed++; break; } } } while (!end_of_page); break; } if (dump_as_xxx) dump_image_as_xxx(&receive_state); display_page_stats(&receive_state); if (!restart_pages || (sends & 1)) t4_tx_end_page(&send_state); t4_rx_end_page(&receive_state); sends++; } t4_tx_release(&send_state); t4_rx_release(&receive_state); /* And we should now have a matching received TIFF file. Note this will only match at the image level. TIFF files allow a lot of ways to express the same thing, so bit matching of the files is not the normal case. */ fflush(stdout); sprintf(buf, "tiffcmp -t %s %s", in_file_name, OUT_FILE_NAME); if (tests_failed || system(buf)) { printf("Tests failed\n"); exit(2); } #endif printf("Tests passed\n"); } return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/fax_tests.sh0000775000175000017500000000740712100553513013614 00000000000000#!/bin/sh # # spandsp fax tests # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 2.1, # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. run_fax_test() { rm -f fax_tests_1.tif echo -i ${FILE} ${OPTS} ./fax_tests -i ${FILE} ${OPTS} >xyzzy 2>xyzzy2 RETVAL=$? if [ $RETVAL != 0 ] then echo fax_tests failed! exit $RETVAL fi # Now use tiffcmp to check the results. It will return non-zero if any page images differ. The -t # option means the normal differences in tags will be ignored. tiffcmp -t ${FILE} fax_tests_1.tif #>/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo fax_tests failed! exit $RETVAL fi rm -f fax_tests_1.tif echo tested ${FILE} } ITUTESTS_DIR=../test-data/itu/fax OPTS="-e" FILE="${ITUTESTS_DIR}/R8_385_A4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R8_385_B4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R8_385_A3.tif" run_fax_test FILE="${ITUTESTS_DIR}/R8_77_A4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R8_77_B4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R8_77_A3.tif" run_fax_test FILE="${ITUTESTS_DIR}/R8_154_A4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R8_154_B4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R8_154_A3.tif" run_fax_test FILE="${ITUTESTS_DIR}/R300_300_A4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R300_300_B4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R300_300_A3.tif" run_fax_test FILE="${ITUTESTS_DIR}/R300_600_A4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R300_600_B4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R300_600_A3.tif" run_fax_test FILE="${ITUTESTS_DIR}/R16_154_A4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R16_154_B4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R16_154_A3.tif" run_fax_test FILE="${ITUTESTS_DIR}/R16_800_A4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R16_800_B4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R16_800_A3.tif" run_fax_test FILE="${ITUTESTS_DIR}/R600_600_A4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R600_600_B4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R600_600_A3.tif" run_fax_test FILE="${ITUTESTS_DIR}/R600_1200_A4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R600_1200_B4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R600_1200_A3.tif" run_fax_test FILE="${ITUTESTS_DIR}/R1200_1200_A4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R1200_1200_B4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R1200_1200_A3.tif" run_fax_test OPTS="" FILE="${ITUTESTS_DIR}/R8_385_A4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R8_385_B4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R8_385_A3.tif" run_fax_test FILE="${ITUTESTS_DIR}/R8_77_A4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R8_77_B4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R8_77_A3.tif" run_fax_test FILE="${ITUTESTS_DIR}/R8_154_A4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R8_154_B4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R8_154_A3.tif" run_fax_test FILE="${ITUTESTS_DIR}/R16_385_A4.tif" #run_fax_test FILE="${ITUTESTS_DIR}/R16_385_B4.tif" #run_fax_test FILE="${ITUTESTS_DIR}/R16_385_A3.tif" #run_fax_test FILE="${ITUTESTS_DIR}/R16_77_A4.tif" #run_fax_test FILE="${ITUTESTS_DIR}/R16_77_B4.tif" #run_fax_test FILE="${ITUTESTS_DIR}/R16_77_A3.tif" #run_fax_test FILE="${ITUTESTS_DIR}/R16_154_A4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R16_154_B4.tif" run_fax_test FILE="${ITUTESTS_DIR}/R16_154_A3.tif" run_fax_test spandsp-0.0.6/tests/t38_terminal_tests.c0000664000175000017500000003312412101215166015147 00000000000000/* * SpanDSP - a series of DSP components for telephony * * t38_terminal_tests.c - Tests for the T.38 FoIP terminal module. * * Written by Steve Underwood * * Copyright (C) 2005, 2006 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /*! \file */ /*! \page t38_terminal_tests_page T.38 termination tests \section t38_terminal_tests_page_sec_1 What does it do? These tests exercise the path T.38 termination <-> T.38 termination */ //#define WITH_SPANDSP_INTERNALS #if defined(HAVE_CONFIG_H) #include #endif #if defined(HAVE_FL_FL_H) && defined(HAVE_FL_FL_CARTESIAN_H) && defined(HAVE_FL_FL_AUDIO_METER_H) #define ENABLE_GUI #endif #include #include #include #include #include #include #if !defined(_WIN32) #include #endif //#if defined(WITH_SPANDSP_INTERNALS) #define SPANDSP_EXPOSE_INTERNAL_STRUCTURES //#endif #include "spandsp.h" #include "spandsp-sim.h" #if defined(ENABLE_GUI) #include "media_monitor.h" #endif #include "fax_utils.h" #define SAMPLES_PER_CHUNK 160 #define INPUT_FILE_NAME "../test-data/itu/fax/itutests.tif" #define OUTPUT_FILE_NAME "t38.tif" t38_terminal_state_t *t38_state_a; t38_terminal_state_t *t38_state_b; g1050_state_t *path_a_to_b; g1050_state_t *path_b_to_a; double when = 0.0; int done[2] = {FALSE, FALSE}; int succeeded[2] = {FALSE, FALSE}; int simulate_incrementing_repeats = FALSE; static int phase_b_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; i = (int) (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase B", i); printf("%c: Phase B handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result)); fax_log_rx_parameters(s, tag); return T30_ERR_OK; } /*- End of function --------------------------------------------------------*/ static int phase_d_handler(t30_state_t *s, void *user_data, int result) { int i; char tag[20]; i = (int) (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase D", i); printf("%c: Phase D handler on channel %c - (0x%X) %s\n", i, i, result, t30_frametype(result)); fax_log_page_transfer_statistics(s, tag); fax_log_tx_parameters(s, tag); fax_log_rx_parameters(s, tag); return T30_ERR_OK; } /*- End of function --------------------------------------------------------*/ static void phase_e_handler(t30_state_t *s, void *user_data, int result) { int i; t30_stats_t t; char tag[20]; i = (int) (intptr_t) user_data; snprintf(tag, sizeof(tag), "%c: Phase E", i); printf("%c: Phase E handler on channel %c - (%d) %s\n", i, i, result, t30_completion_code_to_str(result)); fax_log_final_transfer_statistics(s, tag); fax_log_tx_parameters(s, tag); fax_log_rx_parameters(s, tag); t30_get_transfer_statistics(s, &t); succeeded[i - 'A'] = (result == T30_ERR_OK) && (t.pages_tx == 12 || t.pages_rx == 12); //done[i - 'A'] = TRUE; } /*- End of function --------------------------------------------------------*/ static int tx_packet_handler_a(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count) { int i; static int subst_seq = 0; /* This routine queues messages between two instances of T.38 processing */ if (simulate_incrementing_repeats) { for (i = 0; i < count; i++) { span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d\n", subst_seq, len); if (g1050_put(path_a_to_b, buf, len, subst_seq, when) < 0) printf("Lost packet %d\n", subst_seq); subst_seq = (subst_seq + 1) & 0xFFFF; } } else { span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d, count %d\n", s->tx_seq_no, len, count); for (i = 0; i < count; i++) { if (g1050_put(path_a_to_b, buf, len, s->tx_seq_no, when) < 0) printf("Lost packet %d\n", s->tx_seq_no); } } return 0; } /*- End of function --------------------------------------------------------*/ static int tx_packet_handler_b(t38_core_state_t *s, void *user_data, const uint8_t *buf, int len, int count) { int i; static int subst_seq = 0; /* This routine queues messages between two instances of T.38 processing */ if (simulate_incrementing_repeats) { for (i = 0; i < count; i++) { span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d\n", subst_seq, len); g1050_put(path_b_to_a, buf, len, subst_seq, when); subst_seq = (subst_seq + 1) & 0xFFFF; } } else { span_log(&s->logging, SPAN_LOG_FLOW, "Send seq %d, len %d, count %d\n", s->tx_seq_no, len, count); for (i = 0; i < count; i++) g1050_put(path_b_to_a, buf, len, s->tx_seq_no, when); } return 0; } /*- End of function --------------------------------------------------------*/ int main(int argc, char *argv[]) { int msg_len; uint8_t msg[1024]; int t38_version; int seq_no; int use_ecm; int options; int use_tep; int g1050_model_no; int g1050_speed_pattern_no; const char *input_file_name; double tx_when; double rx_when; int use_gui; int supported_modems; int opt; t30_state_t *t30; t38_core_state_t *t38_core; logging_state_t *logging; t38_version = 1; options = 0; use_tep = FALSE; input_file_name = INPUT_FILE_NAME; use_ecm = FALSE; simulate_incrementing_repeats = FALSE; g1050_model_no = 0; g1050_speed_pattern_no = 1; use_gui = FALSE; supported_modems = T30_SUPPORT_V27TER | T30_SUPPORT_V29 | T30_SUPPORT_V17; while ((opt = getopt(argc, argv, "efgi:Im:M:o:s:tv:")) != -1) { switch (opt) { case 'e': use_ecm = TRUE; break; case 'g': #if defined(ENABLE_GUI) use_gui = TRUE; #else fprintf(stderr, "Graphical monitoring not available\n"); exit(2); #endif break; case 'i': input_file_name = optarg; break; case 'I': simulate_incrementing_repeats = TRUE; break; case 'm': supported_modems = atoi(optarg); break; case 'M': g1050_model_no = optarg[0] - 'A' + 1; break; case 'o': options = atoi(optarg); break; case 's': g1050_speed_pattern_no = atoi(optarg); break; case 't': use_tep = TRUE; break; case 'v': t38_version = atoi(optarg); break; default: //usage(); exit(2); break; } } printf("Using T.38 version %d\n", t38_version); if (use_ecm) printf("Using ECM\n"); srand48(0x1234567); if ((path_a_to_b = g1050_init(g1050_model_no, g1050_speed_pattern_no, 100, 33)) == NULL) { fprintf(stderr, "Failed to start IP network path model\n"); exit(2); } if ((path_b_to_a = g1050_init(g1050_model_no, g1050_speed_pattern_no, 100, 33)) == NULL) { fprintf(stderr, "Failed to start IP network path model\n"); exit(2); } if ((t38_state_a = t38_terminal_init(NULL, TRUE, tx_packet_handler_a, t38_state_b)) == NULL) { fprintf(stderr, "Cannot start the T.38 channel\n"); exit(2); } t30 = t38_terminal_get_t30_state(t38_state_a); t38_core = t38_terminal_get_t38_core_state(t38_state_a); t38_set_t38_version(t38_core, t38_version); t38_terminal_set_config(t38_state_a, options); t38_terminal_set_tep_mode(t38_state_a, use_tep); logging = t38_terminal_get_logging_state(t38_state_a); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-A"); logging = t38_core_get_logging_state(t38_core); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-A"); logging = t30_get_logging_state(t30); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-A"); t30_set_supported_modems(t30, supported_modems); t30_set_tx_ident(t30, "11111111"); t30_set_tx_nsf(t30, (const uint8_t *) "\x50\x00\x00\x00Spandsp\x00", 12); t30_set_tx_file(t30, input_file_name, -1, -1); t30_set_phase_b_handler(t30, phase_b_handler, (void *) (intptr_t) 'A'); t30_set_phase_d_handler(t30, phase_d_handler, (void *) (intptr_t) 'A'); t30_set_phase_e_handler(t30, phase_e_handler, (void *) (intptr_t) 'A'); t30_set_ecm_capability(t30, use_ecm); if (use_ecm) t30_set_supported_compressions(t30, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION | T30_SUPPORT_T85_COMPRESSION); if ((t38_state_b = t38_terminal_init(NULL, FALSE, tx_packet_handler_b, t38_state_a)) == NULL) { fprintf(stderr, "Cannot start the T.38 channel\n"); exit(2); } t30 = t38_terminal_get_t30_state(t38_state_b); t38_core = t38_terminal_get_t38_core_state(t38_state_b); t38_set_t38_version(t38_core, t38_version); t38_terminal_set_config(t38_state_b, options); t38_terminal_set_tep_mode(t38_state_b, use_tep); logging = t38_terminal_get_logging_state(t38_state_b); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-B"); logging = t38_core_get_logging_state(t38_core); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-B"); logging = t30_get_logging_state(t30); span_log_set_level(logging, SPAN_LOG_DEBUG | SPAN_LOG_SHOW_TAG | SPAN_LOG_SHOW_SAMPLE_TIME); span_log_set_tag(logging, "T.38-B"); t30_set_supported_modems(t30, supported_modems); t30_set_tx_ident(t30, "22222222"); t30_set_tx_nsf(t30, (const uint8_t *) "\x50\x00\x00\x00Spandsp\x00", 12); t30_set_rx_file(t30, OUTPUT_FILE_NAME, -1); t30_set_phase_b_handler(t30, phase_b_handler, (void *) (intptr_t) 'B'); t30_set_phase_d_handler(t30, phase_d_handler, (void *) (intptr_t) 'B'); t30_set_phase_e_handler(t30, phase_e_handler, (void *) (intptr_t) 'B'); t30_set_ecm_capability(t30, use_ecm); if (use_ecm) t30_set_supported_compressions(t30, T30_SUPPORT_T4_1D_COMPRESSION | T30_SUPPORT_T4_2D_COMPRESSION | T30_SUPPORT_T6_COMPRESSION | T30_SUPPORT_T85_COMPRESSION); #if defined(ENABLE_GUI) if (use_gui) start_media_monitor(); #endif for (;;) { logging = t38_terminal_get_logging_state(t38_state_a); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); t38_core = t38_terminal_get_t38_core_state(t38_state_a); logging = t38_core_get_logging_state(t38_core); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); t30 = t38_terminal_get_t30_state(t38_state_a); logging = t30_get_logging_state(t30); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); logging = t38_terminal_get_logging_state(t38_state_b); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); t38_core = t38_terminal_get_t38_core_state(t38_state_b); logging = t38_core_get_logging_state(t38_core); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); t30 = t38_terminal_get_t30_state(t38_state_b); logging = t30_get_logging_state(t30); span_log_bump_samples(logging, SAMPLES_PER_CHUNK); done[0] = t38_terminal_send_timeout(t38_state_a, SAMPLES_PER_CHUNK); done[1] = t38_terminal_send_timeout(t38_state_b, SAMPLES_PER_CHUNK); when += (float) SAMPLES_PER_CHUNK/(float) SAMPLE_RATE; while ((msg_len = g1050_get(path_a_to_b, msg, 1024, when, &seq_no, &tx_when, &rx_when)) >= 0) { #if defined(ENABLE_GUI) if (use_gui) media_monitor_rx(seq_no, tx_when, rx_when); #endif t38_core = t38_terminal_get_t38_core_state(t38_state_b); t38_core_rx_ifp_packet(t38_core, msg, msg_len, seq_no); } while ((msg_len = g1050_get(path_b_to_a, msg, 1024, when, &seq_no, &tx_when, &rx_when)) >= 0) { #if defined(ENABLE_GUI) if (use_gui) media_monitor_rx(seq_no, tx_when, rx_when); #endif t38_core = t38_terminal_get_t38_core_state(t38_state_a); t38_core_rx_ifp_packet(t38_core, msg, msg_len, seq_no); } if (done[0] && done[1]) break; #if defined(ENABLE_GUI) if (use_gui) media_monitor_update_display(); #endif } t38_terminal_release(t38_state_a); t38_terminal_release(t38_state_b); if (!succeeded[0] || !succeeded[1]) { printf("Tests failed\n"); exit(2); } printf("Tests passed\n"); return 0; } /*- End of function --------------------------------------------------------*/ /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/tests/modem_monitor.cpp0000664000175000017500000004276412101217323014633 00000000000000/* * SpanDSP - a series of DSP components for telephony * * modem_monitor.cpp - Display QAM constellations, using the FLTK toolkit. * * Written by Steve Underwood * * Copyright (C) 2004 Steve Underwood * * All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #if defined(HAVE_FL_FL_H) && defined(HAVE_FL_FL_CARTESIAN_H) #define __STDC_LIMIT_MACROS #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "spandsp.h" #define SYMBOL_TRACKER_POINTS 12000 #define CARRIER_TRACKER_POINTS 12000 #define FP_FACTOR 4096 struct qam_monitor_s { Fl_Double_Window *w; Fl_Group *c_const; Fl_Group *c_right; Fl_Group *c_eq; Fl_Group *c_symbol_track; /* Constellation stuff */ Ca_Canvas *canvas_const; Ca_X_Axis *sig_i; Ca_Y_Axis *sig_q; Ca_Point *constel_point[100000]; int constel_window; int next_constel_point; int skip; /* Equalizer stuff */ Ca_Canvas *canvas_eq; Ca_X_Axis *eq_x; Ca_Y_Axis *eq_y; Ca_Line *eq_re; Ca_Line *eq_im; double eq_re_plot[200]; double eq_im_plot[200]; /* Carrier and symbol tracking stuff */ Ca_Canvas *canvas_track; Ca_X_Axis *track_x; Ca_Y_Axis *symbol_track_y; Ca_Y_Axis *carrier_y; Ca_Line *symbol_track; Ca_Line *carrier; float symbol_tracker[SYMBOL_TRACKER_POINTS]; double symbol_track_plot[SYMBOL_TRACKER_POINTS*2]; int symbol_track_points; int symbol_track_ptr; int symbol_track_window; float carrier_tracker[CARRIER_TRACKER_POINTS]; double carrier_plot[CARRIER_TRACKER_POINTS*2]; int carrier_points; int carrier_ptr; int carrier_window; /* Audio meter stuff */ Fl_Audio_Meter *audio_meter; Fl_Output *audio_level; int32_t power_reading; }; #include "modem_monitor.h" int qam_monitor_clear_constel(qam_monitor_t *s) { int i; s->canvas_const->current(s->canvas_const); for (i = 0; i < s->constel_window; i++) { if (s->constel_point[i]) { delete s->constel_point[i]; s->constel_point[i] = NULL; } } s->next_constel_point = 0; Fl::check(); return 0; } /*- End of function --------------------------------------------------------*/ int qam_monitor_update_constel(qam_monitor_t *s, const complexf_t *pt) { int i; s->canvas_const->current(s->canvas_const); if (s->constel_point[s->next_constel_point]) delete s->constel_point[s->next_constel_point]; s->constel_point[s->next_constel_point++] = new Ca_Point(pt->re, pt->im, FL_BLACK); if (s->next_constel_point >= s->constel_window) s->next_constel_point = 0; if (++s->skip >= 100) { s->skip = 0; Fl::check(); } return 0; } /*- End of function --------------------------------------------------------*/ int qam_monitor_update_equalizer(qam_monitor_t *s, const complexf_t *coeffs, int len) { int i; float min; float max; /* Protect against screwy values */ for (i = 0; i < len; i++) { if (isnan(coeffs[i].re) || isinf(coeffs[i].re)) break; if (isnan(coeffs[i].im) || isinf(coeffs[i].im)) break; if (coeffs[i].re < -20.0f || coeffs[i].re > 20.0f) break; if (coeffs[i].im < -20.0f || coeffs[i].im > 20.0f) break; } if (i != len) return -1; if (s->eq_re) delete s->eq_re; if (s->eq_im) delete s->eq_im; s->canvas_eq->current(s->canvas_eq); i = 0; min = coeffs[i].re; if (min > coeffs[i].im) min = coeffs[i].im; max = coeffs[i].re; if (max < coeffs[i].im) max = coeffs[i].im; for (i = 0; i < len; i++) { s->eq_re_plot[2*i] = (i - len/2)/2.0; s->eq_re_plot[2*i + 1] = coeffs[i].re; if (min > coeffs[i].re) min = coeffs[i].re; if (max < coeffs[i].re) max = coeffs[i].re; s->eq_im_plot[2*i] = (i - len/2)/2.0; s->eq_im_plot[2*i + 1] = coeffs[i].im; if (min > coeffs[i].im) min = coeffs[i].im; if (max < coeffs[i].im) max = coeffs[i].im; } s->eq_x->minimum(-len/4.0); s->eq_x->maximum(len/4.0); s->eq_y->maximum((max == min) ? max + 0.2 : max); s->eq_y->minimum(min); s->eq_re = new Ca_Line(len, s->eq_re_plot, 0, 0, FL_BLUE, CA_NO_POINT); s->eq_im = new Ca_Line(len, s->eq_im_plot, 0, 0, FL_RED, CA_NO_POINT); Fl::check(); return 0; } /*- End of function --------------------------------------------------------*/ int qam_monitor_update_int_equalizer(qam_monitor_t *s, const complexi16_t *coeffs, int len) { int i; float min; float max; if (s->eq_re) delete s->eq_re; if (s->eq_im) delete s->eq_im; s->canvas_eq->current(s->canvas_eq); i = 0; min = coeffs[i].re; if (min > coeffs[i].im) min = coeffs[i].im; max = coeffs[i].re; if (max < coeffs[i].im) max = coeffs[i].im; for (i = 0; i < len; i++) { s->eq_re_plot[2*i] = (i - len/2)/2.0f; s->eq_re_plot[2*i + 1] = coeffs[i].re/(float) FP_FACTOR; if (min > coeffs[i].re) min = coeffs[i].re; if (max < coeffs[i].re) max = coeffs[i].re; s->eq_im_plot[2*i] = (i - len/2)/2.0f; s->eq_im_plot[2*i + 1] = coeffs[i].im/(float) FP_FACTOR; if (min > coeffs[i].im) min = coeffs[i].im; if (max < coeffs[i].im) max = coeffs[i].im; } min /= (float) FP_FACTOR; max /= (float) FP_FACTOR; s->eq_x->minimum(-len/4.0); s->eq_x->maximum(len/4.0); s->eq_y->maximum((max == min) ? max + 0.2 : max); s->eq_y->minimum(min); s->eq_re = new Ca_Line(len, s->eq_re_plot, 0, 0, FL_BLUE, CA_NO_POINT); s->eq_im = new Ca_Line(len, s->eq_im_plot, 0, 0, FL_RED, CA_NO_POINT); Fl::check(); return 0; } /*- End of function --------------------------------------------------------*/ int qam_monitor_update_symbol_tracking(qam_monitor_t *s, float total_correction) { int i; int j; float min; float max; s->symbol_tracker[s->symbol_track_ptr++] = total_correction; if (s->symbol_track_points < SYMBOL_TRACKER_POINTS) s->symbol_track_points++; if (s->symbol_track_ptr >= SYMBOL_TRACKER_POINTS) s->symbol_track_ptr = 0; s->canvas_track->current(s->canvas_track); if (s->symbol_track) delete s->symbol_track; s->track_x->current(); s->symbol_track_y->current(); min = max = s->symbol_tracker[0]; for (i = s->symbol_track_ptr, j = 0; i < s->symbol_track_points; i++, j++) { s->symbol_track_plot[2*j] = j; s->symbol_track_plot[2*j + 1] = s->symbol_tracker[i]; if (min > s->symbol_tracker[i]) min = s->symbol_tracker[i]; if (max < s->symbol_tracker[i]) max = s->symbol_tracker[i]; } for (i = 0; i < s->symbol_track_ptr; i++, j++) { s->symbol_track_plot[2*j] = j; s->symbol_track_plot[2*j + 1] = s->symbol_tracker[i]; if (min > s->symbol_tracker[i]) min = s->symbol_tracker[i]; if (max < s->symbol_tracker[i]) max = s->symbol_tracker[i]; } s->symbol_track_y->maximum((fabs(max - min) < 0.05) ? max + 0.05 : max); s->symbol_track_y->minimum(min); s->symbol_track = new Ca_Line(s->symbol_track_points, s->symbol_track_plot, 0, 0, FL_RED, CA_NO_POINT); //Fl::check(); return 0; } /*- End of function --------------------------------------------------------*/ int qam_monitor_update_audio_level(qam_monitor_t *s, const int16_t amp[], int len) { int i; char buf[11]; double val; for (i = 0; i < len; i++) { s->audio_meter->sample(amp[i]/32768.0); s->power_reading += ((amp[i]*amp[i] - s->power_reading) >> 10); } val = 10.0*log10((double) s->power_reading/(32767.0*32767.0) + 1.0e-10) + 3.14 + 3.02; snprintf(buf, sizeof(buf), "%5.1fdBm0", val); s->audio_level->value(buf); return 0; } /*- End of function --------------------------------------------------------*/ int qam_monitor_update_carrier_tracking(qam_monitor_t *s, float carrier_freq) { int i; int j; float min; float max; s->carrier_tracker[s->carrier_ptr++] = carrier_freq; if (s->carrier_points < CARRIER_TRACKER_POINTS) s->carrier_points++; if (s->carrier_ptr >= CARRIER_TRACKER_POINTS) s->carrier_ptr = 0; s->canvas_track->current(s->canvas_track); if (s->carrier) delete s->carrier; s->track_x->current(); s->carrier_y->current(); min = max = s->carrier_tracker[0]; for (i = s->carrier_ptr, j = 0; i < s->carrier_points; i++, j++) { s->carrier_plot[2*j] = j; s->carrier_plot[2*j + 1] = s->carrier_tracker[i]; if (min > s->carrier_tracker[i]) min = s->carrier_tracker[i]; if (max < s->carrier_tracker[i]) max = s->carrier_tracker[i]; } for (i = 0; i < s->carrier_ptr; i++, j++) { s->carrier_plot[2*j] = j; s->carrier_plot[2*j + 1] = s->carrier_tracker[i]; if (min > s->carrier_tracker[i]) min = s->carrier_tracker[i]; if (max < s->carrier_tracker[i]) max = s->carrier_tracker[i]; } s->carrier_y->maximum((fabs(max - min) < 0.05) ? max + 0.05 : max); s->carrier_y->minimum(min); s->carrier = new Ca_Line(s->carrier_points, s->carrier_plot, 0, 0, FL_BLUE, CA_NO_POINT); //Fl::check(); return 0; } /*- End of function --------------------------------------------------------*/ qam_monitor_t *qam_monitor_init(float constel_width, const char *tag) { char buf[132 + 1]; float x; float y; qam_monitor_t *s; if ((s = (qam_monitor_t *) malloc(sizeof(*s))) == NULL) return NULL; s->w = new Fl_Double_Window(905, 400, (tag) ? tag : "QAM monitor"); s->c_const = new Fl_Group(0, 0, 380, 400); s->c_const->box(FL_DOWN_BOX); s->c_const->align(FL_ALIGN_TOP | FL_ALIGN_INSIDE); s->canvas_const = new Ca_Canvas(60, 30, 300, 300, "Constellation"); s->canvas_const->box(FL_PLASTIC_DOWN_BOX); s->canvas_const->color(7); s->canvas_const->align(FL_ALIGN_TOP); s->canvas_const->border(15); s->sig_i = new Ca_X_Axis(65, 330, 290, 30, "I"); s->sig_i->align(FL_ALIGN_BOTTOM); s->sig_i->minimum(-constel_width); s->sig_i->maximum(constel_width); s->sig_i->label_format("%g"); s->sig_i->minor_grid_color(fl_gray_ramp(20)); s->sig_i->major_grid_color(fl_gray_ramp(15)); s->sig_i->label_grid_color(fl_gray_ramp(10)); s->sig_i->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->sig_i->minor_grid_style(FL_DOT); s->sig_i->major_step(5); s->sig_i->label_step(1); s->sig_i->axis_color(FL_BLACK); s->sig_i->axis_align(CA_BOTTOM | CA_LINE); s->sig_q = new Ca_Y_Axis(20, 35, 40, 290, "Q"); s->sig_q->align(FL_ALIGN_LEFT); s->sig_q->minimum(-constel_width); s->sig_q->maximum(constel_width); s->sig_q->minor_grid_color(fl_gray_ramp(20)); s->sig_q->major_grid_color(fl_gray_ramp(15)); s->sig_q->label_grid_color(fl_gray_ramp(10)); //s->sig_q->grid_visible(CA_MINOR_TICK | CA_MAJOR_TICK | CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->sig_q->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->sig_q->minor_grid_style(FL_DOT); s->sig_q->major_step(5); s->sig_q->label_step(1); s->sig_q->axis_color(FL_BLACK); s->sig_q->current(); s->c_const->end(); s->c_right = new Fl_Group(440, 0, 465, 405); s->c_eq = new Fl_Group(380, 0, 265, 200); s->c_eq->box(FL_DOWN_BOX); s->c_eq->align(FL_ALIGN_TOP | FL_ALIGN_INSIDE); s->c_eq->current(); s->canvas_eq = new Ca_Canvas(460, 35, 150, 100, "Equalizer"); s->canvas_eq->box(FL_PLASTIC_DOWN_BOX); s->canvas_eq->color(7); s->canvas_eq->align(FL_ALIGN_TOP); Fl_Group::current()->resizable(s->canvas_eq); s->canvas_eq->border(15); s->eq_x = new Ca_X_Axis(465, 135, 140, 30, "Symbol"); s->eq_x->align(FL_ALIGN_BOTTOM); s->eq_x->minimum(-8.0); s->eq_x->maximum(8.0); s->eq_x->label_format("%g"); s->eq_x->minor_grid_color(fl_gray_ramp(20)); s->eq_x->major_grid_color(fl_gray_ramp(15)); s->eq_x->label_grid_color(fl_gray_ramp(10)); s->eq_x->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->eq_x->minor_grid_style(FL_DOT); s->eq_x->major_step(5); s->eq_x->label_step(1); s->eq_x->axis_align(CA_BOTTOM | CA_LINE); s->eq_x->axis_color(FL_BLACK); s->eq_x->current(); s->eq_y = new Ca_Y_Axis(420, 40, 40, 90, "Amp"); s->eq_y->align(FL_ALIGN_LEFT); s->eq_y->minimum(-0.1); s->eq_y->maximum(0.1); s->eq_y->minor_grid_color(fl_gray_ramp(20)); s->eq_y->major_grid_color(fl_gray_ramp(15)); s->eq_y->label_grid_color(fl_gray_ramp(10)); s->eq_y->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->eq_y->minor_grid_style(FL_DOT); s->eq_y->major_step(5); s->eq_y->label_step(1); s->eq_y->axis_color(FL_BLACK); s->eq_y->current(); s->c_eq->end(); s->c_symbol_track = new Fl_Group(380, 200, 525, 200); s->c_symbol_track->box(FL_DOWN_BOX); s->c_symbol_track->align(FL_ALIGN_TOP | FL_ALIGN_INSIDE); s->c_symbol_track->current(); s->canvas_track = new Ca_Canvas(490, 235, 300, 100, "Symbol and carrier tracking"); s->canvas_track->box(FL_PLASTIC_DOWN_BOX); s->canvas_track->color(7); s->canvas_track->align(FL_ALIGN_TOP); Fl_Group::current()->resizable(s->canvas_track); s->canvas_track->border(15); s->track_x = new Ca_X_Axis(495, 335, 290, 30, "Time (symbols)"); s->track_x->align(FL_ALIGN_BOTTOM); s->track_x->minimum(0.0); s->track_x->maximum(2400.0*5.0); s->track_x->label_format("%g"); s->track_x->minor_grid_color(fl_gray_ramp(20)); s->track_x->major_grid_color(fl_gray_ramp(15)); s->track_x->label_grid_color(fl_gray_ramp(10)); s->track_x->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->track_x->minor_grid_style(FL_DOT); s->track_x->major_step(5); s->track_x->label_step(1); s->track_x->axis_align(CA_BOTTOM | CA_LINE); s->track_x->axis_color(FL_BLACK); s->track_x->current(); s->symbol_track_y = new Ca_Y_Axis(420, 240, 70, 90, "Cor"); s->symbol_track_y->align(FL_ALIGN_LEFT); s->symbol_track_y->minimum(-0.1); s->symbol_track_y->maximum(0.1); s->symbol_track_y->minor_grid_color(fl_gray_ramp(20)); s->symbol_track_y->major_grid_color(fl_gray_ramp(15)); s->symbol_track_y->label_grid_color(fl_gray_ramp(10)); s->symbol_track_y->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->symbol_track_y->minor_grid_style(FL_DOT); s->symbol_track_y->major_step(5); s->symbol_track_y->label_step(1); s->symbol_track_y->axis_color(FL_RED); s->symbol_track_y->current(); s->carrier_y = new Ca_Y_Axis(790, 240, 70, 90, "Freq"); s->carrier_y->align(FL_ALIGN_RIGHT); s->carrier_y->minimum(-0.1); s->carrier_y->maximum(0.1); s->carrier_y->minor_grid_color(fl_gray_ramp(20)); s->carrier_y->major_grid_color(fl_gray_ramp(15)); s->carrier_y->label_grid_color(fl_gray_ramp(10)); s->carrier_y->grid_visible(CA_LABEL_GRID | CA_ALWAYS_VISIBLE); s->carrier_y->minor_grid_style(FL_DOT); s->carrier_y->major_step(5); s->carrier_y->label_step(1); s->carrier_y->axis_align(CA_RIGHT); s->carrier_y->axis_color(FL_BLUE); s->carrier_y->current(); s->c_symbol_track->end(); s->audio_meter = new Fl_Audio_Meter(672, 10, 16, 150, ""); s->audio_meter->box(FL_PLASTIC_UP_BOX); s->audio_meter->type(FL_VERT_AUDIO_METER); s->audio_level = new Fl_Output(650, 170, 60, 20, ""); s->audio_level->textsize(10); s->c_right->end(); Fl_Group::current()->resizable(s->c_right); s->w->end(); s->w->show(); s->next_constel_point = 0; s->constel_window = 10000; s->carrier_points = 0; s->carrier_ptr = 0; s->carrier_window = 100; s->symbol_track_points = 0; s->symbol_track_window = 10000; Fl::check(); return s; } /*- End of function --------------------------------------------------------*/ void qam_wait_to_end(qam_monitor_t *s) { fd_set rfds; int res; struct timeval tv; fprintf(stderr, "Processing complete. Press the key to end\n"); do { usleep(100000); Fl::check(); FD_ZERO(&rfds); FD_SET(0, &rfds); tv.tv_usec = 100000; tv.tv_sec = 0; res = select(1, &rfds, NULL, NULL, &tv); } while (res <= 0); } /*- End of function --------------------------------------------------------*/ #endif /*- End of file ------------------------------------------------------------*/ spandsp-0.0.6/unpack_gsm0610_data.sh0000775000175000017500000002155511422612261014103 00000000000000#!/bin/sh # # SpanDSP - a series of DSP components for telephony # # unpack_gsm0610_data.sh # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 2.1, # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # The ETSI distribution file extracts to 5 ZIP files, called DISK1.ZIP to DISK5.ZIP # These were originally the contents of 5 floppy disks. Disks 1 to 3 contain data # files. However, disks 4 and 5 contain .EXE files, which unpack.... but only in an # MS environment. These files need to be executed in a Windows or DOS environment, # or a good emulation like FreeDOS or Wine. ETSIDATA="../../../en_300961v080101p0.zip" cd test-data if [ -d etsi ] then cd etsi else mkdir etsi RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot create test-data/etsi! exit $RETVAL fi cd etsi fi if [ -d gsm0610 ] then cd gsm0610 else mkdir gsm0610 RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot create test-data/etsi/gsm0610! exit $RETVAL fi cd gsm0610 fi if [ $1x == --no-exe-runx ] then # Run the .exe files, which should be here ./FR_A.EXE ./FR_HOM_A.EXE ./FR_SYN_A.EXE ./FR_U.EXE ./FR_HOM_U.EXE ./FR_SYN_U.EXE exit 0 fi # Clear out any leftovers from the past rm -rf ASN.1.txt rm -rf DISK1.ZIP rm -rf DISK2.ZIP rm -rf DISK3.ZIP rm -rf DISK4.ZIP rm -rf DISK5.ZIP rm -rf *.EXE rm -rf READ_FRA.TXT rm -rf ACTION rm -rf unpacked if [ $1x == --no-exex ] then # We need to prepare the .exe files to be run separately rm -rf *.INP rm -rf *.COD rm -rf *.OUT unzip ${ETSIDATA} >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot unpack the ETSI test vectors for GSM 06.10! exit $RETVAL fi unzip ./DISK4.ZIP >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot unpack the ETSI test vectors for GSM 06.10! exit $RETVAL fi unzip ./DISK5.ZIP >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot unpack the ETSI test vectors for GSM 06.10! exit $RETVAL fi rm -rf ASN.1.txt rm -rf DISK1.ZIP rm -rf DISK2.ZIP rm -rf DISK3.ZIP rm -rf DISK4.ZIP rm -rf DISK5.ZIP rm -rf READ_FRA.TXT # An environment which is emulating an MS one will probably need # to make the .EXE files actually executable. chmod 755 *.EXE echo "Now copy the files from the test-data/etsi/gsm0610 directory to a Windows," echo "DOS or other machine which can run .exe files. Run each of the .exe" echo "files (there are 6 of them), and copy the whole directory back here." echo "You can then complete the creation of the working data directories" echo "with the command:" echo $0 "--no-exe-continue" exit 0 fi unzip ${ETSIDATA} >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot unpack the ETSI test vectors for GSM 06.10! exit $RETVAL fi #rm ${ETSIDATA} rm -rf ASN.1.txt if [ $1x != --no-exe-continuex ] then # We need to extract and run the .exe files right now. For this to succeed # we must be running in an environment which can run .exe files. This has been # tested with Cygwin on a Windows XP machine. rm -rf *.INP rm -rf *.COD rm -rf *.OUT unzip ./DISK4.ZIP >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot unpack the ETSI test vectors for GSM 06.10! exit $RETVAL fi unzip ./DISK5.ZIP >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot unpack the ETSI test vectors for GSM 06.10! exit $RETVAL fi # An environment which is emulating an MS one will probably need # to make the .EXE files actually executable. chmod 755 *.EXE ./FR_HOM_A.EXE >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot run ./FR_HOM_A.EXE exit $RETVAL fi ./FR_SYN_A.EXE >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot run ./FR_HOM_A.EXE exit $RETVAL fi ./FR_A.EXE >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot run ./FR_HOM_A.EXE exit $RETVAL fi ./FR_HOM_U.EXE >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot run ./FR_HOM_A.EXE exit $RETVAL fi ./FR_SYN_U.EXE >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot run ./FR_HOM_A.EXE exit $RETVAL fi ./FR_U.EXE >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot run ./FR_HOM_A.EXE exit $RETVAL fi rm -rf READ_FRA.TXT fi rm -rf DISK4.ZIP rm -rf DISK5.ZIP rm -rf *.EXE chmod 644 *.INP chmod 644 *.OUT chmod 644 *.COD # Create the directories where we want to put the test data files. mkdir unpacked mkdir unpacked/fr_A mkdir unpacked/fr_L mkdir unpacked/fr_U mkdir unpacked/fr_homing_A mkdir unpacked/fr_homing_L mkdir unpacked/fr_homing_U mkdir unpacked/fr_sync_A mkdir unpacked/fr_sync_L mkdir unpacked/fr_sync_U # Disks 1, 2 and 3 simply unzip, and the files have sensible file names. We # just need to rearrange the directories in which they are located. unzip ./DISK1.ZIP >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot unpack the ETSI test vectors for GSM 06.10! exit $RETVAL fi unzip ./DISK2.ZIP >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot unpack the ETSI test vectors for GSM 06.10! exit $RETVAL fi unzip ./DISK3.ZIP >/dev/null RETVAL=$? if [ $RETVAL != 0 ] then echo Cannot unpack the ETSI test vectors for GSM 06.10! exit $RETVAL fi rm -rf DISK1.ZIP rm -rf DISK2.ZIP rm -rf DISK3.ZIP mv "./ACTION/SMG#23/HOLD/0610_5~1/TESTSE~1/DISK1/"* ./unpacked/fr_L mv "./ACTION/SMG#23/HOLD/0610_5~1/TESTSE~1/DISK3/"Sync*.cod ./unpacked/fr_sync_L mv "./ACTION/SMG#23/HOLD/0610_5~1/TESTSE~1/DISK2/"Seq*h.* ./unpacked/fr_homing_L mv "./ACTION/SMG#23/HOLD/0610_5~1/TESTSE~1/DISK3/"Seq*h.* ./unpacked/fr_homing_L mv "./ACTION/SMG#23/HOLD/0610_5~1/TESTSE~1/DISK3/Bitsync.inp" ./unpacked/fr_sync_L mv "./ACTION/SMG#23/HOLD/0610_5~1/TESTSE~1/DISK3/Seqsync.inp" ./unpacked/fr_sync_L mv "./ACTION/SMG#23/HOLD/0610_5~1/TESTSE~1/DISK3/Homing01.cod" ./unpacked/fr_homing_L mv "./ACTION/SMG#23/HOLD/0610_5~1/TESTSE~1/DISK3/Homing01.out" ./unpacked/fr_homing_L rm -rf ACTION # The files extracted by the .EXE files have messy naming, and are not in # a sane directory layout. We rename and move them, to make the final result of # the files extracted from all five of the original .ZIP files reasonably # consistent, and easy to follow. rm -rf READ_FRA.TXT for I in SYN*_A.COD ; do mv $I `echo $I | sed -e "s|SYN|./unpacked/fr_sync_A/Sync|" | sed -e "s/COD/cod/"` done for I in SYN*_U.COD ; do mv $I `echo $I | sed -e "s|SYN|./unpacked/fr_sync_U/Sync|" | sed -e "s/COD/cod/"` done for I in SEQ*H_A.COD ; do mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_homing_A/Seq|" | sed -e "s/COD/cod/"` done for I in SEQ*H_U.COD ; do mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_homing_U/Seq|" | sed -e "s/COD/cod/"` done for I in SEQ*H_A.INP ; do mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_homing_A/Seq|" | sed -e "s/INP/inp/"` done for I in SEQ*H_U.INP ; do mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_homing_U/Seq|" | sed -e "s/INP/inp/"` done for I in SEQ*H_A.OUT ; do mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_homing_A/Seq|" | sed -e "s/OUT/out/"` done for I in SEQ*H_U.OUT ; do mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_homing_U/Seq|" | sed -e "s/OUT/out/"` done for I in SEQ*-A.COD ; do mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_A/Seq|" | sed -e "s/COD/cod/"` done for I in SEQ*-U.COD ; do mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_U/Seq|" | sed -e "s/COD/cod/"` done for I in SEQ*-A.INP ; do mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_A/Seq|" | sed -e "s/INP/inp/"` done for I in SEQ*-U.INP ; do mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_U/Seq|" | sed -e "s/INP/inp/"` done for I in SEQ*-A.OUT ; do mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_A/Seq|" | sed -e "s/OUT/out/"` done for I in SEQ*-U.OUT ; do mv $I `echo $I | sed -e "s|SEQ|./unpacked/fr_U/Seq|" | sed -e "s/OUT/out/"` done mv HOM01_A.OUT ./unpacked/fr_homing_A/Homing01_A.out mv HOM01_U.OUT ./unpacked/fr_homing_U/Homing01_U.out mv SEQSYN_A.INP ./unpacked/fr_sync_A/Seqsync_A.inp mv SEQSYN_U.INP ./unpacked/fr_sync_U/Seqsync_U.inp echo "The ETSI test vectors for GSM 06.10 should now be correctly laid out in the" echo "gsm0610 directory" spandsp-0.0.6/spandsp.spec.in0000664000175000017500000000447111136061752013051 00000000000000Summary: A DSP library for telephony. Name: @PACKAGE@ Version: @VERSION@ Release: 1 License: LGPL Group: System Environment/Libraries URL: http://www.soft-switch.org/spandsp BuildRoot: %{_tmppath}/%{name}-%{version}-root Source: http://www.soft-switch.org/downloads/spandsp/@PACKAGE@-@VERSION@.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libtiff-devel BuildRequires: audiofile-devel BuildRequires: doxygen # for xsltproc: BuildRequires: libxslt %description SpanDSP is a library of DSP functions for telephony, in the 8000 sample per second world of E1s, T1s, and higher order PCM channels. It contains low level functions, such as basic filters. It also contains higher level functions, such as cadenced supervisory tone detection, and a complete software FAX machine. The software has been designed to avoid intellectual property issues, using mature techniques where all relevant patents have expired. See the file DueDiligence for important information about these intellectual property issues. %package devel Summary: SpanDSP development files Group: Development/Libraries Requires: spandsp = %{version} Requires: libtiff-devel PreReq: /sbin/install-info %description devel SpanDSP development files. %prep %setup -q %build %configure --enable-doc --disable-static --disable-rpath make %install rm -rf %{buildroot} make install DESTDIR=%{buildroot} rm %{buildroot}%{_libdir}/libspandsp.la %clean rm -rf %{buildroot} %files %defattr(-,root,root,-) %doc DueDiligence ChangeLog AUTHORS COPYING NEWS README %{_libdir}/libspandsp.so.* %files devel %defattr(-,root,root,-) %doc doc/api %{_includedir}/spandsp.h %{_includedir}/spandsp %{_libdir}/libspandsp.so %{_libdir}/pkgconfig/spandsp.pc %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %changelog * Wed Sep 24 2008 Tzafrir Cohen 0.0.5-1 - Preparing for 0.0.5pre4 release - License: LGPL * Mon Jun 23 2008 Steve Underwood 0.0.5-1 - Cleared out the dependency on libxml2 * Sun Dec 31 2006 Steve Underwood 0.0.3-1 - Preparing for 0.0.3 release * Sat Oct 16 2004 Steve Underwood 0.0.2-1 - Preparing for 0.0.2 release * Thu Apr 15 2004 Steve Underwood 0.0.1-1 - Initial version spandsp-0.0.6/aclocal.m40000664000175000017500000124507312343626374011776 00000000000000# generated automatically by aclocal 1.13.4 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Add ABI-specific directories to the system library path. sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS # Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.13' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.13.4], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.13.4])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR spandsp-0.0.6/README0000664000175000017500000000316511072610446010776 00000000000000spandsp 0.0.5 - A DSP library for telephony ------------------------------------------- SpanDSP is a library of DSP functions for telephony, in the 8000 sample per second world of E1s, T1s, and higher order PCM channels. It contains low level functions, such as basic filters. It also contains higher level functions, such as cadenced supervisory tone detection, and a complete software FAX machine. The software has been designed to avoid intellectual property issues, using mature techniques where all relevant patents have expired. See the file DueDiligence for important information about these intellectual property issues. The library is licenced under the LGPL 2.1 licence. The test suite, and some support programs are licenced under the GPL 2 licence. The full text of these licences can be found in the file COPYING. Dependencies ------------ spandsp depends on various other packages for various tasks. Most of these dependencies relate to building the test suite. libtiff (and libtiff-devel on most Linux distributions) is required to build the spandsp library. libaudiofile (and libaudiofile-devel) is required to build the test suite fftw (and fftw-devel) is required to build the test suite. Version 2 or 3 of FFTW may be used. Spandsp adapts to the differences between them. fltk (and fltk-devel), Fl_Cartesian and Fl_Audio_Meter are required to build the test suite with GUI interfaces for some of the tests. The tests will build without these packages, but the GUI features will not be available. Fl_Cartesian and Fl_Audio_Meter can be downloaded from http://www.soft-switch.org/downloads. Steve Underwood spandsp-0.0.6/doc/0000775000175000017500000000000012357123347010744 500000000000000spandsp-0.0.6/doc/Makefile.in0000664000175000017500000003223512343626375012742 00000000000000# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(srcdir)/doxygen.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compiler_vendor.m4 \ $(top_srcdir)/m4/ax_check_real_file.m4 \ $(top_srcdir)/m4/ax_fixed_point_machine.m4 \ $(top_srcdir)/m4/ax_misaligned_access_fails.m4 \ $(top_srcdir)/m4/ax_c99_features.m4 \ $(top_srcdir)/m4/ax_check_export_capability.m4 \ $(top_srcdir)/m4/ax_check_arm_neon.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/config.h CONFIG_CLEAN_FILES = doxygen CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ COMP_VENDOR_CFLAGS = @COMP_VENDOR_CFLAGS@ COMP_VENDOR_LDFLAGS = @COMP_VENDOR_LDFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ HAVE_FAX2TIFF = @HAVE_FAX2TIFF@ HAVE_PBMTOG3 = @HAVE_PBMTOG3@ HAVE_SOX = @HAVE_SOX@ INSERT_INTTYPES_HEADER = @INSERT_INTTYPES_HEADER@ INSERT_MATH_HEADER = @INSERT_MATH_HEADER@ INSERT_STDBOOL_HEADER = @INSERT_STDBOOL_HEADER@ INSERT_STDINT_HEADER = @INSERT_STDINT_HEADER@ INSERT_TGMATH_HEADER = @INSERT_TGMATH_HEADER@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIMLIBS = @SIMLIBS@ SPANDSP_LT_AGE = @SPANDSP_LT_AGE@ SPANDSP_LT_CURRENT = @SPANDSP_LT_CURRENT@ SPANDSP_LT_REVISION = @SPANDSP_LT_REVISION@ SPANDSP_MISALIGNED_ACCESS_FAILS = @SPANDSP_MISALIGNED_ACCESS_FAILS@ SPANDSP_SUPPORT_T85 = @SPANDSP_SUPPORT_T85@ SPANDSP_SUPPORT_V34 = @SPANDSP_SUPPORT_V34@ SPANDSP_USE_EXPORT_CAPABILITY = @SPANDSP_USE_EXPORT_CAPABILITY@ SPANDSP_USE_FIXED_POINT = @SPANDSP_USE_FIXED_POINT@ STRIP = @STRIP@ TESTLIBS = @TESTLIBS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ MAINTAINERCLEANFILES = Makefile.in EXTRA_DIST = css.css \ doxygen.in \ t38-gateway.dia \ t38-terminal.dia \ t38_manual.xml \ wrapper.xsl \ t38_manual/css.css all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): doxygen: $(top_builddir)/config.status $(srcdir)/doxygen.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am all: doxydocs t38_manual/index.html doxydocs: doxygen doxygen t38_manual/index.html: t38_manual.xml cd t38_manual ; xsltproc ../wrapper.xsl ../t38_manual.xml clean: cd t38_manual ; rm *.html ; cd ../api ; rm -rf html # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: spandsp-0.0.6/doc/t38_manual.xml0000664000175000017500000010641311422612261013354 00000000000000 2007-11-14 T.38 protocol (FoIP) support User manual documentation in progress Steve Underwood

steveu@coppice.org
2007 Steve Underwood This document can be freely redistributed according to the terms of the GNU General Public License. The T.38 real-time FAX over IP (FoIP) protocol There are two ITU recommendations which address sending FAXes over IP networks. T.37 specifies a method of encapsulating FAX images in e-mails, and transporting them to the recipient (an e-mail box, or another FAX machine) in a store-and-forward manner. T.38 specifies a protocol for transmitting a FAX across an IP network in real time. This document discusses the implementation of the T.38, real time, FAX over IP (FoIP) protocol. FAXing between two PSTN FAX machines provides the illusion of real-time communication, with confirmed delivery. This is, of course, no more than an illusion. The sender has no idea what is receiving the FAX. It might be a FAX mailbox, where the FAX might only be retrieved much later, or might never be retrieved at all. It might be a FAX machine which is out of paper, and is storing the FAX in memory. If nobody adds paper before the FAX machine is switched off, the FAX might never be printed. With increasing amounts of FAX spam, many people don't ever bother to collect FAXes from the FAX machine in their office. Still, with all these reasons why the real-time confirmed delivery nature of FAXing is an illusion, large numbers of people still insist on using direct FAXing. The FAX protocols - in particular T.30 - were designed for the PSTN. The PSTN is very different from a packet network like the Internet. It offers very strict timing; latency is rock steady throughout a call; and latency is seldom very high. The lack of these features in packet networks tends to spoil the quality of voice over IP, compared to voice over the PSTN. However, it can totally destroy modem data, like that used for FAX. Jitter and packet loss can cause modem reception to fail, and excessive delays can cause timers designed for a low latency environment to expire. T.38 tries to mitigate these factors, and can greatly improve the reliability of FAXing across the internet. It can also send FAXes using less bandwidth than using VoIP protocols. There are limits to what can be achieved on a congested network, though, and T.38 can never offer the reliability of a store and forward protocol, like T.37. Sadly, the average office worker's love affair with real-time FAX ensures a bright future for the T.38 protocol, even though the T.37 protocol makes far more sense. The T.38 protocol primarily operates between: Internet-aware FAX terminals, which connect directly to an IP network. FAX gateways, which allow traditional PSTN FAX terminals to communicate via the Internet. A combination of these. T.38 is the only standardised protocol which exists for real-time FoIP. Reliably transporting a FAX between PSTN FAX terminals, through an IP network, requires use of the T.38 protocol at FAX gateways. VoIP connections are not robust for modem use, including FAX modem use. Most use low bit rate codecs, which cannot convey the modem signals accurately. Even when high bit rate codecs, such as G.711, are used, VoIP connections suffer dropouts and timing adjustments, which modems cannot tolerate. In a LAN environment the dropout rate may be very low, but the timing adjustments which occur in VoIP connections still make modem operation unreliable. T.38 FAX gateways deal with the delays, timing jitter, and packet loss experienced in packet networks, and isolate the PSTN FAX terminals from these as far as possible. In addition, by sending FAXes as image data, rather than digitised audio, the required bandwidth of the IP network might be reduced. However, the redundant transmission needed to make T.38 work acceptably over an unreliable network tends to offset much of the potential bandwidth gain. The original T.38 specification provides for operation up to 14,400bps, using a V.17 modem. The latest version of the T.38 specification adds features for FAXing at up to 33,600bps, using a V.34 modem. However, it appears most current T.38 implementations only support operation up to 14,400bps. The basics of a T.38 entity The T.38 protocol may be used to build an Internet-aware FAX terminal, for direct connection to the Internet. It may also be used to build gateways. A T.38 FAX gateway might be a gateway between the PSTN and the Internet. It might just be an a ATA box acting as a gateway between a directly connected traditional FAX machine and the Internet. The T.38 protocol merely defines what passes between two T.38 entities. Creating a robust entity, able to tolerate the widest possible variation in network delays, jitter and packet loss, requires considerably more than just implementing what is contained in the T.38 spec. Also, the protocol definition is somewhat loose, resulting is considerable variability in the way the protocol is implemented. Considerable flexibility is required in a T.38 entity's design, to tolerate these variations. T.38 currently works over one of the following transports: TCP, with TPKT message framing - the use of TPKT was originally specified in a vague way, and implementations without TPKT framing apparently exist. UDPTL - A UDP based protocol used nowhere else. This is the most common transport for T.38. RTP - Added quite late to the T.38 specification, and still not widely supported. TCP is the ideal way to communicate between two entities on an IP network, which do not have real-time constraints. The entities can talk as fast as they and the medium between them permit, with full error control. Internet-aware FAX devices would, therefore, usually use TCP as the transport for T.38. Gateways have only limited control of the timing of the FAX data passing through them. They have to operate in real-time, at a rate outside their control. Gateways, therefore, usually use UDPTL. The RTP option was only added to the T.38 specification in 2004, and is not yet widely supported. Over time it may become the preferred replacement for UDPTL, since most entities handle more than just FAX, and need to implement RTP anyway. A TCP stream is fully corrected by the TCP protocol itself. However, in the UDPTL or RTP modes of operation, T.38 is subject to possible packet loss. A high level of missing data would defeat the protocol, so some measure of FEC (forward error correction) must be used. The UDPTL specification defines two optional forms of FEC. Both consist of adding information from previous packets to new packets. In one form this repeated data is send as a direct copy of the original. In the other it is sent as parity information, which requires encoding and decoding. The specifications for RTP include definitions of suitable FEC and redundancy protocols (RFC2198 and RFC2733). The T.38 specification says these should be used for T.38 over RTP. Interestingly, even the latest revision of the T.38 specification does not provide properly for security in FAX transmission. SRTP is a standard way to achieve secure multi-media communication, and can be applied to T.38 over RTP without any specific wording on the subject in the T.38 specification. UDPTL might be seen as obsolete in the long term, and not worthy of enhancements to encrypt the data. However, no secure option for T.38 over TCP is defined. TPKT could be sent over TLS/TCP. TLS also has message framing features which would allow IFP packets to be sent directly over a TLS protected connection. However, there is no specified way to do this. Although redundant information in future packets is an important part of a solid T.38 implementation, it is not a complete solution to problem of lost packets. Sometimes the next packet occurs after a considerable delay (e.g. when allowing time for a fast modem to train). If a "start training" message is only received through the redundant information in a following packet, it usually arrives too late to be useful (at least for a gateway). Most T.38 implementations now follow a practice of sending several exact copies of key packets - generally the ones which start or end the stages of the T.30 protocol. Typically up to 4 identical copies of these packets are sent down the wire. The may be sent in a burst, as fast as possible, or they may be spaced in time by 10ms or 20ms. IP network congestion, and the resulting packet loss, can be very bursty. If all copies are sent together, they might all be lost. Even a small amount of spreading in time may significantly increase the likelihood of at least one copy reaching its destination. The price is some delay in delivery of the message, which might be problematic. Multiple copies of these packets add little to the overall volume of data transmitted, as only a small percentage of packets fall in this "key packet" category. Some T.38 implementations follow a less effective practice of sending multiple key packets, which have separate sequence numbers and are separately bundled with redundant information for transmission. They may also be spaced in time. Although this seems a less effective strategy, a T.38 entity must expect to receive packets streams of this kind, and tolerate them. Between the high priority key packets, and the low priority packets for the image data (the loss of which might just cause a streak on an image, or be corrected by ECM FAXing), lies the V.21 HDLC control messages. Some T.38 implementations dynamically adjust the amount of redundant information in packets, so these control messages are repeated through several packets, but the large image data packets are repeated less, or not at all. Used with care, this dynamic redundancy strategy can nicely balance data volume and reliability. A T.38 terminal has a lot more flexibility in how it can deal with problem data than a T.38 gateway. The terminal has no tight timing constraints governing how it behaves with regard to received data. It can wait a considerable period for delayed packets to arrive. The gateway is a man-in-the-middle, and must live with the timing constraints that imposes. This means a T.38 gateway has a rather more difficult design than a terminal. The core elements of a T.38 implementation There are many differences between the behaviour of a T.38 terminal and a T.38 gateway. However, some functions are common to both types of T.38 entity, particular in the IP network interface. The T.38 Internet Fascimile Protocol (IFP) packetiser The T.38 specification defines an ASN.1 schema for the messages which pass between T.38 entities. These messages are called IFP (Internet Fascimile Protocol) messages. Their format is independent of the transport used to carry them. However, there are currently two slightly different versions of the ASN.1 schema. This is due to a typo in the original version of the T.38 specification. The protocol negotiation which occurs just before T.38 communication resolves which version will be used. Although the typo was corrected several years ago, it is still very more common to find implementations which only support the original buggy version. The UDPTL, RTP, TPKT packetiser A second level packetiser bundles the IFP packets for transmission. This functions in different ways, depending on the type of transport in use. For the unreliable transports (UDPTL and RTP) the packetiser adds forward error correction (FEC) information to the packets. This can greatly inprove the reliability of the T.38 protocol, at the expense of higher bandwidth. The amount of error correction information added to the packets is implementation dependant. For UDPTL, two forms of FEC are defined. One simply repeats older T.38 packets as FEC information in the current UDPTL packet. The other generates parity packets over a series of T.38 packets, and includes that parity information in the current UDPTL packet. The type of FEC to be used is negotiated just before T.38 communication begins. The RTP specifications (RFC3550, RFC3551, RFC2198, RFC2733) define common redundancy and FEC formats, to be used for any payload. Where T.38 packets are carried by RTP, the standard RTP FEC mechanisms are used. TPKT (RFC1006, RFC2126) encapsulation works over a TCP transport. TCP provides full error correction, though retries may slow it considerably. TPKT encapsulation merely provides the ability to delineate the start and end of the IFP packets in the structureless TCP stream. The elements of a T.38 terminal The elements of a T.38 gateway The HDLC decoder If the HDLC decoder in a T.38 gateway worked in whole frames, it would introduce unacceptable latency. Instead, the HDLC decoder must work progressively through the HDLC frames, outputing its results octet by octet. The T.38 message stream does not contain HDLC preamble, though it usually contains an indication that preamble is in progress. It does not contain the CRC octets, but simply an indication of whether the CRC is good or bad. The HDLC decoder provides an indication when preamble is being received, and checks the CRC octets at the end of frames to provide the good or bad indication. The decoder makes the frames available, octet by octet, to the T.38 engine for status tracking and possible modification. Tracking and modification imposes a few octets delay, but the goal is to keep this to the minimum possible. Whether the frames are modified or unmodified, good or bad they are always passed on, to maintain the appropriate timing flow for the T.30 protocol. An interesting aspect of the timing flow of V.21 HDLC messages on the T.38 path relates to the size of the CRC. The usual practice for sending these frames is to send one octet in each message, with the messages spaced by the duration of one octet. They will normally be sent with the minimum possible delay. The CRC at the end of each frame is two octets long, and only an indication of good or bad is sent in the T.38 messages. It takes two octet times to know if the CRC is OK or not, typically causing the flow of T.38 messages to stutter by the duration of an octet. Since flow control within a frame is not possible when frames are replayed by a remote T.38 gateway, that gateway must allow for this inevitable stutter as it prepares to begin playout of the frame. T.30 message analysis and manipulation The T.30 message analyser in a T.38 gateway performs the following functions: It passes NSS, NSF and NSC frames, but modifies their contents. A receiving FAX machine must be prevented from acting upon these messages in a manufacturer specific manner. The T.38 protocol is incapable of handling such manufacturer specific things. However, simply dropping these packets would upset the timing of the T.30 protocol. Instead, most T.38 implementations modify the country and manufacturer codes nesr the start of these messages, so the messages will be ignored by any receiver. They are typically set to 0x00, 0x55, 0xAA or 0xFF. Some implementations set them to the country and manufacturer code of the T.38 implementor. As long as they are set to something the receiver will not recognise, problems are avoided. To avoid removing useful information, the original country and manufacturer code bytes might be reinserted in a different part of the modified NSF message, provided space permits. It tracks the contents of the DCS messages. During flow control of non-ECM data, the minimum row length must be preserved, so the current minimum must be found from the DCS messages. Similarly, the current encoding must be known to apply non-ECM flow control correctly. ECM data must be flow controlled in a completely different way than non-ECM data, so ECM mode information must be found from the DCS messages. It may optionally modify the minimum row length in the DIS messages. Because flow control will be applied to non-ECM data, it can make sense to tell the sending FAX machine it has no need to impose a minimum row length, and let the emitting T.38 entity impose the minimum as part of its flow control operation. It passes on the stripped and modified HDLC frames, with the minimum possible delay. This implies that is must analyse and modify the messages octet by octet. The HDLC rate adapting encoder The HDLC data rate adapting encoder accepts a T.30 message stream as input. The V.21 HDLC messages generally arriving byte by byte, in separate T.38 messages. ECM HDLC messages usually arrive in larger chunks, but they are still generally fragmented. The rate adapter dynamically buffers the T.30 data, generates preamble, and adjusts its length if the incoming message data is falling behind. It may insert additional flag octets between frames, as a flow control mechanism. However, the HDLC protocol is synchronous, so the adapter cannot perform any flow control within a frame. It must, therefore, buffer enough octets of a frame to provide reasonable jitter tolerance, before it emits the first octet of that frame. If the arriving messages fall too far behind mid-frame, there will be corruption of the outgoing stream. In the case of ECM image data frames, the frames are fast enough, that buffering whole frames is quite proactical within the T.30 timing constraints. This ensures mid-frame underflow can never occur. TCF (training confirmation) and non-ECM image data rate adaption Non-ECM image data rate adaption deals with exchanging TCF data, and non-ECM image data using T.4 1-D or 2-D compression. Non-ECM image data is typically padded with zero bits at the end of each pixel row. This is used to avoid rows arriving at the receiving FAX machine faster than the mechanical paper handling can process them. It is also used by sending FAX machines for flow control, when their paper handling falls behind. The minimum duration of a row is negotiated between the FAX machines, before image transfer commences. TCF data is a continuous stream of zero bits. It may, optionally, be preceeded by a continuous block of one bits. So, when transferring TCF data between the T.38 entities, flow control is simply a matter of repeating the last received bit when the late arrival of TCF data packets causes underflow at an emitting gateway. T.38 entities may negotiate to generate and check TCF data locally, and not exchange it. Generally, this is only used when TCP/TPKT is used as the transport for the T.38 messages. A TCF checker and a TCF generator are needed by a T.38 gateway supporting this option. Some T.38 entities are capable of negotiating the removal of end of row padding bits in the data passing between the T.38 entities. This may reduce the amount of data significantly, for some types of image. If negotiated, most or all surplus zero bits are stripped from the image bit stream, at the sending T.38 entity. If a T.38 gateway is receiving such stripped data, it may need to reimpose a minimum row time, by inserting zeros, as part of its non-ECM rate adaption process. By checking the contents of the DCS messages, it can determine what this minimum should be. Only two types of image compression are used for non-ECM transmission - T.4 1-D and 2-D. The end of line (EOL) marker for both these is 11 zero bits, followed by a one bit. In 2-D mode, an additional one or zero bit follows, which defines the mode of the next row. It turns out that the maximum number of valid consecutive zeros which could preceed the 11 zeros of an EOL is 3. In a valid image there are no longer runs of zeros than at an EOL, and the maximum there is 14. Therefore, if the padding stripper reduces all runs of zeros longer than 14 to just 14, it will strip most of the padding with very simple logic. Simple logic is a good thing in this case. It not only avoids the need to fully analyse the image data, it also minimises problems when there are bit errors in the image data stream. For image data sent without error correction (T.4 1-D or 2-D) there may be underflow at the outgoing gateway, if image data packets arrive too late. To deal with slow mechanical paper handling in FAX machines, the T.30 specification includes an end of pixel row padding scheme for non-error corrected image data. The receiving machine may request a minimum row duration. The sending machine is required to impose that minimum, but can arbitrarily make it much longer to meet its own paper handling needs, sending padding bits as appropriate. This mechanism provides a robust basis for flow control in a T.38 gateway. If the outgoing gateway only starts sending a pixel row when it has the entire row in its buffer, it can safely idle, sending padding bits, at any row end it needs to. Only the 6 EOL markers, which terminate an image, must be protected from this kind of flow control. Those markers are defined as being consecutive, with no zero bit padding separating them. When ECM is used (usually with T.6 image data) the image is packetised in HDLC frames. In this case rate adaption is handled in a similar manner to the V.21 HDLC packets. Testing an implementation of T.38 The T.38 specification does not define any specific compliance tests which an implementation must pass. It is not supplied with any test vectors. Commetrex is a supplier of T.38 implementations, who have taken it upon themselves to define a set of tests, and create a lab for T.38 interoperability testing. This seems the closest thing to an industry standard for T.38 testing which exists at this time, and is much to their credit. Commetrex have defined 16 tests which an implementation T.38 undergoes in their lab. These are described on the Commetrex web site as: Commetrex T.38 tests Test # Direction Transport Image file Error correction Data rate mgt Image encoding Polling 1originateUDPccitt2p.tifredundancy 0method 2MRno 2originateUDP100page.tifredundancy 0method 2MRno 3originateTCPccitt2p.tifredundancy 0method 1MRno 4originateUDPccitt2p.tifredundancy 3method 2MRno 5originateTCPccitt2p.tifFEC 2 from 3 spanmethod 2MRno 6originateUDPdither1d.tifredundancy 3method 2MRno 7originateUDPccitt2p.tifredundancy 3method 2ECMno 8originate & poll to rxUDPccitt2p.tifredundancy 3method 2MRpolled rx 9answerUDPccitt2p.tifredundancy 0method 2MRno 10answerUDP100page.tifredundancy 0method 2MRno 11answerTCPccitt2p.tifredundancy 0method 1MRno 12answerUDPccitt2p.tifredundancy 3method 2MRno 13answerTCPccitt2p.tifFEC 2 from 3 spanmethod 2MRno 14answerUDPdither1d.tifredundancy 3method 2MRno 15answerUDPccitt2p.tifredundancy 3method 2ECMno 16answer & polled to txUDPccitt2p.tifredundancy 3method 2MRpolled tx
The file dither1d.tif is a whole page of dense checkerboard pattern, which does not compress, and produces a kind of torture test page. It is about 2M bytes. 100page.tif is exactly what it says - a file with 100 pages of FAX images. The content of the pages does not seem to be specified by Commetrex. The ITU T.30 test images, repeated sufficiently, seems a good basis for this test. ccitt2p.tif appears to be page 2 of the ITU test images. The tests are heavily biased towards non-ECM operation with MR coding. No other coding appears to be used, and only 2 tests use error corrected (ECM) FAXing.
Some of the Commetrex tests seem strange. Why is TCP transmission tested with FEC or redundancy? These things are only needed to overcome to lack of reliability in a UDP path.
Living with real world T.38 entities. The T.38 specification leaves a number of grey areas, and many things can be implemented in several ways. It might, therefore, be expected that interoperability will not always run smoothly. Whilst some design decisions are reasonable subjects for discussion, it is quite common to find T.38 implementations doing things which are simply wrong. Non-ECM data ending immediately after the six EOLs denoting the end of a page causes corruption From the T.38 specification, a T.38 entity sending non-ECM image data should be able to end the image data, with t4-non-ecm-sig-end, at the last bit of the six consecutive EOLs which denote the end of a page. However, this offers poor compatibility with some implementations of T.38. They will drop their carrier signal prematurely, and the last few rows of the image will be corrupted at the receiver. This can happen regardless of whether the t4-non-ecm-sig-end is followed by a no-signal message, and regardless of the timing of that no-signal message. Padding with zero bytes for 40ms or more after the six EOLs seems to prevent this, and results in an image which exactly matches the one at the source. Expect mixups between non-ECM and ECM image modes. The TCF data should always be sent as non-ECM image data, whether the images which follow it are sent as non-ECM or ECM data. However, some broken implementations of T.38 (e.g. Mediatrix) may send an hdlc-sig-end message to terminate the TCF data. To be as tolerant as possible, it is probably wise to accept hdlc-sig-end or t4-non-ecm-sig-end, regardless of which kind of data it is really terminating. Expect some very poor timing decisions in various designs. The preamble for V.21 HDLC data is specified as being 1s 15%. This should mean 850ms of preamble is within spec, and many modern FAX machines only send that much. A number of T.38 implementations choke on this. They require at least 1s between the v21-preamble message and the first HDLC data, for reliable operation. This is very poor design. Even if there is 1s between these events at the source, jitter on the network can make them arrive less than 1s apart. It appears the best a tolerant implementation can really do is impose a 1s minimum between sending these T.38 messages, and accept that things might still go wrong when there is some jitter. There is similar intolerance with the timing of the start of training messages for the fast image data modems. Most implementations do not impose a minimum which is above that permitted by the T.30 specification. Some do, however, make no allowance for network jitter reducing the interval at the receiver. You should expect the far end to be using TEP, when sizing the required delay between the start of training, and the first data. Also, for ECM data, make sure the delay allows for the specified minimum 200ms of preamble. Which kinds of error correction to use. T.38 defines two kinds of error correction for UDPTL streams. One inserts redundant copies of older IFP packets in each UDPTL packet. The other uses a more complex parity FEC scheme, based on XOR'ed data inserted in each UDPTL packet. Although each UDPTL packet identifies the type of error correction it contains, the original T.38 spec. did not offer any form of negotiation about the type to be used. The SIP and MGCP SDP for T.38 now includes preferred error correction type information, so some measure of negotiation is possible before the flow of UDPTL packets begins. It appears all T.38 implementations are happy to receive packets with redundant secondary content. However, it seems not all implementations will actually recover anything when there are missing UDPTL packets. It appears not all T.38 implementations are happy to receive packets with parity FEC data. Unless the SDP data from the far end explicitly says they support the parity FEC scheme, it is better to send only redundant information. A good implementation should be prepared to accept either kind of data, even intermixed, regardless of anything in the SDP negotiation. In the real world, whatever you ask for in your SDP data, you will probably receive secondary IFP packet redundancy from the far end. It is the only thing most implementations support, and with real world packet loss it may perform just as well as the more complex parity FEC scheme. When the first few UDPTL packets are sent, there will be no historical information to send as redundant secondary IFP packets, or parity FEC data. When using the redundant secondary packet scheme this is handled transparently. Each UDPTL packet says the number of redundant secondary IFP packets it contains. This can simply be set to zero for the first UDPTL packet, one for the second, up to the amount of redundancy which has been configured. All implementations seem to work in this way. When parity FEC is being used, the startup arrangement is less clear. While some implementations simply insert zeros for the non-existant packets before the start, others send a few packets with redundant secondary IFP packets, until they are able to insert the required amount of FEC data. Dealing with intermixed types of error correction makes a receiving implementation of UDPTL messier and slower, but is necessary for compatibility. What really ends the data? It should be correct to send some image data, and end with the image data signal end message. However, some T.38 implementations misbehave when this is all that is sent. Immediately following the signal end message with a no-signal indicator message seems to greatly improve compatibility with some T.38 implementations. T.38 defines hdlc-fcs-OK, hdlc-fcs-OK-sig-end, hdlc-sig-end, and no-signal messages. Always end periods of HDLC transmission with either a hdlc-fcs-OK, hdlc-sig-end, no-signal sequence or a hdlc-fcs-OK-sig-end, no-signal sequence. Do not send hdlc-sig-end after hdlc-fcs-OK-sig-end. A number of T.38 implementations choke on this sequence, even though it looks fairly harmless. Normal use versus testing The design of some T.38 implementations precludes some reasonable tests from succeeding, due to design features which may have been implemented for sane reasons. This means each test failure needs to be investigated in detail, to see if it represents something genuinely bad in an implementation of T.38. For example, the 2M byte torture test page in the Commetrex test suite will not successfully pass through some T.38 implementations, because of a timeout they impose. For example, some ATAs based on Audiocodes silicon have been seen to stop any continuous period of modem transmission after about 90s. This appears to be a backstop timeout, to prevent troublesome implementations jamming the gateway. Legitimate pages just don't take that long, and the timeout is reasonable. However, the 2M byte test page takes up to 20 minutes to transmit, and will always fail on these boxes. spandsp-0.0.6/doc/t38_manual/0000775000175000017500000000000012357123347012717 500000000000000spandsp-0.0.6/doc/t38_manual/css.css0000664000175000017500000002330010724452433014134 00000000000000body { background-image: url("../images/weave.jpg"); font-family: Verdana, Arial, Helvetica, Sans-serif; color: black; margin-right: 20px; margin-left: 20px; } h1 { text-align: center; } h2 { font-family: Verdana, Arial, Helvetica, Sans-serif; border-color: #c00000; color : black; margin-top: 0.8em; border-style: solid; border-width: 0px 0px 3px 0.5em; line-height : 130%; } h3 { font-family: Verdana, Arial, Helvetica, Sans-serif; border-color: #f02020; color : black; border-width: 0px 0px 2px 0.5em; border-style: solid; margin-right: 20%; line-height : 130%; } caption { font-weight: bold } a.qindex {} a.qindexRef {} a.el { text-decoration: none; font-weight: bold } a.elRef { font-weight: bold } a.code { text-decoration: none; font-weight: normal; color: #4444ee } a.codeRef { font-weight: normal; color: #4444ee } a:hover { text-decoration: none; background-color: #f2f2ff } dl.el { margin-left: -1cm } div.fragment { width: 100%; border: none; background-color: #eeeeee } div.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } td { font-family: Verdana, Arial, Helvetica, Sans-serif; font-weight: bold; } .navheader { font-family: Verdana, Arial, Helvetica, Sans-serif; background-color: #B2B2ff; font-weight: bold; } .navfooter { font-family: Verdana, Arial, Helvetica, Sans-serif; background-color: #B2B2ff; font-weight: bold; } table.menu { background-color: #000066; font-weight: bold; text-align: center; width: 100%; } tr.menu { background-color: #ccffff; font-weight: bold; text-align: center; } td.menu { background-color: #f2e0d0; font-weight: bold; text-align: center; } td.md { background-color: #f2f2ff; font-weight: bold; } td.mdname1 { background-color: #f2f2ff; font-weight: bold; color: #602020; } td.mdname { background-color: #f2f2ff; font-weight: bold; color: #602020; width: 600px; } div.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold } div.groupText { margin-left: 16px; font-style: italic; font-size: smaller } td.indexkey { font-family: Verdana, Arial, Helvetica, Sans-serif; background-color: #eeeeff; font-weight: bold; padding-right : 10px; padding-top : 2px; padding-left : 10px; padding-bottom : 2px; margin-left : 0px; margin-right : 0px; margin-top : 2px; margin-bottom : 2px } td.indexvalue { font-family: Verdana, Arial, Helvetica, Sans-serif; background-color: #eeeeff; font-style: italic; padding-right : 10px; padding-top : 2px; padding-left : 10px; padding-bottom : 2px; margin-left : 0px; margin-right : 0px; margin-top : 2px; margin-bottom : 2px } span.keyword { color: #008000 } span.keywordtype { color: #604020 } span.keywordflow { color: #e08000 } span.comment { color: #800000 } span.preprocessor { color: #806020 } span.stringliteral { color: #002080 } span.charliteral { color: #008080 } em { color: #990000; background-color: transparent; } h1,h2,h3,h4,h5,h6,p,center,td,th,ul,dl,div { font-family: Geneva, Arial, Helvetica, sans-serif; } body,td { font-size: 90%; } h1 { text-align: center; font-size: 160%; } h2 { font-size: 120%; } h3 { font-size: 100%; } caption { font-weight: bold } div.qindex { width: 100%; background-color: #eeeeff; border: 1px solid #b0b0b0; text-align: center; margin: 2px; padding: 2px; line-height: 140%; } div.nav { width: 100%; background-color: #eeeeff; border: 1px solid #b0b0b0; text-align: center; margin: 2px; padding: 2px; line-height: 140%; } div.navtab { background-color: #eeeeff; border: 1px solid #b0b0b0; text-align: center; margin: 2px; margin-right: 15px; padding: 2px; } td.navtab { font-size: 70%; } a.qindex { text-decoration: none; font-weight: bold; color: #1a419d; } a.qindex:visited { text-decoration: none; font-weight: bold; color: #1a419d } a.qindex:hover { text-decoration: none; background-color: #ddddff; } a.qindexHL { text-decoration: none; font-weight: bold; background-color: #6666cc; color: #ffffff; border: 1px double #9295C2; } a.qindexHL:hover { text-decoration: none; background-color: #6666cc; color: #ffffff; } a.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } a.el { text-decoration: none; font-weight: bold } a.elRef { font-weight: bold } a.code:link { text-decoration: none; font-weight: normal; color: #0000FF } a.code:visited { text-decoration: none; font-weight: normal; color: #0000FF } a.codeRef:link { font-weight: normal; color: #0000FF } a.codeRef:visited { font-weight: normal; color: #0000FF } a:hover { text-decoration: none; background-color: #f2f2ff } dl.el { margin-left: -1cm } .fragment { font-family: Fixed, monospace; font-size: 95%; } pre.fragment { border: 1px solid #CCCCCC; background-color: #f5f5f5; margin-top: 4px; margin-bottom: 4px; margin-left: 2px; margin-right: 8px; padding-left: 6px; padding-right: 6px; padding-top: 4px; padding-bottom: 4px; } div.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } td.md { background-color: #F4F4FB; font-weight: bold; } td.mdPrefix { background-color: #F4F4FB; color: #606060; font-size: 80%; } td.mdname1 { background-color: #F4F4FB; font-weight: bold; color: #602020; } td.mdname { background-color: #F4F4FB; font-weight: bold; color: #602020; width: 600px; } div.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold; } div.groupText { margin-left: 16px; font-style: italic; font-size: 90% } td.indexkey { background-color: #eeeeff; font-weight: bold; padding-right : 10px; padding-top : 2px; padding-left : 10px; padding-bottom : 2px; margin-left : 0px; margin-right : 0px; margin-top : 2px; margin-bottom : 2px; border: 1px solid #CCCCCC; } td.indexvalue { background-color: #eeeeff; font-style: italic; padding-right : 10px; padding-top : 2px; padding-left : 10px; padding-bottom : 2px; margin-left : 0px; margin-right : 0px; margin-top : 2px; margin-bottom : 2px; border: 1px solid #CCCCCC; } tr.memlist { background-color: #f0f0f0; } p.formulaDsp { text-align: center; } img.formulaDsp { } img.formulaInl { vertical-align: middle; } span.keyword { color: #008000 } span.keywordtype { color: #604020 } span.keywordflow { color: #e08000 } span.comment { color: #800000 } span.preprocessor { color: #806020 } span.stringliteral { color: #002080 } span.charliteral { color: #008080 } .mdTable { border: 1px solid #868686; background-color: #F4F4FB; } .mdRow { padding: 8px 10px; } .mdescLeft { padding: 0px 8px 4px 8px; font-size: 80%; font-style: italic; background-color: #FAFAFA; border-top: 1px none #E0E0E0; border-right: 1px none #E0E0E0; border-bottom: 1px none #E0E0E0; border-left: 1px none #E0E0E0; margin: 0px; } .mdescRight { padding: 0px 8px 4px 8px; font-size: 80%; font-style: italic; background-color: #FAFAFA; border-top: 1px none #E0E0E0; border-right: 1px none #E0E0E0; border-bottom: 1px none #E0E0E0; border-left: 1px none #E0E0E0; margin: 0px; } .memItemLeft { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memItemRight { padding: 1px 8px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplItemLeft { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplItemRight { padding: 1px 8px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplParams { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; color: #606060; background-color: #FAFAFA; font-size: 80%; } .search { color: #003399; font-weight: bold; } form.search { margin-bottom: 0px; margin-top: 0px; } input.search { font-size: 75%; color: #000080; font-weight: normal; background-color: #eeeeff; } td.tiny { font-size: 75%; } a { color: #252e78; } a:visited { color: #3d2185; } .dirtab { padding: 4px; border-collapse: collapse; border: 1px solid #b0b0b0; } th.dirtab { background: #eeeeff; font-weight: bold; } hr { height: 1px; border: none; border-top: 1px solid black; } spandsp-0.0.6/doc/doxygen.in0000664000175000017500000014003011170265760012665 00000000000000# Doxyfile 1.4.4 # This file describes the settings to be used by the documentation system # doxygen (www.doxygen.org) for a project # # All text after a hash (#) is considered a comment and will be ignored # The format is: # TAG = value [value, ...] # For lists items can also be appended using: # TAG += value [value, ...] # Values that contain spaces should be placed between quotes (" ") #--------------------------------------------------------------------------- # Project related configuration options #--------------------------------------------------------------------------- # The PROJECT_NAME tag is a single word (or a sequence of words surrounded # by quotes) that should identify the project. PROJECT_NAME = @PACKAGE@ # The PROJECT_NUMBER tag can be used to enter a project or revision number. # This could be handy for archiving the generated documentation or # if some version control system is used. PROJECT_NUMBER = @VERSION@ # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. # If a relative path is entered, it will be relative to the location # where doxygen was started. If left blank the current directory will be used. OUTPUT_DIRECTORY = api # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create # 4096 sub-directories (in 2 levels) under the output directory of each output # format and will distribute the generated files over these directories. # Enabling this option can be useful when feeding doxygen a huge amount of # source files, where putting all generated files in the same directory would # otherwise cause performance problems for the file system. CREATE_SUBDIRS = NO # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. # The default language is English, other supported languages are: # Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, # Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, # Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, # Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, # Swedish, and Ukrainian. OUTPUT_LANGUAGE = English # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will # include brief member descriptions after the members that are listed in # the file and class documentation (similar to JavaDoc). # Set to NO to disable this. BRIEF_MEMBER_DESC = YES # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend # the brief description of a member or function before the detailed description. # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. REPEAT_BRIEF = YES # This tag implements a quasi-intelligent brief description abbreviator # that is used to form the text in various listings. Each string # in this list, if found as the leading text of the brief description, will be # stripped from the text and the result after processing the whole list, is # used as the annotated text. Otherwise, the brief description is used as-is. # If left blank, the following values are used ("$name" is automatically # replaced with the name of the entity): "The $name class" "The $name widget" # "The $name file" "is" "provides" "specifies" "contains" # "represents" "a" "an" "the" ABBREVIATE_BRIEF = # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then # Doxygen will generate a detailed section even if there is only a brief # description. ALWAYS_DETAILED_SEC = NO # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. INLINE_INHERITED_MEMB = NO # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full # path before files name in the file list and in the header files. If set # to NO the shortest path that makes the file name unique will be used. FULL_PATH_NAMES = NO # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag # can be used to strip a user-defined part of the path. Stripping is # only done if one of the specified strings matches the left-hand part of # the path. The tag can be used to show relative paths in the file list. # If left blank the directory from which doxygen is run is used as the # path to strip. STRIP_FROM_PATH = # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of # the path mentioned in the documentation of a class, which tells # the reader which header file to include in order to use a class. # If left blank only the name of the header file containing the class # definition is used. Otherwise one should specify the include paths that # are normally passed to the compiler using the -I flag. STRIP_FROM_INC_PATH = # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter # (but less readable) file names. This can be useful is your file systems # doesn't support long names like on DOS, Mac, or CD-ROM. SHORT_NAMES = NO # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen # will interpret the first line (until the first dot) of a JavaDoc-style # comment as the brief description. If set to NO, the JavaDoc # comments will behave just like the Qt-style comments (thus requiring an # explicit @brief command for a brief description. JAVADOC_AUTOBRIEF = NO # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen # treat a multi-line C++ special comment block (i.e. a block of //! or /// # comments) as a brief description. This used to be the default behaviour. # The new default is to treat a multi-line C++ comment block as a detailed # description. Set this tag to YES if you prefer the old behaviour instead. MULTILINE_CPP_IS_BRIEF = NO # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented # member inherits the documentation from any documented member that it # re-implements. INHERIT_DOCS = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC # tag is set to YES, then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. DISTRIBUTE_GROUP_DOC = NO # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce # a new page for each member. If set to NO, the documentation of a member will # be part of the file/class/namespace that contains it. SEPARATE_MEMBER_PAGES = NO # The TAB_SIZE tag can be used to set the number of spaces in a tab. # Doxygen uses this value to replace tabs by spaces in code fragments. TAB_SIZE = 8 # This tag can be used to specify a number of aliases that acts # as commands in the documentation. An alias has the form "name=value". # For example adding "sideeffect=\par Side Effects:\n" will allow you to # put the command \sideeffect (or @sideeffect) in the documentation, which # will result in a user-defined paragraph with heading "Side Effects:". # You can put \n's in the value part of an alias to insert newlines. ALIASES = # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C # sources only. Doxygen will then generate output that is more tailored for C. # For instance, some of the names that are used will be different. The list # of all members will be omitted, etc. OPTIMIZE_OUTPUT_FOR_C = NO # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java sources # only. Doxygen will then generate output that is more tailored for Java. # For instance, namespaces will be presented as packages, qualified scopes # will look different, etc. OPTIMIZE_OUTPUT_JAVA = NO # Set the SUBGROUPING tag to YES (the default) to allow class member groups of # the same type (for instance a group of public functions) to be put as a # subgroup of that type (e.g. under the Public Functions section). Set it to # NO to prevent subgrouping. Alternatively, this can be done per class using # the \nosubgrouping command. SUBGROUPING = YES #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in # documentation are documented, even if no documentation was available. # Private class members and static file members will be hidden unless # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES EXTRACT_ALL = NO # If the EXTRACT_PRIVATE tag is set to YES all private members of a class # will be included in the documentation. EXTRACT_PRIVATE = NO # If the EXTRACT_STATIC tag is set to YES all static members of a file # will be included in the documentation. EXTRACT_STATIC = NO # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) # defined locally in source files will be included in the documentation. # If set to NO only classes defined in header files are included. EXTRACT_LOCAL_CLASSES = YES # This flag is only useful for Objective-C code. When set to YES local # methods, which are defined in the implementation section but not in # the interface are included in the documentation. # If set to NO (the default) only methods in the interface are included. EXTRACT_LOCAL_METHODS = NO # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all # undocumented members of documented classes, files or namespaces. # If set to NO (the default) these members will be included in the # various overviews, but no documentation section is generated. # This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_MEMBERS = NO # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all # undocumented classes that are normally visible in the class hierarchy. # If set to NO (the default) these classes will be included in the various # overviews. This option has no effect if EXTRACT_ALL is enabled. HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all # friend (class|struct|union) declarations. # If set to NO (the default) these declarations will be included in the # documentation. HIDE_FRIEND_COMPOUNDS = NO # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any # documentation blocks found inside the body of a function. # If set to NO (the default) these blocks will be appended to the # function's detailed documentation block. HIDE_IN_BODY_DOCS = NO # The INTERNAL_DOCS tag determines if documentation # that is typed after a \internal command is included. If the tag is set # to NO (the default) then the documentation will be excluded. # Set it to YES to include the internal documentation. INTERNAL_DOCS = NO # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate # file names in lower-case letters. If set to YES upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows # and Mac users are advised to set this option to NO. CASE_SENSE_NAMES = YES # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen # will show members with their full class and namespace scopes in the # documentation. If set to YES the scope will be hidden. HIDE_SCOPE_NAMES = NO # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen # will put a list of the files that are included by a file in the documentation # of that file. SHOW_INCLUDE_FILES = YES # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] # is inserted in the documentation for inline members. INLINE_INFO = YES # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen # will sort the (detailed) documentation of file and class members # alphabetically by member name. If set to NO the members will appear in # declaration order. SORT_MEMBER_DOCS = YES # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the # brief documentation of file, namespace and class members alphabetically # by member name. If set to NO (the default) the members will appear in # declaration order. SORT_BRIEF_DOCS = NO # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be # sorted by fully-qualified names, including namespaces. If set to # NO (the default), the class list will be sorted only by class name, # not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. # Note: This option applies only to the class list, not to the # alphabetical list. SORT_BY_SCOPE_NAME = NO # The GENERATE_TODOLIST tag can be used to enable (YES) or # disable (NO) the todo list. This list is created by putting \todo # commands in the documentation. GENERATE_TODOLIST = YES # The GENERATE_TESTLIST tag can be used to enable (YES) or # disable (NO) the test list. This list is created by putting \test # commands in the documentation. GENERATE_TESTLIST = YES # The GENERATE_BUGLIST tag can be used to enable (YES) or # disable (NO) the bug list. This list is created by putting \bug # commands in the documentation. GENERATE_BUGLIST = YES # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or # disable (NO) the deprecated list. This list is created by putting # \deprecated commands in the documentation. GENERATE_DEPRECATEDLIST= YES # The ENABLED_SECTIONS tag can be used to enable conditional # documentation sections, marked by \if sectionname ... \endif. ENABLED_SECTIONS = # The MAX_INITIALIZER_LINES tag determines the maximum number of lines # the initial value of a variable or define consists of for it to appear in # the documentation. If the initializer consists of more lines than specified # here it will be hidden. Use a value of 0 to hide initializers completely. # The appearance of the initializer of individual variables and defines in the # documentation can be controlled using \showinitializer or \hideinitializer # command in the documentation regardless of this setting. MAX_INITIALIZER_LINES = 30 # Set the SHOW_USED_FILES tag to NO to disable the list of files generated # at the bottom of the documentation of classes and structs. If set to YES the # list will mention the files that were used to generate the documentation. SHOW_USED_FILES = YES # If the sources in your project are distributed over multiple directories # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy # in the documentation. The default is YES. SHOW_DIRECTORIES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from the # version control system). Doxygen will invoke the program by executing (via # popen()) the command , where is the value of # the FILE_VERSION_FILTER tag, and is the name of an input file # provided by doxygen. Whatever the progam writes to standard output # is used as the file version. See the manual for examples. FILE_VERSION_FILTER = #--------------------------------------------------------------------------- # configuration options related to warning and progress messages #--------------------------------------------------------------------------- # The QUIET tag can be used to turn on/off the messages that are generated # by doxygen. Possible values are YES and NO. If left blank NO is used. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are # generated by doxygen. Possible values are YES and NO. If left blank # NO is used. WARNINGS = YES # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings # for undocumented members. If EXTRACT_ALL is set to YES then this flag will # automatically be disabled. WARN_IF_UNDOCUMENTED = YES # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for # potential errors in the documentation, such as not documenting some # parameters in a documented function, or documenting parameters that # don't exist or using markup commands wrongly. WARN_IF_DOC_ERROR = YES # This WARN_NO_PARAMDOC option can be abled to get warnings for # functions that are documented, but have no documentation for their parameters # or return value. If set to NO (the default) doxygen will only warn about # wrong or incomplete parameter documentation, but not about the absence of # documentation. WARN_NO_PARAMDOC = NO # The WARN_FORMAT tag determines the format of the warning messages that # doxygen can produce. The string should contain the $file, $line, and $text # tags, which will be replaced by the file and line number from which the # warning originated and the warning text. Optionally the format may contain # $version, which will be replaced by the version of the file (if it could # be obtained via FILE_VERSION_FILTER) WARN_FORMAT = # The WARN_LOGFILE tag can be used to specify a file to which warning # and error messages should be written. If left blank the output is written # to stderr. WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- # The INPUT tag can be used to specify the files and/or directories that contain # documented source files. You may enter file names like "myfile.cpp" or # directories like "/usr/src/myproject". Separate the files or directories # with spaces. INPUT = .. # If the value of the INPUT tag contains directories, you can use the # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank the following patterns are tested: # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm FILE_PATTERNS = *.c \ *.h # The RECURSIVE tag can be used to turn specify whether or not subdirectories # should be searched for input files as well. Possible values are YES and NO. # If left blank NO is used. RECURSIVE = YES # The EXCLUDE tag can be used to specify files and/or directories that should # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. EXCLUDE = # The EXCLUDE_SYMLINKS tag can be used select whether or not files or # directories that are symbolic links (a Unix filesystem feature) are excluded # from the input. EXCLUDE_SYMLINKS = NO # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude # certain files from those directories. Note that the wildcards are matched # against the file with absolute path, so to exclude all test directories # for example use the pattern */test/* EXCLUDE_PATTERNS = # The EXAMPLE_PATH tag can be used to specify one or more files or # directories that contain example code fragments that are included (see # the \include command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp # and *.h) to filter out the source-files in the directories. If left # blank all files are included. EXAMPLE_PATTERNS = # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be # searched for input files to be used with the \include or \dontinclude # commands irrespective of the value of the RECURSIVE tag. # Possible values are YES and NO. If left blank NO is used. EXAMPLE_RECURSIVE = NO # The IMAGE_PATH tag can be used to specify one or more files or # directories that contain image that are included in the documentation (see # the \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program # by executing (via popen()) the command , where # is the value of the INPUT_FILTER tag, and is the name of an # input file. Doxygen will then use the output that the filter program writes # to standard output. If FILTER_PATTERNS is specified, this tag will be # ignored. INPUT_FILTER = # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # basis. Doxygen will compare the file name with each pattern and apply the # filter if there is a match. The filters are a list of the form: # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER # is applied to all files. FILTER_PATTERNS = # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using # INPUT_FILTER) will be used to filter the input files when producing source # files to browse (i.e. when SOURCE_BROWSER is set to YES). FILTER_SOURCE_FILES = NO #--------------------------------------------------------------------------- # configuration options related to source browsing #--------------------------------------------------------------------------- # If the SOURCE_BROWSER tag is set to YES then a list of source files will # be generated. Documented entities will be cross-referenced with these sources. # Note: To get rid of all source code in the generated output, make sure also # VERBATIM_HEADERS is set to NO. SOURCE_BROWSER = NO # Setting the INLINE_SOURCES tag to YES will include the body # of functions and classes directly in the documentation. INLINE_SOURCES = NO # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct # doxygen to hide any special comment blocks from generated source code # fragments. Normal C and C++ comments will always remain visible. STRIP_CODE_COMMENTS = NO # If the REFERENCED_BY_RELATION tag is set to YES (the default) # then for each documented function all documented # functions referencing it will be listed. REFERENCED_BY_RELATION = YES # If the REFERENCES_RELATION tag is set to YES (the default) # then for each documented function all documented entities # called/used by that function will be listed. REFERENCES_RELATION = YES # If the USE_HTAGS tag is set to YES then the references to source code # will point to the HTML generated by the htags(1) tool instead of doxygen # built-in source browser. The htags tool is part of GNU's global source # tagging system (see http://www.gnu.org/software/global/global.html). You # will need version 4.8.6 or higher. USE_HTAGS = NO # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen # will generate a verbatim copy of the header file for each class for # which an include is specified. Set to NO to disable this. VERBATIM_HEADERS = YES #--------------------------------------------------------------------------- # configuration options related to the alphabetical class index #--------------------------------------------------------------------------- # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index # of all compounds will be generated. Enable this if the project # contains a lot of classes, structs, unions or interfaces. ALPHABETICAL_INDEX = YES # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns # in which this list will be split (can be a number in the range [1..20]) COLS_IN_ALPHA_INDEX = 2 # In case all classes in a project start with a common prefix, all # classes will be put under the same header in the alphabetical index. # The IGNORE_PREFIX tag can be used to specify one or more prefixes that # should be ignored while generating the index headers. IGNORE_PREFIX = #--------------------------------------------------------------------------- # configuration options related to the HTML output #--------------------------------------------------------------------------- # If the GENERATE_HTML tag is set to YES (the default) Doxygen will # generate HTML output. GENERATE_HTML = YES # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `html' will be used as the default path. HTML_OUTPUT = # The HTML_FILE_EXTENSION tag can be used to specify the file extension for # each generated HTML page (for example: .htm,.php,.asp). If it is left blank # doxygen will generate files with .html extension. HTML_FILE_EXTENSION = .html # The HTML_HEADER tag can be used to specify a personal HTML header for # each generated HTML page. If it is left blank doxygen will generate a # standard header. HTML_HEADER = # The HTML_FOOTER tag can be used to specify a personal HTML footer for # each generated HTML page. If it is left blank doxygen will generate a # standard footer. HTML_FOOTER = # The HTML_STYLESHEET tag can be used to specify a user-defined cascading # style sheet that is used by each HTML page. It can be used to # fine-tune the look of the HTML output. If the tag is left blank doxygen # will generate a default style sheet. Note that doxygen will try to copy # the style sheet file to the HTML output directory, so don't put your own # stylesheet in the HTML output directory as well, or it will be erased! HTML_STYLESHEET = css.css # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, # files or namespaces will be aligned in HTML using tables. If set to # NO a bullet list will be used. HTML_ALIGN_MEMBERS = YES # If the GENERATE_HTMLHELP tag is set to YES, additional index files # will be generated that can be used as input for tools like the # Microsoft HTML help workshop to generate a compressed HTML help file (.chm) # of the generated HTML documentation. GENERATE_HTMLHELP = NO # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can # be used to specify the file name of the resulting .chm file. You # can add a path in front of the file if the result should not be # written to the html output directory. CHM_FILE = # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can # be used to specify the location (absolute path including file name) of # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run # the HTML help compiler on the generated index.hhp. HHC_LOCATION = # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag # controls if a separate .chi index file is generated (YES) or that # it should be included in the master .chm file (NO). GENERATE_CHI = NO # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag # controls whether a binary table of contents is generated (YES) or a # normal table of contents (NO) in the .chm file. BINARY_TOC = NO # The TOC_EXPAND flag can be set to YES to add extra items for group members # to the contents of the HTML help documentation and to the tree view. TOC_EXPAND = NO # The DISABLE_INDEX tag can be used to turn on/off the condensed index at # top of each HTML page. The value NO (the default) enables the index and # the value YES disables it. DISABLE_INDEX = NO # This tag can be used to set the number of enum values (range [1..20]) # that doxygen will group on one line in the generated HTML documentation. ENUM_VALUES_PER_LINE = 4 # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be # generated containing a tree-like index structure (just like the one that # is generated for HTML Help). For this to work a browser that supports # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are # probably better off using the HTML help feature. GENERATE_TREEVIEW = YES # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be # used to set the initial width (in pixels) of the frame in which the tree # is shown. TREEVIEW_WIDTH = 250 #--------------------------------------------------------------------------- # configuration options related to the LaTeX output #--------------------------------------------------------------------------- # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will # generate Latex output. GENERATE_LATEX = NO # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `latex' will be used as the default path. LATEX_OUTPUT = # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be # invoked. If left blank `latex' will be used as the default command name. LATEX_CMD_NAME = latex # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to # generate index for LaTeX. If left blank `makeindex' will be used as the # default command name. MAKEINDEX_CMD_NAME = makeindex # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact # LaTeX documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_LATEX = NO # The PAPER_TYPE tag can be used to set the paper type that is used # by the printer. Possible values are: a4, a4wide, letter, legal and # executive. If left blank a4wide will be used. PAPER_TYPE = a4wide # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX # packages that should be included in the LaTeX output. EXTRA_PACKAGES = # The LATEX_HEADER tag can be used to specify a personal LaTeX header for # the generated latex document. The header should contain everything until # the first chapter. If it is left blank doxygen will generate a # standard header. Notice: only use this tag if you know what you are doing! LATEX_HEADER = # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated # is prepared for conversion to pdf (using ps2pdf). The pdf file will # contain links (just like the HTML output) instead of page references # This makes the output suitable for online browsing using a pdf viewer. PDF_HYPERLINKS = NO # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of # plain latex in the generated Makefile. Set this option to YES to get a # higher quality PDF documentation. USE_PDFLATEX = NO # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. # command to the generated LaTeX files. This will instruct LaTeX to keep # running if errors occur, instead of asking the user for help. # This option is also used when generating formulas in HTML. LATEX_BATCHMODE = NO # If LATEX_HIDE_INDICES is set to YES then doxygen will not # include the index chapters (such as File Index, Compound Index, etc.) # in the output. LATEX_HIDE_INDICES = NO #--------------------------------------------------------------------------- # configuration options related to the RTF output #--------------------------------------------------------------------------- # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output # The RTF output is optimized for Word 97 and may not look very pretty with # other RTF readers or editors. GENERATE_RTF = NO # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `rtf' will be used as the default path. RTF_OUTPUT = # If the COMPACT_RTF tag is set to YES Doxygen generates more compact # RTF documents. This may be useful for small projects and may help to # save some trees in general. COMPACT_RTF = NO # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated # will contain hyperlink fields. The RTF file will # contain links (just like the HTML output) instead of page references. # This makes the output suitable for online browsing using WORD or other # programs which support those fields. # Note: wordpad (write) and others do not support links. RTF_HYPERLINKS = NO # Load stylesheet definitions from file. Syntax is similar to doxygen's # config file, i.e. a series of assignments. You only have to provide # replacements, missing definitions are set to their default value. RTF_STYLESHEET_FILE = # Set optional variables used in the generation of an rtf document. # Syntax is similar to doxygen's config file. RTF_EXTENSIONS_FILE = #--------------------------------------------------------------------------- # configuration options related to the man page output #--------------------------------------------------------------------------- # If the GENERATE_MAN tag is set to YES (the default) Doxygen will # generate man pages GENERATE_MAN = NO # The MAN_OUTPUT tag is used to specify where the man pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `man' will be used as the default path. MAN_OUTPUT = # The MAN_EXTENSION tag determines the extension that is added to # the generated man pages (default is the subroutine's section .3) MAN_EXTENSION = # If the MAN_LINKS tag is set to YES and Doxygen generates man output, # then it will generate one additional man file for each entity # documented in the real man page(s). These additional files # only source the real man page, but without them the man command # would be unable to find the correct page. The default is NO. MAN_LINKS = NO #--------------------------------------------------------------------------- # configuration options related to the XML output #--------------------------------------------------------------------------- # If the GENERATE_XML tag is set to YES Doxygen will # generate an XML file that captures the structure of # the code including all documentation. GENERATE_XML = NO # The XML_OUTPUT tag is used to specify where the XML pages will be put. # If a relative path is entered the value of OUTPUT_DIRECTORY will be # put in front of it. If left blank `xml' will be used as the default path. XML_OUTPUT = xml # The XML_SCHEMA tag can be used to specify an XML schema, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_SCHEMA = # The XML_DTD tag can be used to specify an XML DTD, # which can be used by a validating XML parser to check the # syntax of the XML files. XML_DTD = # If the XML_PROGRAMLISTING tag is set to YES Doxygen will # dump the program listings (including syntax highlighting # and cross-referencing information) to the XML output. Note that # enabling this will significantly increase the size of the XML output. XML_PROGRAMLISTING = YES #--------------------------------------------------------------------------- # configuration options for the AutoGen Definitions output #--------------------------------------------------------------------------- # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will # generate an AutoGen Definitions (see autogen.sf.net) file # that captures the structure of the code including all # documentation. Note that this feature is still experimental # and incomplete at the moment. GENERATE_AUTOGEN_DEF = NO #--------------------------------------------------------------------------- # configuration options related to the Perl module output #--------------------------------------------------------------------------- # If the GENERATE_PERLMOD tag is set to YES Doxygen will # generate a Perl module file that captures the structure of # the code including all documentation. Note that this # feature is still experimental and incomplete at the # moment. GENERATE_PERLMOD = NO # If the PERLMOD_LATEX tag is set to YES Doxygen will generate # the necessary Makefile rules, Perl scripts and LaTeX code to be able # to generate PDF and DVI output from the Perl module output. PERLMOD_LATEX = NO # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be # nicely formatted so it can be parsed by a human reader. This is useful # if you want to understand what is going on. On the other hand, if this # tag is set to NO the size of the Perl module output will be much smaller # and Perl will parse it just the same. PERLMOD_PRETTY = YES # The names of the make variables in the generated doxyrules.make file # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. # This is useful so different doxyrules.make files included by the same # Makefile don't overwrite each other's variables. PERLMOD_MAKEVAR_PREFIX = #--------------------------------------------------------------------------- # Configuration options related to the preprocessor #--------------------------------------------------------------------------- # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will # evaluate all C-preprocessor directives found in the sources and include # files. ENABLE_PREPROCESSING = YES # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro # names in the source code. If set to NO (the default) only conditional # compilation will be performed. Macro expansion can be done in a controlled # way by setting EXPAND_ONLY_PREDEF to YES. MACRO_EXPANSION = YES # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES # then the macro expansion is limited to the macros specified with the # PREDEFINED and EXPAND_AS_PREDEFINED tags. EXPAND_ONLY_PREDEF = NO # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files # in the INCLUDE_PATH (see below) will be search if a #include is found. SEARCH_INCLUDES = YES # The INCLUDE_PATH tag can be used to specify one or more directories that # contain include files that are not input files but should be processed by # the preprocessor. INCLUDE_PATH = # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the # directories. If left blank, the patterns specified with FILE_PATTERNS will # be used. INCLUDE_FILE_PATTERNS = # The PREDEFINED tag can be used to specify one or more macro names that # are defined before the preprocessor is started (similar to the -D option of # gcc). The argument of the tag is a list of macros of the form: name # or name=definition (no spaces). If the definition and the = are # omitted =1 is assumed. To prevent a macro definition from being # undefined via #undef or recursively expanded use the := operator # instead of the = operator. PREDEFINED = SPAN_DECLARE(x)=x # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then # this tag can be used to specify a list of macro names that should be expanded. # The macro definition that is found in the sources will be used. # Use the PREDEFINED tag if you want to use a different macro definition. EXPAND_AS_DEFINED = # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then # doxygen's preprocessor will remove all function-like macros that are alone # on a line, have an all uppercase name, and do not end with a semicolon. Such # function macros are typically used for boiler-plate code, and will confuse # the parser if not removed. SKIP_FUNCTION_MACROS = YES #--------------------------------------------------------------------------- # Configuration::additions related to external references #--------------------------------------------------------------------------- # The TAGFILES option can be used to specify one or more tagfiles. # Optionally an initial location of the external documentation # can be added for each tagfile. The format of a tag file without # this location is as follows: # TAGFILES = file1 file2 ... # Adding location for the tag files is done as follows: # TAGFILES = file1=loc1 "file2 = loc2" ... # where "loc1" and "loc2" can be relative or absolute paths or # URLs. If a location is present for each tag, the installdox tool # does not have to be run to correct the links. # Note that each tag file must have a unique name # (where the name does NOT include the path) # If a tag file is not located in the directory in which doxygen # is run, you must also specify the path to the tagfile here. TAGFILES = # When a file name is specified after GENERATE_TAGFILE, doxygen will create # a tag file that is based on the input files it reads. GENERATE_TAGFILE = # If the ALLEXTERNALS tag is set to YES all external classes will be listed # in the class index. If set to NO only the inherited external classes # will be listed. ALLEXTERNALS = NO # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed # in the modules index. If set to NO, only the current project's groups will # be listed. EXTERNAL_GROUPS = YES # The PERL_PATH should be the absolute path and name of the perl script # interpreter (i.e. the result of `which perl'). PERL_PATH = /usr/bin/perl #--------------------------------------------------------------------------- # Configuration options related to the dot tool #--------------------------------------------------------------------------- # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base # or super classes. Setting the tag to NO turns the diagrams off. Note that # this option is superseded by the HAVE_DOT option below. This is only a # fallback. It is recommended to install and use dot, since it yields more # powerful graphs. CLASS_DIAGRAMS = YES # If set to YES, the inheritance and collaboration graphs will hide # inheritance and usage relations if the target is undocumented # or is not a class. HIDE_UNDOC_RELATIONS = YES # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz, a graph visualization # toolkit from AT&T and Lucent Bell Labs. The other options in this section # have no effect if this option is set to NO (the default) HAVE_DOT = NO # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect inheritance relations. Setting this tag to YES will force the # the CLASS_DIAGRAMS tag to NO. CLASS_GRAPH = YES # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen # will generate a graph for each documented class showing the direct and # indirect implementation dependencies (inheritance, containment, and # class references variables) of the class with other documented classes. COLLABORATION_GRAPH = YES # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen # will generate a graph for groups, showing the direct groups dependencies GROUP_GRAPHS = YES # If the UML_LOOK tag is set to YES doxygen will generate inheritance and # collaboration diagrams in a style similar to the OMG's Unified Modeling # Language. UML_LOOK = NO # If set to YES, the inheritance and collaboration graphs will show the # relations between templates and their instances. TEMPLATE_RELATIONS = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT # tags are set to YES then doxygen will generate a graph for each documented # file showing the direct and indirect include dependencies of the file with # other documented files. INCLUDE_GRAPH = YES # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and # HAVE_DOT tags are set to YES then doxygen will generate a graph for each # documented header file showing the documented files that directly or # indirectly include this file. INCLUDED_BY_GRAPH = YES # If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will # generate a call dependency graph for every global function or class method. # Note that enabling this option will significantly increase the time of a run. # So in most cases it will be better to enable call graphs for selected # functions only using the \callgraph command. CALL_GRAPH = NO # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen # will graphical hierarchy of all classes instead of a textual one. GRAPHICAL_HIERARCHY = YES # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES # then doxygen will show the dependencies a directory has on other directories # in a graphical way. The dependency relations are determined by the #include # relations between the files in the directories. DIRECTORY_GRAPH = YES # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images # generated by dot. Possible values are png, jpg, or gif # If left blank png will be used. DOT_IMAGE_FORMAT = png # The tag DOT_PATH can be used to specify the path where the dot tool can be # found. If left blank, it is assumed the dot tool can be found in the path. DOT_PATH = # The DOTFILE_DIRS tag can be used to specify one or more directories that # contain dot files that are included in the documentation (see the # \dotfile command). DOTFILE_DIRS = # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the # graphs generated by dot. A depth value of 3 means that only nodes reachable # from the root by following a path via at most 3 edges will be shown. Nodes # that lay further from the root node will be omitted. Note that setting this # option to 1 or 2 may greatly reduce the computation time needed for large # code bases. Also note that a graph may be further truncated if the graph's # image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH # and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), # the graph is not depth-constrained. MAX_DOT_GRAPH_DEPTH = 0 # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent # background. This is disabled by default, which results in a white background. # Warning: Depending on the platform used, enabling this option may lead to # badly anti-aliased labels on the edges of a graph (i.e. they become hard to # read). DOT_TRANSPARENT = NO # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output # files in one run (i.e. multiple -o and -T options on the command line). This # makes dot run faster, but since only newer versions of dot (>1.8.10) # support this, this feature is disabled by default. DOT_MULTI_TARGETS = NO # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will # generate a legend page explaining the meaning of the various boxes and # arrows in the dot generated graphs. GENERATE_LEGEND = YES # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will # remove the intermediate dot files that are used to generate # the various graphs. DOT_CLEANUP = YES #--------------------------------------------------------------------------- # Configuration::additions related to the search engine #--------------------------------------------------------------------------- # The SEARCHENGINE tag specifies whether or not a search engine should be # used. If set to NO the values of all tags below this one will be ignored. SEARCHENGINE = NO spandsp-0.0.6/doc/css.css0000664000175000017500000002330010346550164012161 00000000000000body { background-image: url("../images/weave.jpg"); font-family: Verdana, Arial, Helvetica, Sans-serif; color: black; margin-right: 20px; margin-left: 20px; } h1 { text-align: center; } h2 { font-family: Verdana, Arial, Helvetica, Sans-serif; border-color: #c00000; color : black; margin-top: 0.8em; border-style: solid; border-width: 0px 0px 3px 0.5em; line-height : 130%; } h3 { font-family: Verdana, Arial, Helvetica, Sans-serif; border-color: #f02020; color : black; border-width: 0px 0px 2px 0.5em; border-style: solid; margin-right: 20%; line-height : 130%; } caption { font-weight: bold } a.qindex {} a.qindexRef {} a.el { text-decoration: none; font-weight: bold } a.elRef { font-weight: bold } a.code { text-decoration: none; font-weight: normal; color: #4444ee } a.codeRef { font-weight: normal; color: #4444ee } a:hover { text-decoration: none; background-color: #f2f2ff } dl.el { margin-left: -1cm } div.fragment { width: 100%; border: none; background-color: #eeeeee } div.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } td { font-family: Verdana, Arial, Helvetica, Sans-serif; font-weight: bold; } .navheader { font-family: Verdana, Arial, Helvetica, Sans-serif; background-color: #B2B2ff; font-weight: bold; } .navfooter { font-family: Verdana, Arial, Helvetica, Sans-serif; background-color: #B2B2ff; font-weight: bold; } table.menu { background-color: #000066; font-weight: bold; text-align: center; width: 100%; } tr.menu { background-color: #ccffff; font-weight: bold; text-align: center; } td.menu { background-color: #f2e0d0; font-weight: bold; text-align: center; } td.md { background-color: #f2f2ff; font-weight: bold; } td.mdname1 { background-color: #f2f2ff; font-weight: bold; color: #602020; } td.mdname { background-color: #f2f2ff; font-weight: bold; color: #602020; width: 600px; } div.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold } div.groupText { margin-left: 16px; font-style: italic; font-size: smaller } td.indexkey { font-family: Verdana, Arial, Helvetica, Sans-serif; background-color: #eeeeff; font-weight: bold; padding-right : 10px; padding-top : 2px; padding-left : 10px; padding-bottom : 2px; margin-left : 0px; margin-right : 0px; margin-top : 2px; margin-bottom : 2px } td.indexvalue { font-family: Verdana, Arial, Helvetica, Sans-serif; background-color: #eeeeff; font-style: italic; padding-right : 10px; padding-top : 2px; padding-left : 10px; padding-bottom : 2px; margin-left : 0px; margin-right : 0px; margin-top : 2px; margin-bottom : 2px } span.keyword { color: #008000 } span.keywordtype { color: #604020 } span.keywordflow { color: #e08000 } span.comment { color: #800000 } span.preprocessor { color: #806020 } span.stringliteral { color: #002080 } span.charliteral { color: #008080 } em { color: #990000; background-color: transparent; } h1,h2,h3,h4,h5,h6,p,center,td,th,ul,dl,div { font-family: Geneva, Arial, Helvetica, sans-serif; } body,td { font-size: 90%; } h1 { text-align: center; font-size: 160%; } h2 { font-size: 120%; } h3 { font-size: 100%; } caption { font-weight: bold } div.qindex { width: 100%; background-color: #eeeeff; border: 1px solid #b0b0b0; text-align: center; margin: 2px; padding: 2px; line-height: 140%; } div.nav { width: 100%; background-color: #eeeeff; border: 1px solid #b0b0b0; text-align: center; margin: 2px; padding: 2px; line-height: 140%; } div.navtab { background-color: #eeeeff; border: 1px solid #b0b0b0; text-align: center; margin: 2px; margin-right: 15px; padding: 2px; } td.navtab { font-size: 70%; } a.qindex { text-decoration: none; font-weight: bold; color: #1a419d; } a.qindex:visited { text-decoration: none; font-weight: bold; color: #1a419d } a.qindex:hover { text-decoration: none; background-color: #ddddff; } a.qindexHL { text-decoration: none; font-weight: bold; background-color: #6666cc; color: #ffffff; border: 1px double #9295C2; } a.qindexHL:hover { text-decoration: none; background-color: #6666cc; color: #ffffff; } a.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff } a.el { text-decoration: none; font-weight: bold } a.elRef { font-weight: bold } a.code:link { text-decoration: none; font-weight: normal; color: #0000FF } a.code:visited { text-decoration: none; font-weight: normal; color: #0000FF } a.codeRef:link { font-weight: normal; color: #0000FF } a.codeRef:visited { font-weight: normal; color: #0000FF } a:hover { text-decoration: none; background-color: #f2f2ff } dl.el { margin-left: -1cm } .fragment { font-family: Fixed, monospace; font-size: 95%; } pre.fragment { border: 1px solid #CCCCCC; background-color: #f5f5f5; margin-top: 4px; margin-bottom: 4px; margin-left: 2px; margin-right: 8px; padding-left: 6px; padding-right: 6px; padding-top: 4px; padding-bottom: 4px; } div.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px } td.md { background-color: #F4F4FB; font-weight: bold; } td.mdPrefix { background-color: #F4F4FB; color: #606060; font-size: 80%; } td.mdname1 { background-color: #F4F4FB; font-weight: bold; color: #602020; } td.mdname { background-color: #F4F4FB; font-weight: bold; color: #602020; width: 600px; } div.groupHeader { margin-left: 16px; margin-top: 12px; margin-bottom: 6px; font-weight: bold; } div.groupText { margin-left: 16px; font-style: italic; font-size: 90% } td.indexkey { background-color: #eeeeff; font-weight: bold; padding-right : 10px; padding-top : 2px; padding-left : 10px; padding-bottom : 2px; margin-left : 0px; margin-right : 0px; margin-top : 2px; margin-bottom : 2px; border: 1px solid #CCCCCC; } td.indexvalue { background-color: #eeeeff; font-style: italic; padding-right : 10px; padding-top : 2px; padding-left : 10px; padding-bottom : 2px; margin-left : 0px; margin-right : 0px; margin-top : 2px; margin-bottom : 2px; border: 1px solid #CCCCCC; } tr.memlist { background-color: #f0f0f0; } p.formulaDsp { text-align: center; } img.formulaDsp { } img.formulaInl { vertical-align: middle; } span.keyword { color: #008000 } span.keywordtype { color: #604020 } span.keywordflow { color: #e08000 } span.comment { color: #800000 } span.preprocessor { color: #806020 } span.stringliteral { color: #002080 } span.charliteral { color: #008080 } .mdTable { border: 1px solid #868686; background-color: #F4F4FB; } .mdRow { padding: 8px 10px; } .mdescLeft { padding: 0px 8px 4px 8px; font-size: 80%; font-style: italic; background-color: #FAFAFA; border-top: 1px none #E0E0E0; border-right: 1px none #E0E0E0; border-bottom: 1px none #E0E0E0; border-left: 1px none #E0E0E0; margin: 0px; } .mdescRight { padding: 0px 8px 4px 8px; font-size: 80%; font-style: italic; background-color: #FAFAFA; border-top: 1px none #E0E0E0; border-right: 1px none #E0E0E0; border-bottom: 1px none #E0E0E0; border-left: 1px none #E0E0E0; margin: 0px; } .memItemLeft { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memItemRight { padding: 1px 8px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplItemLeft { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplItemRight { padding: 1px 8px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; background-color: #FAFAFA; font-size: 80%; } .memTemplParams { padding: 1px 0px 0px 8px; margin: 4px; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-color: #E0E0E0; border-right-color: #E0E0E0; border-bottom-color: #E0E0E0; border-left-color: #E0E0E0; border-top-style: solid; border-right-style: none; border-bottom-style: none; border-left-style: none; color: #606060; background-color: #FAFAFA; font-size: 80%; } .search { color: #003399; font-weight: bold; } form.search { margin-bottom: 0px; margin-top: 0px; } input.search { font-size: 75%; color: #000080; font-weight: normal; background-color: #eeeeff; } td.tiny { font-size: 75%; } a { color: #252e78; } a:visited { color: #3d2185; } .dirtab { padding: 4px; border-collapse: collapse; border: 1px solid #b0b0b0; } th.dirtab { background: #eeeeff; font-weight: bold; } hr { height: 1px; border: none; border-top: 1px solid black; } spandsp-0.0.6/doc/wrapper.xsl0000664000175000017500000000040310724452433013066 00000000000000 css.css spandsp-0.0.6/doc/t38-gateway.dia0000664000175000017500000000570710724461263013427 00000000000000][s6~( oUNNfw=7,27!8~߾TE4 4cْ!:߹b(M&#yϋoN_D;QHrlrSNOP|"Pݢ\Oı8UN'N Q]QYtu[H'+y6O,Mjf<,ɛ19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#*` !'Z, RB5ثr'sV杷gn4s0|.ZW;~]n>&Z<QE𮉝[>.65I 6={~O?_ ͇=sȱǍfOAt)QS@ ); )P))a+>MzsD Ҹ>P[ZֶՁZ@0 dʟutB=D=+쪌 VC:9NalImb{7e,XѶʞ-Ϧ"Pf * spandsp-0.0.6/spandsp/tones.dtd0000664000175000017500000001346212350610054013407 00000000000000 spandsp-0.0.6/spandsp/tsb85.xml0000664000175000017500000112046512350610054013254 00000000000000 spandsp-0.0.6/spandsp/global-tones.xml0000664000175000017500000067256412350610054014710 00000000000000 spandsp-0.0.6/spandsp/fax-tests.dtd0000664000175000017500000000247112350610054014173 00000000000000 spandsp-0.0.6/autogen.sh0000775000175000017500000000776411422612260012123 00000000000000#!/usr/bin/env sh # # SpanDSP - a series of DSP components for telephony # # autogen script # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 2.1, # as published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. UNAME=`uname` if [ "x$UNAME" = "xFreeBSD" ]; then echo "" echo "" echo "******************************************" echo "*** NOTICE ***" echo "******************************************" echo " " echo "FreeBSD is buggy. Please use this " echo "workaround if you want to bootstrap " echo "on FreeBSD. " echo " " echo "cd /usr/local/share/aclocal19 " echo "ln -s ../aclocal/libtool15.m4 . " echo "ln -s ../aclocal/ltdl15.m4 . " echo " " echo "******************************************" echo "" fi debug () { # Outputs debug statments if DEBUG var is set if [ ! -z "$DEBUG" ]; then echo "DEBUG: $1" fi } version_compare() { # Checks a command is found and the version is high enough PROGRAM=$1 MAJOR=$2 MINOR=$3 MICRO=$4 test -z "$MAJOR" && MAJOR=0 test -z "$MINOR" && MINOR=0 test -z "$MICRO" && MICRO=0 debug "Checking $PROGRAM >= $MAJOR.$MINOR.$MICRO" WHICH_PATH=`whereis which | cut -f2 -d' '` COMMAND=`$WHICH_PATH $PROGRAM` if [ -z $COMMAND ]; then echo "$PROGRAM-$MAJOR.$MINOR.$MICRO is required and was not found." return 1 else debug "Found $COMMAND" fi INS_VER=`$COMMAND --version | head -1 | sed 's/[^0-9]*//' | cut -d' ' -f1` INS_MAJOR=`echo $INS_VER | cut -d. -f1 | sed s/[a-zA-Z\-].*//g` INS_MINOR=`echo $INS_VER | cut -d. -f2 | sed s/[a-zA-Z\-].*//g` INS_MICRO=`echo $INS_VER | cut -d. -f3 | sed s/[a-zA-Z\-].*//g` test -z "$INS_MAJOR" && INS_MAJOR=0 test -z "$INS_MINOR" && INS_MINOR=0 test -z "$INS_MICRO" && INS_MICRO=0 debug "Installed version: $INS_VER" if [ "$INS_MAJOR" -gt "$MAJOR" ]; then debug "MAJOR: $INS_MAJOR > $MAJOR" return 0 elif [ "$INS_MAJOR" -eq "$MAJOR" ]; then debug "MAJOR: $INS_MAJOR = $MAJOR" if [ "$INS_MINOR" -gt "$MINOR" ]; then debug "MINOR: $INS_MINOR > $MINOR" return 0 elif [ "$INS_MINOR" -eq "$MINOR" ]; then if [ "$INS_MICRO" -ge "$MICRO" ]; then debug "MICRO: $INS_MICRO >= $MICRO" return 0 else debug "MICRO: $INS_MICRO < $MICRO" fi else debug "MINOR: $INS_MINOR < $MINOR" fi else debug "MAJOR: $INS_MAJOR < $MAJOR" fi echo "You have the wrong version of $PROGRAM. The minimum required version is $MAJOR.$MINOR.$MICRO" echo " and the version installed is $INS_MAJOR.$INS_MINOR.$INS_MICRO ($COMMAND)." return 1 } # Check for required version and die if unhappy if [ "x$UNAME" = "xFreeBSD" ]; then version_compare libtoolize 1 5 16 || exit 1 version_compare automake19 1 9 5 || exit 1 version_compare autoconf259 2 59 || exit 1 ACLOCAL=aclocal19 AUTOHEADER=autoheader259 AUTOMAKE=automake19 AUTOCONF=autoconf259 else version_compare libtoolize 1 5 16 || exit 1 version_compare automake 1 9 5 || exit 1 version_compare autoconf 2 59 || exit 1 ACLOCAL=aclocal AUTOHEADER=autoheader AUTOMAKE=automake AUTOCONF=autoconf fi libtoolize --copy --force --ltdl #NetBSD seems to need this file writable chmod u+w libltdl/configure $ACLOCAL $AUTOHEADER --force $AUTOMAKE --copy --add-missing $AUTOCONF --force #chmod ug+x debian/rules if [ "x$UNAME" = "xNetBSD" ]; then echo "" echo "Please remember to run gmake instead of make on NetBSD" echo "" fi spandsp-0.0.6/debian/0000775000175000017500000000000012357123346011420 500000000000000spandsp-0.0.6/debian/rules0000775000175000017500000000452310644155273012425 00000000000000#!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) DEBVERSION:=$(shell head -n 1 debian/changelog \ | sed -e 's/^[^(]*(\([^)]*\)).*/\1/') ORIGTARVER:=$(shell echo $(DEBVERSION) | sed -e 's/^.*://' -e 's/-[0-9.]*$$//')# -e 's/.dfsg$$//' -e 's/~//') UPVERSION:=$(shell echo $(ORIGTARVER) | tr -d '~') FILENAME := spandsp_$(ORIGTARVER).orig.tar.gz FULLNAME := spandsp-$(UPVERSION) URL := http://soft-switch.org/downloads/spandsp/spandsp-$(UPVERSION).tgz CFLAGS = -Wall -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif include /usr/share/dpatch/dpatch.make autotools: patch-stamp ln -s /usr/share/misc/config.sub config.sub ln -s /usr/share/misc/config.guess config.guess touch autotools config.status: autotools configure dh_testdir CFLAGS="$(CFLAGS)" ./configure \ --host=$(DEB_HOST_GNU_TYPE) \ --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr \ --mandir=\$${prefix}/share/man \ --infodir=\$${prefix}/share/info \ --enable-doc build: build-stamp build-stamp: config.status dh_testdir $(MAKE) touch build-stamp clean: clean-patched unpatch clean-patched: dh_testdir dh_testroot rm -f build-stamp autotools -$(MAKE) distclean -$(RM) -f config.sub -$(RM) -f config.guess dh_clean install: build-stamp dh_testdir dh_testroot dh_clean -k $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp binary-indep: build-stamp install dh_testdir -i dh_testroot -i dh_installchangelogs -i ChangeLog dh_installdocs -i DueDiligence dh_install -i dh_compress -i dh_fixperms -i dh_installdeb -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i binary-arch: build-stamp install dh_testdir -a dh_testroot -a dh_installchangelogs -a ChangeLog dh_installdocs -a DueDiligence dh_install -a dh_strip -a dh_compress -a dh_fixperms -a dh_makeshlibs -a dh_installdeb -a dh_shlibdeps -a dh_gencontrol -a dh_md5sums -a dh_builddeb -a get-orig-source: -@@dh_testdir @@[ -d ../tarballs/. ]||mkdir -p ../tarballs @@echo Downloading $(FILENAME) from $(URL) ... @@wget -N -nv -T10 -t3 -O ../tarballs/$(FILENAME) $(URL) binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install patch unpatch spandsp-0.0.6/debian/copyright0000664000175000017500000000176310644155273013303 00000000000000This package was debianized by Simon Richter on Sun, 2 Jan 2005 15:22:58 +0100. It was downloaded from http://soft-switch.org/downloads/spandsp/ Copyright: Steve Underwood License: This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 dated June, 1991. This package is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this package; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. On Debian systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL'. spandsp-0.0.6/debian/libspandsp-dev.install0000664000175000017500000000017110644155273015643 00000000000000debian/tmp/usr/include debian/tmp/usr/lib/libspandsp.so debian/tmp/usr/lib/libspandsp.la debian/tmp/usr/lib/libspandsp.a spandsp-0.0.6/debian/control0000664000175000017500000000344211156707324012746 00000000000000Source: spandsp Section: libs Priority: optional Maintainer: Debian VoIP Team Uploaders: Jose Carlos Garcia Sogo , Kilian Krause , Santiago Garcia Mantinan , Mark Purcell , Tzafrir Cohen , Santiago Ruano Rincón Build-Depends: debhelper (>= 4.0.0), libtiff4-dev, libjpeg62-dev, dpatch, doxygen, autotools-dev, xsltproc Standards-Version: 3.7.2 XS-Vcs-Svn: svn://svn.debian.org/pkg-voip/ XS-Vcs-Browser: http://svn.debian.org/wsvn/pkg-voip/ Package: libspandsp6 Architecture: any Depends: ${shlibs:Depends} Conflicts: libspandsp0, libspandsp1, libspandsp2 Description: Telephony signal processing library This is a low-level signal processing library that modulate and demodulate signals commonly used in telephony, such as the "noise" generated by a fax modem or DTMF touchpad. . This package contains the shared library. Package: libspandsp-dev Section: libdevel Architecture: any Depends: libspandsp6 (= ${Source-Version}), libtiff4-dev, libjpeg62-dev Description: Telephony signal processing library This is a low-level signal processing library that modulate and demodulate signals commonly used in telephony, such as the "noise" generated by a fax modem or DTMF touchpad. . This package contains the static library and development headers. . Homepage: http://www.soft-switch.org/ Package: libspandsp-doc Section: doc Architecture: all Description: Documentation for the spandsp signal processing library This package contains the online API in HTML for the libspandsp, a low level signal processing library that modulate and demodulate siignals commonly used in telephony, such as the "noise" generated by a fax modem or DTMF touchpad. spandsp-0.0.6/debian/libspandsp6.install0000664000175000017500000000011211156707324015147 00000000000000debian/tmp/usr/lib*/libspandsp.so.2.* debian/tmp/usr/lib*/libspandsp.so.2 spandsp-0.0.6/debian/watch0000664000175000017500000000030010644155273012363 00000000000000# See uscan(1) for format # Compulsory line, this is a version 3 file version=3 # http://soft-switch.org/downloads/spandsp/ spandsp-(.*)\.tgz debian svn-upgrade spandsp-0.0.6/debian/changelog0000664000175000017500000000707411156707324013222 00000000000000spandsp (0.0.6~pre7-1) unstable; urgency=low [ Steve Underwood ] * New upstream release. * Fixed upstream file name for get-orig-source. * Updates to 64bit archs support * Removal of obsoleted files -- Steve Underwood Sat, 14 Mar 2009 09:23:36 +0100 spandsp (0.0.5~pre2-1) unstable; urgency=low [ Massimo Cetra ] * New upstream release. * Fixed upstream file name for get-orig-source. * Updates to 64bit archs support * Removal of obsoleted files -- Massimo Cetra Mon, 5 May 2008 09:23:36 +0100 spandsp (0.0.4~pre3-1) unstable; urgency=low [ Santiago Ruano Rincón ] * Added Conflicts: libspandsp2 * Fixed URL in debian/rules [ Tzafrir Cohen ] * New upstream release. * Fixed upstream file name for get-orig-source. * standards version updated to 3.7.2 . -- Tzafrir Cohen Mon, 18 Jun 2007 09:53:06 +0300 spandsp (0.0.4~pre1-1) experimental; urgency=low * New upstream release. -- Santiago Ruano Rincón Fri, 11 May 2007 15:24:41 -0500 spandsp (0.0.3pre27-2) experimental; urgency=low * Conflict with libspandsp1 due to /usr/share/spandsp/global-tones.xml -- Kilian Krause Thu, 4 Jan 2007 00:29:10 +0100 spandsp (0.0.3pre27-1) experimental; urgency=low * New upstream release. * Bump library name due to API incompatibility with 0.0.2 versions. -- Kilian Krause Wed, 3 Jan 2007 21:31:17 +0100 spandsp (0.0.3pre26-1) experimental; urgency=low * New upstream release - New version of spandsp available (Closes: #339293) - Remove src/spandsp/mmx.h is not GPL and has no license attached (Closes: #357813) * Lintian: outdated-autotools-helper-file - Build-Depends: autotools-dev * Add debian/watch -- Mark Purcell Sat, 9 Dec 2006 14:00:57 +0000 spandsp (0.0.2pre26-1) unstable; urgency=low * New upstream release. * Added get-orig-source target. * Removed unneeded and buggy nommx.dpatch (Closes: #376249, #377374) -- Tzafrir Cohen Tue, 1 Aug 2006 06:27:47 +0100 spandsp (0.0.2pre25-1) unstable; urgency=low * New upstream version. * debian/copyright: Source's URL in copyright file updated to the new author' site. * Added -doc package, with the API documentation. * Fixed package name to follow new upstream's version. -- Kilian Krause Sat, 18 Feb 2006 22:10:21 +0100 spandsp (0.0.2pre17-1) unstable; urgency=low * New upstream version. -- Kilian Krause Mon, 9 May 2005 21:56:53 +0200 spandsp (0.0.2pre10-3) unstable; urgency=low * debian/control: fixed overrides. again. (Back to the old optional) -- Kilian Krause Mon, 21 Mar 2005 10:39:30 +0100 spandsp (0.0.2pre10-2) unstable; urgency=low * debian/control: fixed overrides. * debian/patches/mmx.dpatch: Added compilation on non-i386 and non-amd64. -- Kilian Krause Sun, 20 Mar 2005 23:32:48 +0100 spandsp (0.0.2pre10-1) unstable; urgency=low * New upstream release. * Debian VoIP Team takes this package from Simon. Thanks! * debian/rules: fixed how config.[sub,guess] files are linked from autotools-dev and cleaned. -- Kilian Krause Sat, 22 Jan 2005 13:44:28 +0100 spandsp (0.0.2-2) unstable; urgency=low * Corrected build dependencies. -- Simon Richter Mon, 3 Jan 2005 13:33:33 +0100 spandsp (0.0.2-1) unstable; urgency=low * Initial Release (Closes: #262032). -- Simon Richter Sun, 2 Jan 2005 15:22:58 +0100 spandsp-0.0.6/debian/compat0000664000175000017500000000000210644155273012537 000000000000004 spandsp-0.0.6/debian/libspandsp-doc.install0000664000175000017500000000005710644155273015635 00000000000000doc/api/html usr/share/doc/libspandsp-doc/api/